This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
reference:attachment_processing_script [2018/06/28 09:41] – created paul | reference:attachment_processing_script [2022/11/24 09:29] (current) – [IsLockNeeded] paul | ||
---|---|---|---|
Line 10: | Line 10: | ||
* IsLockNeeded | * IsLockNeeded | ||
* RewriteAttachment | * RewriteAttachment | ||
+ | |||
+ | ====NeedsRecode==== | ||
+ | function NeedsRecode(filtervariables, | ||
+ | |||
+ | Called when VPOP3 is about to process a message | ||
+ | |||
+ | * returns True if the Lua script wants to alter any of the attachments of the whole message | ||
+ | |||
+ | ====NeedsRewrite==== | ||
+ | function NeedsRewrite(attachmentname, | ||
+ | |||
+ | Called when VPOP3 is about to process an attachment in a message (Only called if ' | ||
+ | |||
+ | * returns True if the Lua script wants to rewrite/ | ||
+ | |||
+ | ====GetRename==== | ||
+ | function GetRename(type, | ||
+ | |||
+ | * type = MIME or UUENCODE | ||
+ | |||
+ | * returns two values, the first is the new filename, the second is the new MIME type (eg ' | ||
+ | |||
+ | ====GetContentDispositionLine==== | ||
+ | function GetContentDispositionLine(originalContentDispositionLine, | ||
+ | |||
+ | * type = MIME | ||
+ | * rewriteSection = true if the MIME section will be rewritten (eg because of ' | ||
+ | |||
+ | * returns new Content-Disposition MIME header line | ||
+ | |||
+ | ====IsLockNeeded==== | ||
+ | function IsLockNeeded(originalFileName, | ||
+ | |||
+ | * returns True if a critical section is required around the ' | ||
+ | |||
+ | ==RewriteAttachment==== | ||
+ | function RewriteAttachment(originalFileName, | ||
+ | | ||
+ | Called to give the script a chance to rewrite the attachment. The original attachment is stored in the file ' | ||
+ | |||
+ | Note that whether or not this function alters the attachment, the attachment data in the message is rewritten using Base64 encoding, so if the original attachment was stored using a different encoding (eg Quoted-Printable) then the message will be changed. ' | ||
+ | |||
+ | * returns True if the attachment has actually been rewritten. If not, the original one is used. | ||