Monthly Archives: January 2009

Drupal – Encoding Email Addresses to Deter Spam-bots

While working on my latest Drupal project, I really wanted an easy, brainless way for users to create clickable “mailto:” links that gave pesky spam-bots a hard time.

Turns out, the Bbcode module does just the trick. Even if you don’t normally use it, you can add this input filter to your standard HTML filters, and it will work. The first step is to download and install the module.

Next up, enable the module, and add it to your input filters (located at /admin/settings/filters):


As you can see,  you don’t even need to assign it any roles. However, the Filtered HTML and Full HTML filters can use it, just set them up like so:

Input Filters

Next, go in and and configure the Bbcode module to encode email addresses:


Now, to use it – just use the standard bbcode to encode any email address:


And when the page is rendered, the underlying HTML will all be JavaScript gobbly-gook, but to the end user, it will be a normal link.

Transferring IMAP email to Google Apps for Your Domain

Over the holiday break, I took the plunge and migrated my businesses email service over to Gmail, using Google Apps for Your Domain (GAFYD) Premier Edition for businesses. For $50 per user per year, a 99.9% SAL, 25 gigs of space, extra bad-ass spam filtering, virus protection, backups, etc. I figured why the heck not.

Modifying the DNS and MX records was very easy (note if you use Postini, you will need to use different records) – they provide clear directions on this. However, make sure you install SPF records, this gives Google/Postini permission to send email on behalf of your domain. This will ensure you make it through today’s highly sensitive spam filters.

The only part of the transfer that made me a little nervous, and gave me a little trouble, was migrating my existing IMAP email over to the GAFYD servers. It’s really just a matter of knowing what IMAP client your current email server uses, and then entering the correct settings. Google provides a handy tool for doing this, but only supports certain IMAP servers, so check that yours is on the list. As of this writing, the supported IMAP servers are: Microsoft Exchange Server 2003, Cyrus IMAP Server, Courier-IMAP, and Dovecot.

Here are the settings I used:


143 is the default IMAP port. The thing that was tripping me up was the “IMAP Path Prefix.” Is this the path to where the email is stored on the server? A folder prefix name? It seemed no matter what I put in there, the only email folder it could find was “Inbox” – none of my subfolders where showing up.

Finally, I just left it blank, and whammo! All my subfolders were found. However, the “exclude” option did not work for me, which is fine – I can clean that up later.

After verifying that everything looked OK, I started the transfer. When I got back from lunch, it was finished! Cool.

Folders to Labels

This feature didn’t quite work as I expected it to. All my IMAP folders were indeed correctly labeled, but they were labeled with the full folder path. For example, if I had “folder-b” inside “folder-a” which was inside my Inbox, the label would be: “Inbox.folder-a.folder-b” – which is actually a smart way to do it because it takes into account that 2 folders may have the same name, but be in different locations. After the import, all I had to do was tweak my label names.

Am I Glad I Did It?

Absolutely. I love it. Being a huge fan of keyboard shortcuts, I can fly around Gmail like no other email program. And the spam filtering (along with Postini – a GAFYD free add-on), is the best. It just works, even better than Spam Assasin. Postini sends me a daily email with whatever emails it has quarantined, so I don’t have to constantly log in and check to see if a legitimate message was caught. I also enjoy the full suite of GAFYD apps – in particular the Calendar. And if you’re on a Mac, you’ll want to check out MailPlane – an excellent way to work in Gmail.