[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [msmtp-users] Not specifying password in .msptprc breaks sendmail-mode behavior



On Sun, May 04, 2008 at 08:31:11PM +0200, Martin Lambers wrote:
> Hi!

Hello,

> > 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.

Yeah, we _still_ need tty for that... I must have been out of coffee or
sth ;)

> 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!

Thanks :)

I would also like to ask you about updating manual page.
Precisely, I think it's worth noting that (1) we need tty for password
input. Additionally some suggestion that empty password means (2) msmtp
can't operate in sendmail-compatible way might be helpful.

I tried to fix (1), see below.  I dunno what to say about (2).

Thanks again!


Index: doc/msmtp.1
===================================================================
RCS file: /cvsroot/msmtp/msmtp/doc/msmtp.1,v
retrieving revision 1.24
diff -u -r1.24 msmtp.1
--- doc/msmtp.1	12 Mar 2008 08:36:29 -0000	1.24
+++ doc/msmtp.1	4 May 2008 22:10:11 -0000
@@ -282,7 +282,7 @@
 \fBpassword\fP). 
 If no password is set but one is needed during authentication, msmtp will try to
 find it in ~/.netrc. If that fails, it will try to get it from a system specific
-keychain (if available). If that fails, msmtp will prompt you for it.
+keychain (if available). If that fails but it's possible to access controlling terminal, msmtp will prompt you for it.
 .br
 Currently the only supported keychain is the Mac OS X keychain. See the EXAMPLES
 section below.
@@ -317,7 +317,7 @@
 password. Authentication must be activated with the \fBauth\fP command.
 If no password is set but one is needed during authentication, msmtp will try to
 find it in ~/.netrc. If that fails, it will try to get it from a system specific
-keychain (if available). If that fails, msmtp will prompt you for it.
+keychain (if available). If that fails but it's possible to access controlling terminal, msmtp will prompt you for it.
 .IP "ntlmdomain [\fIdomain\fP]"
 Set a domain for the \fIntlm\fP authentication method. The default is to use no
 domain (equivalent to an empty argument), but some servers seem to require one,