Is refile as spam training the IMAP server?

14 views
Skip to first unread message

Carl Whalley

unread,
Jun 27, 2019, 9:03:58 AM6/27/19
to K-9 Mail
All year I've been getting tons of spam. The backend is Posttfix with spamassassin on Ubuntu. I get lots of obvious spam which I am sure spamassassin would block after having seen it reported, so it stuck me that I'm not certain that the training is working, if indeed it does work the way I think it is.

Am I missing something here , please? Otherwise, refile as spam seems to be doing nothing here, at that's after me doing it all year.

sjb

unread,
Jun 27, 2019, 12:40:43 PM6/27/19
to k-9-...@googlegroups.com
On 27/06/2019 14:03, Carl Whalley wrote:

> All year I've been getting tons of spam. The backend is Posttfix with
> spamassassin on Ubuntu. I get lots of obvious spam which I am sure
> spamassassin would block after having seen it reported, so it stuck me
> that I'm not certain that the training is working, if indeed it does
> work the way I think it is.

This isn't k-9 related.

spamassassin can be configured multiple ways ..

https://en.wikipedia.org/wiki/Apache_SpamAssassin#Operation

Sounds like you need to re-visit your configs.

Greg Troxel

unread,
Jun 27, 2019, 3:03:06 PM6/27/19
to Carl Whalley, K-9 Mail
[more or less OT answer, but a fair question about what k-9 does. This
turned into advice about SA, mostly]
The refile as spam button moves the message to the configured "spam
folder" That's basically all an MUA can do. So nothing automatically happens.

spamassassin maintains a database mapping words to spam/non-spam
probabilities, more or less, in ~/.spamassasin/bayes*

The easiest way I know to learn from spam marked by k-9 is to run a cron
job that runs "sa-learn --spam" on the spam mailbox periodically; daily
seems adequate. You can also sa-learn --ham on your non-spam mailboxes.
Probably some systems have a way to notice the refile into spam and
trigger the sa-learn on it right away, but that's not about k-9.

Even if you just do

sa-learn --spam --dir $HOME/IMAP/.spam

or whatever your IMAP maildir is (sa-learn can read lots of kinds of
mail) once, that should help a lot. And also sa-learn on your inbox
and others once, after you have purged spam. Don't worry about learning
with --ham an odd spam message; once you find and refile it, it can get
learned as spam.

There is also an SA auto-whitelist database. I'm fuzzy on the details,
but generally messages with very non-spammy or very spammy scores cause
a reputation of the sender to be adjusted, and this is applied to future
messages from that sender.

Another point is that SA is tuned to declare spam at 5, and aims to have
a very low false positive rate at the expense of spam getting through.
If that's not what you want, you could have the server sort into spam.1
through spam.5 for messages with >= 1 (and so on) points. That will put
a lot of legit mail into spam.N, and less spam in INBOX. You can then
refine spam.N legit to INBOX, and have the daily cron job learn from
your sorting. This approach is probably only sensible if you are
reading INBOX only on your phone and using a desktop MUA elsewhere. It
also leads to adding a lot of whitelist_from_dkim (these days) for legit
mail that smells a bit spammy.

Make sure your SA install is up to date, and run "sa-update" to fetch
new rules.

Look at the headers and see which rules hit, when you get spam.
Consider bumping up scores, if you like a rule. Use spamassassin -t on
the raw message to see more detail about rules, and what the BAYES score
is after learning.

Carl Whalley

unread,
Jun 30, 2019, 10:05:15 AM6/30/19
to K-9 Mail
Sincere thanks for this Greg. You might have gathered I was on the right lines, just didn't have the details you provided. I actually just ran that sa-learn commadn manually and was told 2604 messages were examined in the .spam folder, so all those times I filed as spam from K-9 seems to have been useful, just all in one go.


On Thursday, June 27, 2019 at 8:03:06 PM UTC+1, Greg Troxel wrote:
[more or less OT answer, but a fair question about what k-9 does.  This
turned into advice about SA, mostly]

Reply all
Reply to author
Forward
0 new messages