From d4ab03eccee5651bd705d939d3ae93be294e0e92 Mon Sep 17 00:00:00 2001 From: Alain Schneble Date: Sun, 9 Oct 2016 20:46:58 +0200 Subject: [PATCH] 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. --- lisp/gnus/message.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index ed0422c..19a777f 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4807,9 +4807,11 @@ message-multi-smtp-send-mail (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 (< 0 port) port service)) + (smtpmail-smtp-user (or (nth 3 method) smtpmail-smtp-user))) (message-smtpmail-send-it))) (t (error "Unknown method %s" method)))))) -- 2.9.1