Steve Harris (theno23) wrote,
Steve Harris
theno23

  • Location:
  • Mood:

Mail.app, iPhone and spam

So, I have this debilitating problem where my work email inbox gets so much spam that I can't read real mail on my phone unless I've used my Mac mail client (with clientside spam filter) in the last couple of hours. My main machine is a laptop, so while it's asleep, no spam filtering gets done.

Work's ISP runs a spam filter, but it just modifies the subject line, which means the phone still downloads it.

I found a for-money, mac based solution, but I don't have any always-on macs that I wanted to run the software on, and I'm not keen on paying money to get rid of spam anyway.

But, I found a solution that keeps the phone relativly free of spam and doesn't mess with Mail.app. It involves running spamassasin on my home server and a pythion script, ISBG.

You can follow the instructions on the ISBG page to get it setup, ignore how out-of-date it is, it works fine. The key thing is the exact IMAP folder ID for the Mail.app Junk folder (so you don't end up with excess spam folders). I had to brush up on my IMAP skills and connect with telnet to find the exact folder id that Mail.app expects to find spam in. The key line is:

isbg.py --imaphost mail.host.com --spaminbox "INBOX.Junk (NameOfAccount)" --imapuser username --delete --expunge --nostats

NameOfAccount is the name the account appears under when you expand the Inbox virtual folder.

I've put it in a crontab, to run every 10 mins (*/10 * * * *), and it seems to be doing the job...
Tags: mac, mail, spam
  • Post a new comment

    Error

    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic
  • 0 comments