Re: [Exim] square brackets in To header

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Nigel Metheringham
CC: Miquel van Smoorenburg, exim-users
Subject: Re: [Exim] square brackets in To header
On 5 Jul 2001, Nigel Metheringham wrote:

> On 05 Jul 2001 13:17:41 +0000, Miquel van Smoorenburg wrote:
> > But, in the To: header, Customer Name [some info] <email@domain>
> > is absolutely legal. What exactly is breaking ?
>
> although with special characters in there you should have the stuff
> quoted:-
> To: "Customer Name [some info]" <email@domain>


It's all there in RFC 2822. The syntax rules, in the order you need to
understand them for this header line, are:

     destination =  "To"          ":" 1#address  ; Primary
                 /  "Resent-To"   ":" 1#address
                 /  "cc"          ":" 1#address  ; Secondary
                 /  "Resent-cc"   ":" 1#address
                 /  "bcc"         ":"  #address  ; Blind carbon
                 /  "Resent-bcc"  ":"  #address


     address     =  mailbox                      ; one addressee
                 /  group                        ; named list


     mailbox     =  addr-spec                    ; simple address
                 /  phrase route-addr            ; name & addr-spec


     phrase      =  1*word                       ; Sequence of words


     word        =  atom / quoted-string


     atom        =  1*<any CHAR except specials, SPACE and CTLs>


     specials    =  "(" / ")" / "<" / ">" / "@"  ; Must be in quoted-
                 /  "," / ";" / ":" / "\" / <">  ;  string, to use
                 /  "." / "[" / "]"              ;  within a word.


OK? Square brackets are in the list of specials. Therefore they have to
be quoted if they appear in the "phrase" part of an address.

If you turn on headers_check_syntax in Exim's configuration, it will
check the syntax against the published rules. If you want to process
messages that break the rules, turn that switch off.

Incidentally, this particular rule has not changed since RFC 822. In
other words, it has been like this SINCE 1984. Long enough, one would
hope, for people to understand it...

Sigh.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.