Google Analytics

Wednesday, November 18, 2009

Whitelist Twitter emails on Postfix

Unfortunately it seems that Twitter's email servers often end up listed on RBLs like SpamCop, which I use for spam filtering. This means my email account holders don't get emails about direct messages, new followers and other ego-building things like that.

Here's a simple way to white-list these emails for Postfix:
  1. Create a new file /etc/postfix/ip_whitelist with the following contents:

    128.121.146.141 OK
    128.121.146.142 OK
    128.121.146.143 OK
    128.121.146.144 OK
    128.121.146.150 OK
    128.121.146.151 OK
    128.121.146.152 OK
    128.121.146.153 OK

    These map from mx001.twitter.com to mx008.twitter.com, which seem to be all they have for now.

  2. Run: postmap /etc/postfix/ip_whitelist

  3. Edit your /etc/postfix/main.cf file to include the IP whitelist. Find the line where you have your RBL checks, e.g.:
    reject_rbl_client bl.spamcop.net
    and add the following line above them:
    check_client_access hash:/etc/postfix/ip_whitelist

  4. Restart Postfix.

These vital emails should now get through to your psychologically fragile account holders.

1 comment:

Marcel said...

Thanks dude, this helped me a lot :)