This is a sample, your exact paths would vary. Be aware, though, that this could load your mail server down . It will run a separate process for each incoming mail message. If your server is small relative to your load, you should investigate one of the other techniques listed here. Craig Hagan has contributed a method for blocking third-party relaying with smap.
Spammers often use third-party relaying to distribute spam via an intermediary party's mailer.
Using this routine, you can prevent your mailer from being misused that way. They are starting to do this because the other blocking techniques are making it harder for them to reach their targets. They can block mail from known SPAMers and SPAM sites, stop your site being abuse by them to act as a relay, etc. Axel's patches allow blocking spam during the SMTP transaction phase. His procedure accepts the SMTP mail and then drops it during the delivery phase.