diff options
| author | fukachan <fukachan> | 2003-02-03 12:33:29 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-02-03 12:33:29 +0000 |
| commit | 571e93e1372b558999066da01c2a33b4871debb9 (patch) | |
| tree | 7a7954d33f0eec16767c6f69f60f2d1153e019cb /fml/lib/FML/Process | |
| parent | 52905e4eb47df4e80ebf274af1824e1e5c1c8781 (diff) | |
| download | fml8-571e93e1372b558999066da01c2a33b4871debb9.tar.gz fml8-571e93e1372b558999066da01c2a33b4871debb9.tar.bz2 fml8-571e93e1372b558999066da01c2a33b4871debb9.zip | |
check From: contents more.
o permit plural addresses From: contains.
In this case, we use the first one as the sender.
o deny if From: has no address.
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/Kernel.pm | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/fml/lib/FML/Process/Kernel.pm b/fml/lib/FML/Process/Kernel.pm index e63640ca..3d099300 100644 --- a/fml/lib/FML/Process/Kernel.pm +++ b/fml/lib/FML/Process/Kernel.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Kernel.pm,v 1.156 2003/02/01 04:36:28 fukachan Exp $ +# $FML: Kernel.pm,v 1.157 2003/02/01 08:51:41 fukachan Exp $ # package FML::Process::Kernel; @@ -486,10 +486,20 @@ sub verify_sender_credential LogError("cannot extract From:"); } - # XXX-TODO: check $from should match safe address regexp. - # XXX "@addrs must be empty" is valid since From: is unique. - unless (@addrs) { + if (@addrs) { + LogWarn("invalid From: duplicated addresses"); + LogWarn("use $from as the sender"); + my $i = 0; + for my $a ($addr, @addrs) { + my $s = $a->address; + ++$i; + LogWarn("From[$i] $s"); + } + } + + # XXX-TODO: check $from should match safe address regexp. + if ($from) { # XXX o.k. From: is proven to be valid now. # XXX log it anyway Log("sender: $from"); @@ -499,7 +509,8 @@ sub verify_sender_credential $curproc->{'credential'}->set( 'sender', $from ); } else { - LogError("invalid From:"); + $curproc->stop_this_process(); + LogError("no valid From:"); } } @@ -540,7 +551,7 @@ sub simple_loop_check if ($match) { # we should stop this process ASAP. $curproc->stop_this_process(); - Log("mail loop detected for $match"); + LogError("mail loop detected for $match"); } } |
