Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

How can I train Thunderbird to automatically mark all messages from a sender as junk?

  • 11 replies
  • 2 have this problem
  • 327 views
  • Last reply by Matt

more options

Not sure if this is even possible. But if not, it -should- be. It's maddening that I get the same junk messages week in and week out and no matter how many times I mark the msg as Junk, the next week, messages from the same spam addys are back.

All Replies (11)

more options

Hi

You may want to look into using a filter to automatically move emails from an address to a folder. You can read more about how to set this up here.

I hope this helps, but if not please come back here and we can look into a different solution for you.

more options

i use msg filters to do this. it usually works. i don't open the emails in TB, but save them to a temp directory. edit/view the saved email in your favorite editor ( i use vim, but kate or notepad (if you're on windows) will work). if you've already opened the email, control-U will open another window with the raw content of the email, with all headers visible.

i use several different filters based on the content of some of the headers.

method 1. scroll/search down to the From: and Subject: headers. if the term "utf-8" appears in either header, it's probably spam. create a new filter, give it a name like "subj is utf8" or somesuch. click the 'match on any' button (center top). click the first box, first line, top box, where it says 'Subject'. in the 3rd field (text entry box, same line) enter "utf-8" (without quotes).

the finished rule should look something like this: Subject contains utf-8

in the bottom box (Perform these actions) click the left select widget (Move message to) and select whatever you deem appropriate: "set junk status to" or "move message to" or whatever. complete the entry.

method 2. this method is a bit more complicated, but i use dozens of rules like this, and they work GREAT! it fixes situations where the From: header is spoofed by the sender (trivial to do).

create a new filter with a name something like "filter on IP". select "Match any of the following". in the first select box (with default selection of "Subject") click on "Customize", and create a header (exactly) like this: "Received:" (again, without quotes but do include the ":"). view the header of the email as in method 1. scroll down to the last Received: header - it will say something like

 Received: from xyz.domainname.com ([198.204.123.123]) by ...

now you need to decide how much of the ip you want to include. i use whois (or dig) to determine where the source of that particular IP is.

 whois 198.204.123.123

