From: Dan F. <da...@ha...> - 2006-05-09 18:13:55
|
Steve Heaven wrote: > Can someone post a patch to filter out invalid chars from the recipient > address. > I downloaded 1.7 to make a patch for you, when i noticed that 1.7.3 actually seem to correct handling of this issue.. Maybe upgrading to 1.7.3 an isnt an option for you? If not, then ive made a quick fix for you against 1.7.1: --- sqlgrey.org 2006-05-09 20:12:12.000000000 +0200 +++ sqlgrey 2006-05-09 20:12:37.000000000 +0200 @@ -994,7 +994,7 @@ $rcpt =~ s/\./\[\.\*-\]+/g; my ($rcpt_lhs, $rcpt_rhs) = split /\@/, $rcpt, 2; # BATV implementations use third or first alternative (first by abuse.net) - my $pat = qr/$rcpt_lhs[=\?\*~\.]+?$rcpt_rhs|$rcpt_rhs[=\?\*~\.]+?$rcpt_lhs|$rcpt_lhs/; + my $pat = qr/\Q$rcpt_lhs\E[=\?\*~\.]+?\Q$rcpt_rhs\E|\Q$rcpt_rhs\E[=\?\*~\.]+?\Q$rcpt_lhs\E|\Q$rcpt_lhs\E/; # replace address with capital RCPT to be save with deletes $user =~ s/(.+[\*=-])$pat(.*)/$1RCPT$2/; |