Closed Bug 242361 Opened 16 years ago Closed 12 years ago

User-Agent header malformed


(Thunderbird :: Preferences, defect)

Not set


(Not tracked)

Thunderbird 3


(Reporter: BenB, Assigned: mkmelin)




(1 file)

thunderbird sends e.g.
User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207)
The User-Agent header format follows and is defined by the HTTP spec. That
mandates that the product token does not contain spaces. So, it must be
"Mozilla-Thunderbird" instead of "Mozilla Thunderbird".

def user-agent: <>
def product token: <>
def token: <>
Actually, the separator to the version is also wrong. Should be:
"Mozilla-Thunderbird/0.5" (dash, slash).

The comment section "(Windows/20040207)" also looks strange, looks like it's
Windows build 20040207, but I don't see a definition for comments, so this is
not strictly wrong. I don't have a sensible suggestion, apart from replacing "/"
with "; " like in the browser.

Suggested header:
User-Agent: Mozilla-Thunderbird/0.5 (Windows; 20040207)
FYI, that spec defines the UA string for browsers, the string that gets passed
to http request. We issue the proper full fledged mozilla http UA string for all
http request.
Sure, but I thought the mail header field were defined to have the same syntax
as the HTTP header. I don't know/remember (and can't find) where that's speced,
most of our competing pure mail products use very friendly UA strings which
contain just the produce name and sometimes a version number. They definetly
aren't formatted to look like http UA strings. (just an FYI)
QA Contact: preferences
Blocks: 230182
Version: unspecified → Trunk
The updated URI is for Usenet messages. In short, all that needs to be done is to insert a `/' instead of a space in between Thunderbird and the version number
Nah, Mozilla is also wrong. Spaces are not allowed in product tokens. If you consider "Mozilla" to be a product on its own, it's syntactically valid, but semantically wrong, subproducts come afterwards.
See comment 1.
Better look at what current Thunderbird sends before making such a comment ;-)
They actually seem to have lost the "Mozilla" some time there and are only sending "Thunderbird (...)" nowadays.
Ah, right, I was just looking at comment 0 / 1. So:
Actual result:
Thunderbird (X11/20080510)
Expected result:
Thunderbird (X11; 20080510)
Eh, Expected result:
Thunderbird/ (X11; 20080510)
Attached patch proposed fixSplinter Review
Dan/David: what do you think? 

With this patch we would send e.g. 
User-Agent: Thunderbird/3.0a2pre (X11; 2008061321)

I think that's still quite a friendly UA string.

I note that the ietf draft in comment #6 has expired, but the proposed format should be ok also according to the standard refs in comment 0.
Assignee: mscott → mkmelin+mozilla
Attachment #325172 - Flags: superreview?(bienvenu)
Attachment #325172 - Flags: review?(dmose)
Attachment #325172 - Flags: superreview?(bienvenu) → superreview+
Duplicate of this bug: 230182
Comment on attachment 325172 [details] [diff] [review]
proposed fix

Attachment #325172 - Flags: review?(dmose) → review+
Checking in mailnews/compose/src/nsMsgCompUtils.cpp;
/cvsroot/mozilla/mailnews/compose/src/nsMsgCompUtils.cpp,v  <--  nsMsgCompUtils.cpp
new revision: 1.199; previous revision: 1.198

Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3
User-Agent: Thunderbird 3.0a2pre (Windows/2008061903)
User-Agent: Thunderbird/3.0a2pre (Windows; 2008062003)

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