this part can be a bit tricky: i live in florida, USA. so emails from china or israel or russia or hong kong (the list goes on) are, 99.999% of the time, garbage. so i'll only use the first few digits of the IP in the rule, like this:

 Received: contains [198.20

this will block thousands of IP addresses. the fewer digits you use, the more addresses it will block. but be careful - sometimes just blocking the 198 part could block a completely diff country, including an ISP in the US (or whatever country you're in). this is probably not good.

be sure to include the "[" part in the rule - it'll help distinguish the from ip address from other random text.

make the rule move all IP matched emails to a specific folder - i created a new folder called "filter on IP" - check it periodically to ensure you didn't catch something you didn't intend to. you need to create the new folder before you can add its name to the rules.

if you did catch something you shouldn't, there are a couple things you can do: 1. look at the header of the good msg, find the IP rule that caught it, extend the IP addr in the rule by a digit or two (if you know the digits) 2. create a new rule that catches that particular email and place it above the "filter on IP" rule - they're used in the order they appear in the list. use the "move filter up" or "..down" button. for the action in this rule, choose "Stop Filter Execution". you can create a rule to put the mail in any folder you like (before the "stop" rule) or just leave it in the Inbox.

if the junk comes from a server in the US (for me), i feel i can't block that whole server - who knows who uses it. so i create another filter that contains the name (just the TLD - the "domain" part of xyz.domain.<net, com, info, ch, il or whatever>) - it's also in the Received: part of the filter. use something like this:

 Received: contains brazelphratz

if the name in the Received: header looks like this:

 Received: from spammer.brazelphratz.hk ([23.45.67.89]]

check your filter destination folder frequently - some large companies, esp'ly banks, use servers that go outside their country of origin.

study the headers of your difficult-to-detect spam - you'll find patterns in them. use that commonality to build a filter.

use the filter log (in the filters dialog - be sure to enable it) to determine which filter trapped what messages. unfortunately you can't search in the filter log, but you can select it/copy 'n' paste it to something else where you CAN search: notepad, vim, kate, whatever.

NOTE: if the Received: header indicates received from localhost, don't use addresses in that header, use the from address in the Received: header just above it.

these methods are a bit painful and seemingly complex, but they are powerful tools to stomp on the garbage these miscreants pump out. Received: headers are added by the mail exchangers and can't be faked. there can be fake ones ADDED but the real ones will be there too. after the first filter or two, they'll become quite simple for you.

good hunting

:-)

Modified by wmmmoz

more options

Thanks for the replies. I'm fairly IT savvy so I can certainly create the manual filters given the (very) detailed info. Cool.

I guess this question then is now morphing into a short F/R and rant. To wit: I shouldn't -have- to use manual filters. In my mind, if I get the same damned 'newsletter' every other day, with the same header, and I mark it as Junk like 10 times in a row, at some point T-Bird should 'figure it out' and start -automatically- marking the thing as Junk. But it never does. And I can't for the life of me figure out -why-? The addy isn't in my address book.

So T-Bird should do this automatically OR it should have a way for me to know -why- it isn't. ie. I should be able to follow its logic and 're-train' it. That doesn't seem to be rocket science.

Modified by suntower

more options

suntower-

when you're right, you're right. sadly, TB has some issues, but on the bright side, it provides a way to help offset some of those ills. in this case, filters are a band-aid, but they're band-aids with a bang.

<rant> right now, i can't seem to get it to move all the auto-spam to the junk folder, at least, automatically. when i can actually get it to move or delete emails, i can transfer them myself, and that's only shortly after startup - if TB has been running more than a couple hours, no delete, no copy. </rant>

i feel your pain.

more options

Hi

I do not know your email setup, but I spent some time training the filters on the mail portal at my internet service provider and that has helped reduce a lot of regular junk and spam email.

more options

I'll shut up now, but I guess I don't understand why this is such a technological challenge. It would seem to me that T-Bird's 'filter' would simply 'count' how many times I've marked a given sender as 'Junk' and learn that I dislike them. This just seems pretty basic to me... even without any more sophisiticated algorithms.

wmmmoz said

suntower- when you're right, you're right. sadly, TB has some issues, but on the bright side, it provides a way to help offset some of those ills. in this case, filters are a band-aid, but they're band-aids with a bang. <rant> right now, i can't seem to get it to move all the auto-spam to the junk folder, at least, automatically. when i can actually get it to move or delete emails, i can transfer them myself, and that's only shortly after startup - if TB has been running more than a couple hours, no delete, no copy. </rant> i feel your pain.

Modified by suntower

more options

The junk controls don't pay any particular attention to the sender. It awards scores to words according to how often they appear in junk messages vs non-junk messages. In general, it's rare for real spam to repeatedly come from the same source, so sender address isn't necessarily a good indicator of spam. I see dozens of copies of the same message but from different senders, all of which I assume to be fictitious or stolen addresses. Blacklisting those one-off addresses would be rather pointless. Your situation where you get repeats from a given sender seems to me to be quite unusual, and would justify a Message Filter.

I have many times seen legitimate messages of a commercial nature classified as spam. My guess is that some users, on tiring of a subscription, just report it as spam rather than unsubscribing. If you signed up for it, it ain't spam.

more options

With all due respect. I -technically- see yer point differentiating between true 'spam' from unknowns and ANNOYING stuff which comes from sites I visited once and then start sending me e-mails FOREVER without regard to niceties such as 'unsubscribe'. But frankly, it's a distinction without a practical difference.

IMO, if I mark a message 'Junk' a dozen times, T-Bird should 'learn' that this is 'unwanted'. I think this is what the average user would want, regardless of whether it conforms to the CANSPAM definition of 'spam' or not.

Zenos said

The junk controls don't pay any particular attention to the sender. It awards scores to words according to how often they appear in junk messages vs non-junk messages. In general, it's rare for real spam to repeatedly come from the same source, so sender address isn't necessarily a good indicator of spam. I see dozens of copies of the same message but from different senders, all of which I assume to be fictitious or stolen addresses. Blacklisting those one-off addresses would be rather pointless. Your situation where you get repeats from a given sender seems to me to be quite unusual, and would justify a Message Filter. I have many times seen legitimate messages of a commercial nature classified as spam. My guess is that some users, on tiring of a subscription, just report it as spam rather than unsubscribing. If you signed up for it, it ain't spam.
more options

You "visited" once and gave them an email address? So you have subscribed and it ain't spam. It isn't what the Junk Controls are designed to work with, so create a filter. Right-click the senders address in the header pane, select "Create filter from" and off you go. No need for wmmmoz's overkill approach.

more options

FWIW... -THIS- is why so many softwares never gain traction beyond a certain point: they don't work how HUMANS work. I don't care whether the spam controls were 'designed' for this. If that's the case? Then modify them so that they do. I shouldn't have to create a filter for every addy I want to ignore.

'Junk' consists of a LOT more these days than just 'spam' and I assume that's why the feature was labelled 'junk'... to incorporate a bigger idea than the technical definition of 'spam'.

So: feature request. If I mark the same msg as 'junk' 10xs? Ignore it forever. Simple.

I'm done.

Zenos said

You "visited" once and gave them an email address? So you have subscribed and it ain't spam. It isn't what the Junk Controls are designed to work with, so create a filter. Right-click the senders address in the header pane, select "Create filter from" and off you go. No need for wmmmoz's overkill approach.
more options

Don't provide your email address to people you do not want mail from. Simple really. Tthen there would be no need for filters, spam or otherwise, to deal with issues you yourself create.

You are looking for a software solution for a problem that is created by your actions. I suggest you look at disposable email addresses and Plus addressing if you are not prepared to change your unfortunate browsing habits.

You will not find a spam filter that is any good that has regard to email address. If for no other reason that the creator leaves themselves open to litigation. One of the largest spammers in the USA successfully sued Microsoft for blocking their SPAM in early versions of MSE. Any mail sender who can not get their mail, that the intended recipient requested, probably has a reasonable case as well.

I suggest you examine the bug for blocking a sender here https://bugzilla.mozilla.org/show_bug.cgi?id=11035 it was reported: 1999-08-01 13:25 PDT