tgpaul Posted February 27, 2005 Posted February 27, 2005 Hi all, I need a bit of direction to write a Perl script that will filter e-mails tagged by Spam Assassin according to a set of rules. I know that within the E-mail filtering page in cPanel I choose "SpamAssassin Spam Header begins with Yes" and then I pipe it to my script "|/home/user/spam.pl". From here, I have no clue what to do. I don't know what the e-mail looks like to the script at this point, and I am unsure how to extract basic header information and make decisions based on this information. Some of the information I would like includes destination user mail account (not necessarily the same as the "To" field if it was forwarded), and the SA spam score. I'm thinking something along the lines of this: If score >= 10 then discard else put it in the intended recipients spam folder (~/mail/user/Spam) I am a programmer and know a bit of Perl, so I'm not asking someone to write this for me. I just need some resources with examples of what such a script might look like. Thanks. TGP Quote
tgpaul Posted February 27, 2005 Author Posted February 27, 2005 Well, I seem to have made a bit of progress. I had the nice tech support people install a perl lib called Mail::Audit on server99. It contains excellent functions for doing just what I'm looking for. I'll post my code when it's complete. In the mean time, please throw out some suggestions! TGP Quote
TCH-Don Posted February 27, 2005 Posted February 27, 2005 Wish I could help, but I just use php. But thanks for sharing and maybe others fluent in pearl or just those needing this will offer some ideas. Quote
tgpaul Posted February 27, 2005 Author Posted February 27, 2005 Wish I could help,but I just use php. But thanks for sharing and maybe others fluent in pearl or just those needing this will offer some ideas. <{POST_SNAPBACK}> Don, Do you do mail filtering in php, or do you just know php in general? I have no preference of language for this script. TGP Quote
TCH-Don Posted February 27, 2005 Posted February 27, 2005 No filtering, I just know a enough to be dangerous I like php for forms and making a modular site with includes and it seems php scripts are easier to read. the more I use it the more I like it. I do all my e-mail filtering spam assassin and with pop tray for e-mail. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.