sergiobortsov has asked for the wisdom of the Perl Monks concerning the following question:

Hello! I am first time on this site. And I beginner in perl. But I need to configure the Courierperlfilter. I use the Mail-Tools(Mark Overneer's). Maybe somebody know how I can use the Mail::Header module for rejecting mail messages with bad (viagra,sex and other) subjects. Thank a lot for your help.

Replies are listed 'Best First'.
Re: about using of Mail::Header module
by GrandFather (Saint) on Apr 28, 2006 at 10:51 UTC

    You could use Courier::Filter::Module::Header to filter mail into a spam bin based on key words in the subject, but so much spam has obfusicated in so many ways that a simple filter based on key words will not be very robust.

    A better option would be to use Courier::Filter::Module::SpamAssassin.

    However I suspect that neither of these options are a good point to be starting out in Perl unless you have a fair amount of general programming experience and are a fast learner. Good luck with it in any case and come back if you run into trouble.


    DWIM is Perl's answer to Gödel
Re: about using of Mail::Header module
by mantadin (Beadle) on Apr 28, 2006 at 11:09 UTC
    Hi and welcome!

    First I must admit, I don't know the Courierperlfilter. But if your aim is to fight spam, and you can do it at the MTA level, there are different ways you could achieve this.

    Did you consider to use SpamAssassin? You can combine it with Greylisting, if you (and your customers) like.

    SpamAssassin is a content-checker and marks your Mails, if it thinks it is spam. Your customers can then configure their Mail Clients to filter the marked mails into trash or into a quarantaene area, if they wish.

    You can connect content checkers (as well as virus scanners f.e.) with your MTA using f.e. amavisd-new as an interface. The MTA passes the mails via (E)SMTP to amavisd-new (and gets them back via (E)SMTP, too).

    As to greylisting, this is a completely different thing, rather a 'reputation system' for mail sources on the Internet. It works well with RFC-compliant MTAs, while usual spam bots have a hard time to penetrate it.

    Hope that helps.