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

I am the one who posted about writing a spam filter for a mail server a few days ago. I just found out this morning what mailserver they're using, and it's Lotus (whatever the newest version is minus 1, I was told). I already wrote the random text image for verification. Can someone point me in the direction on how to make the script be included in email receiving so I know whether or not to give the recipient the email?

I'm writing a spam filter where anyone on @mydomain.com's email will be filtered through this script and if the sender isn't verefied by my script to ensure the account is real, the message isn't received and I send a random ID link to the sender saying they need to prove their account works and it's their's. Where do I begin writing a script for the mail server so I can filter all incoming mails?

Thanks

Replies are listed 'Best First'.
Re: mail server scripts (repost)
by blue_cowdawg (Monsignor) on Jan 24, 2004 at 15:07 UTC

    AM there are a plethora of methods of writing scripts to filter out UCBE, A.K.A. SPAM.

    For an off the shelf solution if you can stick sendmail or other "pluggable" delivery agent between the bad guys and your users is to use SpamAssassin to to the dirty work.

    If you insist on doing your own scripting then you need to look at the MIME::* modules as well as Mail::* modules.

    I've done quite a bit of scripting to do various checks of incoming email. You have your work cut out for you.


    Peter L. Berghold -- Unix Professional
    Peter at Berghold dot Net
       Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice.
      I guess my question really is, how do I get scripts to run when incoming messages are received? Where do I put the scripts? What on the mail server must I edit?

            Where do I put the scripts? What on the mail server must I edit?

        The answers to that question depend on the architecture of your mailer environment. You mentioned Lotus Notes. How does Lotus Notes handle its mail queues? If you have the opportunity to have LN store incoming mail into a queue directory where a script initiated by cron can "pick it up" and then hand it off to a delivery agent then that's one way.

        SpamAssassin is actually invoked by the MTA through a socket. Can LN deal with that? Can procmail be invoked by LN?

        Short answer is: it all depends. You need to work with your MTA administrator to work out the naughty bits of getting this to work.


        Peter L. Berghold -- Unix Professional
        Peter at Berghold dot Net
           Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice.