Hi! On Thu, 01. May 2008, 23:26:33 +0200, Karol Lewandowski wrote: > I've recently hit following problem -- if one omits password > field in .msmtprc and doesn't have .netrc nor keychain then > msmtp tries to read password from stdin. Problem is, that > usually stdin might (and usually does) contain mail itself. > > Here's where fun begins: > - if msmtp is run from terminal, getpass() opens /dev/tty > and reads password from there, > - otherwise password is read from stdin, namely first line > of mail message is used as password. > (At least this is what I've been able to understand from short > look at the code.)
You're right, msmtp should not read a password from stdin, because it reads the mail from there. > IMHO "ideal" would be if msmtp would ask for the password > after reading mail from stdin, but that's not as simple as I hoped. > msmtp starts smtp session before reading mail from stdin, which > is great as it doesn't need to keep entire mail in memory, but > gives us problem just as decribed. I don't think it is possible to distinguish between a password and the mail on stdin. I changed the code to only use getpass() if we're sure that it can read from a controlling terminal and not from stdin. If there's no controlling terminal and no password can be found elsewhere, msmtp simply reports an authentication failure. The change is in CVS now. Thanks for the report! Martin ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ msmtp-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/msmtp-users
