Jump to content

Recommended Posts

Posted

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

Posted

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

Posted
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.

 

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

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...