User Tools

Site Tools


reference:spamrules_statement_zipcount

Spam Filter Rules: ZipCount

Statement ZipCount
Version 6.7+
Purpose Enables the script to obtain the number of files contained in a ZIP attachment

The ZipCount statement requires a message section number and variable name, in the format

ZipCount <message section number> <variable name>
  • If the message section doesn't contain a ZIP attachment, then the variable will be set to '-1'
  • If the message section does contain a ZIP attachment, then the variable will be set to the number of files in the ZIP attachment

Example

The following example will iterate through the MIME sections and get the ZIP file content count into a variable ${zipcount}

ForEach MimeSection SectionInfo
 IfMatch ${SectionInfo} "/^(\d+):([\d\. ]*):([^:]*)/"
  ${SectionId} = ${1}
  ${SectionType} = ${3}
  If ${SectionType} == "application/zip"
   ZipCount ${SectionId} zipcount
  EndIf
 EndIf
EndForEach
reference/spamrules_statement_zipcount.txt · Last modified: 2018/11/14 10:45 (external edit)