Closed Bug 146488 Opened 22 years ago Closed 22 years ago

Can't send any SMTP messages: "Server %S"

Categories

(MailNews Core :: Backend, defect)

x86
All
defect
Not set
critical

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: adam.winer, Assigned: vparthas)

References

Details

(Whiteboard: [adt2])

Attachments

(2 files, 1 obsolete file)

With a fresh install of the 5/22/2002 Win32 trunk nightly
on a clean machine, I set up a new account.  IMAP mail
is being received perfectly, but all attempts to send
mail are met with:
 "Sending of message failed.
  
  An error occurred sending mail: Unable to connect to SMTP server %S. (etc.)"

The string "%S" appears instead of the actual entered server name.

The server name is correctly set (triple-checked), the port is blank.
Visible configuration settings appear identical to those on another
machine with an older build with functioning e-mail.
I've seen the %s too
OK: there were two problems here.

The first is a very minor problem;  I'll treat that as the
issue addressed by this bug, and have changed the severity
accordingly.  If the SMTP server field is blank - or screwed-up
preference files mean the SMTP server can't be found at all - you
get "%S" in the error message.

So, to repro, just clear the SMTP server, and try to send any e-mail.

The second may be a major problem, but I don't know if it'll
consistently repro:  in pref.js, I had:

  user_pref("mail.identity.id1.smtpServer", "smtp2");

... even though there was no "smtp2".  Early on in the configuration
process, I noticed that clicking on "Advanced" revealed _two_
identical SMTP servers, though I'd done nothing special here.  I deleted
one of the two, and apparently things went poorly after that...   So,
I think there's a bug in this subsystem as well.
Severity: major → minor
QA Contact: sheelar → nbaca
Confirmed for Mozilla 1.0

Just installed Mozilla 1.0 on two different Laptops today (Windows XP). 
Mozilla created identical SMTP Servers for each Mail Account. Also, when 
I changed something with an account (user name etc.) a new identical SMTP
Server was created... 
This could be a knock-out criteria for many people.. as it's really annoying 
when you're unable to send your mails. 
the handeling of SMTP server is so bad that I get this error a lot.
build 20020607
Severity: minor → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached image screenshot of SMTP error —
*** Bug 149921 has been marked as a duplicate of this bug. ***
Moving to MailNews Back End since this is pref corruption.
Bumping severity.  
This is a definate stopper for the average user.
Severity: normal → critical
Component: Networking: SMTP → Mail Back End
confirming same problem with 2002062808 trunk new profile with newly created pop
and imap account. same smtp server, mozilla added another server wich empty
entires to my smtp server list.
Seeing this also in Linux. Setting Platform to All.
OS: Windows 2000 → All
*** Bug 160157 has been marked as a duplicate of this bug. ***
There is a possably related bug 150471: the advanced dialog's OK button is
failing to dismiss the dialog.
Hi!
Yes. I've seen the %s as well. I had a look at the prefs.js in my
config-directory. A very strange aspect is the use of the numbering of the
outgoing smtp-servers like smtp1 smtp2 and so on. When I add a new smtp-server
and then delete it again I get a cross-reference problem with other entries
which refer to the smtp-server. In some entries there is then a smtp1 and at
other smtp2 although I have only ONE entry in the outgoing SMTP-lists. I can
confirm the bug for Mozilla 1.1b under Linux.
/Bernd
Mozilla1.0 (release) but the error is also there with the later versions
Mozilla1.1a and Mozilla1.1b. The system is Linux.
As I told you in the last e-mail there is a problem with the numbering of the
smtp-entires. What I've done:
1) one SMTP-server after installation of mozialla -> works fine
2) added another SMTP-server and deleted the first one -> gives the error
   message shown in the attachement.
