nmh-workers
[Top] [All Lists]

Re: smtp.gmail.com and nmh | post: problem initializing server; [BHST] TLS is not supported

2020-08-19 12:24:27
Hi Ken:

On Wed 8/19/20 11:15 -0400 Ken Hornstein wrote:
This non nmh perl approach seems to work for me:

  smtp-cli \
      --verbose \
      --host smtp.gmail.com:587 \
      --user MYGOOGLE_USERNAME --password XXXXXX \
      --auth \
      --from MYGOOGLE_USERNAME@gmail.com \
      --to SOMEONE@gmail.com \
      --data /tmp/MSG_WITH_HEADERS_AND_BODY

I _think_ most of the information you want is in send(1), but here are
some likely switches you need to add to send:

      -sasl
      -server smtp.gmail.com
      -user MYGOOGLE_USERNAME
      -tls

OK, great.  Here's what I tried:

    $ ls -l ~/.netrc
    -rw-------. 1 moobt crew 57 Aug 19 10:49 /a/moobt/.netrc
    $ cat ~/.netrc
    machine smtp.gmail.com login examplefoo@gmail.com password XXXXXXXXX

    $ send -snoop -nomime -msgid -server smtp.gmail.com -port 587 -tls -sasl 
-user examplefoo@gmail.com /tmp/MSG_WITH_HEADERS_AND_BODY
    Trying to connect to "smtp.gmail.com" ...                                   
               
    Connecting to 2607:f8b0:400e:c08::6c:587...                                 
               
    => RSET                                                                     
               
    <= 220 smtp.gmail.com ESMTP s125sm30489454pfc.63 - gsmtp                    
               
    => QUIT                                                                     
               
    <= 250 2.1.5 Flushed s125sm30489454pfc.63 - gsmtp                           
               
    post: problem initializing server; [BHST] TLS is not supported              
               
    send: message not delivered to anyone                               

'TLS is not supported' Does this mean I need to rebuild nmh? 

Minor question: Is sasl used by tls? My sendmail MTA uses "STARTTLS", and I
had to set that up, but I'm not familiar with sasl.
https://en.wikipedia.org/wiki/Simple_Authentication_and_Security_Layer

You want to put the password in a .netrc file, or some other file defined
by the "credentials" profile entry.  mh-profile(5) has this info, but
the entry in there should look something like:

machine smtp.gmail.com login MYGOOGLE_USERNAME password XXXXXX

You can use the -snoop switch to send(1) to see what is going on,
that will be invaluable for debugging.  FYI, in my experience
"MYGOOGLE_USERNAME" includes "@gmail.com", but that is outside the scope
of nmh; it will happily use whatever you put in there, but you have to
get it right.

Right, per above, I followed an example in the nmh mailing list with 
MYGOOGLE_USERNAME@gmail.com.

And if you don't mind me asking ... I would like to make this information
more easily findable.  Were you just overwhelmed at where to start?

Maybe a bit lazy and overwhelmed.  I think a few more examples would not hurt,
or if the man pages referred to another doc with examples.  Your help, Ralph's
help, the man pages, and an 'egrep -r' of my nmh mailing list tree helped.

Did you look at send(1)?  If you did, what was unclear?

I expected the answers might be in send or post. I glanced at the send man
page, but honestly only for a few seconds -- sorry, I could have concatenated
the send and post man pages and then searched them both at once.

Thanks!

--Tom

--
I plan to use smtp.gmail.com sparingly.

<Prev in Thread] Current Thread [Next in Thread>