Filter for non ascii in header?

User Help for Mozilla Thunderbird
Post Reply
bmaring
Posts: 16
Joined: March 11th, 2018, 6:32 am

Filter for non ascii in header?

Post by bmaring »

Over the last few months, the number of messages received that contain non-ascii image characters in the header (subject and from) has exploded. The result is completely unreadable message lists. Is there a way I can set up filters to send these messages directly to trash? If not, this is a feature badly needed in future releases.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Filter for non ascii in header?

Post by tanstaafl »

In one of the posts in http://forums.mozillazine.org/viewtopic ... &t=3039069 I mentioned "https://ncona.com/2011/06/using-utf-8-c ... l-subject/ talks about "moving all incoming emails that have “UTF-8” in the header to a spam folder. It’s quite the brute force approach, but it seems to be working.""

You could create a message filter that tests whether "Subject" "contains" "UTF-8" + "From" "contains" "UTF-8" and whose "Action" is "Move message to" "Trash". Set the radio button above that to "match any of the following" so that matching either rule will move the message to the trash. The '+' means press the "add a new rule" button (whose icon is a plus sign)

All of the example messages that you forwarded me used Unicode encoding to insert icons in the Subject. It's much easier to test for that than to try to determine if a non-ASCII character is embedded in the header. I suspect you don't care if somebody used ISO-8859-1 or Windows-1250 encoding. They add support for international characters that might have accent marks such as umlauts, grave, circumflex etc. but can't be used to embed a colored graphics icon.
bmaring
Posts: 16
Joined: March 11th, 2018, 6:32 am

Re: Filter for non ascii in header?

Post by bmaring »

I had already set up filters for UTF-8 in subject and from. These were effective most of the time (80%). However, some offending messages do not have UTF-8 in either subject or from. However, they have utf-8 in Content-Type. So I tried to set up a custom filter on Content-Type, but this isn't working.
bmaring
Posts: 16
Joined: March 11th, 2018, 6:32 am

Re: Filter for non ascii in header?

Post by bmaring »

Finally got custom filter on Content-Type to work. Matched on " charset=utf-8".

Thanks again for your help.
bmaring
Posts: 16
Joined: March 11th, 2018, 6:32 am

Re: Filter for non ascii in header?

Post by bmaring »

Custom message filter for "Content-Type" " contains" "text/html; charset=utf-8" doesn't work. Any idea why?

Portion of message source:
from: Love.SW󾌩🔥<IIPGE@dfjyze.rapidnbc.com>
Date: Wed, 21 Mar 2018 09:08:25 -0400
Subject: 󾬘hi xxxxx,Pics of me being bad here󾬘 __bf
To: <ViYW54p33XbINkqwQJgPq@itlgopk.uk>
Message-Id: <kqBPbn8nw5RC0YB46Vpm9bX-P6epjdUTITvs9K662pzwnHkW@vevida.net>
X-EMMAIL: xxxx@gmail.com@woodsblogs.com
Content-Type: text/html; charset=utf-8
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Filter for non ascii in header?

Post by tanstaafl »

Look at the filter log.

Why are you checking the Content-Type header since the icons you object to are in From: and/or Subject? Do you really want to delete a HTML message that has no icons in the headers and uses unicode in the message body? That is an extremely common scenario. The Content-Type header describes the message body (or a part of it), not the preceding headers.

The characters in the two headers look like they are from iso 8859-1. It doesn't support the icons you are worried about.
bmaring
Posts: 16
Joined: March 11th, 2018, 6:32 am

Re: Filter for non ascii in header?

Post by bmaring »

OK. Removed Content-Type filters. Didn't realize this pertains to body and not header.

Where do I find the filter log?

Also, the above portion of message source did, in fact, have icons in the header. I did set a filter for from content "rapidnbc.com" which worked. However, I was hoping for a more generic filter.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Filter for non ascii in header?

Post by tanstaafl »

"Where do I find the filter log?"

There is a button in the lower right hand corner of the message filter window. Click it and check the checkbox to enable the log.
Post Reply