I've been rewriting the LJ support system the past few days and I keep putting off the email --> database gateway, for fear of having to deal with people using Outlook Express stationaries and stuff, but it isn't actually hard to deal with at all using MIME::Parser.
I had to setup postfix on my dev server since I'd never have to work on anything related to mail locally before. Getting delivery to work from my windows machine was interesting ... my SMTP server I use from Windows is my Linux box, and I needed mail to be delivered to the FreeBSD box, ljdev. I hoped my hosts file would work, but it needed an MX record, so I ended up changing livejournal's DNS to have ljdev.livejournal.com point to 10.0.0.11, which is useless for all mailers except my Linux box, which can access ljdev there. Then I had to change ljdev's postfix config to accept ljdev.livejournal.com as a destination.
Another fun hack ... I couldn't pipe mail directly into /home/lj/bin/mailgate.pl because I needed the environment variable LJHOME set. Solution? Pipe it into procmail, set an environment variable there, then pipe it into mailgate. Bonus --- I can specify an explicit mailgate.lock file in my .procmailrc, so if we get flooded with email, each mailgate process won't try to connect to the database at once and max out mysql's max_connections.
Fun fun. Again, I'm so glad it's summer. This is exactly the sort of stuff I love doing, but wouldn't have time or patience for during school.
Anyway, back to work on mailgate.pl ... new support system up tonight, I hope.