Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Many fetchmail tutorials I've read say putting your email account password clear-text in a config file is safe. However, I prefer security through layers [silly example: if my terminal is up and someone suspecting such email foolery slides over and simply types "grep -i pass ~/.*" then, oops, all my base are belong to them! especially if my email provider uses openid (or I'm dumb enough to use the same password for my bank)].

Now, with msmtp (as opposed to sendmail) I can authenticate using the OSX keychain. Is there a free/open-source email 'grabber' that lets me use Keychains (specifically the OSX keychain) or at least, that lets me MD5 the password?

This is a duplicate of my question on serverfault. I've put it on superuser because I'm doing this on a personal computer (viz. with OSX) so it's a superuser question too.

share|improve this question
Doesn't OS X have a "Lock workstation" feature? – grawity Jun 9 '10 at 14:48
Sure, but, there is a ~3 second window where if you move the mouse or hit a key it doesn't lock. That's why I said security through layers. Just because your house has a locked door doesn't mean you shouldn't keep your passport etc. in a safe. Hence, why would one leave a password as cleartext with only thier user (and admin group) permission? It's asking for something bad to happen. – bias Jun 9 '10 at 15:21
Now, with open ID this is especially dangerous since people are likely to have an email account that can access many other web sites (viz. gmail and openid). So, if this gets taken, it's more than just email that is compromised. – bias Jun 9 '10 at 15:25
cross-posted as… – Ether Mar 7 '15 at 22:15
up vote 1 down vote accepted

You write a script to use getmail_fetch and submit your password using security(1).

For example:

getmail_fetch --ssl $server \
  $user \
  $(security find-internet-password -g -s $server -a $user 2>&1 1>&- | sed -e 's/password: "\(.*\)"/\1/') \

You will need to click "Always Allow" the first time you access a particular keychain item with security.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .