Most effective way to get rid of existing spam mails in thunderbird? API?

1

I have my own mail server (hosting package) on which spam assassin is installed, which basically does no help at all. I get a LOT of spam mails, between 50 and 100 daily. All from a different sender/domain/server, many have a similar subject but it changes a lot aswell. Some try to sell stuff, some try to install stuff, but none of them are any legitimate business at all.

The e-mail account(s) those go to are business accounts on my own domain, simply changing my mail everywhere is not an option. I use thunderbird as my mail client.

I've been out of office for a bit and I now have thousands of unread mails, simply deleting all won't work because around 5% are important.

I have a text file containing thousands of subjects from scam mails that I frequently get. Is there anyway I can use this to automatically delete all mails with the same subject on specific mail accounts?

I know there is the message filters feature in thunderbird, but I don't feel like manually adding thousands of subjects to it at all.

I have enabled thunderbird's junk detection, but it has no training data yet so it doesn't help with existing mails.

I tried the search filter "Junk level percentage greater than 0" and it showed me around 400 mails (I'm guessing this comes from spam assassin on the server?), there's still thousands left that are classified as non-spam by the server and thunderbird though.

Do I have any reliable (I do not want anything that might not be spam to be considered as spam and deleted) option of detecting what is spam that is already existing?

What I'm thinking is an advanced search filter that matches any mail in an account which subject matches any subject within a text file (one subject per line) or similar approach, so I'm guessing my real question would be:

Is there a way to programatically/API access thunderbird and search/delete mails?

confetti

Posted 2019-07-07T16:44:10.500

Reputation: 1 625

Question was closed 2019-07-07T17:17:21.203

Even if you changed email addresses, it wouldn’t stop the spam, spammers would spam you eventually. It costs literally nothing to try every combination and send an email to that address. – Ramhound – 2019-07-07T16:54:52.467

@Ramhound That question is terribly outdated, im sure there's been improvements in this area within the last ten years. And yeah, I know. (Even though sendings billions of mails a day will most likely get you blocked from any SMTP server there is as scammer, so it kinda depends on how many SMTP servers/accounts/proxies/etc you have to use.) – confetti – 2019-07-07T17:02:42.180

The truth here is that there is very little you can do to block the spam. Yes, you can improve your own open source technology and get some relief. But 100 spam mails per day as opposed to 200 isn’t much help. You don’t see enough bad mail in a day, nor have enough resources to create a good spam filter. You need a cloud provider to take care of the problem for you. And no matter what you do, some spam will get through and some good mail will be junked. It’s just the way it is and you need to understand the nature of what we are talking about here. – Appleoddity – 2019-07-07T17:07:41.227

@Appleoddity I know, but there's some things that could actually help. Like a way to delete every message with a specific subject in thunderbird or adding a message filter that gets triggered if any subject within a list or text file of subjects matches. If anyone knows a way to do that, that'd help a lot already. Besides that I agree, other than advanced AI and a lot of training data this problem is hard to solve. – confetti – 2019-07-07T17:13:45.203

I don't understand why to close this as a duplicate. The other question is not only completely outdated but not even the same. The questions the other guy asked are mostly ignored, instead just other plugins (also outdated) were suggested. – confetti – 2019-07-07T18:29:54.817

The other question is old, but in what sense is it *outdated?*  The answers are old; but are they no longer correct? or is it just that you believe that better solutions have been developed in the last seven years?  Do you have some reason to say that the answers to the other question are, categorically, not answers to your question?  If so, please explain that clearly.  … (Cont’d) – G-Man Says 'Reinstate Monica' – 2019-07-07T19:09:29.513

(Cont’d) …  If all you’re saying is that you want newer answers, then, I’m sorry to say, you should just put a bounty on the other question.  You may provide a note highlighting how your need is different from what the old question asks, and/or you may edit the question, so long as you do not dramatically change its intent or invalidate the existing answers. – G-Man Says 'Reinstate Monica' – 2019-07-07T19:09:34.213

@G-Man The other Q focuses almost entirely on thunderbird's built-in junk detection and it's training features. This might be useful to detect spam in the future (?) but doesn't really help with sorting out my current mails. His Q in a nutshell is "How does thunderbird's junk detection training work?" (which is pretty technical) while mine tries to focus around deleting junk mails I already have, with an untrained not used TB junk detection filter. An answer showing how to automatically delete messages matching a subject from a textfile would help me a lot, not so much that guy, as an example. – confetti – 2019-07-07T19:42:31.527

OK, I (partially) see your point. Still: (1) The “duplicate” message says “This question already has an answer here:”. That seems to be true, inasmuch as, … (2) as you, yourself, pointed out, the people who posted on the other thread seem to have “mostly ignored” “the questions the other guy asked”, and answered your question instead. – G-Man Says 'Reinstate Monica' – 2019-07-07T19:51:11.597

@G-Man I don't think they've answered either question.. Most of the answers there are about plugins that detect junk or assist TB's junk detection. I've read the linked mozilla pages too but they don't really answer either question too. All those answers would apply to "How can I train thunderbird to detect spam?" or similar in my opinion, on a very basic level for most of them. – confetti – 2019-07-07T20:43:03.737

@confetti, deep into your question, you finally focus on what makes your question different. The question suffers from the fact that the title and beginning focus on a different problem. Might be worth improving the title and focus to make the real question more obvious. – fixer1234 – 2019-07-07T22:33:54.590

Honestly, that was one of the only Spam Thunderbird question’s I could find, no matter what question I flagged as a duplicate candidate would have “it’s not identical to my problem” problem which isn’t a valid reason not to close it as a duplicate. Bottom line is that your question is asking for the most efficient way to deal with spam, which is entirely subjective, and will result in a bunch of answers suggesting possible solutions which is more or less the exact reason questions seeking recommendations are out of scope here at Super User. – Ramhound – 2019-07-08T00:10:49.677

You don’t prevent spam, you filter it, which involves training a spam filter. Hence the reason I selected that question as the duplicate candidate (despite it not being a perfect duplicate). I felt the answers were accurate and relevant to your question of how to filter spam. – Ramhound – 2019-07-08T00:13:25.393

@Ramhound, the actual question buried in this post is the problem that a ton of spam is already downloaded and in various folders. None of the answers on the other thread that deal with prevention (the unfortunate title here), or processing incoming messages is directly applicable. It's possible that Thunderbird's filter can be at least part of the solution, but the task described here would need a larger process that isn't addressed on the other thread. Training a smart filter is different from creating targeted rules, (cont'd) – fixer1234 – 2019-07-08T01:49:04.863

and a practical way to create a massive number would be fodder for another question just to deal with that. Given the lack of specifics here, a solution appropriate to this situation may even be too broad of a question. The solution might include bits of advice contained in the other thread, but nothing there really addresses this situation as a direct solution (they're more akin to useful comments that could be part of a solution). Maybe the answer here is that there's no good answer, or it's too broad to address here, but I don't see it as a dupe. – fixer1234 – 2019-07-08T01:49:11.227

@Ramhound I have edited my question and title, hope it's better now. – confetti – 2019-07-08T08:27:22.623

No answers