Delan Azabani

Forwarding Curtin email

In an effort to avoid using any email UI other than the familiar embrace of Gmail via Google Apps, one of the first things I did when I became a Curtin student was to forward my email. I couldn't quite filter all of the incoming emails properly though, until last night I had a sudden realisation.

Most emails to my Curtin account look something like this:

Delivered-To: delan@azabani.com
Return-Path: <delan.azabani@student.curtin.edu.au>
Resent-From: <delan.azabani@student.curtin.edu.au>
To: <delan.azabani@student.curtin.edu.au>

The obvious approach was to configure the Outlook Web App to forward email to delan@azabani.com, and that seemed to work reasonably. On the Gmail side, I simply created a filter that took all emails matching to:delan.azabani@student.curtin.edu.au and added the curtin label to them.

Except that didn't work for the significant minority of messages where all of the recipients were blind carbon copied, myself included. Why not filter on the Return-Path or Resent-From headers? Gmail doesn't allow users to search arbitrary headers, only those that are whitelisted. This includes From, To, Subject, Cc, Bcc and Message-ID.

Gmail also allows you to search the Delivered-To headers of messages, and this seemed useless to me because the value would always be delan@azabani.com. There's where the realisation hit me: combined with Gmail's automatic "plus" aliasing, the Delivered-To header is in fact the perfect solution.

Now that I forward Curtin messages to delan+curtin@azabani.com and filter on deliveredto:delan+curtin@azabani.com, no more emails need to be manually labelled. In retrospect, that it took me over a year as a Curtin student to forward my mail properly is somewhat disappointing.