The config-file shows the following configuration:
  user_pref("mail.smtp.defaultserver", "smtp2");
  user_pref("mail.smtpserver.smtp2.auth_method", 1);
  user_pref("mail.smtpserver.smtp2.hostname", "smart.cn.stir.ac.uk");
  user_pref("mail.smtpserver.smtp2.try_ssl", 0);
  user_pref("mail.smtpserver.smtp2.username", "");
  user_pref("mail.smtpservers", "smtp2");
and
  user_pref("mail.identity.id1.sign_mail", false);
  user_pref("mail.identity.id1.signing_cert_name", "");
  user_pref("mail.identity.id1.smtpServer", "smtp1");
                                           ^^^^^^^^^!!!!!!!!
Thus the _counter_ for the smtp-server is NOT reset to one.
The smtp-server which I've entered as a second one still has the id 2.

Now I've renamed in the file prefs.js all smtp2 into smtp1. And guess what: it
works again. :-)

Thus I think in the java-script which maintains the list of the smtp-server the
unique id is a wee bit too unique...

/Bernd
Screenshot, Mozilla 1.1B, Linux:
http://www.cn.stir.ac.uk/~bp1/mozilla_bug/
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020808 (nightly build)
Great! The list of the smtp-servers seems to work. I've added an SMTP-server and
I removed one and it works fine...
...however. :-( I can change the SMTP-settings with the "advanced" menu. I can
click on "ok" in the advanced menu and it accepts the changes and closes
correctly. But when I click on the ok-button of the parent window ("mail and
newsgroup account-settings") it does not react. Thus, I can only close the
window by clicking "cancel".
/Bernd
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020808 (nightly build)
Oh no. I've been too optimistic. It still doesn't work. Same error as usual.
Can not connect to "%s".
/Bernd
Varada, can you check out this trunk bug?
Assignee: mscott → varada
Accepting bug.
Status: NEW → ASSIGNED
I am able to reproduce this with my daily debug builds on Win 2K. 
Can confirm this bug for 2002072104, I've also had the 1.1a installed with the
same result. I can verify that it must be an internal error; when sending a
message Mozilla does not communicate with any server before the error message is
displayed. 

This blocks all mail sending; is there any workaround? Changing to smtp1 in
prefs.js did not seem to work. Anyone know if the bug is about to be resolved?
Actually, there is a workaround! Bernd Porr's suggestion in comment #13 works
for me, although he says it didn't work for him in comment #16.

What I did was simply to change all the smtp2, smtp3 and so on to smtp1 in
prefs.js. I guesse a restart of Mozilla is needed after this. It's also possible
that messing around with accounts or the smtp server(s) might do the bug active
again.
I have a tentative fix for this involving changing the value directly in the
prefs.js but I want to do it with a better fix involving changing the value in
the account instead and this will be part of a bigger cleanup for account manager.
Keywords: nsbeta1+
Whiteboard: [adt2]
Attached patch Patch V1 (obsolete) — — Splinter Review
When an smtp server is deleted we automatically search through all the
identities and replace the matching smtpserverkeys with the default
smtpserverkey.
*** Bug 167542 has been marked as a duplicate of this bug. ***
1)

+  for (var accountid in accountArray) {
+    var account = getAccountFromServerId(accountid);

where is account used?

+    var accountValues = accountArray[accountid];
+    try {
+        if (accountValues['identity']['smtpServerKey'] == deletedSmtpServerKey)
+          setAccountValue(accountValues,'identity', 'smtpServerKey',
smtpService.defaultServer.key);
+    }
+    catch(ex){
+    //we will get here for any of the non imap or pop accounts which do not
have identities.
+    }

if you want to skip accounts with out identities, see
nsMsgAccountManagerDataSource::serverHasIdentities()

you can implement that in js, and use it.  I'd rather do that, than call
setAccountValue().


2) 

+var gServerKey=""; //Making the serverKey global so that we can get rid of the
key in Identity prefs.

no need to default this to "";

3)

I can't tell from the patch, but is it possible for gServerKey to be used when
it isn't correct?
We set it in getSelectedServer().  when is getSelectedServer() called?
I hate this bug:

