1

Like the poster here I'm having difficulty connecting to an smtp server that uses tls. I have installed gnutls-cli but I am still getting an error, "530 5.7.0 Must issue a STARTTLS command first. ub8sm33925197wjc.39 - gsmtp". How can I tell if smtpmail.el is really finding this program? I have set up .key and .cert files, too, eventhough I'm not sure if they're necessary.

Here are all my settings:

(setq
 send-mail-function 'smtpmail-send-it
 message-send-mail-function 'smtpmail-send-it
 user-mail-address "XXXX.YYYY@gmail.com"
 smtpmail-starttls-credentials '(("smtp.gmail.com" "587"
           "~/.gnutls/smtp.gmail.com.key" "~/.gnutls/smtp.gmail.com.cert"))
 smtpmail-auth-credentials  (expand-file-name "~/.authinfo")
 smtpmail-default-smtp-server "smtp.gmail.com"
 smtpmail-smtp-server "smtp.gmail.com"
 smtpmail-smtp-user "XXXX.YYYY@gmail.com"
 smtpmail-smtp-service 587
 smtpmail-stream-type 'ssl
 smtpmail-debug-info t
 smtpmail-debug-verb t
 starttls-extra-arguments nil
 starttls-gnutls-program "/usr/bin/gnutls-cli"
 starttls-extra-arguments nil
 starttls-use-gnutls t
)

Many thanks.

healyp
  • 171
  • 1
  • 3
  • Although it may not be related to your problem, depending upon what version of Emacs you are using, the variable `smtpmail-starttls-credentials` may no longer exist. – lawlist Sep 06 '16 at 17:19
  • Although that seemed like a hopeful lead it didn't apply, unfortunately. Doing `(require 'smptmail)` in version 23.4.1 defines that variable. Thanks, though. – healyp Sep 14 '16 at 11:36

1 Answers1

1

You have hopefully figured this out by now but I think you need (setq smtpmail-stream-type 'starttls). You've specified TLS directly which won't work if the service expects unencrypted connections at first with starttls support.

Ronald
  • 11
  • 1