Bounce, RFC and From header

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bounce, RFC and From header

Nerijus Kislauskas
Hi,

Does this From: header of default bounce message in postfix conforms to
RFC2822, RFC5322 or RFC6854?:

From: [hidden email] (Mail Delivery System)


I'm using postfix 2.7.1. As I can see 2.11 is not much different. There
are a lot of libraries, like

http://search.cpan.org/~rjbs/Email-Address-1.903/lib/Email/Address.pm

in the wild, which doesn't correctly parse such From: header. Thanks for
answers.
--
Pagarbiai,
Nerijus Kislauskas
KTU ITD, Litnet valdymo centras
Studentu g. 48a - 101, Kaunas
tel.: (8~37) 30 06 45
mob. tel.: 8-614-93889
e-mail.: [hidden email]


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Bounce, RFC and From header

Wietse Venema
Nerijus Kislauskas:

> Hi,
>
> Does this From: header of default bounce message in postfix conforms to
> RFC2822, RFC5322 or RFC6854?:
>
> From: [hidden email] (Mail Delivery System)
>
>
> I'm using postfix 2.7.1. As I can see 2.11 is not much different. There
> are a lot of libraries, like
>
> http://search.cpan.org/~rjbs/Email-Address-1.903/lib/Email/Address.pm
>
> in the wild, which doesn't correctly parse such From: header. Thanks for
> answers.

RFC822 comments (text inside parentheses) were defined in 1982.
That's more than 30 years ago! I recommend that you use better
software.

You can change Postfix's header in the bounce template.
http://www.postfix.org/bounce.5.html 
But that won't change the format of bounces from other systems.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Bounce, RFC and From header

Michael Tokarev
30.04.2014 15:23, Wietse Venema wrote:

> Nerijus Kislauskas:
>> Hi,
>>
>> Does this From: header of default bounce message in postfix conforms to
>> RFC2822, RFC5322 or RFC6854?:
>>
>> From: [hidden email] (Mail Delivery System)
>>
>>
>> I'm using postfix 2.7.1. As I can see 2.11 is not much different. There
>> are a lot of libraries, like
>>
>> http://search.cpan.org/~rjbs/Email-Address-1.903/lib/Email/Address.pm

Hm.  This is Email::Address, not Email::Header, is it?
I mean, the (comments) appears in email _header_, from which you extract
an _address_, which you can give to this module for further inspection.

>> in the wild, which doesn't correctly parse such From: header. Thanks for
>> answers.

I think you should use something to parse _header_ first, before giving
it to _address_ parsing part.

Thanks,

/mjt
Reply | Threaded
Open this post in threaded view
|

[OT?] Re: Bounce, RFC and From header

Pau Amma
In reply to this post by Wietse Venema
On Wed, April 30, 2014 11:23 am, Wietse Venema wrote:

> Nerijus Kislauskas:
>> Hi,
>>
>> Does this From: header of default bounce message in postfix conforms to
>> RFC2822, RFC5322 or RFC6854?:
>>
>> From: [hidden email] (Mail Delivery System)
>>
>>
>> I'm using postfix 2.7.1. As I can see 2.11 is not much different. There
>> are a lot of libraries, like
>>
>> http://search.cpan.org/~rjbs/Email-Address-1.903/lib/Email/Address.pm
>>
>> in the wild, which doesn't correctly parse such From: header. Thanks for
>> answers.
>
> RFC822 comments (text inside parentheses) were defined in 1982.
> That's more than 30 years ago! I recommend that you use better
> software.

Parses just fine for me:

$ perl -e 'use Email::Address; print "$Email::Address::VERSION\n"; my
@addrs = Email::Address->parse(q[From: [hidden email] (Mail
Delivery System)]); print scalar(@addrs), " address(es) found\n"; print
"{", join("}{", $_->original, $_->phrase, $_->address, $_->comment),"}\n"
foreach @addrs;'
1.892
1 address(es) found
{ [hidden email] (Mail Delivery
System)}{}{[hidden email]}{(Mail Delivery System)}