I've never encountered it until the past few days, when I obtained another SMTP
account - after a while, Mail/News goes crazy. I've seen the %s, lots of blank
entry's in the SMTP window, multiple default entries, OK button bustage, and the
typical "check your smtp settings in Account blah blah".

Since this bug has effectively killed Mail/News as my primary mail reader on all
my machines under mutliple OS's, I will pound the heck out of any post-patch
build and test like crazy.
the *best* way to fix this is to completly exit mozilla and edit your prefs.js
file which get corrupted!

now search your prefs.js file for:

"mail.smtp" and check if all entries in:
user_pref("mail.smtpservers", "smtp1");
actually are defined and remove any dupes.

one easy fix which properly could fix some of these errors is:
http://bugzilla.mozilla.org/show_bug.cgi?id=117924
Attached patch Patch V1.1 — — Splinter Review
1)

>>where is account used?
I had forgotten to remove it earlier when I used it for some dumps but now it
is there for checking the defaultidentity.

>>if you want to skip accounts with out identities, see
>>nsMsgAccountManagerDataSource::serverHasIdentities()

>>you can implement that in js, and use it.  I'd rather do that, than call
>>setAccountValue().

I have decided to use the account to check to see if it has a defaultIdentity
and then proceed. This eliminates all accounts that dont have one(smtp and
local folders).



2) 

>>no need to default this to "";

I have removed the initialization to "".

3)

>>I can't tell from the patch, but is it possible for gServerKey to be used
when
>.it isn't correct?
>>We set it in getSelectedServer().  when is getSelectedServer() called?

getSelectedServer is used during edit, delete, updatebuttons and setdefault.
I tried several scenarios using all the above operations and there was no wrong
assignations due to using the gServerKey and each time the replacement after
the smtpserver was deleted worked correctly - the getSelectedServer gets only
the selected smtpServerKey each time.
Attachment #98225 - Attachment is obsolete: true
it looks like your code does all this work on delete.

but what if the user cancels?  See onOk() in the SmtpServerList.js

currently, if I delete or add an smtp server, and hit cancel what happens?

does your changes act the same?  or, with your patch, if I delete, will
cancelling cause problems.

also, what happens if I add an smtp server or an account in the account manager
session where I delete?  will any of the code in replaceWithDefaultSmtpServer()
fail?

my gut tells me there might be scenarios where replaceWithDefaultSmtpServer() is
going to thrown an exception.
>>currently, if I delete or add an smtp server, and hit cancel what happens?
It either adds or deletes the server and does nothing else.

>>does your changes act the same?  or, with your patch, if I delete, will
>>cancelling cause problems.
Good catch on this one.
It does the same thing for all cases except one. If I add an smtp server and
then set it as default, then delete the existing default smtp server, then when
we cancel the default remains the old one in the Outgoing SMTP Panel page. And
since this will over write any other changes in this case alone we lose data/
get wrong data. I am looking into this issue.

>>also, what happens if I add an smtp server or an account in the account manager
>>session where I delete?  will any of the code in replaceWithDefaultSmtpServer()
>>fail?

 With the exception of that one case of replacing defaults and deleting old
default - it works fine. 

I shall post a new patch as soon as I get it done.

*** Bug 167937 has been marked as a duplicate of this bug. ***
This is still a problem with Mozilla1.1 on Windows.
To save you time finding the file prefs.js on Windows (2000) check here:
c:\Documents and Settings\username\Application Data\Mozilla\Profiles\default\xxx\

I wonder why this file is not xml. 
I thought this bug was fixed in 1.2 alpha, but as always, Mozilla has proven me
wrong.

I read a comment by a developer in a Mozilla newsgroup that developers should
not be "wasting time chasing down bugs" because they have new features to work on.

Is this the case with bugs such as this which have existed for no less than
three release versions of Mozilla? If so, I intend to jump ship and start using
Internet Explorer, because if the Mozilla developers are going to continue
mis-managing the project like this, it leaves open source operating systems
without a viable, standards compliant browser than we can rely on; and most
certainly not one that we could ever reccomend to a client for fear of looking
like a fool when the product falls around their ears.

