All users were logged out of Bugzilla on October 13th, 2018

Error 5.5.4 on sending to MS Exchange server due to newlines in hostname

RESOLVED FIXED in Thunderbird 3


11 years ago
10 years ago


(Reporter: jamesmstone, Assigned: mkmelin)


Thunderbird 3

Firefox Tracking Flags

(Not tracked)



(1 attachment)



11 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: Gecko/20071127 Firefox/
Build Identifier: Thunderbird

When I send mail vi the MS Exchange server at work, I get the error "5.5.4 Invalid Address" and the mail is not sent. This makes using Thunderbird impossible.

The error is apparently due to an idiosyncrasy in the way the MS Exchange server handles trailing spaces and dots:

Reproducible: Always

Steps to Reproduce:

Comment 1

11 years ago
More info: It seems to be generated by the strange name that is given to my PC on this network.. Here is the log from Thunderbird talking to the exchange server:

-1610567004[130d020]: SMTP Response: 220 Microsoft ESMTP MAIL Serv
ice, Version: 6.0.3790.3959 ready at Mon, 7 Jan 2008 15:20:27 +0000
-1610567004[130d020]: SMTP entering state: 15
-1610567004[130d020]: SMTP Send: EHLO pc02607
-1610567004[130d020]: SMTP entering state: 0
-1610567004[130d020]: SMTP Response: 501 5.5.4 Invalid Address

Notice the PC name seems to have a <CR> in it!! So this is clearly a local problem. I think if Thunderbird just sent the part of the address, it would work fine.. I guess this is what other email clients do.


Comment 2

11 years ago
Could would be around here:

Can you try to workaround the problem by setting the name without line break? The pref is something like mail.smtpserver.<smtpXXX>.hello_argument 

Comment 3

11 years ago
Oh, and you have to use a nightly, because that pref isn't available on 2.0.

Comment 4

11 years ago
I added the pref in and it worked fine. Thanks!

Would it be possible for future versions of TB to strip out any unacceptable characters from the PC name prior to speaking to SMTP? Other mail clients seem to work around somehow, so it would be good if TB is not alone in looking broken.

Anyway, many thanks for your help!


Comment 5

11 years ago
Turns out is is available for 2.0 also - the keyword was just forgotten in that bug.
OS: Mac OS X → All
Hardware: Macintosh → All
Summary: Error 5.5.4 on sending to MS Exchange server → Error 5.5.4 on sending to MS Exchange server due to newlines in hostname

Comment 6

11 years ago
Created attachment 296709 [details] [diff] [review]
proposed fix

Wouldn't imagine it's very common for the hostname to have newlines, but apparently it can in some cases.
Assignee: nobody → mkmelin+mozilla
Ever confirmed: true
Attachment #296709 - Flags: superreview?(bienvenu)
Attachment #296709 - Flags: review?(bienvenu)

Comment 7

11 years ago
Comment on attachment 296709 [details] [diff] [review]
proposed fix

Wild. thx, Magnus. The other possibility would be to call StripWhitespace(), but I'll leave that up to you.
Attachment #296709 - Flags: superreview?(bienvenu)
Attachment #296709 - Flags: superreview+
Attachment #296709 - Flags: review?(bienvenu)
Attachment #296709 - Flags: review+

Comment 8

11 years ago
StripWhitespace() sounds like a good idea! Fixed that and checked in.

Checking in mailnews/compose/src/nsSmtpProtocol.cpp;
/cvsroot/mozilla/mailnews/compose/src/nsSmtpProtocol.cpp,v  <--  nsSmtpProtocol.cpp
new revision: 1.201; previous revision: 1.200

Last Resolved: 11 years ago
Resolution: --- → FIXED


11 years ago
Target Milestone: --- → Thunderbird 3

Comment 9

11 years ago

Any possibility you could provide more details on how your PC is configured (and where it got the funny name)?

Comment 10

11 years ago
The bug is fixed (see the post before yours).

Why are you replying to a closed bug?

The PC name is automatically assigned on my network at work. I have nothing to do with the network admin so I can't give any more details.

Comment 11

10 years ago
I wanted to know because there are other possible places we should test....

Comment 12

10 years ago
Ah.. OK.

Well, I'm afraid I can't really give you much more info. The IT department at work has some very odd practices.. For instance my computer is assigned a new name every time I connect to the network (it's a powerbook, and I think they are set up primarily for windows PCs).. I don't know how the names are generated or why some of them have spaces or <CR> in them. All I know is that after that fix to Thunderbird, mail works perfectly.

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