Username Post: help wanted        (Topic#6059)
amidatrust 
addict

Posts: 497
02/09/04 08:24 PM - Post#6059    



I want to write a lua program for shiftng out my spam into different catagories.

If my ISP thinks it is spam it adds headers to my emails like
X-SpamShield: SpamShieldScore 15.60 Yes
(the score can vary from 0 to anything)

I want based on the score do something like the following:

score <2
Remove the yes in the Header (otherwise DL rules thinks it is spam)
score >=2 and <3
Do nothing
score >=3 and <5
Add "SPAM" to the subject line
score >=5 and <10
Add "VERY SPAM" to the subject line
score >=10
delete the email (by download rules, oid)

And all for a POP3 account

PS is LUA working before or after using the downloadrules?
 
Paul_Smith 
Administrator

Posts: 6279
Paul_Smith
03/09/04 09:18 AM - Post#6061    


    In response to amidatrust

Lua is run before the download rules, but any changes to the headers aren't processed until afterwards. (Download rules, Lua scripts & DLL plugins all build up a table of actions to perform on the message, then, after they're all finished, the actions take place)

So, normally you'd want Lua to do any redirection & deletion, rather than doing part with Lua and part with download rules.

I'll put a suitable script up here later today.
Paul Smith PSCS Technical Support


 
Paul_Smith 
Administrator

Posts: 6279
Paul_Smith
03/09/04 10:49 AM - Post#6072    


    In response to Paul_Smith

Attached is a script to do what you asked for - but I'm not sure if it's exactly what you want, becuase it just changes the subject lines, it doesn't redirect the message. There are comments in the script that you can remove to redirect the message to different places depending on the 'Score' value.

Just put this 'pop3clt.lua' file into the VPOP3 folder (VPOP3 doesn't need restarting)
   Attachment
Paul Smith PSCS Technical Support


 
amidatrust 
addict

Posts: 497
03/09/04 02:25 PM - Post#6075    


    In response to Paul_Smith

That was quick and already two downloads before me.
Vpop3 is the Best

Added later

Looks great but how does it interfere with the DL rules that i use for whitelisting?

(Just a number of "+< rules")

I was looking in the lua help but i could not find a list with all the possible actions.

Does this list exsist and can it be put in the helpfile?
What happens as 2 conflicting actions get in the actions table?



 
amidatrust 
addict

Posts: 497
03/09/04 11:11 PM - Post#6079    


    In response to amidatrust

I have installed the file (after a little bit of editing) and all seems to work fine.

I use download rules for the routing and
Lua for editing the subject line.

(It was possible to not have the header below a certain score)
Now all emails with a Spamschield score go to my Spam mailbox but the very spam ones are deleted by the email client.

Thanks very much
 
Paul_Smith 
Administrator

Posts: 6279
Paul_Smith
05/09/04 05:29 PM - Post#6080    


    In response to amidatrust

Quote:

Looks great but how does it interfere with the DL rules that i use for whitelisting?

(Just a number of "+< rules")




It can get complicated..

First - download rules & download rule plugins work. These can tell VPOP3 to ignore the message and/or delete it from the ISP, etc

If the download rule lets the message be downloaded (eg a 'download' or 'download and delete' or 'redirect' etc rule), then VPOP3 downloads the message, then calls the 'MessageProcessor' plugins and the Lua script.

The MessageProcessor plugin and Lua script can then modify the recipients, modify the headers of the downloaded message, and/or tell VPOP3 to ignore the message (not deliver it at all) and/or delete it from the ISP. (The message processor & Lua script are given a list of recipients for the message - this is the recipients after the download rules have acted)

Quote:


What happens as 2 conflicting actions get in the actions table?



For the Lua script the actions are basically:
- ignore the message
- delete the message from the ISP
- send the message to different recipients from originally
- modify message headers

The only one which can possibly conflict with others is 'ignore'. In that case, the 'ignore' takes precedence over the header & recipient modifications.
Paul Smith PSCS Technical Support


 
amidatrust 
addict

Posts: 497
06/09/04 01:02 PM - Post#6083    


    In response to Paul_Smith

Clear as allways.
Thanks a lot.

I will do some testing and editing now with this script and the other settings. and then post it to the spam subgroup.
 
Icon Legend Permissions & Sharing Options Topic Options
Print Topic


4270 Views
FusionBB™ Version 3.1 Final | ©2003-2020 InteractivePHP, Inc.
Execution time: 0.354 seconds.   Total Queries: 96   Zlib Compression is on.
All times are (GMT+1). Current time is 11:01 AM
Top