Using my own Postfix, filtering spam and getting all the mail into my ISP's inbox

Posted by djechelon on Server Fault See other posts from Server Fault or by djechelon
Published on 2010-12-23T22:45:21Z Indexed on 2010/12/23 22:55 UTC
Read the original article Hit count: 282

Hello,

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 [email protected] to [email protected]. 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 [email protected] gets redirected to [email protected] after a severe spam check
  3. I don't care about [email protected] 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

transport

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

relay

somedomain.com                 OK

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

virtual

@mydomain.com                  [email protected]

(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)

© Server Fault or respective owner

Related posts about postfix

Related posts about spamassassin