Some help understanding this filter please

Tomaž Šolc tomaz.solc at tablix.org
Fri Nov 12 09:37:12 CET 2021


Hi

On 12. 11. 21 04:23, hput via bogofilter wrote:
> In second (Content-Type) line at:
> 
>  * 1^0 ^\/Content-Type:.*charset="(  <== That double quote seems to have
> 
> no matching mate?

Procmail conditions are regular expressions. As far as they are
concerned, email messages are just a sequence of characters. Conditions
look for specific strings of characters. Since they don't know about any
syntax, the regular expressions don't need to match full syntactically
correct headers.

The expression you're asking about is simply looking for a string that
contains ... charset=" ... It doesn't look for the closing double quote,
even though it will probably be there in the actual mail. That closing
double quote isn't important for the rule to do its thing.

> The only reason I even noticed it is that when I pasted it into my
> .procmailrc file it threw the syntax highlighting off from that point to
> the end of the file.  And I cannot find another matching double quote
> anywhere in the 4 working lines of the recipe.

Since it's throwing off the syntax highlighting, your text editor
probably just doesn't know how procmailrc works and is applying some
generic highlighting rules to it that expect quoted strings.

> ## Silently drop all completely unreadable mail

By the way, what this rule does is filter mail that's sent in encodings
used by languages that don't tend to use the Latin alphabet. Mail like
this can be "completely unreadable" to you or something you need on a
daily basis. That example file certainly could do with a better comment.

Best regards
Tomaž


More information about the bogofilter mailing list