On 2024-09-27, Dale <rdalek1...@gmail.com> wrote:

> It says port 465 but it is using Oauth2 if that matters.

It doesn't.

> I'll admit, the last time I got this working, I followed a guide and
> it just worked.  Once it worked, I left it alone.  I was scared that
> if I touched it, it would stop working.  LOL 
>
> I changed the config to port 465 and it still failed with this. 
>
>
> Sep 26 19:04:26 Gentoo-1 smartd[18737]: Executing test of <mail> to root ...
> Sep 26 19:04:36 Gentoo-1 msmtp[18815]: host=smtp.gmail.com tls=on
> auth=off from=rdalek1967<at>gmail.com recipients=root errormsg='the
> server sent an empty reply' exitcode=EX_PROTOCOL

According to that message, the msmtp auth option is off.  It needs to
be on.

Look at the working configuraiton I posted.

Use that configuration with your email address and app password.

It also looks like smartd is trying to send mail to the recipient
"root". That's not a valid destination when sending via most smtp
servers.  You need to be sending to a recipient that looks like
"user@domain".

What port number are you trying to use?

Please re-read what I wrote about port numbers and starttls.  If
you're using port 465, you need to turn tls_starttls OFF.  If you're
using port 587, tls_starttls needs to be ON. That's the default, but I
recommend turning it on explicitly.

My advice: don't use smartd to try to get msmtp working.  Use
something easier to work with. The usual way to do it is using
something like mailx.  The Arch wiki page is an excellent resource:

https://wiki.archlinux.org/title/Msmtp

It shows how to test msmtp using mailx.

It also addresses the error you're seeing explicitly:

   8.2 Server sent empty reply

   If you get a "server sent empty reply" error, this probably means
   the mail server does not support STARTTLS over port 587, but
   requires TLS over port 465.

Note that some systems will ignore a message without a Message-Id:
header, so the example from the Arch page that cats a message from a
file to msmtp might not work reliably.



Reply via email to