diff options
| author | fukachan <fukachan> | 2001-04-12 14:12:00 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-04-12 14:12:00 +0000 |
| commit | 0a90d74828b60e4457bad47068f67879788f729b (patch) | |
| tree | ef148d7949305cb10630ad9b09f1e0c4b3dca398 /fml | |
| parent | 5f4815657ad8c9bc5992eeee3395ec487e719118 (diff) | |
| download | fml8-0a90d74828b60e4457bad47068f67879788f729b.tar.gz fml8-0a90d74828b60e4457bad47068f67879788f729b.tar.bz2 fml8-0a90d74828b60e4457bad47068f67879788f729b.zip | |
define Mail::Bounce::address_clean_up() to canonicalize mail
addresses. It is used for Mail::Bounce::* class.
Diffstat (limited to 'fml')
| -rw-r--r-- | fml/lib/Mail/Bounce.pm | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/fml/lib/Mail/Bounce.pm b/fml/lib/Mail/Bounce.pm index b55a492d..90bd62be 100644 --- a/fml/lib/Mail/Bounce.pm +++ b/fml/lib/Mail/Bounce.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: Bounce.pm,v 1.6 2001/04/12 12:06:11 fukachan Exp $ +# $FML: Bounce.pm,v 1.7 2001/04/12 13:37:15 fukachan Exp $ # package Mail::Bounce; @@ -132,6 +132,34 @@ sub look_japanese } +sub address_clean_up +{ + my ($self, $type, $addr) = @_; + + # nuke predecing and trailing strings around user@domain pattern + my $prev_addr = $addr; + do { + $prev_addr = $addr; + print " address_clean_up.in: $prev_addr\n" if $debug; + + $addr =~ s/\.$//; + $addr =~ s/^\<//; + $addr =~ s/\>$//; + $addr =~ s/^\"//; + $addr =~ s/\"$//; + + print " address_clean_up.out: $addr\n" if $debug; + } while ($addr ne $prev_addr); + + if ($type eq 'nifty.ne.jp' && $addr !~ /\@/) { + $addr . '@nifty.ne.jp'; + } + else { + $addr; + } +} + + =head1 AUTHOR Ken'ichi Fukamachi |
