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

Re: [msmtp-users] msmtp-1.2.4 and errors with mail server



Hi Martin!

> > a.  Email that I send out doesn't seem to have a From line.  I DID twiddle
> > the elm compile option related to this - the first iteration, the option
> > value was that the MTA (sendmail) could be expected to include a From, and
> > the second iteration, I changed this to could NOT be expected to include
> > a From.
> 
> Can you verify that elm really adds a From: header? It is unlikely that msmtp
> deletes it. Maybe you can set your mailer to '/bin/cat > /tmp/dumpmail' and 
> then examine the file. Or try the --debug option of msmtp.

Ok, on this one, I've figured out that there is a dilemma, and I'm not sure
what to do about it.  One of elm's configuration options is "Does your
mailer provide the From: header?"  For "yes", elm doesn't put a From on the
outbound mail.  For "no", it does.  Since I use sendmail, I've always had
"yes" selected, and elm doesn't add a header.  When I then replaced sendmail
with msmtp, which doesn't put a From header, I then started getting emails
generated with no "From" header, as described.

But if I check "no", which makes elm add the From header, then I wind up with
my local host/domain going out on the email, as you saw (ref:  "This certainly
is not right...").

The ways I can think of to get around this are:

1.  During configuration, tell elm to ignore the values it gets from
calls to gethostname and getdomainname, and instead hard-code those
values as being the ISPs values.  Since this is a single-user box, that
will work, but it's not clean.

2.  Change the host name and domain name of my box to be that of my ISP.
That way, elm will get those values.  This will probably work for mail
purposes, but since I have 4 other machines on the same LAN, and I use
the same private names for them, there's probably a bunch of network
reasons not to do it.

3.  Confirm with my ISP whether they allow relay through their mail server.
So far, it seems like they don't, but maybe they do and I'm just not seeing
it because so far, I've been coming at them from a different ISPs IP address.

4.  Switch to an MUA that has IMAP support.  I suppose this can work, but
the only two I know of are pine and mutt, and I don't really care for
either of them.  I don't like pine's user interface and the way it does
foldering.  Mutt's ok in these regards, but I've recently read something
that says that it's not really a proper SMTP client.

Can you suggest any other approaches?  After all these years of people
running home linux boxes with mail and ISP support, I've gotta believe
there's a simple and clean solution.

> > b.  When I come at the server cold, the first email I send seems to work just
> > fine.  But every one after that generates an error back to elm, and the capture
> > in the msmtp log is:
> > 
> > errormsg='the SMTP server does not support authentication' exitcode=EX_UNAVAILABLE
> 
> This is really strange. Please try --debug to see the whole SMTP
> session. You can use
> echo "hello" | msmtp --debug --account=test -- me@...8...
> as a simple test without starting elm.

Ok, did this.  Here's what came back:

jhiller@...11...:~$ echo "hello" | msmtp --debug --account=default -- jhiller@...5...
using account default from /home/jhiller/.msmtprc:
host            = mail.visi.net
port            = 25
domain          = visi.net
from            = jhiller@...5...
auth            = choose
user            = jhiller
password        = *
tls             = false
tls_trust_file  = 
tls_key_file    = 
tls_cert_file   = 
tls_nostarttls  = false
tls_nocertcheck = false
dsn_notify      = 
dsn_return      = 
keepbcc         = false
logfile         = /home/jhiller/msmtp.log
<-- 220 VisiNet ESMTP Mail Server Welcome!
--> EHLO visi.net
<-- 250-visi.net we trust you visi.net
<-- 250-HELP
<-- 250-PIPELINING
<-- 250-ETRN
<-- 250-DSN
<-- 250-TURN
<-- 250-ATRN
<-- 250-SIZE 20971520
<-- 250-STARTTLS
<-- 250 EHLO
--> QUIT
<-- 221 visi.net VisiNet SMTP closing connection
msmtp: the SMTP server does not support authentication
msmtp: could not send mail (account default from /home/jhiller/.msmtprc)

My .msmtprc is:

host mail.myisp.domain
from myuserid@...8...
user myuserid
password mypassword
domain myisp.domain
logfile ~/msmtp.log

The logfile contents show:

Dec 10 06:45:28 conffile=/home/jhiller/.msmtprc account=default from=myuserid@...8... recipients=myuserid@...8... errormsg='the SMTP server does not support authentication' exitcode=EX_UNAVAILABLE

> > c.  Thinking that maybe I could get past this by using tls, I included
> > 
> > tls
> > 
> > in the config file.  But this time, I get a runtime error that:
> > 
> > TLS certificate check failed: the certificate's owner does not match hostname.
> 
> You can use tls_nocertcheck to ignore the peer certificate.
> But using TLS should be completely unrelated to the issues above...

Will try this after I get past the other two issues.

Thx for your help!

jbh