User Tools

Site Tools


reference:spamrules_statement_zipcontents

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

reference:spamrules_statement_zipcontents [2018/11/14 10:45] (current)
Line 1: Line 1:
 +======Spam Filter Rules: ZipContents======
 +^Statement ​ |ZipContents |
 +^Version ​ |6.7+ |
 +^Purpose ​ |Enables the script to obtain the list of files contained in a ZIP attachment |
  
 +The **ZipContents** statement requires a message section number and bag name, in the format
 +  ZipContent <message section number> <bag name>
 +
 +  * If the message section doesn'​t contain a ZIP attachment, then the bag will be empty after this statement
 +  * If the message section does contain a ZIP attachment, then the bag will contain a list of the ZIP file contents in the format: ''​filename<​tab>​ZIP comment<​tab>​compressed length<​tab>​uncompressed length<​tab>​timestamp''​
 +
 +
 +=====Example=====
 +The following example will iterate through the MIME sections and get the ZIP contents into a bag '​zipcontents'​
 +<​code>​
 +ForEach MimeSection SectionInfo
 + ​IfMatch ${SectionInfo} "/​^(\d+):​([\d\. ]*):​([^:​]*)/"​
 +  ${SectionId} = ${1}
 +  ${SectionType} = ${3}
 +  If ${SectionType} == "​application/​zip"​
 +   ​ZipContents ${SectionId} zipcontents
 +  EndIf
 + EndIf
 +EndForEach
 +</​code>​
reference/spamrules_statement_zipcontents.txt ยท Last modified: 2018/11/14 10:45 (external edit)