Filtering mail

    • Filtering mail

      I want to set up mail filtering, so it automatically puts mail tagged with [SPAM] by SpamAssassin in the junk folder, but I'm not exactly sure how to do this. I have looked at some guides online, but I am not sure if the instructions were accurate. I don't want to switch to a completley different mail server, just make it so spam goes into the roundcube spam folder.
    • But I'm not exactly sure what the folder that it will be moved into is called, RoundCube has a folder for spam called Junk, but it's not enabled by default, I had to enable it, and I'm not sure if it will work on the other accounts that don't have it enabled. I've been getting SO MUCH spam, sometimes over 100 spam emails a day, and pretty much all of it gets tagged by SpamAssasin, but I just need to move it into the junk folder. Also, do you know if it can be set up so the mail in the junk folder automatically gets deleted?

      The post was edited 1 time, last by CarpCharacin ().

    • RoundCube should have the ability to have filtering set up so that it automatically (when you go into it) copies those into the junk folder. That's also what I was referring to about sieve, which will do it automatically.

      Did you not read the answers on that link I provided?

      It will take some modifications of your dovecot.conf to get sieve enabled and filtering correctly. That way, when the mail comes in with the SPAM in it, it will automatically be moved to Junk. You should be able to also have the Junk folder emptied regularly.
      Instead of repeating what's already out there in great detail I'll refer you here. This is for a CentOS box.
    • Ok, yeah it's set to rewrite the header as [SPAM] when I configured SpamAssasin. I'm going to try to work on configuring this over the weekend. Also, there is a RoundCube setting called "Directly delete messages in junk" so does having that checked automatically clear the spam folder?
    • I tried to get it set up, but now when I try to log in to roundcube, it just says connection to storage server failed. Also, when it said to run ## chown vmail: -R /etc/dovecot/sieve
      ## chown vmail:mail /var/log/dovecot-* it said chown: invalid spec: ‘vmail:’. I followed the steps to the point in the guide to where it says to test the spam filter and enable the roundcube plugin. How do I make it so I can log in?
    • That's the issue with guides you find on the internet. They may not be using the same owners/processes that you are, just similar and you have to know that to know what to change in them. Are you sure that the owner of the processes is vmail?
      The correct syntax for chown is chown user:group.
      I hope you made notations of what you changed so that you could reverse them if needed.
      Have you checked the logs for the HTTP server and associated processes used?
      Have you confirmed that the sub-processes are running? Stuff like mySQL, Postfix, Dovecot, etc.
      The connection to storage server issue is most likely a dovecot issue, so it's imperative to check it first.

      What is the link to the guide you used?
    • Looks like dovecot is not running from what I could tell?
      If not, that's the issue and you need to reverse the changes you made to the dovecot config files and then try restarting dovecot.
      One thing I noticed was you were, in your chown examples, prefixing the ## on them. You do realize that those are not to be typed in, only the chown commands, correct?

      chown vmail: -R /etc/dovecot/sieve
      chown vmail:mail /var/log/dovecot-*

      But you have to make sure that dovecot is running as vmail:mail user:group. You will have to look in the config files for it to find what it is running as.
    • I've quit using a home rolled mail solution and grabbed another VPS and run Mailcow-dockerized on it. It does the spam related stuff for you and does a very good job of it.

      It uses RSpamD to do the spam checking with and I have very little problems with spam getting through.
      It is much easier to deal with since it is a package setup and uses a nicer web interface (SoHo) than RoundCube.
      One of the reasons I went to it was sieve was giving me headaches to set up as well as the span/virus checking. It would work then stop working for no reason.

      I'd have to go back and set up a test bed install to research enabling sieve on a system. Generally it's just about as easy to recreate it from scratch with it enabled than using one of the guides that has all aspects included in it - but you have to be sure it's a fairly recent guide.

      You could try Pigeonhole for Dovecot. Their wiki is here.