Hi,
My father has a third party running a webshop for him but they seem unable to implement any method to stop spam bots on the contact form and he was getting overwhelmed with spam. So I created 2 rules using sogo to automatically discard emails with 1 of 2 urls in them which all the spam messages had. But then the spammers changed the emails suddenly had lots of different urls. So I deleted the rules and created a new one that I want to automatically move any email from the website to the junk folder and mark it read. But it refuses to do it. The emails sit in the inbox untouched. Has anyone any hints for me as to why this might be? I have attached an image of the rule and an example spam.

  • Dan replied to this.
  • Do you have any other filters?

    What I’d try doing is running a Sieve filter tester and ensure the filter should be matching properly. I don’t think Mailcow has one built in (it’d be a good addition!) but you can use FastMail’s one at https://www.fastmail.com/cgi-bin/sievetest.pl

    1. Log in to the Mailcow UI as the correct user
    2. On the “Mailbox Details” page, click the “[Show active user sieve filter]” link and copy the entire Sieve script that appears
    3. Paste it into the first box on https://www.fastmail.com/cgi-bin/sievetest.pl
    4. View the source of the email you expected to be filtered (in SOgo, it’s the “three vertical dots” icon at the top right when you’re viewing the message, then “View Message Source”
    5. Paste it into the second box on the sievetest page
    6. Click “Run test”

    If it just says “keeping message” then none of the filters matched.

    Daemon-Byte they seem unable to implement any method to stop spam bots on the contact form and he was getting overwhelmed with spam.

    If they don’t do anything, they’ll probably eventually end up on a spam blacklist…

    Daemon-Byte The emails sit in the inbox untouched.

    Filters only apply to newly-received emails; they don’t apply to emails that have already been delivered to the inbox. Your filter configuration looks fine, so any new emails that match the filter should be moved to the right folder.

    Do note that moving emails to the “Junk” folder trains the spam filter, so it’s likely that all emails from the contact form (even legitimate ones) will start to be marked as spam if you do that. You may want to create a new folder just for the bad contact form emails, or get the webshop to properly implement spam filtering on the form.

      Have something to say?

      Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

      Dan Sorry that was my miscommunication. I meant new emails just come in and sit in the inbox. It’s like it doesn’t notice the rule exists at all. I was doing this last night and it seemed to be ignoring all the rules I made and then it started working so I assumed I fixed whatever the issue was. It was very late so I just went to bed. Today all the spam has come in unfiltered again but I can’t see anything particularly striking in the logs as an issue. I have no idea how to test if the rule is being applied but wrong or if the rule isn’t being applied at all.

      I know it will learn from that but it was late and I didn’t think about creating a new folder. I think I will do that 🙂

      Do you have any other filters?

      What I’d try doing is running a Sieve filter tester and ensure the filter should be matching properly. I don’t think Mailcow has one built in (it’d be a good addition!) but you can use FastMail’s one at fastmail.com Icon Log in | Fastmail

      1. Log in to the Mailcow UI as the correct user
      2. On the “Mailbox Details” page, click the “[Show active user sieve filter]” link and copy the entire Sieve script that appears
      3. Paste it into the first box on fastmail.com Icon Log in | Fastmail
        fastmail.com Icon fastmail.com
        Log in | Fastmail
        Use your username and password to log in to your Fastmail account to access your email.
        fastmail.com
      4. View the source of the email you expected to be filtered (in SOgo, it’s the “three vertical dots” icon at the top right when you’re viewing the message, then “View Message Source”
      5. Paste it into the second box on the sievetest page
      6. Click “Run test”

      If it just says “keeping message” then none of the filters matched.

      The test was failing but thanks to that website it was so much easier to debug. Some numpty at the ecommerce company has put 2 spaces in between words in the subject so it doesn’t match. Thanks a lot you saved me a big headache.

      • Dan replied to this.

        Daemon-Byte Glad to hear you figured it out!

        I submitted a feature request to add a Sieve filter tester in Mailcow, which would make it easier to debug without having to copy-paste the entire Sieve script to a different site: mailcow/mailcow-dockerized4030

        No one is typing