procmail
[Top] [All Lists]

Re: Filter on Scandinavian characters in subject

2018-09-14 11:00:09
On 14.09.18,17:34, Andreas Schamanek wrote:

On Fri, 14 Sep 2018, at 15:40, Jostein Berntsen wrote:

when I use recipes like these to filter messages with Scadinavian
characters (æ,ø,å) in Subject it fails to work. My locale is
nb_NO.UTF-8.  Is there a recipe that can be used to match these cases?

:0
* ^Subject:.*lån
innboks/IN-spam/

A proper message must have such characters encoded. Look at the source of
messages. You will see something like (for "lån")

  =?UTF-8?B?bMOlbg==?=
When you match against this (mind the ? und escape them as \?) it should
work.


Thanks. I solved it doing this:

:0 h
* ^Subject:.*=\?
SUBJECT=| formail -cXSubject: | perl -MEncode -ne 'print 
encode("UTF8",decode("MIME-Header",$_))'

:0 hE
SUBJECT=| formail -cXSubject:

:0
* SUBJECT ?? ^Subject:.*lån
innboks/IN-spam/


Something for the manual maybe? 


Jostein

____________________________________________________________
procmail mailing list -- procmail(_at_)lists(_dot_)rwth-aachen(_dot_)de   
Procmail homepage: http://www.procmail.org/
To unsubscribe send an email to 
procmail-leave(_at_)lists(_dot_)rwth-aachen(_dot_)de
https://lists.rwth-aachen.de/postorius/lists/procmail.lists.rwth-aachen.de