diff options
| author | fukachan <fukachan> | 2002-04-13 14:54:51 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-04-13 14:54:51 +0000 |
| commit | ca25689c79153f2be87d1068a498d4984aa58cf0 (patch) | |
| tree | 16eebf0cbc0156cc54e634db5fdc0012b30c3ba2 /fml | |
| parent | 87659a6bec6f5de41d9384e795b0319ffafeb679 (diff) | |
| download | fml8-ca25689c79153f2be87d1068a498d4984aa58cf0.tar.gz fml8-ca25689c79153f2be87d1068a498d4984aa58cf0.tar.bz2 fml8-ca25689c79153f2be87d1068a498d4984aa58cf0.zip | |
o reply_message() can handle OBJ(Mail::Message).
o save error reason at pcb area when the message is rejected by
xxx_restrictions.
Diffstat (limited to 'fml')
| -rw-r--r-- | fml/lib/FML/Process/Kernel.pm | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/fml/lib/FML/Process/Kernel.pm b/fml/lib/FML/Process/Kernel.pm index c382a427..e4ac0c91 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.83 2002/04/10 04:31:09 fukachan Exp $ +# $FML: Kernel.pm,v 1.84 2002/04/10 08:59:39 fukachan Exp $ # package FML::Process::Kernel; @@ -504,12 +504,14 @@ sub _check_resitrictions my ($curproc, $args, $type) = @_; my $config = $curproc->{ config }; my $cred = $curproc->{ credential }; # user credential + my $pcb = $curproc->{ pcb }; for my $rule (split(/\s+/, $config->{ "${type}_restrictions" })) { if ($rule eq 'reject_system_accounts') { my $match = $cred->match_system_accounts($curproc, $args); if ($match) { Log("${rule}: $match matches sender address"); + $pcb->set("check_restrictions", "deny_reason", $rule); return 0; } } @@ -533,6 +535,7 @@ sub _check_resitrictions } } elsif ($rule eq 'reject') { + $pcb->set("check_restrictions", "deny_reason", $rule); return 0; } else { @@ -941,11 +944,23 @@ sub queue_in next QUEUE unless $r eq $rcptkey; - unless ($t eq 'text') { - $msg->attach(Type => $q->{ type }, - Path => $q->{ path }, - Filename => $q->{ filename }, - Disposition => $q->{ disposition }); + if ($t eq 'Mail::Message') { + use FileHandle; + my ($rh, $wh) = FileHandle::pipe; + $q->print($wh); + $msg->attach(Type => 'message/rfc822', + FH => $rh); + } + else { + unless ($t eq 'text') { + $msg->attach(Type => $q->{ type }, + Path => $q->{ path }, + Filename => $q->{ filename }, + Disposition => $q->{ disposition }); + } + else { + Log("queue_in: unknown typ $t"); + } } } } @@ -963,8 +978,20 @@ sub queue_in next QUEUE unless $r eq $rcptkey; - if ($t eq 'text') { - $s .= $q; + if ($t eq 'Mail::Message') { + use FileHandle; + my ($rh, $wh) = FileHandle::pipe; + $q->print($wh); + $msg->attach(Type => 'message/rfc822', + FH => $rh); + } + else { + if ($t eq 'text') { + $s .= $q; + } + else { + Log("queue_in: unknown typ $t"); + } } } |
