Breaking the Law (of Hostname Canonicalization)
Mailman is a great little program written in Python that lets you manage mailing lists. I was tasked with installing it on a new machine last week, and I got to learn about canonicalization the hard way. All of the emails sent by our server out to the mailing lists were using the host name instead of the DNS A record for the Mailman VirtualHost. I tried for days to fix this and eventually got the feeling that it was DNS related. However, I still couldn’t see why Sendmail would force the To-header back to the canonical name when Mailman was setting it correctly.
Eventually, I happened across this email on Mailman’s dev list that solved the problem by removing one of sendmail.cf’s canonicalization rules. I’m sure this violates some RFC. Although, the hack does indeed solve the problem. The actual wizardry was to comment out the following line in sendmail.cf.
# pass to name server to make hostname canonical # R$* $| $* < @ $* > $* $: $2 < @ $[ $3 $] > $4
It’s absolutely wrong to do this because if you edit sendmail.mc, and restart sendmail, the cf file gets regenerated automatically which obliterates the change. Is there a better way to fix this without violating RFCs and changing sendmail rulesets? Note: I don’t have access to the DNS server.
Another Step Toward the Triumverate of Email Promulence
I managed to solve one of the three problems that I talked about earlier by using teh G00gle. Apparently, you can use this script to mirror email to Gmail from a Berkeley format mail file. The command-line invocation is highly-bizarre, but it seemed to work on two out of the three mail files that I tried. So, I just mirrored all of my email from 1999 to 2001 to Gmail as a test, and it worked. Now, I’ll have a completely searchable mail archive indexed automagically. This had the by-product of syncing all of my old email to my Powerbook as well. So, now everything is anywhere I could possibly need it, backed up, and highly accessible. Before I put all of my old email in GMail have to go in with Mutt and manually find everything on a per-folder basis. I still have two problems left to solve: (1) Forwarding all sent mail from Mail.app to Gmail automatically using sendmail configuration foo, and (2) Getting all sent Gmail on to hudge.
Reaching Valhalla via Port 25 (over SSH)
I was infinitely proud of this last hack on OS X that seems to work. I wanted to send email from an arbitrary wireless or wired IP address from Mail.app. So, here’s what I did… I issued this command to route port 25 from suudsu to hudge!
sudo ssh -L 25:localhost:25 hoyhoy@hudge
Hudge is where involution.com is hosted and runs a mail server. So, I redirect my Powerbook’s port 25 to hudge, and configure Mail.app to use localhost as it’s outgoing sendmail server over an encrypted link via SSH I’m syncing my Powerbook to Gmail’s POP access (over SSL). Involution.com’s mail (*@involution.com) that is not stopped by Spamassassin, Bogofilter, DCC, or my custom virus notification and unreadable character set filters is forwarded to GMail if it’s not something that was sent from within gmail, and mails sent to hoyhoy@example.com are forwarded back to hudge which implicitly creates a backup. Also, I setup Mutt to BCC sent mail to GMail so it’s included in the archive. The only one that I haven’t figured out is how to make Mail.app BCC sent mail to Gmail, and how to make GMail send it’s sent mail back to hudge. I know there’s ample sendmail foo to be messed with, and I imagine it’s possible to replicate based on the fact that it knows when an email is coming from the Mail.app MUA and tony@involution.com, it is safe to mirror that to my user account on hudge. Similarly, I think I can actually hack Eric S. Raymond’s “fetchmail” program to download emails that I sent from GMail over POP3, and only grab any email that I didn’t send to myself, and archive it on hudge. These are automatically in Mail.app because it syncs to GMail POP3, and sent email is part of what’s downloaded. So, basically, I’m left with emails I sent from Mail.app only being in Mail.app, and email sent from GMail only going to Mail.app and not hudge, but everything else is mirrored everywhere. I used to keep Outlook running on Windows too, but I’ve since stopped being part of that whole scene about four years ago. I transferred all of my Outlook email over to Berkely format and use pine to look through it, on the rare occassion I need an email from before 2002. If only I could somehow get all of that imported to GMail, but that’s another story. Someone needs to write a GMailFS driver to where I can simply drag .eml files or entire mbx files and have them import.
Total Gmail Integration
I don’t know why I feel the need to have the most complicated mail setup in the world, but everyday it seems like I’m adding another layer of complexity. I setup a Gmail account in 2004, and I’ve been using it more and more, however it’s introduced a lot of complexity into how I deal with email. I used to keep everything on one machine in the Berkeley mail format. It was easier back then, but when my network would go down, I’d be unable to check my mail, and not every machine has access to ssh. So, I started using Gmail, and setup a procmail rule to forward all of my involution.com mail to Gmail. The problem with that was, I wasn’t getting my gmail on my home machine. So, I setup Gmail to forward all the email that I got back to my mail server, and prevented it from forwarding that back (an infinite loop). Then, I have the problem of email that I send from mutt doesn’t get forwarded to gmail. So, then I hacked it to append a BCC header to forward sent items on to my Gmail account. Now, the latest conundrum is, how do I make Gmail BCC sent-items back to my server? I haven’t figured that one out.





