take out spurious warning

improve address parsing a bit to make it easier to add parsing of MAIL
FROM extensions


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@263 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Ask Bjørn Hansen 2004-07-16 02:22:11 +00:00
parent db15fbf9ad
commit 86c887fd59

View File

@ -226,8 +226,13 @@ sub mail {
else {
my $from_parameter = join " ", @_;
$self->log(LOGINFO, "full from_parameter: $from_parameter");
my ($from) = ($from_parameter =~ m/^from:\s*(\S+)/i)[0];
warn "$$ from email address : [$from]\n";
my ($from) = ($from_parameter =~ m/^from:\s*(<[^>]+>)/i)[0];
# support addresses without <> ... maybe we shouldn't?
($from) = "<" . ($from_parameter =~ m/^from:\s*(\S+)/i)[0] . ">"
unless $from;
if ($from eq "<>" or $from =~ m/\[undefined\]/) {
$from = Qpsmtpd::Address->new("<>");
}