I'm running SpamAssassin as a milter in a Docker container separate from Postfix and Dovecot. Postfix and SA work together nicely, Postfix connects to spamass-milter
, SA does its thing, mail gets flagged appropriately, all good.
Now, I'd like to be able to teach SA spam from ham when I move messages back and forth between Inbox and Junk, more or less like in this guide. I confirmed that sieve works by having a simple filter that moves spam to the Junk folder when flagged so by SA, and it seems to work. Dovecot also runs in its own Docker container.
That guide implies that the spamc
command can connect to a SA instance via TCP, which would be great if only that didn't mean that I have to have spamc
available inside the container running Dovecot, which means having to install SA inside that very container, which means in turn lots of unnecessary duplication.
Is there a way around this?
EDIT It was suggested that Ubuntu-based containers have a spamc
package. However, I'm using a CentOS base image, which does not have a separate spamc
package.
Yes there is!
As you need only
spamc
in your Dovecot container, you should solely install spamc and not Spamassassin in the Dovecot container.Debian/Ubuntu (Dovecot Container):
CentOS (Dovecot Container):
You may install solely spamc with pip (Python Package Manager).
In case your container does not have pip already installed:
Add the EPEL Repository:
Install pip:
And now install spamc with pip as mentioned above.