nmh-workers
[Top] [All Lists]

Re: smtp.gmail.com and nmh

2020-08-19 10:17:17
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

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.

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?
Did you look at send(1)?  If you did, what was unclear?

--Ken

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