Last Comment Bug 298126 - In Offline mode, message sent via MAPISendMail will not save the unsent mail in Outbox (Unsent Messages)
: In Offline mode, message sent via MAPISendMail will not save the unsent mail ...
Status: RESOLVED FIXED
: dataloss
Product: MailNews Core
Classification: Components
Component: Simple MAPI (show other bugs)
: Trunk
: x86 Windows 2000
: -- critical (vote)
: Thunderbird 14.0
Assigned To: Mark Banner (:standard8)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-18 15:59 PDT by Dirk Lausecker
Modified: 2012-04-04 02:49 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
fixed
fixed
12+
fixed


Attachments
The fix (1.67 KB, patch)
2012-03-28 10:04 PDT, Mark Banner (:standard8)
no flags Details | Diff | Review
The fix v2 (1.15 KB, patch)
2012-04-03 02:04 PDT, Mark Banner (:standard8)
mozilla: review+
standard8: approval‑comm‑aurora+
standard8: approval‑comm‑beta+
standard8: approval‑comm‑esr10+
Details | Diff | Review

Description Dirk Lausecker 2005-06-18 15:59:48 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.6) Gecko/20050226 Firefox/1.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.6) Gecko/20050226 Firefox/1.0.1

My software use the function MAPISendMail() to save E-Mails in the "Unsent
Messages" folder. This works fine with Netscape Messenger 4.75 and NSMAPI32.DLL.
On Thunderbird 1.0 (german) the message will be sent immediatly if the
Mailclient is in the Online mode. But in the Offline mode, the message will not
saved under "Unsent Messages".


Reproducible: Always

Steps to Reproduce:
1.Write a test program which calls MAPISendMail with the following params:
0L,         // use implicit session.
0L,         // ulUIParam; 0 is always valid
&message,   // the message being sent
0,	    // no MAPI_DIALOG
0L          // reserved; must be 0

2. Start Thunderbird and activate Offline mode.
3. Start test software and check the "Unsent Messages" folder.

Actual Results:  
The test message will not be show under "Unsent Messages" or elsewhere.
The MAPISendMail function returns no error code (0), but nothing is happen.

Expected Results:  
The message must be saved under "Unsent Messages".
Comment 1 Gervase Markham [:gerv] 2005-09-27 02:09:19 PDT
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
Comment 2 Dirk Lausecker 2008-01-18 15:53:33 PST
I have test on Thunderbird 2.0.0.6. The bug is still present. If Thunderbird is in offline mode, the mails will not be saved as unsent mail. 
Comment 3 Wayne Mery (:wsmwk, NI for questions) 2008-08-17 17:37:25 PDT
Dirk, I

I'll confirm this based on your expertise, but I'd prefer to know it still fails for trunk. Can you try an early release of TB3
http://www.mozillamessaging.com/en-US/thunderbird/early_releases/ ? 
(taking appropriate precautions to protect yourself of course)

Comment 4 Wayne Mery (:wsmwk, NI for questions) 2008-08-20 04:17:46 PDT
even better ... Dirk, can you attach a test program?
Comment 5 Dirk Lausecker 2008-08-28 16:13:18 PDT
Hello Wayne,

Thank you for your interest on this bug.
I have retested an early release of the 3.0 version. (German version with the name "Shredder"). But the bug still exist :-|
I can't upload my test program to this public forum. But if you're interested, I could send it to you as private mail. Its a tiny program, but have a big runtime environment which must be installed (Win 2000/XP). We must transfer about 10 MB.
Let me know if you're interested.

Best regards

Dirk
Comment 6 Wayne Mery (:wsmwk, NI for questions) 2008-08-30 08:54:28 PDT
confirmed using Dirk's program. when offline, message isn't saved for later sending.

unsent messages has been renamed outbox, so modding summary
Comment 7 Mark Banner (:standard8) 2012-03-28 10:04:01 PDT
Created attachment 610176 [details] [diff] [review]
The fix

The error here is quite simple, we're not checking to see if we're in offline mode or not.

Really that's probably the fault of the message send code, but that feels a bit complicated to fix here, and if in future we complete the send in background, then that would eliminate the online/offline issue anyway.

Hence I'm just going for the simple fix of keeping online mode sending as it is, and in offline mode, we'll queue them for later.

Try server build is here:

http://ftp.mozilla.org/pub/mozilla.org/thunderbird/try-builds/bugzilla@standard8.plus.com-fde157e811ed/

I haven't actually tested the patch myself as I couldn't find a set up to do that with.
Comment 8 David :Bienvenu 2012-03-29 09:30:34 PDT
Comment on attachment 610176 [details] [diff] [review]
The fix

does it compile if you use WeAreOffline() instead of the ioservice? If so, I'd prefer that.
Comment 9 Mark Banner (:standard8) 2012-04-03 02:04:49 PDT
Created attachment 611746 [details] [diff] [review]
The fix v2

Using WeAreOffline()
Comment 10 Mark Banner (:standard8) 2012-04-03 13:21:53 PDT
Comment on attachment 611746 [details] [diff] [review]
The fix v2

[Triage Comment]
We decided this is low risk enough to take to branches and we'll ship it on the esr branch.
Comment 11 Mark Banner (:standard8) 2012-04-03 14:20:34 PDT
Checked in: http://hg.mozilla.org/comm-central/rev/ee9a4fdb8c27
Comment 13 Mark Banner (:standard8) 2012-04-04 02:17:20 PDT
Comment on attachment 611746 [details] [diff] [review]
The fix v2

[Triage Comment]
Comment 14 Mark Banner (:standard8) 2012-04-04 02:49:39 PDT
Fixed for ESR:

http://hg.mozilla.org/releases/comm-esr10/rev/adb435376119

Note You need to log in before you can comment on or make changes to this bug.