hi
this plugin is picked from
http://wiki.apache.org/spamassassin/CustomPlugins
spamassassin plugin which will check the mail from and the envelope sender
(reply-to)
if both don't match or if either of them is blank then the message will be
tagged as spam
most spam messages do not have the same from and reply-to addresses so it
is a big advantage.
unfortunately some legitimate email lists may also get trapped by this,
but these can be whitelisted in simcontrol file or spamassassin
plugin is attached herewith
more information here
http://wiki.apache.org/spamassassin/FromNotReplyTo
rajesh
The FromNotReplyTo Plugin
Checks if 'From:' is equal to 'Reply-To:' and set point if this is not the case.
Code
Add to your spamassassin
local.cf
########################
loadplugin FromNotReplyTo plugins/FromNotReplyTo.pm
header FROM_NOT_REPLYTO eval:check_for_from_not_reply_to()
score FROM_NOT_REPLYTO 2.0
describe FROM_NOT_REPLYTO From: does not match Reply-To:
########################
Create file
FromNotReplyTo.pm
########################
package FromNotReplyTo;
1;
use strict;
use Mail::SpamAssassin;
use Mail::SpamAssassin::Plugin;
our @ISA = qw(Mail::SpamAssassin::Plugin);
sub new {
my ($class, $mailsa) = @_;
$class = ref($class) || $class;
my $self = $class->SUPER::new( $mailsa );
bless ($self, $class);
$self->register_eval_rule ( 'check_for_from_not_reply_to' );
return $self;
}
# Often spam uses different From: and Reply-To:
# while most legitimate e-mails does not.
sub check_for_from_not_reply_to {
my ($self, $msg) = @_;
my $from = $msg->get( 'From:addr' );
my $replyTo = $msg->get( 'Reply-To:addr' );
#Mail::SpamAssassin::Plugin::dbg( "FromNotReplyTo: Comparing
'$from'/'$replyTo" );
if ( $from ne '' && $replyTo ne '' && $from ne $replyTo ) {
return 1;
}
return 0;
}
########################
How To Use It
Simply drop FromNotReplyTo.pm into /etc/spamassasin/plugin/ (or whereever your
configuration is put).
Caveats
It is a very simple plugin, so it should be used with care.
last edited 2008-07-07 11:59:49 by RonnieMose
---------------------------------------------------------------------------------
Managed Qmailtoaster servers are now available
Visit http://qmailtoaster.com/QMTManaged.html to order yours today!
Qmailtoaster is sponsored by Vickers Consulting Group
(www.vickersconsulting.com)
Please visit qmailtoaster.com for the latest news, updates, and packages.
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]