diff options
| author | fukachan <fukachan> | 2001-01-25 16:14:08 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-01-25 16:14:08 +0000 |
| commit | 06db3000c1bf25a41f216b8bf9812e5977f5c63f (patch) | |
| tree | e3f21f92855e9a8b81db0e8470368c1f52c5b7d9 | |
| parent | fe1209542cddfdd1049ee1e8cc1323cf6e2cb5f1 (diff) | |
| download | fml8-06db3000c1bf25a41f216b8bf9812e5977f5c63f.tar.gz fml8-06db3000c1bf25a41f216b8bf9812e5977f5c63f.tar.bz2 fml8-06db3000c1bf25a41f216b8bf9812e5977f5c63f.zip | |
change arguments for FML::Parse class.
save unix-from information at pcb in parsing process
| -rw-r--r-- | fml/lib/FML/Parse.pm | 13 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Kernel.pm | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/fml/lib/FML/Parse.pm b/fml/lib/FML/Parse.pm index e93f0f71..ecaea64e 100644 --- a/fml/lib/FML/Parse.pm +++ b/fml/lib/FML/Parse.pm @@ -69,19 +69,19 @@ use FML::Log qw(Log); sub new { - my ($self, $fd) = @_; + my ($self, $curproc, $fd) = @_; my $me = {}; bless $me, $self; # return ( $ref_to_mail_header, $ref_to_mail_body, $error_code); - return $me->_parse($fd); + return $me->_parse($curproc, $fd); } # return ( $ref_to_mail_header, $ref_to_mail_body, $error_code); sub _parse { - my ($self, $fd) = @_; + my ($self, $curproc, $fd) = @_; my ($header, $header_size); my $body_size; my $total_buffer_size; @@ -114,6 +114,13 @@ sub _parse my $x; for $x (@h) { $x .= "\n";} + # save unix-from (mail-from) in PCB and remove it in the header + if ($h[0] =~ /^From\s/o) { + my $pcb = $curproc->{ pcb }; + $pcb->set('credential', 'unix-from', $h[0]); + shift @h; + } + # extract each field from the header array my $r_header = new FML::Header \@h, Modify => 0; my $r_body = new MailingList::Messages { content => \$InComingMessage }; diff --git a/fml/lib/FML/Process/Kernel.pm b/fml/lib/FML/Process/Kernel.pm index 25ad9c46..0341455b 100644 --- a/fml/lib/FML/Process/Kernel.pm +++ b/fml/lib/FML/Process/Kernel.pm @@ -204,7 +204,7 @@ sub parse_incoming_mail # malloc the incoming message on memory. # $r_msg is the reference to the memory area. my $r_msg = {}; - ($r_msg->{'header'}, $r_msg->{'body'}) = new FML::Parse \*STDIN; + ($r_msg->{'header'}, $r_msg->{'body'}) = new FML::Parse $curproc, \*STDIN; $curproc->{'incoming_mail'} = $r_msg; } |
