how to block mail where From and To are the same?

Rob Poe rpoe at
Thu Jun 14 17:41:44 IST 2007

So that would break me sending myself love notes?  :)

>>> Julian Field <MailScanner at> 4/27/2007 10:25 AM >>>
Hash: SHA1

You could do this with a very simple Custom Function. It would just 
check to see if
1) There is only 1 recipient
2) The recipient address @{$message->{from}}[0] eq the sender address 

Don't trust the syntax is 100% accurate, my Perl is a bit rusty due to

my hospital stay.

Quite which configuration option you would attach this to is left as an

exercise for the reader :-)


Daniel Maher wrote:
> Hello all,
> Lately I have been receiving an increasingly large amount of spam 
> where both the From and To fields are identical (and, of course, 
> forged). The net result is that many of my users appear to be 
> receiving spam /from themselves/, which is causing some distress 
> amongst the user base.
> Now, there are a handful of ways to deal with this situation;
> like always, the community probably already knows the best way to 
> block – or at least add SA points to – such spam.
> I’m using Postfix 2.0 (yes, I know), and the newest MailScanner & 
> SpamAssassin. Thank you all for your comments and suggestions.
> --
> _
> °v° Daniel Maher
> /(_)\ Administrateur Système Unix
> ^ ^ Unix System Administrator
> //“How can a man choose between Fresh and Fly? And believe me,
> IS a difference.” – Crack Stuntman, 2007.////


- -- 
Julian Field MEng CITP 
Buy the MailScanner book at 

MailScanner customisation, or any advanced system administration help?
Contact me at Jules at Jules.FM 

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
For all your IT requirements visit 

Version: PGP Desktop 9.6.1 (Build 1012)
Charset: windows-1252


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
For all your IT requirements visit 

MailScanner mailing list
mailscanner at 

Before posting, read 

Support MailScanner development - buy the book off the website!

More information about the MailScanner mailing list