Filter by attachment extension

User Help for Mozilla Thunderbird
Post Reply
tsherr
Posts: 6
Joined: August 25th, 2015, 11:19 am

Filter by attachment extension

Post by tsherr »

I'm using TB 45.1.1 and I'd like to filter emails with extensions of different types, but I can't figure out how to do so.

Is there a way to filter, say all .doc or .zip files? I read about about an extension called FiltaQuilla, but further research suggested it won't work.

Any idea how I can do this?

Thanks!
tsherr
Posts: 6
Joined: August 25th, 2015, 11:19 am

Re: Filter by attachment extension

Post by tsherr »

The filter I tried was:
Body Contains Content-Disposition: attachment;
and
Body Contains .zip

But this doesn't do anything.
User avatar
DanRaisch
Moderator
Posts: 127246
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: Filter by attachment extension

Post by DanRaisch »

How is that account set up in Thunderbird, as POP or IMAP?
tsherr
Posts: 6
Joined: August 25th, 2015, 11:19 am

Re: Filter by attachment extension

Post by tsherr »

I'm using POP (sorry, I should have mentioned that).

T
User avatar
DanRaisch
Moderator
Posts: 127246
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: Filter by attachment extension

Post by DanRaisch »

With that filter set up, did you set "Match All of the following?"
Is that filter intended to test new, incoming messages or previously received messages?
alta88
Posts: 1029
Joined: January 28th, 2006, 3:08 pm

Re: Filter by attachment extension

Post by alta88 »

I realize your use case is, apparently, to catch and handle (move/copy) messages with specific attachment extensions.

Another way might be to identify all messages with a single attachment, say, extension .doc and sort or group them. You can do this using the AttachmentCount extension. The stock attachment column with a single (initially inaccurate) paperclip icon can be replaced with the AttachmentCount column, which indicates by filetype icons what the attachment is, or gives a count if there are multiple attachments in the message. It's not necessary to open the message. And it does other stuff like preview text attachments and give a summary by hovering the column row.

http://attachmentcount.mozdev.org/
tsherr
Posts: 6
Joined: August 25th, 2015, 11:19 am

Re: Filter by attachment extension

Post by tsherr »

DanRaisch wrote:With that filter set up, did you set "Match All of the following?"
Is that filter intended to test new, incoming messages or previously received messages?
I have it set to Match all of the following.

I'm hoping to catch new messages (I don't care about ones that have been received. I have it set to "Getting New Mail" - "Filter Before Junk Classification"
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Filter by attachment extension

Post by tanstaafl »

Body used to cover the entire message (including all headers and attachments) but was redefined a couple of years ago to cover only the message body. Some testing with simpler criteria could verify that is still true. http://kb.mozillazine.org/Message_Filters

I suggest you think about defining Content-Type: as a custom header and searching for whether "Content-Type" "contains" "zip". That should catch both a application/zip and a application/x-zip-compressed mime-type (which they might not use) and a name="something.zip" filename argument in that header. You could mimic that for other compressed file formats such as .rar files etc.

https://www.sitepoint.com/web-foundatio ... lete-list/
Post Reply