I do not really see anything in your “What I’m trying to achieve” that is not actually implemented.

kopano-spamd will not “react” to mail that has already been marked as spam (by spamassassin) before it even reached the inbox. the if-else cases in the code handle only non-marked ham, or unlearning spam, that before was ham. sounds confusing i know :)

I think you both are still not talking about the same thing. I´m facing this issue too and I´d love to see that fixed.

Following happens:

Email is received via MTA and SA tags it as spam

Dagent correctly delivers that email to the Junk folder

User realizes, that Email is in fact NOT spam and moves it to the Inbox manually

Now if “/etc/kopano/spamd.cfg” contains “learn_ham = yes”, then spamd should initiated a “sa-learn --ham” for this email, but this doesn´t happen.

Just a small annoiance, but would be great to get this fixed.

@hodor27: I hope I got you right and this is the same issue that you´re facing

yes in the sense that SA-tagged spam is ignored by kopano-spamd, if user moves it out of the junk-folder.
As i understand the status of kopano-spamd, it will only copy messages to spam/ham folders and leaves the sa-learn part to other tools.
I’ll submit a patch for kopano-spamd when i have time™.

The way I see it, incoming mail marked as spam by spamassassin AND not already known in kopano-spamd’s self.spamdb cannot be learned as HAM via the update function.
the relevant if/else in kopano_spamd/init.py: