.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Mail::SpamAssassin::Plugin::MIMEHeader 3" .TH Mail::SpamAssassin::Plugin::MIMEHeader 3 2024-09-01 "perl v5.40.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME MIMEHeader \- perform regexp tests against MIME headers .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& loadplugin Mail::SpamAssassin::Plugin::MIMEHeader \& mimeheader NAME_OF_RULE Content\-Id =~ /foo/ .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This plugin allows regexp rules to be written against MIME headers in the message. .SH "RULE DEFINITIONS AND PRIVILEGED SETTINGS" .IX Header "RULE DEFINITIONS AND PRIVILEGED SETTINGS" .IP "mimeheader NAME_OF_RULE Header-Name =~ /pattern/modifiers" 4 .IX Item "mimeheader NAME_OF_RULE Header-Name =~ /pattern/modifiers" Specify a rule. \f(CW\*(C`NAME_OF_RULE\*(C'\fR is the name of the rule to be used, \&\f(CW\*(C`Header\-Name\*(C'\fR is the name of the MIME header to check, and \&\f(CW\*(C`/pattern/modifiers\*(C'\fR is the Perl regular expression to match against this. .Sp Note that in a message of multiple parts, each header will be checked against the pattern separately. In other words, if multiple parts have a 'Content\-Type' header, each header's value will be tested individually as a separate string. .Sp Header names are considered case-insensitive. .Sp The header values are normally cleaned up a little; for example, whitespace around the newline character in "folded" headers will be replaced with a single space. Append \f(CW\*(C`:raw\*(C'\fR to the header name to retrieve the raw, undecoded value, including pristine whitespace, instead. .IP "tflags NAME_OF_RULE range=x\-y" 4 .IX Item "tflags NAME_OF_RULE range=x-y" Match only from specific MIME parts, indexed in the order they are parsed. Part 1 = main message headers. Part 2 = next part etc. .Sp .Vb 4 \& range=1 (match only main headers, not any subparts) \& range=2\- (match any subparts, but not the main headers) \& range=\-3 (match only first three parts, including main headers) \& range=2\-3 (match only first two subparts) .Ve .IP "tflags NAME_OF_RULE concat" 4 .IX Item "tflags NAME_OF_RULE concat" Concatenate all headers from all mime parts (possible range applied) into a single string for matching. This allows matching headers across multiple parts with single regex. Normally pattern is tested individually for different mime parts.