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

Status

--
major
RESOLVED FIXED
11 years ago
10 years ago

People

(Reporter: jamesmstone, Assigned: mkmelin)

Tracking

unspecified
Thunderbird 3

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

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

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:

http://support.microsoft.com/kb/291828

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
(Reporter)

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 x.x.ac.uk 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
sgd-01790.x.x.ac.uk
-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 sgd-01790.x.x.ac.uk part of the address, it would work fine.. I guess this is what other email clients do.

James
(Assignee)

Comment 2

11 years ago
Could would be around here:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/mailnews/compose/src/nsSmtpProtocol.cpp&rev=1.200#375

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

Comment 3

11 years ago
Oh, and you have to use a nightly, because that pref isn't available on 2.0. 
http://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-trunk/
(Reporter)

Comment 4

11 years ago
I added the pref in 2.0.0.9 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!

James
(Assignee)

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
(Assignee)

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
Status: UNCONFIRMED → ASSIGNED
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+
(Assignee)

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
done

->FIXED
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
(Assignee)

Updated

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

Comment 9

11 years ago
James:

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

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....
(Reporter)

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.

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