Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    kopano-spamd not learning tagged spam as ham

    Kopano Groupware Core
    6
    12
    707
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • hodor27
      hodor27 @fbartels last edited by

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

      fbartels 1 Reply Last reply Reply Quote 0
      • fbartels
        fbartels Kopano @hodor27 last edited by

        @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).

        Regards Felix

        Resources:
        https://kopano.com/blog/how-to-get-kopano/
        https://documentation.kopano.io/
        https://kb.kopano.io/

        Support overview:
        https://kopano.com/support/

        1 Reply Last reply Reply Quote 0
        • weini
          weini last edited by

          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

          hodor27 1 Reply Last reply Reply Quote 0
          • hodor27
            hodor27 @weini last edited by

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

            weini 1 Reply Last reply Reply Quote 0
            • weini
              weini @hodor27 last edited by

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

              1 Reply Last reply Reply Quote 0
              • vm_machina
                vm_machina last edited by vm_machina

                @hodor27
                Whats the Status here ?

                Br Stefan

                hodor27 1 Reply Last reply Reply Quote 0
                • vm_machina
                  vm_machina last edited by

                  @weini
                  You yound a Solution for that behaviour ?

                  Br Stefan

                  1 Reply Last reply Reply Quote 0
                  • hodor27
                    hodor27 @vm_machina last edited by hodor27

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

                    1 Reply Last reply Reply Quote 0
                    • kt1040
                      kt1040 last edited by

                      Hallo,

                      I’m new to kopano-spamd and do have the above problem. Does anybody have a hint helping me?

                      1 Reply Last reply Reply Quote 0
                      • ejjoman
                        ejjoman last edited by ejjoman

                        Hi alltogether,

                        I am new to this community. Because I want to use kopano for a customer of mine, some fixes are needed to be made.
                        This problem was one of them :)

                        I created a patch which fixes this issue with kopano-spamd not beeing able to learn spam-flagged emails as ham (and then as spam again).
                        I already sent the patch to contributing@kopano.io in hope they will merge it.

                        But anyhow - here is the patch in case anyone wants to test it now for themselfes:
                        https://github.com/ejjoman/kopano-core/commit/073d9a230f7a79612850c26da9e95db2bbd2a680

                        With this patch, kopano-spamd is able to keep track of incoming emails which are flagged as spam.
                        It will then mark the message in the internal db as “was spam” and at this point the message behaves as you would expect it from the user pov.
                        You then can move the message to the inbox, which will trigger the ham-learning. You can also move the message to the spam folder again to trigger spam-learning in case the user moved a wrong message to the inbox.

                        I hope you like it.

                        –
                        Michael

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post