"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/Mail/SpamAssassin/Plugin/FromNameSpoof.pm" between
Mail-SpamAssassin-3.4.3.tar.bz2 and Mail-SpamAssassin-3.4.4.tar.bz2

About: SpamAssassin is a mail filter that uses a wide range of heuristic tests on mail headers and body text to identify "spam" (also known as unsolicited commercial email) incl. Bayesian (statistical) spam filter and several internet-based realtime blacklists.

FromNameSpoof.pm  (Mail-SpamAssassin-3.4.3.tar.bz2):FromNameSpoof.pm  (Mail-SpamAssassin-3.4.4.tar.bz2)
skipping to change at line 58 skipping to change at line 58
=head1 CONFIGURATION =head1 CONFIGURATION
The plugin allows you to skip emails that have been DKIM signed by specific send ers: The plugin allows you to skip emails that have been DKIM signed by specific send ers:
fns_ignore_dkim googlegroups.com fns_ignore_dkim googlegroups.com
FromNameSpoof allows for a configurable closeness when matching the From:addr an d From:name, FromNameSpoof allows for a configurable closeness when matching the From:addr an d From:name,
the closeness can be adjusted with: the closeness can be adjusted with:
fns_extrachars 5 fns_extrachars 50
B<Note> that FromNameSpoof detects the "owner" of a domain by the following sear ch: B<Note> that FromNameSpoof detects the "owner" of a domain by the following sear ch:
<owner>.<tld> <owner>.<tld>
By default FromNameSpoof will ignore the TLD when testing if From:addr is spoofe d. By default FromNameSpoof will ignore the TLD when testing if From:addr is spoofe d.
Default 1 Default 1
fns_check 1 fns_check 1
skipping to change at line 196 skipping to change at line 196
return $Mail::SpamAssassin::Conf::MISSING_REQUIRED_VALUE; return $Mail::SpamAssassin::Conf::MISSING_REQUIRED_VALUE;
} }
my $listname = "FNS_$1"; my $listname = "FNS_$1";
$value = $2; $value = $2;
$self->{parser}->remove_from_addrlist ($listname, split (/\s+/, $value)); $self->{parser}->remove_from_addrlist ($listname, split (/\s+/, $value));
} }
}); });
push(@cmds, { push(@cmds, {
setting => 'fns_extrachars', setting => 'fns_extrachars',
default => 5, default => 50,
type => $Mail::SpamAssassin::Conf::CONF_TYPE_NUMERIC, type => $Mail::SpamAssassin::Conf::CONF_TYPE_NUMERIC,
}); });
push (@cmds, { push (@cmds, {
setting => 'fns_ignore_dkim', setting => 'fns_ignore_dkim',
default => {}, default => {},
type => $Mail::SpamAssassin::Conf::CONF_TYPE_HASH_KEY_VALUE, type => $Mail::SpamAssassin::Conf::CONF_TYPE_HASH_KEY_VALUE,
code => sub { code => sub {
my ($self, $key, $value, $line) = @_; my ($self, $key, $value, $line) = @_;
if ($value eq '') { if ($value eq '') {
skipping to change at line 265 skipping to change at line 265
my ($self, $pms) = @_; my ($self, $pms) = @_;
$self->_check_fromnamespoof($pms); $self->_check_fromnamespoof($pms);
return $pms->{fromname_domain_different}; return $pms->{fromname_domain_different};
} }
sub check_fromname_spoof sub check_fromname_spoof
{ {
my ($self, $pms, $check_lvl) = @_; my ($self, $pms, $check_lvl) = @_;
$self->_check_fromnamespoof($pms); $self->_check_fromnamespoof($pms);
$check_lvl //= $pms->{conf}->{fns_check}; if ( not defined $check_lvl ) {
$check_lvl = $pms->{conf}->{fns_check};
}
my @array = ( my @array = (
($pms->{fromname_address_different}) , ($pms->{fromname_address_different}) ,
($pms->{fromname_address_different} && $pms->{fromname_owner_different}) , ($pms->{fromname_address_different} && $pms->{fromname_owner_different}) ,
($pms->{fromname_address_different} && $pms->{fromname_domain_different}) ($pms->{fromname_address_different} && $pms->{fromname_domain_different})
); );
return $array[$check_lvl]; return $array[$check_lvl];
} }
skipping to change at line 351 skipping to change at line 353
s/^FNS_// foreach (@lists); s/^FNS_// foreach (@lists);
dbg("using addrlists: ".join(', ', @lists)); dbg("using addrlists: ".join(', ', @lists));
} }
my %fnd = (); my %fnd = ();
my %fad = (); my %fad = ();
my %tod = (); my %tod = ();
$fnd{'addr'} = $pms->get("From:name"); $fnd{'addr'} = $pms->get("From:name");
if ($fnd{'addr'} =~ /\b([\w\.\!\#\$\%\&\'\*\+\/\=\?\^\_\`\{\|\}\~\-]+@[\w\-\.] +\.[\w\-\.]++)\b/i) { if ($fnd{'addr'} =~ /\b((?>[\w\.\!\#\$\%\&\'\*\+\/\=\?\^\_\`\{\|\}\~\-]+@[\w\- \.]+\.[\w\-\.]+))\b/i) {
my $nochar = ($fnd{'addr'} =~ y/A-Za-z0-9//c); my $nochar = ($fnd{'addr'} =~ y/A-Za-z0-9//c);
$nochar -= ($1 =~ y/A-Za-z0-9//c); $nochar -= ($1 =~ y/A-Za-z0-9//c);
return 0 unless ((length($fnd{'addr'})+$nochar) - length($1) <= $conf->{'fns _extrachars'}); return 0 unless ((length($fnd{'addr'})+$nochar) - length($1) <= $conf->{'fns _extrachars'});
$fnd{'addr'} = lc $1; $fnd{'addr'} = lc $1;
} else { } else {
return 0; return 0;
} }
 End of changes. 4 change blocks. 
4 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)