Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick

  • Music:


The perl MIME-Tools package is extremely impressive.

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 point to, 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 as a destination.

Another fun hack ... I couldn't pipe mail directly into /home/lj/bin/ 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 ... new support system up tonight, I hope.
Tags: mysql, perl, tech
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.