我通过mu4e
在emacs中写电子邮件。如果我在以下代码中指定starttls
而不是ssl
,则smtpmail可以发送消息:
;; 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
但是,对于ssl
,我获得了* 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]
怎么了?
答案 0 :(得分:1)
将"smtp"
替换为465
并且有效。