Closed Bug 292643 Opened 20 years ago Closed 16 years ago

Use of the wrong SMTP server when multiple accounts defined

Categories

(Thunderbird :: Account Manager, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b1

People

(Reporter: diretoria, Assigned: Bienvenu)

Details

(Whiteboard: [has reviewed, slightly bitrotted, patch])

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3

When you have multiple email accounts defined (both pop and imap) and multiple
SMTP servers and delete some of these accounts, the Thunderbird usually gets
confused and insist on using the wrong SMTP server for some accounts, even if
you define that account to use the default or a particular SMTP server. The only
solution I found for this is deleting all SMTP servers and reconfigure them.
This problem just occur after deleting an account.

Reproducible: Didn't try
I am sure the problem always happen after deleting accounts because it has
happend more than once, in spite of I did not try to reproduce the bug.
I have the same problem. When I add a second SMTP server, nothing will make
Thunderbird use it. I've attached the screenshot of my settings. Although smtp2
is the default (franklin), the mail gets sent through smtp1 (meer).
I have the same problems having 4 accounts in Thunderbird. I never know which
SMTP server it will try to use (except it's almost always the wrong one). This
is really a flagrant bug, please fix it asap! It really makes the whole product
unusable or at least cumbersome.
If you are trying to access AOL and have more than one SMTP account logged in
the email account area, it always goes to the default email account upon a send
directive. 

Even if you have changed the sender's name to reflect the account the mail was
received under, and attempt to send the email anyways, using your default
account as a simple gateway, it returns "an error occurred while sending mail.
The mail server responded: MAIL FROM sender and AUTH username do not match.
Please verify that your email address is correct in your Mail preferences and
try again." 

(Basically unless you change the SMTP account to default, you are limited to the
initial SMTP account only being able to send email.)

 Also if you have an AIM account, which as well uses the SMTP format (handler?)
(unless you change the SMTP account to default, you are limited in the same
fashion I already mentioned.)

O/S: Win xp pro, service pack 2 and all security updates installed.
Mozilla Thunderbird build: version 1.0.5 (20050711)
Reproducible: yes
In our hands, TB does not recognize any but the 1st of a list of SMTP servers,
even using the "SelectSMTP!" extension, which shows them, but does not honor the
selection of any but the top one on the list.  We wish to be able to easily
switch SMTP servers *for a single account/profile* because this is a laptop used
in different locations, each of which seems to honor only requests for SMTP
service through from its own servers (earthlink in one location, sbcglobal in
the other.) Running TB 1.0.6 (20050716) on XP, new HP Pavilion dv4000.  Our
workaround takes us to the "Outgoing Server/Advanced" window, where we delete
the other location's server, and add the current location's.  Each time we
relocate (can be daily)! 
I think there is some confusion in this bug. The bug reporter is talking about a problem which occurs when an account is deleted.

From comment #2 onwards the discussion seems to be about multiple SMTP server configuration issues. For those people I think the problem is that you have your account/identity set to use a particular SMTP server instead of "Always use default server."

You can access this setting by Tools->Account Settings->Server Settings->Advanced (button)->SMTP (tab).

Please ensure that you have the account set to use the default server. If the problem persists please post to this bug again.

Bob
PS The problem is visible in "Screenshot of my SMTP setting" at the setting:
mail.identity.id1.smtpServer  user set  string  smtp1
This sets the smtp server to always use smtp1 regardless of what is the default SMTP server.

To use the default server the line in prefs.js should look like this:
user_pref("mail.identity.id1.smtpServer", "");
[NOT: user_pref("mail.identity.id1.smtpServer", "smtp1");]
You're right about reporter talking about a different problem I believe.  However, your solution isn't valid in version 1.5.0.2.  First of all, I think that there should be a clearer way to show that the "default" smtp server will not be used (it appears to be buggy because it's unclear).  The real solution is to go to tools->account settings and click on the bold account you're having trouble with.  Then select the Manage Identities button and set up SMTP server to always use the default (as I believe Thunderbird should be set out of the box)

(In reply to comment #6)
> I think there is some confusion in this bug. The bug reporter is talking about
> a problem which occurs when an account is deleted.
> 
> From comment #2 onwards the discussion seems to be about multiple SMTP server
> configuration issues. For those people I think the problem is that you have
> your account/identity set to use a particular SMTP server instead of "Always
> use default server."
> 
> You can access this setting by Tools->Account Settings->Server
> Settings->Advanced (button)->SMTP (tab).
> 
> Please ensure that you have the account set to use the default server. If the
> problem persists please post to this bug again.
> 
> Bob
> PS The problem is visible in "Screenshot of my SMTP setting" at the setting:
> mail.identity.id1.smtpServer  user set  string  smtp1
> This sets the smtp server to always use smtp1 regardless of what is the default
> SMTP server.
> 
> To use the default server the line in prefs.js should look like this:
> user_pref("mail.identity.id1.smtpServer", "");
> [NOT: user_pref("mail.identity.id1.smtpServer", "smtp1");]
> 

I have exactly this same problem too, as described by the comments already left.  I have 89 email accounts set up at my domain and 89 matching SMTP accounts.  I use one account per person or company that I know to avoid spam.  As described already the assignment of the SMTP accounts to the email accounts by Thunderbird comes and goes.  I will look and a handfull of email accounts randomly have their SMTP accounts set back to "default", or to one of the other SMTP accounts.  If I re-create the SMTP acount for the email account in question it may or may no stick.  I just did that for 5 email accounts.  After closing and restaring Thunderbird 2 of the 5 had been set back to "default", 1 had taken on the SMTP of some other email account, and 2 were still set correctly.

I have not reported (or looked for) this bug to bugzilla until now since I've been trying to correlate it with something, other than just purely random.  I've been thinking maybe it was a high number of email accounts and/or SMTP accounts (89) that was overflowing a buffer somewhere, but 89 is not anywhere near a power of 2.  Not likely.  I have been suspicious that it may have something to do with the effects of deleting either a email acount and/or an SMTP account, but have not been able to prove it as of yet.  I notice that one of the comments already left mentions that deleting SMTP accounts might be the cause.  That would be a great place to start looking.  

I am reporting this now since I just "upgraded" from V 1.5.07 to V3.01a1 beta in a desperate attempt at fixing this bug.  I don't like to use betas - much less alphas - but I figured that sure by V 3.0 this really bad bug would be fixed.  Not so.  That has led me to search bugzilla and I found the bug here.  I'm surprised this one has not been fixed yet.  It is really messing me up.  Must only be showing up with high numbers of email/smtp accounts or you would be getting a flood of bug email from the public.

The bug is quite reproducable on my system, as noted above.  Just tried fixed 5 messed up smtp accounts with limited success.  If whoever is working on this bug wants a copy of my profile or anything else just email me.

Uv93z_Qk2c1@Uf51h9Ks.com
An additional comment to what I just left here.  This bug report thread seems to have veered away from the orignal bug report.  What I am experiencing is **exactly** what the original bug report stated:

************

When you have multiple email accounts defined (both pop and imap) and multiple
SMTP servers and delete some of these accounts, the Thunderbird usually gets
confused and insist on using the wrong SMTP server for some accounts, even if
you define that account to use the default or a particular SMTP server. The
only
solution I found for this is deleting all SMTP servers and reconfigure them.
This problem just occur after deleting an account.


***********

And just like this fellow I also strongly suspect it has something to do with deleting one or more email accounts and/or SMTP server entries.  I have done both and it seems the problem occured and/or got worse after the deletes.

Thanks!
I am the person that posted the original bug. Currently I am running Thunderbird version 1.5.0.7 (20060909). The solution I adopted is to configure a SMTP server that can handle any emails, I mean, that does not check the “from field” and use this unique server for all my outgoing emails. Anyway, recently I had a problem with this server for two days, and then I had to use the Thunderbird multiple SMTP feature: apparently the old problem is still there.
If you share identities between accounts, then removing an account will clobber the identities, from what I can see:

http://lxr.mozilla.org/mozilla/source/mailnews/base/src/nsMsgAccountManager.cpp#695

Could that be going on?

We should really be checking that no other account is using an identity before clobbering it.
I took a quick look at the code you referred to and apparently identityArray is unique for all the accounts. Is that correct? That could be the cause. I had many pop accounts on my Thunderbird and then I started to get rid of them and use fetchmail in my Linux box to fetch email from all my pop accounts and place them in a unique imap account, in a particular folder. That process took a while, and every day I did some additions to fetchmail, deleted a few Thunderbird pop accounts, and created the same pop identity on the imap account. Sometime during this process I noticed my SMTP servers were misconfigured. Does that help?
The identities in the identity array might not have been unique when you were deleting accounts, if you ever chose a pre-existing identity for a new account. The code as is seems horribly wrong, though I haven't verified that it breaks things. I don't know how it could not be clobbering shared identities, however.
In my case all 89 email accounts have the same identity.  Sounds like that code bug/issue could be one of the culprits.

A bit more background on the overall usage issue of why 89 emails accounts set up at the one domain and why 89 matching email servers set up.  This kind of thing will likely become more prevalent as time goes on due to people avoiding spammers, combined with people migrating to their own domains from ISP domain mail accounts.

*** 89 accounts ***

I've found that an excellent way to avoid both spammers and to deal with "polluted" company and friend computers (they get a virus that havests my email address from their PC and them the virus uses it to spam my PC) is to assign one email address at the domain to each person or company that I know.  For example:

bob@mydomain.com
sue@mydomain.com
phone_payment_website@mydomain.com
car_repair_shop_3@mydomain.com

That way if any one person gets a virus that harvests my email with the intent to spam it, like a relative in Texas did, all I have to do is delete the account and create/distribute a new one. I have zero spam now.:-) Same goes for publicly viewable boards, like this one, or any other public forum where an email address can possibly be harvested and spammed.  Just delete/recreate addresses at the domain as neeeded.

Also works well if a company sells the email address to a spammer but claims that they didn't.  Becomes immediately obvious which company did the deed since they all have unique emails.  Making the address more random prevents dictionary lookups by spammers:

9_3fCvWq@mydomain.com.

Another issue is filing.  Since each person effectively gets their own inbox in my Thunderbird the flood of incomming email auto-files itself, as opposed to sorting though an inbox and filing emails into folders, or setting up mail rules to do the same.  And finally there is a corruption benefit in Thunderfird (unlike Outlook's single pst file) since very account inbox has a file assigned.   If any one inbox file corrupts on the computer, only the email for that account is lost.

So, long story short, 89 email accounts at the domain and counting.  So far Thunderbird has been a great tool to use for this setup, at least in the "receive" direction.

****** 89 SMTP servers ******

Actually is 89 different account logins at the same SMTP server at GoDaddy, who does my hosting.  In a perfect world it should really only be necessary to set up one SMTP server and use it for all 89 email accounts.  Unfortunately GoDaddy is not that perfect.:-)  GoDaddy only allows 250 daily SMTP relays per email account, presumably to limit "zombie" spam blasting by infected computers.  So although each domain registered and hosted at GoDaddy comes with 500 free email accounts at 10MB each, I am limited to 250 outgoing emails a day per account.  Hence the need to use the actual SMTP server login that goes with each account to make use of that account's 250 daily SMTP relays.

For exmaple, from above,

GoDaddy SMTP server ( smtpout.secureserver.net) SMTP login bob@mydomain.com has 250 daily SMTP relays

GoDaddy SMTP server ( smtpout.secureserver.net ) SMTP login sue@mydomain.com has 250 daily SMTP relays

GoDaddy SMTP server ( smtpout.secureserver.net ) SMTP login phone_payment_website@mydomain.com has 250 daily SMTP relays

I don't usually come anywhere near 250 outgoing emails on most accounts, but on a few I do.

So, long story short, there is the reason for 89 SMTP server accounts set up.

***********************

Thanks again for everyone's help who is looking in the code for the bug.  Thunderbird rocks!!!!
This is already Year 2007 and I am using Thunderbird 1.5.0.10 both in Windows and in Fedora Core 6. This annoying bug still persists! When I reply the emails received from different POP3 servers, Thunderbird seems to always assign the default SMTP server to send the replied emails regardless of the configurations I set up to associate different SMTP servers to different POP3 email accounts. Very rarely Thunderbird can make correct decisions. //sigh... However both Evolution in Linux and Outlook in Windows don't have this annoying problem.
(In reply to comment #15)
> This is already Year 2007 and I am using Thunderbird 1.5.0.10 both in Windows
> and in Fedora Core 6. This annoying bug still persists! When I reply the emails
> received from different POP3 servers, Thunderbird seems to always assign the
> default SMTP server to send the replied emails regardless of the configurations
> I set up to associate different SMTP servers to different POP3 email accounts.
> Very rarely Thunderbird can make correct decisions. //sigh... However both
> Evolution in Linux and Outlook in Windows don't have this annoying problem.
> 

This is some relevant info:


$ grep -i smtp prefs.js 
user_pref("mail.identity.id1.smtpServer", "smtp1");
user_pref("mail.identity.id2.smtpServer", "smtp2");
user_pref("mail.smtp.defaultserver", "smtp2");
user_pref("mail.smtpserver.smtp1.auth_method", 1);
user_pref("mail.smtpserver.smtp1.description", "Yahoo Mail");
user_pref("mail.smtpserver.smtp1.hostname", "smtp.mail.yahoo.com");
user_pref("mail.smtpserver.smtp1.port", 25);
user_pref("mail.smtpserver.smtp1.try_ssl", 1);
user_pref("mail.smtpserver.smtp1.username", "g4x86");
user_pref("mail.smtpserver.smtp2.auth_method", 1);
user_pref("mail.smtpserver.smtp2.description", "GBICC Mail");
user_pref("mail.smtpserver.smtp2.hostname", "218.246.35.49");
user_pref("mail.smtpserver.smtp2.port", 25);
user_pref("mail.smtpserver.smtp2.try_ssl", 1);
user_pref("mail.smtpserver.smtp2.username", "xiongyuguang");
user_pref("mail.smtpservers", "smtp1,smtp2");
Some hopefully helpful information...

About a month after I posted my report above I was able to confirm to my satisfaction that the bug is caused, among any other causes, by deleting SMTP accounts after they are set up, as was speculated in one of the early bug reports in this thread.  

I deleted all nearly-100 SMTP accounts and recreated all of them, based on one of the suggestions in this bug thread.  It worked perfectly.   I went several weeks without the issue/bug surfacing one.  Then I had to delete one of the POP accounts and the matching SMTP account.  *Immediately* afterward the problem started again.  FF assigned about 5 seemingly-randomly-picked SMTP accounts to the default SMTP account.  

WORSE STILL, there is a GUI bug that goes with this.  The text box for picking the SMTP account in the POP setup form for each of the affected accounts shrinks to about 1 pixel tall the first time after the bug occurs.  To clear this I have to then click on some other POP account, then go back to the affected one and the text box will then be normal height from then on.

Unfortunately due to this rather bad bug and the lack of send/receive groups in FF (a critical omission with nearly 300 email accounts set up now)  I've had to move back to Outlook in December of last year.  But I'm still pulling for FF!!  I look forward to the day/year when I can switch back.  I would be happy to do any tests that are ever needed to help track this bug down.
Attached patch possible fix.Splinter Review
thought I had this reviewed before - but I can't find a bug with this patch. Basically, this patch makes it so we don't clear out an identity if some other account is using it...
Assignee: mscott → bienvenu
Status: NEW → ASSIGNED
Attachment #257895 - Flags: superreview?(mscott)
Attachment #257895 - Flags: superreview?(mscott) → superreview+
QA Contact: account-manager
I have the same issue with SeaMonkey 1.1.1
I had an ISP go belly up and now I can not change the default Outgoing Server (SMTP). This setting does not follow the default account and can not be changed from the mail account settings menu. I do want to delete the old account since I need to review the old emails. 
The default server settings should follow the default account but they don't. Once it is set it can not be changed.
Patch still needs checkin on trunk, with modification due to revision 1.320.
David, is this a good candidate for a TB2 update? 

possible dupes: bug 330680, bug 347442
OS: Windows XP → All
Hardware: PC → All
David, can this be driven in if still valid?   only tiny bitrot from bug 379070

I'm wondering if it might help fix my bug 404393
Wayne, I can look into it - please pester me again if I don't get to it in a few days.
Pestering ;)
Flags: wanted-thunderbird3+
Priority: -- → P5
Whiteboard: [has reviewed, slightly bitrotted, patch]
Target Milestone: --- → Thunderbird 3.0b1
fix checked in changeset:   270:c2db134bc8dd
Target Milestone: Thunderbird 3.0a3 → Thunderbird 3.0b1
I still see this problem (and I do not think I deleted an account) in 2.0.0.18pre (20081026). I set my gmail identity to use the gmail smtp server, but Thunderbird (on OS X) uses smtp.comcast.net always.
the fix is in 3.0 nightly builds, not 2.0.0.18 - marking fixed. It will be in 3.0 beta 1 when that is released.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
(In reply to comment #26)
> the fix is in 3.0 nightly builds, not 2.0.0.18 - marking fixed. It will be in
> 3.0 beta 1 when that is released.

I still see this on Linux with the beta 1 release. Steps:

* Added Imap account (works fine)
* Added gmail imap account <- smtp for previous imap account changed !!
* Went to account settings and changed the smtp for the previous imap account back. This worked fine, in contrast with some of the bug description that the servers need to be deleted.

Does this require a separate bug ?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: