This is an old revision of the document!
Every time VPOP3 is going to send messages via SMTP Relay, it runs a script called relayout.lua in the VPOP3 directory. For every message which is to be sent (according to any SMTP Domain filter rules) VPOP3 calls a function in that script called CheckFile.
The function signature is: CheckFile(Filename, Actions, Size, CreationTime, ReturnPath, Recipients, HeaderData, HeaderLines)
The function returns an Actions object saying what to do with the message. If nothing else, the function should return the Actions parameter.
The Actions object contain three values:
A simple function which will stop messages over 10,000,000 bytes being sent between 7am and 7pm, and make messages over 5,000,000 bytes be sent last is below
function CheckFile(filename, actions, size, createtime, mailfrom, recipients, headerdata, headerlines) time = os.date("*t"); if size > 10000000 and (time.hour > 7 and time.hour < 19) then actions["SkipSend"] = 1; end; if size > 5000000 then actions["Priority"] = 1; end; return actions; end;
In VPOP3 3.0.0L and later, there are two global variables set at the start of the script:
As an example, if you want messages over 50000 bytes to go through mail sender '0' and all other messages to go through mail sender '1' you could have:
function CheckFile(filename, actions, size, createtime, mailfrom, recipients, headerdata, headerlines) time = os.date("*t"); if size > 50000 then if senderid ~= 0 then actions["SkipSend"] = 1; end; else if senderid ~= 1 then actions["SkipSend"] = 1; end; end; return actions; end;