I greatly anticipate this bug being fixed by about Mozilla version 3.9, at which
point this will either be a useable project or a very large tarball of
nonsensical ASCII strings.
This bug has a patch that has been reviewed and super reviewed- I haven't had
time yet to transfer the r and sr from a related bug. I shall be checking the
fix sometime this weekend along with some other fixes for cleaning up some of
the messes in the account manager / smtp server areas.
Marking Fixed.
Patch checked in along with 167834 - cancelling advanced smtp settings dialog
should do the right thing.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
*** Bug 171233 has been marked as a duplicate of this bug. ***
This bug is not only not fixed, but it now appears to be worse. Now I can no
longer even OPEN the "advanced" settings dialog of the "Outgoing Server (SMTP)"
configuration section.

Mail & News was working fine - I was able to sucesfully send approximately four
e-mails, then without any further modification of the preferences, it suddenly
stopped working and began giving me the error message again.

Unfortunately I don't have the ability to change this BACK to its rightful
designation - OPEN CRITICAL.
Using the latest debug and release builds I am able to do all operations
including send mail and open the advanced dialogs and change smtp servers. Does
this happen to you in a new profile as well?
Confirming that the Advanced popup in Outgoing Server (SMTP) does not even open. 
The button is active and responds to the mouse klick, but no window shows up.
Build ID 2002093004 on Win2K.
I haven't (yet) attempted to create a new profile. I've probably re-created my
profile atleast a dozen times, which will temporarily result in a fix, but more
often than not the problem re-appears days (or sometimes weeks) later. I have
noticed that the profiles are rife with extraneous SMTP entries, which are
listed at http://www.snerk.org/moz_smtp.txt. I may try to remove my profile, but
as usual the prefs.js file becomes horribly bloated after about a week or two,
and that's usually when the problems all start to re-appear. My biggest problem
with the profile corruption isn't my own use (I can re-create my preference in a
matter of minutes), but the businesses I've deployed Mozilla for (for both a web
browser and Mail & News reader) and my parents' system. I'll search next for a
bug relating to the profile corruption but it is my belief that the problems are
directly inter-related.
*** Bug 173153 has been marked as a duplicate of this bug. ***
*** Bug 173704 has been marked as a duplicate of this bug. ***
*** Bug 176853 has been marked as a duplicate of this bug. ***
THE SOLUTION

you need to modify the pref.js file

edit it, and try to leave only one smtp server: smtp1
erase smtp2
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
giorgio have you used the latest builds and still getting this problem? - this
bug was fixed sometime in the last week of september or first week of october -
try pulling a build or downloading one from recent days and let me know if this
still occurs. Also see if it happens with an old profile or with a new profile.
Re-resolving as fixed sine nothing indicates the bug is in new builds.
(Bug 176853 was reported by "giorgio" with a several months old build.)
Status: REOPENED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
Trunk build 2002-10-29: WinMe, Linux 8, Mac 10.1.3
Verified Fixed (used steps in comment# 13 for steps to verify)
Status: RESOLVED → VERIFIED
*** Bug 178217 has been marked as a duplicate of this bug. ***
*** Bug 178699 has been marked as a duplicate of this bug. ***
Probably submitted as a duplicate so many times because doing a search on "SMTP %S" doesn't give any matches (!?)
*** Bug 178734 has been marked as a duplicate of this bug. ***
*** Bug 171268 has been marked as a duplicate of this bug. ***
*** Bug 177759 has been marked as a duplicate of this bug. ***
*** Bug 181650 has been marked as a duplicate of this bug. ***
*** Bug 161056 has been marked as a duplicate of this bug. ***
*** Bug 172332 has been marked as a duplicate of this bug. ***
*** Bug 169661 has been marked as a duplicate of this bug. ***
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: