User Tools

Site Tools


Spam Filter Rules: GetDecodedSection

Statement GetDecodedSection
Version 2.1.11+
Purpose Returns a specified MIME section of a message into a variable, after processing any Base64 or Quoted-Printable encoding of the raw message data

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

GetDecodedSection <message section number> <variable name>

The section numbers start at 0 for the header, 1 for the first message section and so on.

Starting from version 6.11, if the variable ${safechar} is set, then the first character of that variable is used in place of null characters (value 0) in the returned data. This allows the full decoded data to be used in later comparisons, even if it is binary and contains invalid ASCII characters.


Basic example, returning the result into the ${SectionText} variable

GetDecodedSection 1 SectionText

Using GetDecodedSection with ForEach MimeSection

ForEach MimeSection SectionInfo
 IfMatch ${SectionInfo} "/^(\d+):([\d\. ]*):(.*?):(\d+):(\d+):(.*)$/"
  ${SectionId} = ${1}
  GetDecodedSection ${SectionId} SectionText
reference/spamrules_statement_getdecodedsection.txt · Last modified: 2018/11/14 10:45 (external edit)