kopano-spamd not learning tagged spam as ham



  • Re: Moving spam emails from Junk folder do not trigger kopano-spamd

    Has this been solved in newer versions? I’m experiencing the same behaviour on a 8.6.9.0 install.
    What’s working out of the box:

    • incoming mail NOT marked as spam by spamassassin
    • mail is moved to junk
    • kopano-spamd picks it up & it can be learned by sa-laern etc.
    • (“unlearning” this same msg works too)

    What I’m trying to achieve/what I would expect:

    • incoming mail is MARKED as spam by spamassassin
    • mail is moved to junk folder automatically
    • user moves mail to inbox/out of junk
    • kopano-spamd picks up the change/move and saves the mail for sa-learn

    Is there a reason, why this is not implemented?
    Is this already working in newer versions?

    I did an experimental patch on a test-server to achieve this(not thouroughly tested yet). @fbartels interested?


  • Kopano

    @hodor27 said in kopano-spamd not learning tagged spam as ham:

    Is there a reason, why this is not implemented?

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

    @hodor27 said in kopano-spamd not learning tagged spam as ham:

    I did an experimental patch on a test-server to achieve this(not thouroughly tested yet). @fbartels interested?

    Sure, patches are always welcome. The easiest for an external is to open a pr on https://github.com/Kopano-dev/kopano-core.



  • @fbartels said in kopano-spamd not learning tagged spam as ham:

    @hodor27 said in kopano-spamd not learning tagged spam as ham:

    Is there a reason, why this is not implemented?

    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 :)

    @hodor27 said in kopano-spamd not learning tagged spam as ham:

    I did an experimental patch on a test-server to achieve this(not thouroughly tested yet). @fbartels interested?

    Sure, patches are always welcome. The easiest for an external is to open a pr on https://github.com/Kopano-dev/kopano-core.

    I’ll submit a patch when i have time, that should clear things up.


  • Kopano

    @hodor27 said in kopano-spamd not learning tagged spam as ham:

    kopano-spamd will not “react” to mail that has already been marked as spam (by spamassassin) before it even reached the inbox.

    yes, it indeed does not do this. but this is usually handled by kopano-dagent (its has a configurable spam header and will deliver mails marked as spam into the junk folder and not into the inbox).



  • 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



  • @weini said in kopano-spamd not learning tagged spam as ham:

    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™.



  • @hodor27: absolutely correct. I was a bit misleading in that aspect: It is just about moving the mail to the ham folder.



  • @hodor27
    Whats the Status here ?

    Br Stefan



  • @weini
    You yound a Solution for that behaviour ?

    Br Stefan



  • @vm_machina

    i had no time yet to test.

    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:

    elif (item.folder == item.store.inbox and \
                      self.learnham and \
                      self.was_spam(searchkey)):
    

    the self.was_spam(searchkey) can only return true if the msg in question was learned as spam before, which can only happen if it was not tagged as spam by spamassassin.


Log in to reply