summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2006-11-12 15:14:06 +0000
committerfukachan <fukachan>2006-11-12 15:14:06 +0000
commit8f209d07b7f37ed043f3abfa752473fc6db9d3a8 (patch)
tree3d4c52edc6ccb598d0a9583fdd35c8e7fe0c3a94
parent90de229c2239f1e1160a35c0f1d3317d587914d0 (diff)
downloadfml8-8f209d07b7f37ed043f3abfa752473fc6db9d3a8.tar.gz
fml8-8f209d07b7f37ed043f3abfa752473fc6db9d3a8.tar.bz2
fml8-8f209d07b7f37ed043f3abfa752473fc6db9d3a8.zip
fix comments
use FML::Credential->is_same_assress() to compare addresses. move variable definitions to the block using it more nearly.
-rw-r--r--fml/lib/FML/Envelope.pm21
1 files changed, 14 insertions, 7 deletions
diff --git a/fml/lib/FML/Envelope.pm b/fml/lib/FML/Envelope.pm
index 4d8e02d7..4834e5e8 100644
--- a/fml/lib/FML/Envelope.pm
+++ b/fml/lib/FML/Envelope.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: Envelope.pm,v 1.1 2006/05/14 11:25:13 fukachan Exp $
+# $FML: Envelope.pm,v 1.2 2006/07/09 12:11:12 fukachan Exp $
#
package FML::Envelope;
@@ -42,7 +42,14 @@ sub new
}
-# Descriptions: checksum of mail Envelope part.
+=head2 check_envelope_sender()
+
+check if the envelope sender is not our maintainer.
+
+=cut
+
+
+# Descriptions: check if the envelope sender is not our maintainer.
# Arguments: OBJ($self)
# Side Effects: none
# Return Value: NUM(1 or 0)
@@ -59,12 +66,12 @@ sub check_envelope_sender
return 0;
}
- # compare sender and envelope sender.
+ # compare the envelope sender with our maintainer.
my $maintainer = $config->{ maintainer } || '';
if ($maintainer) {
- $maintainer =~ tr/A-Z/a-z/;
- $envelope_sender =~ tr/A-Z/a-z/;
- if ($maintainer eq $envelope_sender) {
+ use FML::Credential;
+ my $cred = new FML::Credential $curproc;
+ if ($cred->is_same_address($maintainer, $envelope_sender, 128)) {
$curproc->logerror("envelope sender == maintainer");
return 1;
}
@@ -101,12 +108,12 @@ my $gloval_default_checksum_type = 'md5';
sub set_checksum_type
{
my ($self, $type) = @_;
- my $curproc = $self->{ _curproc };
if ($type eq 'md5') {
$self->{ _type } = $type;
}
else {
+ my $curproc = $self->{ _curproc };
$curproc->logerror("unsupported checksum: $type");
}
}