* lib/Qpsmtpd/Address.pm
RFC-2821 Section 4.5.1 specifically requires <postmaster> (without domain name) as a legal RCPT TO: address. * t/qpsmtpd-address.t Test the above. git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@560 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
37ec3b151e
commit
8a18bb00a1
@ -198,7 +198,9 @@ sub canonify {
|
||||
# empty path is ok
|
||||
return "" if $path eq "";
|
||||
|
||||
#
|
||||
# bare postmaster is permissible, perl RFC-2821 (4.5.1)
|
||||
return ("postmaster", undef) if $path eq "postmaster";
|
||||
|
||||
my ($localpart, $domainpart) = ($path =~ /^(.*)\@($domain)$/);
|
||||
return (undef) unless defined $localpart;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
use strict;
|
||||
$^W = 1;
|
||||
|
||||
use Test::More tests => 27;
|
||||
use Test::More tests => 29;
|
||||
|
||||
BEGIN {
|
||||
use_ok('Qpsmtpd::Address');
|
||||
@ -16,6 +16,11 @@ $ao = Qpsmtpd::Address->parse($as);
|
||||
ok ($ao, "parse $as");
|
||||
is ($ao->format, $as, "format $as");
|
||||
|
||||
$as = '<postmaster>';
|
||||
$ao = Qpsmtpd::Address->parse($as);
|
||||
ok ($ao, "parse $as");
|
||||
is ($ao->format, $as, "format $as");
|
||||
|
||||
$as = '<foo@example.com>';
|
||||
$ao = Qpsmtpd::Address->parse($as);
|
||||
ok ($ao, "parse $as");
|
||||
|
Loading…
Reference in New Issue
Block a user