> Don’t use email auto-forwarding (emails will go missing)

September 19th, 2014

I’ve been trying to chase down a mysterious problem with emails going missing. The problem with things being missing is that you can’t see them, so it has been difficult to track down exactly what’s going on, but it became clear that we were receiving no email at all from Amazon or Play.com for several months, and that some other mails had disappeared too. I was secretly assuming that I’d screwed something up in the terrifying postfix+dovecot+fetchmail+spamassassin+procmail config on our server, but I couldn’t find any indication of what could be going wrong.

I finally got around to considering whether it was someone else’s fault, and very surprisingly, my ISP Plusnet and my web hosts Bluehost were both very responsive and helpful when I contacted them.

I thought an over-enthusiastic spam filter might be swallowing mails, but it turns out the problem was that I was “forwarding” emails from my domain to my ISP-provided mailbox.

Since the SPF anti-spam system has begun to be implemented, emails from people like Amazon come with SPF policies that make plain message forwarding fail, because forwarding makes it look like emails come from the server forwarding them, when actually they come from the original sender. This makes it impossible to do SPF, so the emails were getting silently deleted.

Now that I know what the problem is, I have even found a sentence describing this on the Wikipedia page on SPF: “SPF breaks plain message forwarding” and this useful article: Why forwarding your email is a BAD idea.

The only solution I can see is to set up a mailbox on my domain host’s site, and stop using the mailbox provided by my ISP. I was only using this mailbox as a holding area before I pulled down the mail via POP3, so it doesn’t actually make much difference to me.

If you’re using GMail you can set it up to pull from a POP3 server, and some other webmail services let you do that too, so using your domain host’s web server doesn’t have to be inconvenient.

Losing email makes me stressed.

> Fetchmail “mda” option makes emails bypass the spamassassin filter in postfix

September 19th, 2014

I have spent several months with no spam filtering in my postfix+dovecote+spamassassin+fetchmail+procmail setup, and no idea why. I had spamassassin enabled and working when I piped emails into it manually, and I had lines like this in my postfix master.cf:

# Listen on port 2025, not 25, and filter with the spamassassin service
2025      inet  n       -       -       -       -       smtpd
	-o content_filter=spamassassin
# ...

# Definition of the spamassassin service: pipe to spamc, then sendmail
spamassassin unix -     n       n       -       -       pipe
	user=spamd argv=/usr/bin/spamc -x -e    
	/usr/sbin/sendmail -oi -f ${sender} ${recipient}

But no matter what I did, I saw no spamassassin headers in my emails, and no mention of using it in the logs. Frustratingly, it was filtering perfectly on outgoing mail, which I really don’t need…

Today I worked out what the problem was – nothing to do with postfix or spamassassin config, but to do with my .fetchmailrc.

Because I was running on a non-standard port, and also because I had tried not allowing unencrypted connections to postfix even from localhost, I was using telling fetchmail to deliver with /usr/sbin/sendmail, instead of allowing it to connect to postfix on port 25 as it normally does. So my .fetchmailrc contained:

poll example.com with proto POP3
    user 'x' there with password 'y' is 'z' here
    mda "/usr/sbin/sendmail  -i  -f %F -- %T"

It turns out this completely bypasses all the filters, and delivers the mail immediately. So, what I needed was the syntax to connect on a non-standard port, which looks like:

poll example.com with proto POP3
    user 'x' there with password 'y' is 'z' here
    smtphost localhost/2025

(If your postfix listens on port 25, you don’t need the smtphost line at all.)

And now my email is being filtered for spam, and put into a Junk folder by procmail.

> Android programming – a menu using Activities and Intents

September 17th, 2014

Series: Setup, Menu

I will be talking about how to write Android programs that share code with non-Android programs. The program I will be writing is a simple game.

This time we’re making a simple menu structure:

> Raspberry Pi Minecraft Python summer project screenshots

September 16th, 2014

[Screenshots of Minecraft on the Raspberry Pi can't be made with VNC or screenshot tool like scrot, but they can be made with the excellent raspi2png.]

We did some Python programming in Minecraft on the Raspberry Pi for our summer projects.

Child 2 made some lovely houses and enjoyed destroying things much more efficiently than when you do it by hand:


and Child 0 made a spell book. You can see the “elements” spell has been cast in the background (earth, air, water and fire), the “topsy-turvy” spell on the right, the “frozen” spell on the left, and on the far left you can just see a bit of the “river” spell:


To cast spells you must first utter the magical incantations:


and then:

from spells import *

then each spell can be cast by simply saying its name followed by the double brackets of power, for example:


> Android programming – setting up Android Studio

September 11th, 2014

Series: Setup, Menu

I will be talking about how to write Android programs that share code with non-Android programs. The program I will be writing is a simple game.

First, how to set up Android Studio: