diff options
| author | fukachan <fukachan> | 2003-03-06 14:13:27 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-03-06 14:13:27 +0000 |
| commit | 34bd1f7b1d5c4fdcd9b4d2ce2c49eee21d4bb33d (patch) | |
| tree | 6037a9e5c01ae68fc2760b6481ba4f04fe46429f /fml/lib/FML/Process | |
| parent | 179ed66cbfbe6c35f20cdbd021ce82f8ca0b2d17 (diff) | |
| download | fml8-34bd1f7b1d5c4fdcd9b4d2ce2c49eee21d4bb33d.tar.gz fml8-34bd1f7b1d5c4fdcd9b4d2ce2c49eee21d4bb33d.tar.bz2 fml8-34bd1f7b1d5c4fdcd9b4d2ce2c49eee21d4bb33d.zip | |
implment new method convert_to_mail_address() and use it
to expand {admin, sender, ...} to the corresponding mail address.
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/Utils.pm | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm index 25419394..09dee4df 100644 --- a/fml/lib/FML/Process/Utils.pm +++ b/fml/lib/FML/Process/Utils.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: Utils.pm,v 1.60 2003/02/16 08:55:42 fukachan Exp $ +# $FML: Utils.pm,v 1.61 2003/02/20 04:32:50 fukachan Exp $ # package FML::Process::Utils; @@ -1112,6 +1112,45 @@ sub which_map_nl } +=head2 convert_to_mail_address($list) + +convert_to_mail_address() converts $list to mail addresses. +For example + + admin => $maintainer + sender => sender of the current message (From: in header) + +=cut + + +# Descriptions: convert to mail addresses. +# Arguments: OBJ($curproc) ARRAY_REF($list) +# Side Effects: none +# Return Value: ARRAY_REF +sub convert_to_mail_address +{ + my ($curproc, $list) = @_; + my $config = $curproc->config(); + my $cred = $curproc->{ credential }; + my $result = []; + + for my $rcpt (@$list) { + if ($rcpt eq 'admin') { + push(@$result, $config->{ maintainer }); + } + elsif ($rcpt eq 'sender') { + my $sender = $cred->sender(); + push(@$result, $sender); + } + else { + LogError("unknown recipient type $rcpt"); + } + } + + return $result; +} + + =head2 article_id_max() return the current article number (sequence number). |
