======Quarantine Report Mailer Scripting====== (Added in v9.1) This script is called when VPOP3 is mailing out (or considering mailing out) spamfilter quarantine reports. It allows customisation of the emailed reports and whether they're generated ====AreMailsNeeded==== function AreMailsNeeded(lastTimeEmailsSent) returns mailsNeeded, untilTime * mailsNeeded = boolean, true = send emails, false = don't send emails * untilTime (optional) = latest date/time of the quarantined items to include in the emails in the form "yyyyMMddHHmmss" If this function doesn't exist, then it works on the configured schedule, and includes items up to the current time ====GetMsgLimit==== function GetMsgLimit(username, itemLimit) returns newItemLimit This is called for each user, and indicates how many items will be included in the quarantine report emails (default 5000) ====GetSortOrder==== function GetSortOrder(username, existingSortOrder, numberOfItems, quarantineItems) This is called for each user to whom an email will be sent, and allows customisation of the sorting of the items on the email. returns newSortOrder Possible sort orders are: * Time * Sender * Subject * Size * Score quarantineItems is a table of items, where each is: * Id - internal ID (string) * Sender (string) * SenderName (string) * Date (string) * Time (string) * Subject (string) * Size (number, in bytes) * Score (number) ====GenerateMessage==== function GenerateMessage(username, quarantineItems, numberOfItems, limitReached, userSettings) returns messageSubject, messageTextContent, messageHtmlContent This allows the script to generate the entire quarantine report message. If all three items are returned, then it overrides the automatic generation, otherwise VPOP3 will generate using the other settings/script results ====GetHtmlTemplate==== function GetHtmlTemplate(username, quarantineItems, numberOfItems, limitReached) returns filename, templateContents * filename = a list of possible filenames to use. VPOP3 will pick the first which exists as the template for the HTML part of the message * templateContents = the content of the HTML template. If this is not empty, then VPOP3 will ignore the 'filename' value ===Filename=== "filename" contains a list of or more filenames, separated by ';'. In a filename '%base%' is replaced by the installation directory, '%temp%' is replaced by the temporary directory (usually the _temp subdirectory), '%exe%' is replaced by the directory where VPOP3.EXE is installed ==Template format== The template file or "templateContents" should contain the HTML source for the email. It can contain control sequences * ~rows:~ - this contains a comma-separated list of CSS classes which are applied to rows. Eg the default is ',,,lt,lt,lt' so that for each set of 6 rows, the first 3 have no class, and the second 3 have the class 'lt' applied * ~rowtemplate~