<p>Here was my response to Pan, it should be helpful for you two as well.</p>
<p>You will need to change the spec for .netrc, not just python's implementation.</p>
<div class="gmail_quote">---------- Forwarded message ----------<br>From: "Leif Walsh" <<a href="mailto:leif.walsh@gmail.com">leif.walsh@gmail.com</a>><br>Date: Mar 21, 2011 9:27 AM<br>Subject: Re: ~/.netrc & multiple accounts with same @domain<br>
To: "Pan Tsu" <<a href="mailto:inyaoo@gmail.com">inyaoo@gmail.com</a>><br><br type="attribution"><p>You can't use .netrc for both, this is a .netrc limitation, that is, it keys entries by machine name, not (machine name, user). I suggest a password file, that's what I use.</p>
<div class="elided-text">
<div class="gmail_quote">On Mar 21, 2011 6:17 AM, "Pan Tsu" <<a href="mailto:inyaoo@gmail.com" target="_blank">inyaoo@gmail.com</a>> wrote:<br type="attribution">> offlineimap is unable to get password from ~/.netrc when it contains<br>

> more than one entry for `machine'<br>> <br>>   machine <a href="http://imap.gmail.com" target="_blank">imap.gmail.com</a> login foo password blah<br>>   machine <a href="http://imap.gmail.com" target="_blank">imap.gmail.com</a> login bar password blah<br>

> <br>> where the last one wins, i.e. `bar'. It'll ask password for `foo'<br>> account when running in TTY.TTYUI.<br>> <br>> OTOH, msmtp which I use to send mails picks the right password without issues.<br>

> <br>> --<br>> $ offlineimap --version<br>> 6.3.2<br>> <br>> _______________________________________________<br>> OfflineIMAP-project mailing list<br>> <a href="mailto:OfflineIMAP-project@lists.alioth.debian.org" target="_blank">OfflineIMAP-project@lists.alioth.debian.org</a><br>

> <a href="http://lists.alioth.debian.org/mailman/listinfo/offlineimap-project" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/offlineimap-project</a><br>> <br>> OfflineIMAP homepage: <a href="http://software.complete.org/offlineimap" target="_blank">http://software.complete.org/offlineimap</a><br>

</div>
</div></div>