From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alain Schneble Newsgroups: gmane.emacs.bugs Subject: bug#24653: 25.1.50; Gnus; X-Message-SMTP-Method header does not support port number as advertised Date: Sun, 9 Oct 2016 21:00:18 +0200 Message-ID: <86oa2twdod.fsf@realize.ch> References: <86shs5wem3.fsf@realize.ch> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1476039697 17055 195.159.176.226 (9 Oct 2016 19:01:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Oct 2016 19:01:37 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (windows-nt) To: <24653@debbugs.gnu.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 09 21:01:32 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btJLY-0001cJ-FC for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Oct 2016 21:01:16 +0200 Original-Received: from localhost ([::1]:45285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btJLW-00051W-MS for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Oct 2016 15:01:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btJLP-00051C-2f for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 15:01:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btJLK-0005R0-Qr for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 15:01:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btJLK-0005Qh-NC for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 15:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1btJLK-0001nq-Cm for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 15:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alain Schneble Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Oct 2016 19:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24653 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24653-submit@debbugs.gnu.org id=B24653.14760396486894 (code B ref 24653); Sun, 09 Oct 2016 19:01:02 +0000 Original-Received: (at 24653) by debbugs.gnu.org; 9 Oct 2016 19:00:48 +0000 Original-Received: from localhost ([127.0.0.1]:50228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btJL5-0001n7-M5 for submit@debbugs.gnu.org; Sun, 09 Oct 2016 15:00:48 -0400 Original-Received: from clientmail.realize.ch ([46.140.89.53]:4001) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btJL3-0001mq-Lx for 24653@debbugs.gnu.org; Sun, 09 Oct 2016 15:00:46 -0400 Original-Received: from rintintin.hq.realize.ch.lan.rit (Unknown [192.168.0.105]) by clientmail.realize.ch with ESMTP ; Sun, 9 Oct 2016 21:00:30 +0200 Original-Received: from myngb (192.168.66.64) by rintintin.hq.realize.ch.lan.rit (192.168.0.105) with Microsoft SMTP Server (TLS) id 15.0.516.32; Sun, 9 Oct 2016 21:00:22 +0200 In-Reply-To: <86shs5wem3.fsf@realize.ch> (Alain Schneble's message of "Sun, 9 Oct 2016 20:40:04 +0200") X-ClientProxiedBy: rintintin.hq.realize.ch.lan.rit (192.168.0.105) To rintintin.hq.realize.ch.lan.rit (192.168.0.105) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124279 Archived-At: --=-=-= Content-Type: text/plain Tags: patch Here is a patch supposed to solve this issue. Thanks. Alain --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename="0001-Support-port-number-in-Gnus-X-Message-SMTP-Method-he.patch" Content-Description: Support port number in Gnus X-Message-SMTP-Method header >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 --=-=-= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Alain Schneble writes: > Gnus X-Message-SMTP-Method header does not support a port number in its > value even though this is described in the manual. This special header > can be used to specify an alternative email server to which the message > should be sent. It works properly when supplying a service name like > smtp, but not with a service port number. > > Recipe: > - emacs -Q > - eval: > (defun test-message-send-hook () > (message-add-header "X-Message-SMTP-Method: smtp smtp.fsf.org 587")) > (add-hook 'message-send-hook 'test-message-send-hook) > - M-x compose-mail > - Fill in To and Subject headers > - M-x message-send-and-exit > > It terminates with an error: > =3D> Unknown service: 587 > > This scenario should be supported as described in the manual: > > - (info "(message)Mail Variables") > See description of =A1=AEmessage-send-mail-function=A1=AF about =A1=AEs= mtpmail=A1=AF: >=20=20=20 > =A1=AEsmtpmail=A1=AF > > X-Message-SMTP-Method: smtp smtp.fsf.org 587 > > This will send the message via =A1=AEsmtp.fsf.org=A1=AF, using = port 587. > > X-Message-SMTP-Method: smtp smtp.fsf.org 587 other-user > > This is the same as the above, but uses =A1=AEother-user=A1=AF = as the > user name when authenticating. This is handy if you have > several SMTP accounts on the same server. > > Alain > > > In GNU Emacs 25.1.50.1 (x86_64-w64-mingw32) > of 2016-09-27 built on MYNGB > Repository revision: bbf1ffd7c74bdf3ea766580788f7f4adb98a47f0 > Windowing system distributor 'Microsoft Corp.', version 10.0.10586 > Configured using: > 'configure --prefix /c/usr/bin/emacs-25.1 --without-imagemagick' > > Configured features: > XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB > TOOLKIT_SCROLL_BARS > > Important settings: > value of $LANG: DES > locale-coding-system: cp1252 > > Major mode: Org > > Minor modes in effect: > org-indent-mode: t > global-git-commit-mode: t > async-bytecomp-package-mode: t > shell-dirtrack-mode: t > diff-auto-refine-mode: t > gdb-many-windows: t > winner-mode: t > icomplete-mode: t > show-paren-mode: t > display-time-mode: t > display-battery-mode: t > tooltip-mode: t > global-eldoc-mode: t > electric-indent-mode: t > mouse-wheel-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > blink-cursor-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > column-number-mode: t > line-number-mode: t > transient-mark-mode: t > > Recent messages: > kmacro-call-macro: No kbd macro has been defined > C-x C-g is undefined > Quit > Type "q" in help window to restore its previous buffer. [2 times] > Auto-saving...done > Saving file c:/data/private/git/Emacs.org... > Wrote c:/data/private/git/Emacs.org > Mark set > Auto-saving...done > Auto-saving...done > > Features: > (shadow sort mail-extr emacsbug debug apropos org-indent org-element > org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view subr-x > jka-compr image-mode org-bibtex bibtex org-bbdb org-w3m bongo > lastfm-submit smtpmail sendmail thingatpt eieio-opt speedbar sb-image > ezimage dframe ace-window ace-jump-mode cl ssh-agency magit-blame > magit-stash magit-bisect magit-remote magit-commit magit-sequence magit > magit-apply magit-wip magit-log magit-diff smerge-mode magit-core > magit-process magit-popup magit-mode magit-git crm magit-section > magit-utils git-commit log-edit message rfc822 mml mml-sec epg mm-decode > mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums > mailabbrev gmm-utils mailheader pcvs-util add-log with-editor > async-bytecomp async tramp-sh tramp tramp-compat auth-source > password-cache tramp-loaddefs trampver ucs-normalize shell advice dash > misearch multi-isearch dired-aux dired vc-git diff-mode cc-mode cc-fonts > cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs > cl-seq gdb-mi bindat json map gud linum paredit winner ob-ditaa > ob-gnuplot org org-macro org-footnote org-pcomplete pcomplete org-list > org-faces org-entities noutline outline easy-mmode org-version > ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys > ob-comint comint ansi-color ring ob-core ob-eval org-compat org-macs > org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs > warnings server ido icomplete sanityinc-tomorrow-night-theme > sanityinc-tomorrow-bright-theme color-theme-sanityinc-tomorrow paren > gnus gnus-ems nnheader gnus-util mail-utils mm-util help-fns mail-prsvr > wid-edit time battery cus-start cus-load finder-inf ac-js2-autoloads > ace-window-autoloads ace-jump-mode-autoloads bongo-autoloads > color-theme-sanityinc-tomorrow-autoloads company-autoloads > emms-autoloads expand-region-autoloads gnuplot-autoloads > gnuplot-mode-autoloads google-this-autoloads js2-refactor-autoloads > json-mode-autoloads json-reformat-autoloads json-snatcher-autoloads > eieio eieio-core cl-macs multiple-cursors-autoloads > auto-complete-autoloads flycheck-autoloads paredit-autoloads > pkg-info-autoloads epl-autoloads popup-autoloads s-autoloads > skewer-mode-autoloads js2-mode-autoloads simple-httpd-autoloads > solarized-theme-autoloads spacegray-theme-autoloads swift-mode-autoloads > info yasnippet-autoloads zenburn-theme-autoloads package epg-config seq > byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv > edmacro kmacro cl-loaddefs pcase cl-lib time-date mule-util tooltip > eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel > dos-w32 ls-lisp disp-table w32-win w32-vars term/common-win tool-bar dnd > fontset image regexp-opt fringe tabulated-list newcomment elisp-mode > lisp-mode prog-mode register page menu-bar rfn-eshadow timer select > scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame > cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai > tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian > slovak czech european ethiopic indian cyrillic chinese charscript > case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer > cl-preloaded nadvice loaddefs button faces cus-face macroexp files > text-properties overlay sha1 md5 base64 format env code-pages mule > custom widget hashtable-print-readable backquote w32notify w32 multi-tty > make-network-process emacs) > > Memory information: > ((conses 16 579416 81602) > (symbols 56 45654 0) > (miscs 48 1666 705) > (strings 32 114550 13852) > (string-bytes 1 3347364) > (vectors 16 67967) > (vector-slots 8 1750918 177142) > (floats 8 434 233) > (intervals 56 14576 548) > (buffers 976 175)) --=-=-=--