From unknown Fri Sep 12 04:34:01 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#38066 <38066@debbugs.gnu.org> To: bug#38066 <38066@debbugs.gnu.org> Subject: Status: 26.1; X-Message-SMTP-Method header does not affect smtpmail-stream-type Reply-To: bug#38066 <38066@debbugs.gnu.org> Date: Fri, 12 Sep 2025 11:34:01 +0000 retitle 38066 26.1; X-Message-SMTP-Method header does not affect smtpmail-s= tream-type reassign 38066 emacs submitter 38066 Ryan Tate severity 38066 normal tag 38066 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 04 23:48:33 2019 Received: (at submit) by debbugs.gnu.org; 5 Nov 2019 04:48:34 +0000 Received: from localhost ([127.0.0.1]:37807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iRqld-0002cg-8q for submit@debbugs.gnu.org; Mon, 04 Nov 2019 23:48:33 -0500 Received: from lists.gnu.org ([209.51.188.17]:57836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iRqjG-0002Yn-Uw for submit@debbugs.gnu.org; Mon, 04 Nov 2019 23:46:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59005) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRqjE-0001iK-Q1 for bug-gnu-emacs@gnu.org; Mon, 04 Nov 2019 23:46:06 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRqjC-00022o-PN for bug-gnu-emacs@gnu.org; Mon, 04 Nov 2019 23:46:04 -0500 Received: from helm.ryantate.com ([52.37.201.218]:46066) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iRqjC-00022T-93 for bug-gnu-emacs@gnu.org; Mon, 04 Nov 2019 23:46:02 -0500 From: Ryan Tate DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ryantate.com; s=mail; t=1572929158; bh=Dat+12EzitIdblu65XX5/8zdRuGTfYZ64itJNjreJRw=; h=From:To:Subject:Date; b=CZI2a9HGpy7utm1+5rhrdqAaj04PR1hP8mdefXzMhqNmDrt0klL5zWW6Xe4+c+lxZ NNJ4w5uPtuh6lFZn2AS/037lhI5rBB8SgQdBuoV9nw5WF5Ies1F3FaoSDOpjYfLtRh sgo/Bt1siKpsZefOX0jJqGv1bW0G27TpMx+qSxKk= To: bug-gnu-emacs@gnu.org Subject: 26.1; X-Message-SMTP-Method header does not affect smtpmail-stream-type Date: Mon, 04 Nov 2019 23:45:52 -0500 Message-ID: <87ftj3j5hb.fsf@disp2634> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 52.37.201.218 X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 04 Nov 2019 23:48:31 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) The internal emacs mail header X-Message-SMTP-Method is described in section 3.3 of the manual as a way to get "some messages to go via one mail server, and other messages to go through another." Both examples given show that this header can be used to communicate a method, server name, and port. https://www.gnu.org/software/emacs/manual/html_node/message/Mail-Variables.html However, emacs, in particular gnus/message.el when sending through smtpmail.el, fails to adjust the variable smtpmail-smtp-stream type to match the port. So, for example, if a user selects port 465, the connection will fail as this is the port for SMTP connections with TLS. Port 587 will happen to work as this is the port for SMTP with STARTTLS, and STARTTLS upgrades can happen in a plain stream type (the smtpmail default). But emacs will not (and does not provide an option to) force STARTTLS when port 587 is specified as would occur if 'ssl were supplied as the value for smtpmail-stream-type. This provides an avenue under which encryption may be silently dropped. There is no warning in the manual that port 465 will not function as expected using the X-Message-SMTP-Method header. There is also no mechanism through which a stream may be user specified via the X-Message-SMTP-Method header. I believe the ideal solution here is for emacs to either auto-associate ports with their usual stream types (465->'ssl, 587->'starttls, 25->nil) or provide a mechanism for stream type to be specified in the header as the fifth value (after method, machine, port, alt username). Or auto-associate by default and provide a config variable through which to override stream type by machine and port. Personally I am working around this with the following hook. (Due to changes to emacs in subsequent versions, it needs to work with both strings and numbers as the port): (defun set-smtpmail-stream-type-from-port () (when (or (equal smtpmail-smtp-service "465") (equal smtpmail-smtp-service 465)) (setq smtpmail-stream-type 'ssl)) (when (or (equal smtpmail-smtp-service "587") (equal smtpmail-smtp-service 587)) (setq smtpmail-stream-type 'starttls)) (when (or (equal smtpmail-smtp-service "25") (equal smtpmail-smtp-service 25)) (setq smtpmail-stream-type nil)) ) (add-hook 'message-send-mail-hook #'set-smtpmail-stream-type-from-port) In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.4) of 2019-02-03, modified by Debian built on zam904 Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description: Debian GNU/Linux 10 (buster) Recent messages: Loading /etc/emacs/site-start.d/50autoconf.el (source)...done Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)... Loading debian-ispell... Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done Loading debian-ispell...done Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. Mark set [4 times] Auto-saving...done Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-26.1+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Message[Notmuch] Minor modes in effect: diff-auto-refine-mode: t mml-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-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 line-number-mode: t auto-fill-function: message-do-auto-fill transient-mark-mode: t abbrev-mode: t Load-path shadows: /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-show hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-show /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-jump hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-jump /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-crypto hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-crypto /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/coolj hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/coolj /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-draft hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-draft /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-compat hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-compat /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-autoloads hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-autoloads /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-company hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-company /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-query hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-query /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-hello hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-hello /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-message hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-message /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/make-deps hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/make-deps /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-address hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-address /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-parser hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-parser /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-print hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-print /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-tag hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-tag /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-lib hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-lib /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-wash hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-wash /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-maildir-fcc hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-maildir-fcc /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-pkg hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-pkg /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-tree hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-tree /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-version hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-version /usr/share/emacs/site-lisp/elpa/notmuch-0.28.4/notmuch-mua hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.28.4/notmuch-mua Features: (shadow emacsbug sendmail sort gnus-alias mail-extr notmuch hl-line notmuch-message notmuch-hello wid-edit notmuch-tree notmuch-show notmuch-print notmuch-crypto notmuch-mua notmuch-draft notmuch-maildir-fcc notmuch-address notmuch-company notmuch-parser notmuch-wash diff-mode easy-mmode coolj notmuch-query goto-addr thingatpt icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs notmuch-tag edmacro kmacro crm notmuch-lib advice notmuch-version notmuch-compat cl message rmc puny dired dired-loaddefs format-spec rfc822 mml mailabbrev gmm-utils mailheader mm-view mml-smime mml-sec epa derived epg gnus-util rmail rmail-loaddefs mail-utils smime dig mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr elec-pair finder-inf info package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors 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 composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray 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 dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 260049 19820) (symbols 48 29943 6) (miscs 40 184 580) (strings 32 83885 3752) (string-bytes 1 2093686) (vectors 16 25869) (vector-slots 8 656309 21192) (floats 8 58 202) (intervals 56 493 19) (buffers 992 14)) From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 05 05:18:32 2019 Received: (at 38066) by debbugs.gnu.org; 5 Nov 2019 10:18:32 +0000 Received: from localhost ([127.0.0.1]:37911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iRvuy-00073m-0B for submit@debbugs.gnu.org; Tue, 05 Nov 2019 05:18:32 -0500 Received: from mail-wm1-f42.google.com ([209.85.128.42]:33812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iRvuv-00073V-Km for 38066@debbugs.gnu.org; Tue, 05 Nov 2019 05:18:30 -0500 Received: by mail-wm1-f42.google.com with SMTP id v3so16126454wmh.1 for <38066@debbugs.gnu.org>; Tue, 05 Nov 2019 02:18:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=sLwd5Dko4BfB9k8GWsdcf8MEYF6avi8JHHtmz75QaVY=; b=PsD4k3nDhEQrzyPcL6a6hgZD0MTop7PpCW9E4CEeuKBepL+beff+5KfDteQpFhbSGO YR36+hfHEc/sy/c7sUA+wcrchGHQznMPpxnAq+55jbSnfa1rgAQoFuBq/mePXqrJLG/E pulkjxtRuVa7QFDHZPP3JDRJfZiKt0X6GGkIbJoPbZ0iD2KR3OrBWrh7OarVcY4rUion F//cVvb0PcIXQaWfWLY48f3tLlApzjqz+S4cgkgUIR3ktVtQ/LLOusN0DCJ3nJCEdFX0 /Ujuz8XiKpTS5xseY6WIwFlnlMBE0JgY5XYA3OE/2b38h9VtNr5q11wB2YP6JKbtldnm wTqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=sLwd5Dko4BfB9k8GWsdcf8MEYF6avi8JHHtmz75QaVY=; b=AZ3doQdAREKxeyEC1tuPg2hKoqbK3d6DQuHl5Rg9K9HXHDjS4lsKX/P0WoVftqjB8H clPWvnejtySbvlAYS3PxO20PsTksPnmAL5RGK2SxPTsTGPLF48YqbubFE6skJ9/FlUoO 1NZVRKKek6ogkIVumHB1uDTd3oWSmAbhUM26k4KJ3NyAHAiRR8ZL2Hnkc4DA+c7Bdd3j S8T1NoXI4DQ7mApEdG+NOfxh6Y06A/F9kp2ruywf5YRg8gEnm+MK7JxajoeCu9r2GBVB RrAZOtDKosPdsW2uSab+VvvVXBPHVyTYSv5tOZXltINrtPcmZ2Kl4dOr2Ylr57yT+XoO 31IA== X-Gm-Message-State: APjAAAXfGYQNjipZ2RdFg5+2iedoiv5x2hJUQPEr+InOQV0TbgrvNy2O Ou7oi0zc3pGFo3KrsdAqsNvNkbhh X-Google-Smtp-Source: APXvYqx9vTiD35OfHS4jvU3EnNf2mDVY1pZC7F6ciM7uvPRsNUS8FpcUjgRsbxwNqJ+FuSsRysvqVA== X-Received: by 2002:a1c:1d10:: with SMTP id d16mr3679684wmd.14.1572949103187; Tue, 05 Nov 2019 02:18:23 -0800 (PST) Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id s21sm1089246wmh.28.2019.11.05.02.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 02:18:22 -0800 (PST) From: Robert Pluim To: Ryan Tate Subject: Re: bug#38066: 26.1; X-Message-SMTP-Method header does not affect smtpmail-stream-type References: <87ftj3j5hb.fsf@disp2634> X-Debbugs-No-Ack: yes Mail-Copies-To: never Gmane-Reply-To-List: yes Date: Tue, 05 Nov 2019 11:18:21 +0100 In-Reply-To: <87ftj3j5hb.fsf@disp2634> (Ryan Tate via's message of "Mon, 04 Nov 2019 23:45:52 -0500") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38066 Cc: 38066@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Mon, 04 Nov 2019 23:45:52 -0500, Ryan Tate said: Ryan> I believe the ideal solution here is for emacs to either auto-ass= ociate Ryan> ports with their usual stream types (465->'ssl, 587->'starttls, 2= 5->nil) Ryan> or provide a mechanism for stream type to be specified in the hea= der as Ryan> the fifth value (after method, machine, port, alt username). Or Ryan> auto-associate by default and provide a config variable through w= hich to Ryan> override stream type by machine and port. I=CA=BCm not so sure about the auto association. How about we allow people to ask for auto-detection? Something like the following (and then we can discuss whether to turn it on by default, and I can argue that STARTTLS is evil and we should force everyone to use 465 :-) ) Alternatively we could put this kind of code in open-network-stream, to allow other protocols to benefit from the same kind of detection. diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 9cf28fbe8a..75b15a99aa 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -98,11 +98,13 @@ smtpmail-stream-type "Type of SMTP connections to use. This may be either nil (upgrade with STARTTLS if possible), `starttls' (refuse to send if STARTTLS isn't available), -`plain' (never use STARTTLS), or `ssl' (to use TLS/SSL)." - :version "24.1" +`plain' (never use STARTTLS), or `ssl' (to use TLS/SSL), or +`auto' to derive the stream-type from the port number." + :version "27.1" :type '(choice (const :tag "Possibly upgrade to STARTTLS" nil) (const :tag "Always use STARTTLS" starttls) (const :tag "Never use STARTTLS" plain) + (const :tag "Derive from port number" auto) (const :tag "Use TLS/SSL" ssl))) =20 (defcustom smtpmail-sendto-domain nil @@ -666,6 +668,16 @@ smtpmail-user-mail-address (string-match "\\." (cadr parts)) user-mail-address)))) =20 +(defun smtpmail-derive-stream-type (stream-type port) + (if (equal stream-type 'auto) + (cdr (assoc port '((465 . ssl) + ("465" . ssl) + (587 . starttls) + ("587" . starttls) + (25 . nil) + ("25" . nil)))) + stream-type)) + (defun smtpmail-via-smtp (recipient smtpmail-text-buffer &optional ask-for-password send-attempts) @@ -712,7 +724,9 @@ smtpmail-via-smtp ;; FIXME: Should we use raw-text-dos coding system to handle the= r\n ;; for us? (let ((coding-system-for-read 'binary) - (coding-system-for-write 'binary)) + (coding-system-for-write 'binary) + (smtpmail-stream-type + (smtpmail-derive-stream-type smtpmail-stream-type port))) (setq result (open-network-stream "smtpmail" process-buffer host port From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 05 12:24:27 2019 Received: (at 38066) by debbugs.gnu.org; 5 Nov 2019 17:24:27 +0000 Received: from localhost ([127.0.0.1]:39023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS2Z8-0003oQ-O9 for submit@debbugs.gnu.org; Tue, 05 Nov 2019 12:24:27 -0500 Received: from mail-wr1-f46.google.com ([209.85.221.46]:41282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS2Z7-0003oC-A0 for 38066@debbugs.gnu.org; Tue, 05 Nov 2019 12:24:25 -0500 Received: by mail-wr1-f46.google.com with SMTP id p4so22360160wrm.8 for <38066@debbugs.gnu.org>; Tue, 05 Nov 2019 09:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=rMJD/lqq+E2N6U2pE4CbG2mdnVVsV/6CXnK7FDjcthY=; b=bCk7VBHlfnyYfpr3TUPIYUI2tx4Rcs2jEJumsAakom7L+enVxibRRmX58BpG0Woeu/ Uz9K9Zmy7VYw6DImfG9p3FEOt2lGUubYHtcQ9kt7PUO4/vPRpNGzlXOY3Cpy6NVicNl/ cKlw93KQo0V4rJKWPkawMug+wRx7yuYoAufOikfnrFBcj2wRwYAk2jvUghCCBft9fQnb 7KCYRUJIbbxNcXz3bMUqUk81MS0nL9oYsSXsqV+tXJ0sYZk8RrPugDZDrvxAT1v0VYmM Aa1p/H2d2b7hz8R8w1m5Ionk26fFPD4L8TOQFB3lsT6A9F1pJs5XQ6Idj8vPuffyXvlu RRVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=rMJD/lqq+E2N6U2pE4CbG2mdnVVsV/6CXnK7FDjcthY=; b=GDPDHyhHRZcYfkC/qfhQxCvLgqyAinjjkq2Bmlilu0/huzahBecz9bD96805djD7bn ILyqPI517VSvxUtMqgoI0Nj7ZK4OQx57KOXJw1Rb5Dl5tdqJOzELUFzqexzR/q+nC+F9 F879CfMX017btcU0gv6Rf2wj83vO8uoyRN5pk2f3Hp2zPwb4AEpNaeZPPC09wR+Fi8tL XzNysaOZLweUml9bi3vMkLPAIZZxeIYeSV/GIGtYUScMBFq5ZObzXrnER571zbbVm0vL rjkLOxvIVJVnNm/b3Vb3E1MkyRysfDud439koLBYPWjnwDNEYPoEP79eIVXW/6UH3elX Kr6g== X-Gm-Message-State: APjAAAXvTgeaDY1nJTydxuE3hYlE5SV09wiqlLv3QHqPomm7S++Xuf0x dhcBh9qpxP0i8N7s/IrumYcN+vin X-Google-Smtp-Source: APXvYqz4psm+RLv9SlhfBvV6vfiGTMCMRXcD08ISUxf++GiW3obRgmdIdYGRlH+vuBPLgaHRkjqkvg== X-Received: by 2002:adf:9506:: with SMTP id 6mr12521451wrs.274.1572974658560; Tue, 05 Nov 2019 09:24:18 -0800 (PST) Received: from rpluim-mac ([2a01:e34:ecfc:a860:c514:c07d:445b:e553]) by smtp.gmail.com with ESMTPSA id b17sm106911wrr.37.2019.11.05.09.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 09:24:17 -0800 (PST) From: Robert Pluim To: Ryan Tate Subject: Re: bug#38066: 26.1; X-Message-SMTP-Method header does not affect smtpmail-stream-type References: <87ftj3j5hb.fsf@disp2634> <87o8xqcn8v.fsf@disp2634> Date: Tue, 05 Nov 2019 18:24:16 +0100 In-Reply-To: <87o8xqcn8v.fsf@disp2634> (Ryan Tate's message of "Tue, 05 Nov 2019 11:16:16 -0500") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38066 Cc: 38066@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) (please keep 38066@debbugs.gnu.org in the CC) >>>>> On Tue, 05 Nov 2019 11:16:16 -0500, Ryan Tate = said: >> Alternatively we could put this kind of code in open-network-stream, >> to allow other protocols to benefit from the same kind of detection. Ryan> I don't know enough about the open-network-stream corner of emacs= so won't argue either Ryan> way. At the very least, I think it certainly makes sense with reg= ard to the X-Message-SMTP-Method Ryan> header because this is a convenience feature (so some small amoun= t "magic" Ryan> seems permissable) and there is no existing way to set the stream= type Ryan> here. I imagine it could be useful elsewhere in emacs though. If we do it in the lower layers, then everyone gets to use it, not just people using X-Message-SMTP-Method or smtpmail-stream-type. Ryan> Your patches look good, thank you for writing them! (Do I need to= submit Ryan> them formally as a patch on this list?) No, if they gain traction I can commit them. I took a look at open-network-stream, and it=CA=BCs not too hard to do the equivalent there, although it probably needs to be conditioned on the specified :type being nil rather than unconditionally overriding it. diff --git i/lisp/net/gnutls.el w/lisp/net/gnutls.el index 9b13adaefe..a083e9df6c 100644 --- i/lisp/net/gnutls.el +++ w/lisp/net/gnutls.el @@ -202,6 +202,7 @@ open-gnutls-stream (process (open-network-stream name buffer host service :nowait nowait + :auto-tls (plist-get parameters :auto-tls) :tls-parameters (and nowait (cons 'gnutls-x509pki diff --git i/lisp/net/network-stream.el w/lisp/net/network-stream.el index 4050c83eb0..8b4bd66ef4 100644 --- i/lisp/net/network-stream.el +++ w/lisp/net/network-stream.el @@ -73,6 +73,35 @@ network-stream-use-client-certificates :type 'boolean :version "27.1") =20 +(defcustom network-stream-auto-tls nil + "Whether to automatically try with TLS for certain port +numbers. See `network-stream-auto-tls-alist' for the default +settings." + :group 'network + :type 'boolean + :version "27.1") + +(defcustom network-stream-auto-tls-alist + '((465 . tls) + (587 . starttls) + (993 . tls)) + "Alist used for mapping ports to TLS usage. +Specifies which port number to map to which TLS behaviour. See +`open-network-stream' for a full explanation of the possible +behaviours." + :group 'network + :type '(alist :key-type integer + :value-type (choice + (const :tag "Possibly upgrade to STARTTLS" ni= l) + (const :tag "Always use STARTTLS" starttls) + (const :tag "Never use STARTTLS" plain) + (const :tag "Use TLS/SSL" tls))) + :version "27.1") + ;;;###autoload (defun open-network-stream (name buffer host service &rest parameters) "Open a TCP connection to HOST, optionally with encryption. @@ -175,7 +204,19 @@ open-network-stream (unless (featurep 'make-network-process) (error "Emacs was compiled without networking support")) (let ((type (plist-get parameters :type)) - (return-list (plist-get parameters :return-list))) + (return-list (plist-get parameters :return-list)) + mapped-type) + (when (and network-stream-auto-tls (not (plist-get parameters :auto-tl= s))) + (setq mapped-type (assoc (if (integerp service) + service + (string-to-number service)) + network-stream-auto-tls-alist)) + (when mapped-type + (setq type (cdr mapped-type) + parameters (plist-put + (plist-put parameters :auto-tls t) + :type (cdr mapped-type))))) + (message "Auto-TLS %s %s" type mapped-type) (if (and (not return-list) (or (eq type 'plain) (and (memq type '(nil network)) From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 05 12:42:46 2019 Received: (at 38066) by debbugs.gnu.org; 5 Nov 2019 17:42:46 +0000 Received: from localhost ([127.0.0.1]:39032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS2qs-0004IU-A1 for submit@debbugs.gnu.org; Tue, 05 Nov 2019 12:42:46 -0500 Received: from quimby.gnus.org ([80.91.231.51]:54340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS2qq-0004IJ-0I for 38066@debbugs.gnu.org; Tue, 05 Nov 2019 12:42:45 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iS2ql-0005AM-UI; Tue, 05 Nov 2019 18:42:42 +0100 From: Lars Ingebrigtsen To: Robert Pluim Subject: Re: bug#38066: 26.1; X-Message-SMTP-Method header does not affect smtpmail-stream-type References: <87ftj3j5hb.fsf@disp2634> <87o8xqcn8v.fsf@disp2634> Date: Tue, 05 Nov 2019 18:42:39 +0100 In-Reply-To: (Robert Pluim's message of "Tue, 05 Nov 2019 18:24:16 +0100") Message-ID: <87r22m8bjk.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Robert Pluim writes: > +(defcustom network-stream-auto-tls-alist > + '((465 . tls) > + (587 . starttls) > + (993 . tls)) I'm not sure I understand the rationale hre. 465 is defined as a TLS port, so that's what Emacs should talk on that port. It's like port 443 -- it's also TLS. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38066 Cc: 38066@debbugs.gnu.org, Ryan Tate X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Robert Pluim writes: > +(defcustom network-stream-auto-tls-alist > + '((465 . tls) > + (587 . starttls) > + (993 . tls)) I'm not sure I understand the rationale hre. 465 is defined as a TLS port, so that's what Emacs should talk on that port. It's like port 443 -- it's also TLS. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 05 12:53:42 2019 Received: (at 38066) by debbugs.gnu.org; 5 Nov 2019 17:53:42 +0000 Received: from localhost ([127.0.0.1]:39041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS31S-0004bu-0n for submit@debbugs.gnu.org; Tue, 05 Nov 2019 12:53:42 -0500 Received: from mail-wr1-f47.google.com ([209.85.221.47]:41232) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS31Q-0004bh-So for 38066@debbugs.gnu.org; Tue, 05 Nov 2019 12:53:41 -0500 Received: by mail-wr1-f47.google.com with SMTP id p4so22476975wrm.8 for <38066@debbugs.gnu.org>; Tue, 05 Nov 2019 09:53:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=hVrb6e0QSMar5Fc9w9QsybJQIBdN6RcVRFNQ+ETvRto=; b=d0ibH32kLC4f02DGUXB6nRx/BWZa3XTGJ/6t0VpQscIi2hVK1A3Z1Z8CxxgoyJgHTe x9vE0qbuqvCLlyPjHLSsr+LPMvCKeZUXdVYMmmJGAyvpAotIENLERCz2J2Fmf/2Koexs 2AZNTBexXRHi3+m/D4Iqrof/gCxi24llT0qRoNRLKgvRCHogBfHR+fVJyLYSTyZi0HyB c97o9iHnbG1bTwg2WiuYWLXovlaSHaqNAGVVGr/Wia0P4boty3HyhcbDzk0IjqM2EBqI AcQ1T6cWzKGbTJt5FgzU4mMzB+QBWPnpdfGZ3pK3RGi0A9vvvhbE15ctWO9XIpN2ANNw 2RmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=hVrb6e0QSMar5Fc9w9QsybJQIBdN6RcVRFNQ+ETvRto=; b=Lf3U/OiKWd9zldO2G+L7N1wLrXbiJ4GXoVdNzT9LFq59M/oXmHa2i/AlVXe943HA6k Qz9Wut1Yh8y3WTvlokMGNlPjmkbo0p75n4/ZYA0kkEun0yw3RXPnWHLQIccp1FcWafAc 7XBi6AJKkD84h67wmf73C8+8OJTYlGoHl+/zGB+SRX6VkswPl5bxfwuaCTbnXW9qLfnD XEgxIAqvLAsXlc976LgiDjk0AU9vfF2lHkkIyIIY4HDyDzAQ8TtHr4/9Bj12fAhe5Qfq DGGo1IRL5VvDWlerEyN8VDc/gl+sCv293HXFzwVE3DHkEByDxTmIhiEv8Y7b7/jTuns4 mEJQ== X-Gm-Message-State: APjAAAX1uzzzqpi+PXspDPX2Zmtp8qqQw+Foru9blHIzuMPtKp3Twx61 fKyCgON277BurxCKcQ9KfZ6armxX X-Google-Smtp-Source: APXvYqy+rBRfXRUZVfTElfb+pBMzlmxhAb4Sr8GQcDssEvwER936dch7mWjYeJb95HOjk/O66gGbug== X-Received: by 2002:adf:f607:: with SMTP id t7mr8091175wrp.390.1572976414725; Tue, 05 Nov 2019 09:53:34 -0800 (PST) Received: from rpluim-mac ([2a01:e34:ecfc:a860:c514:c07d:445b:e553]) by smtp.gmail.com with ESMTPSA id w10sm137504wmd.26.2019.11.05.09.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 09:53:34 -0800 (PST) From: Robert Pluim To: Lars Ingebrigtsen Subject: Re: bug#38066: 26.1; X-Message-SMTP-Method header does not affect smtpmail-stream-type References: <87ftj3j5hb.fsf@disp2634> <87o8xqcn8v.fsf@disp2634> <87r22m8bjk.fsf@gnus.org> X-Debbugs-No-Ack: yes Mail-Copies-To: never Gmane-Reply-To-List: yes Date: Tue, 05 Nov 2019 18:53:33 +0100 In-Reply-To: <87r22m8bjk.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 05 Nov 2019 18:42:39 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38066 Cc: 38066@debbugs.gnu.org, Ryan Tate X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Tue, 05 Nov 2019 18:42:39 +0100, Lars Ingebrigtsen said: Lars> Robert Pluim writes: >> +(defcustom network-stream-auto-tls-alist >> + '((465 . tls) >> + (587 . starttls) >> + (993 . tls)) Lars> I'm not sure I understand the rationale hre. 465 is defined as a= TLS Lars> port, so that's what Emacs should talk on that port. It's like p= ort Lars> 443 -- it's also TLS. 465 is just a port. And eg (open-network-stream "google" nil "mail.google.com" 465) will attempt a STARTTLS connection (and incidentally hang my emacs :-)). You can override that by passing in :type tls, but in some situations you can=CA=BCt do that, hence the proposed patch. Unless you=CA=BCre suggesting that we unconditionally use tls for 465/443? That=CA=BCs another option, but it=CA=BCs sure to break someone's setup. Robert From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 05 12:57:23 2019 Received: (at 38066) by debbugs.gnu.org; 5 Nov 2019 17:57:23 +0000 Received: from localhost ([127.0.0.1]:39045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS350-0004iF-Hb for submit@debbugs.gnu.org; Tue, 05 Nov 2019 12:57:22 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:35803) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS34y-0004i6-QE for 38066@debbugs.gnu.org; Tue, 05 Nov 2019 12:57:21 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 476y6l3gRjz1qqlD; Tue, 5 Nov 2019 18:57:19 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 476y6l1wlyz1qqkh; Tue, 5 Nov 2019 18:57:19 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id NAI5PRKcw6x8; Tue, 5 Nov 2019 18:57:18 +0100 (CET) X-Auth-Info: F6iM1yAdpqRCl9H09SoxK5bqN0HnYiyTcKvpi5rNe9FhkLhwTiiFu4NFIqKWjN+7 Received: from igel.home (ppp-46-244-168-100.dynamic.mnet-online.de [46.244.168.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 5 Nov 2019 18:57:18 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id ED09E2C0212; Tue, 5 Nov 2019 18:57:17 +0100 (CET) From: Andreas Schwab To: Robert Pluim Subject: Re: bug#38066: 26.1; X-Message-SMTP-Method header does not affect smtpmail-stream-type References: <87ftj3j5hb.fsf@disp2634> <87o8xqcn8v.fsf@disp2634> X-Yow: Yes, but will I see the EASTER BUNNY in skintight leather at an IRON MAIDEN concert? Date: Tue, 05 Nov 2019 18:57:17 +0100 In-Reply-To: (Robert Pluim's message of "Tue, 05 Nov 2019 18:24:16 +0100") Message-ID: <87pni6fbpe.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 38066 Cc: 38066@debbugs.gnu.org, Ryan Tate X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) On Nov 05 2019, Robert Pluim wrote: > +(defcustom network-stream-auto-tls nil > + "Whether to automatically try with TLS for certain port The first line should be a complete sentence. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 05 13:24:05 2019 Received: (at 38066) by debbugs.gnu.org; 5 Nov 2019 18:24:05 +0000 Received: from localhost ([127.0.0.1]:39061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS3Ur-0005Tv-H8 for submit@debbugs.gnu.org; Tue, 05 Nov 2019 13:24:05 -0500 Received: from quimby.gnus.org ([80.91.231.51]:54806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS3Uo-0005Tb-V4 for 38066@debbugs.gnu.org; Tue, 05 Nov 2019 13:24:04 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iS3Uk-0005RR-Qw; Tue, 05 Nov 2019 19:24:01 +0100 From: Lars Ingebrigtsen To: Ryan Tate Subject: Re: bug#38066: 26.1; X-Message-SMTP-Method header does not affect smtpmail-stream-type References: <87ftj3j5hb.fsf@disp2634> <87o8xqcn8v.fsf@disp2634> <87r22m8bjk.fsf@gnus.org> Date: Tue, 05 Nov 2019 19:23:58 +0100 In-Reply-To: (Robert Pluim's message of "Tue, 05 Nov 2019 18:53:33 +0100") Message-ID: <87muda89mp.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Robert Pluim writes: > Lars> I'm not sure I understand the rationale hre. 465 is defined as a TLS > Lars> port, so that's what Emacs should talk on that port. It's like port > Lars> 443 -- it's also TLS. > > 465 is just a [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38066 Cc: 38066@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Robert Pluim writes: > Lars> I'm not sure I understand the rationale hre. 465 is defined as= a TLS > Lars> port, so that's what Emacs should talk on that port. It's like= port > Lars> 443 -- it's also TLS. > > 465 is just a port. And eg > > (open-network-stream "google" nil "mail.google.com" 465) > > will attempt a STARTTLS connection (and incidentally hang my emacs > :-)). You can override that by passing in :type tls, but in some > situations you can=CA=BCt do that, hence the proposed patch. > > Unless you=CA=BCre suggesting that we unconditionally use tls for 465/443? > That=CA=BCs another option, but it=CA=BCs sure to break someone's setup. 465 is a TLS port in an SMTP context, and 443 is a TLS port in an HTTP context. Outside those contexts, they're not anything in particular, of course. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 05 15:10:10 2019 Received: (at 38066) by debbugs.gnu.org; 5 Nov 2019 20:10:10 +0000 Received: from localhost ([127.0.0.1]:39095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS59W-0008RL-6J for submit@debbugs.gnu.org; Tue, 05 Nov 2019 15:10:10 -0500 Received: from mail-wm1-f49.google.com ([209.85.128.49]:39338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS59T-0008Qu-Ji for 38066@debbugs.gnu.org; Tue, 05 Nov 2019 15:10:08 -0500 Received: by mail-wm1-f49.google.com with SMTP id t26so728326wmi.4 for <38066@debbugs.gnu.org>; Tue, 05 Nov 2019 12:10:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=fIlouw6BgdcgaA3CFNqNu2z/AQYPF7wTg+QaK7GvOI8=; b=tXoSE2r4hSADZslelJZEseWQF73R6TeQ/03gomtiIRUf8OCyeE6dj4odZWoE/sl7oh 6wmrtSrMuzjDclgSz8pf/4u7jQtVGXje8zjDQDnW6EZ9t7zGBVqCG2kGShqHKu1QWwyF W4tQuIaIV9EBGrqDx1mM9Efvmsp32yEZdggOEOFVU3uVY+ZkCcPAlvmtiIZ1eHG339MG ArfJ2WbtLUo9/fc6bFF2qTZgXIShm15zXOZL+WpAKKKHeLBUvO4YAxSHUVfqd3CrOChX KvquKDOgYJhF02UZh95Yf8UbcHLo/ZWdRLOznKlq4eVJ870EtczcLwBUGOm96CVP4/zj T3MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=fIlouw6BgdcgaA3CFNqNu2z/AQYPF7wTg+QaK7GvOI8=; b=KAF2XlCCSGvmFUlSfRIka5aeFIp7e1CTmr8PuBZngXSihE+Ws04mnvBliBZVt8evUF LdQYr1cgU5d+IhMKtg4Zcokvq8T2sCMeRUtI8o97Zwe/8LedvhdWkGuM5tzzM8xodu0b 7hQdVKn4aej/UZ3gC28sY5VNM5zAB2rVmzMywoBkLecSmC9E6g4oiIeyJshcb9e9KIJB nPkqIAjf2hhFASukxd03A/A5uC2po/kVTo+1pWnv1xB8Po46wpwYWLSl9RavQumYHJ4Z +YRSQwGomOdOzVDy5LbE7Kv7bxZW+KsD57zKJhk27/zbVWCj2OlLOoO96CyiDU/Euw+5 6lXQ== X-Gm-Message-State: APjAAAXQD9jt2pFgitdHeRPor2GFNXwuV4nHefX4HbbX/KjmcNaW5MV9 LkwmtxrB9lo4AfuOgrcjGa2lgsAa X-Google-Smtp-Source: APXvYqze2ePrXBmFqa7iq671iO04dQj80QPWDqwFRFk3E/Cb/p3AmlFic42saZlijcXpq7cRB8xPaw== X-Received: by 2002:a1c:dd45:: with SMTP id u66mr693548wmg.12.1572984601284; Tue, 05 Nov 2019 12:10:01 -0800 (PST) Received: from rpluim-mac ([2a01:e34:ecfc:a860:c514:c07d:445b:e553]) by smtp.gmail.com with ESMTPSA id b17sm12684189wru.36.2019.11.05.12.10.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 12:10:00 -0800 (PST) From: Robert Pluim To: Lars Ingebrigtsen Subject: Re: bug#38066: 26.1; X-Message-SMTP-Method header does not affect smtpmail-stream-type References: <87ftj3j5hb.fsf@disp2634> <87o8xqcn8v.fsf@disp2634> <87r22m8bjk.fsf@gnus.org> <87muda89mp.fsf@gnus.org> X-Debbugs-No-Ack: yes Mail-Copies-To: never Gmane-Reply-To-List: yes Date: Tue, 05 Nov 2019 21:09:59 +0100 In-Reply-To: <87muda89mp.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 05 Nov 2019 19:23:58 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38066 Cc: 38066@debbugs.gnu.org, Ryan Tate X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Tue, 05 Nov 2019 19:23:58 +0100, Lars Ingebrigtsen said: Lars> Robert Pluim writes: Lars> I'm not sure I understand the rationale hre. 465 is defined as a= TLS Lars> port, so that's what Emacs should talk on that port. It's like p= ort Lars> 443 -- it's also TLS. >>=20 >> 465 is just a port. And eg >>=20 >> (open-network-stream "google" nil "mail.google.com" 465) >>=20 >> will attempt a STARTTLS connection (and incidentally hang my emacs >> :-)). You can override that by passing in :type tls, but in some >> situations you can=CA=BCt do that, hence the proposed patch. >>=20 >> Unless you=CA=BCre suggesting that we unconditionally use tls for 46= 5/443? >> That=CA=BCs another option, but it=CA=BCs sure to break someone's se= tup. Lars> 465 is a TLS port in an SMTP context, and 443 is a TLS port in an= HTTP Lars> context. Outside those contexts, they're not anything in particu= lar, of Lars> course. So you=CA=BCre suggesting we do autodetection in smtpmail and nnimap only (and probably a few more besides)? Robert From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 08 15:56:43 2019 Received: (at 38066) by debbugs.gnu.org; 8 Nov 2019 20:56:43 +0000 Received: from localhost ([127.0.0.1]:47733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iTBJD-0002Z8-2n for submit@debbugs.gnu.org; Fri, 08 Nov 2019 15:56:43 -0500 Received: from quimby.gnus.org ([80.91.231.51]:53332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iTBJB-0002Yz-56 for 38066@debbugs.gnu.org; Fri, 08 Nov 2019 15:56:41 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iTBJ7-0007Gg-Oe; Fri, 08 Nov 2019 21:56:40 +0100 From: Lars Ingebrigtsen To: Ryan Tate Subject: Re: bug#38066: 26.1; X-Message-SMTP-Method header does not affect smtpmail-stream-type References: <87ftj3j5hb.fsf@disp2634> <87o8xqcn8v.fsf@disp2634> <87r22m8bjk.fsf@gnus.org> <87muda89mp.fsf@gnus.org> Date: Fri, 08 Nov 2019 21:56:37 +0100 In-Reply-To: (Robert Pluim's message of "Tue, 05 Nov 2019 21:09:59 +0100") Message-ID: <87woca3x4q.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Robert Pluim writes: > Lars> 465 is a TLS port in an SMTP context, and 443 is a TLS port > Lars> in an HTTP context. Outside those contexts, they're not > Lars> anything in particular, of course. > > So youʼre suggesting [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38066 Cc: 38066@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Robert Pluim writes: > Lars> 465 is a TLS port in an SMTP context, and 443 is a TLS port > Lars> in an HTTP context. Outside those contexts, they're not > Lars> anything in particular, of course. > > So you=CA=BCre suggesting we do autodetection in smtpmail and nnimap only > (and probably a few more besides)? When smtpmail contacts port 465, it should set the type to 'ssl, yes. (And the same for nnimap and 993.) --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 20 11:05:35 2020 Received: (at 38066) by debbugs.gnu.org; 20 Aug 2020 15:05:35 +0000 Received: from localhost ([127.0.0.1]:43413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8m8E-0005tW-RD for submit@debbugs.gnu.org; Thu, 20 Aug 2020 11:05:35 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8m8D-0005tH-28 for 38066@debbugs.gnu.org; Thu, 20 Aug 2020 11:05:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=cKpKA3LRZXhxnqVAYjV6abmtiz8Rk7gVppo3ElgBwCA=; b=ps+MR89jhi3AlsmWlNzMPqtlZP 8joq8OlL7WQV+lazqwCY9J0yGXCK5jGB3rg0jhKZwD04AIyJGfjB9p86HGEGnNzV2wbLKtCeQXJW1 eFmpMMHS9UqEC6GPLpgFKc0I1eTZ5xx/OFm8WTI6/EgZIKyWvdyDTKXQXXra0Vp1rMO8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8m84-0004p6-4Y; Thu, 20 Aug 2020 17:05:26 +0200 From: Lars Ingebrigtsen To: Ryan Tate Subject: Re: bug#38066: 26.1; X-Message-SMTP-Method header does not affect smtpmail-stream-type References: <87ftj3j5hb.fsf@disp2634> <87o8xqcn8v.fsf@disp2634> <87r22m8bjk.fsf@gnus.org> <87muda89mp.fsf@gnus.org> <87woca3x4q.fsf@gnus.org> X-Now-Playing: Ved Buens Ende...'s _Written in Waters_: "Remembrance of Things Past" Date: Thu, 20 Aug 2020 17:05:22 +0200 In-Reply-To: <87woca3x4q.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 08 Nov 2019 21:56:37 +0100") Message-ID: <87tuwxs6h9.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > Robert Pluim writes: > >> Lars> 465 is a TLS port in an SMTP context, and 443 is a TLS port >> Lars> in an HTTP context. Outside those contexts, they're not >> Lars> anything in p [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38066 Cc: 38066@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > Robert Pluim writes: > >> Lars> 465 is a TLS port in an SMTP context, and 443 is a TLS port >> Lars> in an HTTP context. Outside those contexts, they're not >> Lars> anything in particular, of course. >> >> So you=CA=BCre suggesting we do autodetection in smtpmail and nnimap only >> (and probably a few more besides)? > > When smtpmail contacts port 465, it should set the type to 'ssl, yes. > (And the same for nnimap and 993.) I've now done this on the trunk. I think Robert's suggestion to add more DWIM logic at a lower level is interesting, but I think it makes sense to handle this at a higher (protocol) level -- and I think the Message level is the most flexible. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 20 11:05:42 2020 Received: (at control) by debbugs.gnu.org; 20 Aug 2020 15:05:42 +0000 Received: from localhost ([127.0.0.1]:43416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8m8M-0005tq-3M for submit@debbugs.gnu.org; Thu, 20 Aug 2020 11:05:42 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8m8K-0005td-S9 for control@debbugs.gnu.org; Thu, 20 Aug 2020 11:05:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=nYV2WPCWIYzdpAUuJPmHnnMfR+lyvd3ByJz2Dwo3tls=; b=YXxs7CIfEEmSkT5WdQhNI32zse q3+vcqc2zRbK4aETRR4E8EtbehoGsVfafFzzxLKCJK8SfXa5CJ/qBRwRLqAlaIV1hD69Xhzz0YD2U 9fIQvhH45gRU3fSqz4Wb5StPmKZFEcxiW/HCQ4JIr2w5F3+SrDrryc4/FLg5vgbTNt2w=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8m8D-0004pJ-4x for control@debbugs.gnu.org; Thu, 20 Aug 2020 17:05:35 +0200 Date: Thu, 20 Aug 2020 17:05:31 +0200 Message-Id: <87sgchs6h0.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #38066 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 38066 fixed close 38066 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 38066 fixed close 38066 28.1 quit From unknown Fri Sep 12 04:34:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 18 Sep 2020 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator