Support port number in Gnus X-Message-SMTP-Method header

* lisp/gnus/message.el (message-multi-smtp-send-mail): Try to parse
service as port number.  If it succeeds, use parsed number, else use
supplied service name as before (bug#24653).  (This only matters
on some operating systems.)
This commit is contained in:
Alain Schneble 2018-04-12 00:51:19 +02:00 committed by Lars Ingebrigtsen
parent 45e3753762
commit 57442b6812

View file

@ -4676,9 +4676,11 @@ that instead."
(message-send-mail-with-sendmail))
((equal (car method) "smtp")
(require 'smtpmail)
(let ((smtpmail-smtp-server (nth 1 method))
(smtpmail-smtp-service (nth 2 method))
(smtpmail-smtp-user (or (nth 3 method) smtpmail-smtp-user)))
(let* ((smtpmail-smtp-server (nth 1 method))
(service (nth 2 method))
(port (string-to-number service))
(smtpmail-smtp-service (if (> port 0) port service))
(smtpmail-smtp-user (or (nth 3 method) smtpmail-smtp-user)))
(message-smtpmail-send-it)))
(t
(error "Unknown method %s" method))))))