Table of Contents

Attachment Processing Script

(Added in v7.6)

This script has functions to allow message attachments to be altered:

NeedsRecode

function NeedsRecode(filtervariables, attachments_array, mime_structure)

Called when VPOP3 is about to process a message

NeedsRewrite

function NeedsRewrite(attachmentname, MIMEtype, filtervariables)

Called when VPOP3 is about to process an attachment in a message (Only called if 'NeedsRecode' returned true, or there is some other reason for VPOP3 to process attachments, eg to remove/rename an attachment due to Attachment Filtering)

GetRename

function GetRename(type, attachmentName, MIMEtype, filterVariables)

GetContentDispositionLine

function GetContentDispositionLine(originalContentDispositionLine, type, attachmentName, rewriteSection, MIMEtype, filterVariables)

IsLockNeeded

function IsLockNeeded(originalFileName, newFileName, originalAttachmentName, MIMEtype)
RewriteAttachment
function RewriteAttachment(originalFileName, newFileName, originalAttachmentName, MIMEtype, filterVariables)

Called to give the script a chance to rewrite the attachment. The original attachment is stored in the file 'originalFileName'. The script should write the new attachment to 'newFileName'.

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. 'NeedsRewrite' should return False if you want the message to stay unaltered.