diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2016-06-25 21:28:32 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2016-06-25 21:28:32 +0200 |
commit | 063af8ae790e4e67087aa1ed51aceae1a3b77be0 (patch) | |
tree | 2a0f71cb95e21a04fe1e0af83a30e25e9f02ae2c /pullimap | |
parent | 7e720edd5557a88b5e595240b123a7dad377c9a7 (diff) |
wibble
Diffstat (limited to 'pullimap')
-rwxr-xr-x | pullimap | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -277,14 +277,13 @@ sub pull_callback($$) { my $uid = $mail->{UID}; my $from = first { defined $_ and @$_ } @{$mail->{ENVELOPE}}[2,3,4]; if (defined $from and @$from) { - my ($l, $d) = ($from->[0]->[2], $from->[0]->[3]); - if ($l !~ qr/\A$RE_ATOM(?:\.$RE_ATOM)*\z/o) { # Dot-string, RFC 5321 - # quote the local part - $IMAP->panic("Invalid MAIL FROM: <$l\@$d>") unless $l =~ qr/\A[\x20-\x7E]*\z/; + my ($l, $d) = @{$from->[0]}[2,3]; + unless ($l =~ /\A$RE_ATOM(?:\.$RE_ATOM)*\z/o) { # quote the local part if not Dot-string (RFC 5321) $l =~ s/([\x22\x5C])/\\$1/g; # escape double-quote and backslash $l = '"' .$l. '"'; } $from = $l .'@'. $d; + $IMAP->fail("Invalid character in MAIL FROM: <$from>") unless $l =~ /\A[\x20-\x7E]*\z/; } else { $from = ''; } |