Attachment Extraction Scripting

This is the 'extraction.lua' script.

(Added in V6.17)

This script has one functions:

This functions is called if the attachment extraction is enabled in Settings → Attachment Processing → Extraction.

For every message VPOP3 loads the script file, then for each (non-virus) attachment it calls

Extract(attachmentname, sender, subject, copy, targetdirectory)

The functions return two values:

  1. an 'operation' id : 0 = don't save the attachment to file, and leave it in the message, 1 = save the attachment and delete it from the message, 2 = save the attachment and leave it in the message
  2. the directory to save the attachment to (if operation <> 0). This can just be 'targetdirectory' or something else. (In v6.20 and later this can contain the standard expansions for the extraction directory)

Example

A simple example could be:

function Extract(attach, sender, subject, copyatt, attdir)
  print(attach,sender,subject,copyatt,attdir); -- log the details to lua.out
  return 2, "%base%\\_attach2"; --copy the attachment to the VPOP3\\_attach2 folder
end