mathlete
mathlete

Reputation: 6692

smtpmail error "An unexpected TLS packet was received"

I write emails in emacs via mu4e. If I specify starttls instead of ssl in the following code, smtpmail can send the messages:

;; sending mail (see Appendix B.3.2 of the mu4e manual)
(setq send-mail-function 'smtpmail-send-it
      messsage-send-mail-function 'smtpmail-send-it; use smtpmail for sending mails
      smtpmail-stream-type 'ssl; starttls works here, why not ssl?
      smtpmail-default-smtp-server "mail.uni.edu"; default smtp server
      smtpmail-smtp-server "mail.uni.edu"; host name of the SMTP server
      smtpmail-smtp-service "smtp"); controls the port on the server to contact

However, for ssl, I obtain (output of *Messages*):

Sending via mail...
gnutls.c: [0] (Emacs) fatal error: An unexpected TLS packet was received.
gnutls.el: (err=[-15] An unexpected TLS packet was received.) boot: (:priority NORMAL :hostname mail.ethz.ch :loglevel 0 :min-prime-bits 256 :trustfiles (/etc/ssl/certs/ca-certificates.crt) :crlfiles nil :keylist nil :verify-flags nil :verify-error nil :verify-hostname-error nil :callbacks nil)
gnutls-negotiate: GnuTLS error: #<process smtpmail>, -15
gnutls.c: [0] (Emacs) fatal error: An unexpected TLS packet was received. [100 times]

What's wrong?

Upvotes: 2

Views: 2647

Answers (1)

mathlete
mathlete

Reputation: 6692

Replace "smtp" by 465 and it works.

Upvotes: 3

Related Questions