>If you intend to write an RFC822 parser, please, please take >the advice of everyone who has done so until now: > >Do not write a parser which accepts only what is specified in >RFC822 exactly and nothing else. Rather, write a parser which >accepts and tries to understand everything which remotely looks >like RFC822! Otherwise you will get into endless trouble. > >Example of illegal RFC822 things you should accept: > >John Smith <JS@HOST> Sorry Jacob, this is a perfectly legal address. None of the characters are "specials" and therefore nothing needs to be quoted. >should correctly be >"John Smith" <JS@HOST> This is another legal form of the same address > >Message-ID: <AAA&BBB@CCC> This is a correct message id. The portion of the string before "@" can be anything, and '&' is not a 'special', I don't see why you would want to quote it. >should correctly be >Message-ID: <"AAA6BBB"@CCC> My parser does not parse message-ids, ie it consider its contents as a unique string of undetermined format and records it as such. >Message-ID: <AAA@BBB> (From my perfect mailer) >should correctly be >Message-ID: <AAA@BBB> This would not be treated as the same message-id. >And please do accept things, even if they are on different lines. >Thus you should accept: >To: "a very very very very very very very very very long name" > <AAA@BBB> Well this is a perfectly valid RFC822 address, folded according to the norm. Eric