I currently own a domain bought via GoDaddy.com, which provides me a basic email setup for the most common needs. I configured it to forward all mail to me@mydomain.com to me@myisp.com. I also own a virtual server with a running Postfix that I use for a specific website (all mail to somedomain.com gets forwarded via LMTP to a program written by me).

Since I'm recently experiencing some harassing by spammers, since GoDaddy doesn't seem to filter spam, and since my Windows Phone's Pocket Outlook cannot filter spam, I would like to use SpamAssassin to filter inbound spam by changing my domain's MX records to my server

My ideal setup is the following:

  1. All mail delivered to somedomain.com gets redirected via LMTP as usual via virtual transport without any spam check
  2. All mail to me@mydomain.com gets redirected to me@myisp.com after a severe spam check
  3. I don't care about otheraddress@mydomain.com since I use just one address for now
  4. I would like to train SpamAssassin with customized spam rules, possibly based on the presence of certain keywords (links to certain unsubscribe pages I found recurring)

I currently configured Postfix with


somedomain.com                 lmtp:[]:8025
.somedomain.com                error: Cannot accept mail for this domain


somedomain.com                 OK

(I guess I should add mydomain.com OK too)


@mydomain.com                  me@myisp.com

(looks like a catch-all rule, it's OK as requirement 3)

I installed SpamAssassin, I can do rcspamd start and set it to boot with the server, but I don't know if there is anything else to do for use in Postfix, and how to apply requirement 1 (only mail to mydomain.com gets filtered)

I also tried to send an email via Telnet to make sure my settings are ready for MX change. I received the message into my account but I found that it gone through secureserver.net, like Postfix didn't rewrite the destination but simply relayed the message.

Thank you in advance. I'm no expert in SpamAssassin, and I have little experience in Postfix (enough to avoid making my server an open relay)


Have you set SpamAssassin as a content-filter or smtpd_proxy_filter?

Postfix needs to know how to talk to SpamAssassin. I've always used Postfix with some kind of SMTP-Proxy (like Amavis or VBoxAdm) so I'm not sure whether SpamAssassin ships with a SMTP-Proxy of its own. Figure this out and use content-filter if you want Post-Queue filtering or smtpd_proxy_filter if you want Pre-Queue filtering. In the case of the pre-queue filter the smtp proxy needs a way to re-inject the mail, so you have to create a new transport in the master.cf. A content-filter is set in the main.cf while a smtpd_proxy_filter must be set in the master.cf.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.