What was that email password again?

Last week I was migrating a client to a new computer and was preparing to configure Outlook. Their email account used POP3 and they didn’t remember their password anymore. I really didn’t want to call the email provider to reset the password, but I had to get this setup too. With a bit of hunting around, I configured the account to point to my laptop, fired up netcat and did some fast work replying to the POP commands. I collected the password and finished setting up Outlook on the new machine.

Later I went back to try to reconstruct what I did by testing it against Mail.app. No luck. This wasn’t the first time that I’ve needed to recover a password from an email client, so I decided to write a script to make it easier. So here is the script for you to use. I wrote it in Ruby and it doesn’t need any additional gems installed. The default Ruby install on OSX 10.5 worked fine.

Email Password Collector v0.1

It only works for POP3 right now. I’m going to start working on IMAP support next.

As an additional note, I found out some interesting things about email clients and why I couldn’t get things to work with netcat and Mail.app. It seems that Outlook is relaxed about following the RFC and doesn’t get too upset about missing CRLF characters after each line. Mail.app is stickler about it and won’t work unless those CRLFs are setup properly. Thunderbird is different than either one. It asks the POP3 server what its capabilities are when it connects. If the server doesn’t reply to that, then it sits until it times out.

Who knew there would be so much difference?

Jason Wood
Latest posts by Jason Wood (see all)