Closed Bug 72761 Opened 23 years ago Closed 20 years ago

Send unsent messages fails if no folder of the account is open

Categories

(MailNews Core :: Networking: SMTP, defect)

x86
Windows 98
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: udo_richter, Assigned: mscott)

References

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; 0.8.1) Gecko/20010312
BuildID:    2001031204

Send unsent messages fails if no folder of the account is open

My configuration:
-First account is a dummy account without working servers.
-Second account is a SMTP-auth/POP3, working.
-The second account is set to use the default smtp server.

Thats the bug:
-Write a short mail. Do a send later.
-Select a local folder or a folder of the dummy account.
-Click on Send unsent messages. Mozilla asks for the smtp-auth password of the
mail server. User name is correct.
-An error message appears:
"An error occured while sending mail, The mail server responded: {mp009-rz3}
Cannot resolve your domain. Please verify that your email adress is correct in
your Mail preferences and try again.", then "Sending of message failed".
-Try different folders. Click again on Send unsent messages. Mozilla doesnt ask
again for the password. Same error.
-Go to any folder of the second account.
-Click again on Send unsent messages. 
-Mozilla asks a second time for the mail password! Same server, same user name.
-Sending the mail works!

I'm not sure if this bug occurs on all accounts or only on the second/later ones.

In Account settings->Outgoing SMTP->Advanced, the mail account keeps
multiplying: Currently I have 5 copies of the SMTP settings, one of them set as
default. But the bug also appears after "cleaning up".

The bug also appears without smtp-auth, using smtp-after-pop.

This may be related to bug 67285

Reproducible: Always
Status: UNCONFIRMED → NEW
Ever confirmed: true
I've re-checked this bug in more detail on the 2001-04-09-04 trunk build, using 
a new Mozilla user.

I created a mail account using noone@nowhere, smtp server "nowhere". Then I 
created a second mail account using a different, working SMTP server with an IP 
based authentification. The default SMTP server was the working second one.

I wrote a short message using the second mail account, did a send later, changed 
to local Unsent Messages and did a Send Unsent Messages.
This time the error message was: ... responded: 5.1.8 <noone@nowhere> Domain of 
sender address does not exist.
Then I changed to the Inbox of the second account and retried. It worked as 
expected.

Finally, I activated the default (working) SMTP server for the first account, 
but left the noone@nowhere address. I wrote a mail using the first account as 
usual. Now sending always fails with the same error message as above, the mail 
address never got replaced by the address of the second account.

All in all it looks like this: The mail was sent via the correct SMTP server, 
but using the first account's mail address. The mail in the outbox and later in 
the send folder had the correct mail address, so someone changed it just before 
sending, depending on the currently selected mail account. This only affects 
mails written for the second (or later?) mail account, the first mail account 
always uses his mail address.


Happy bug hunting!
Also, synchronizing news articles doesn't work either. Instead of getting 
messages for all flagged newsgroups, it only gets messages for 1 newsgroup and 
then stops.

If you select a folder, then synchronize, it seems to go through the various 
newsgroups, and then crashes (without a talkback screen!). I'm using nightly 
build 2001062815
*** Bug 89846 has been marked as a duplicate of this bug. ***
QA Contact: esther → sheelar
Re-checked this using 2002021403.

Bug is still present, but has changed: 
-Mail of the default account (mail.accountmanager.defaultaccount) is always sent
through the SMTP server of the default account.
-Mails from other accounts are always sent through the SMTP server of
mail.account.account1.
-The currently selected folder has no influence any more.

Any chance of getting this fixed until 1.0? 
Mozilla still cant handle more than one SMTP server (except if
default!=account1, then it can handle two. :) , and by that cant handle more
than one email account, since most public mail providers check for valid From:
headers.
changing QA contact from Sheela to Gregg
QA Contact: sheelar → meehansqa
Since this bug had no real activity for 1 1/2 years I decided to take a look
inside myself, my first look into sources at all.

The basic problem seems to be a design flaw: Interface design implies that each
mail account has its own unsent messages folder, but there's actually only one
for all accounts. mailnews/base/resources/content/mailWindowOverlay.js function
SendUnsentMessages() forces the current behavior:

   // right now, all identities point to the same unsent messages
   // folder, so to avoid sending multiple copies of the
   // unsent messages, we only call messenger.SendUnsentMessages() once
   // see bug #89150 for details

Unsent messages get sent by the first working account in the identities loop.

Possible fixes:
-Implement unsent messages folders for each account, eg.
GetFolderURIFromUserPrefs should not return the same folder for all id's. Then
remove the workaround for bug 89150. Possibly major impact, may result in new
bugs because of new different unsent messages folders. (and user complains :)

-Change nsMsgSendLater::SendUnsentMessages to only
mMessagesToSend->AppendElement messages that match the identity. (check
X-Identity-Key in header?) Not sure if this is possible, may even result in
mails that dont get sent because no account feels responsible(?).

The first solution is more general, but lots of work. The second one is more
like a quick fix.

Any comments, volunteers for coding, etc?
This seems fixed in 1.4a, probably by the fix of bug 59548. (phew. After two
years of avoiding send later.)

Thanks to all who have helped on both bugs.
Resolving FIXED at request of reporter.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.