From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65069 Path: news.gmane.org!not-for-mail From: Wolfram Fenske Newsgroups: gmane.emacs.gnus.general Subject: Re: The return of starttls doesn't work in smtpmail Date: Sun, 19 Aug 2007 23:17:35 +0200 Message-ID: <86hcmvcjgw.fsf@hondo.cadr.de> References: <86d4xmyk77.fsf@hondo.cadr.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1187558322 30615 80.91.229.12 (19 Aug 2007 21:18:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 19 Aug 2007 21:18:42 +0000 (UTC) Cc: simon@josefsson.org To: ding@gnus.org Original-X-From: ding-owner+M13579@lists.math.uh.edu Sun Aug 19 23:18:38 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1IMsAQ-0003ci-0S for ding-account@gmane.org; Sun, 19 Aug 2007 23:18:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1IMs9Z-00073O-Jp; Sun, 19 Aug 2007 16:17:45 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IMs9X-000735-JG for ding@lists.math.uh.edu; Sun, 19 Aug 2007 16:17:43 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IMs9V-00029y-Gw for ding@lists.math.uh.edu; Sun, 19 Aug 2007 16:17:43 -0500 Original-Received: from mail.uni-magdeburg.de ([141.44.1.10]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IMs9U-0006dA-00 for ; Sun, 19 Aug 2007 23:17:40 +0200 Original-Received: from sunny.urz.uni-magdeburg.de ([141.44.8.7]) by mail.uni-magdeburg.de with esmtp (EXIM Version 4.62) id 1IMs9S-0000yt-04; Sun, 19 Aug 2007 23:17:39 +0200 Original-Received: from hondo.cadr.de (p54B68E86.dip0.t-ipconnect.de [84.182.142.134]) (authenticated bits=0) by sunny.urz.uni-magdeburg.de (8.12.10/8.12.10) with ESMTP id l7JLHaSr012453 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 19 Aug 2007 23:17:37 +0200 Mail-Followup-To: ding@gnus.org, simon@josefsson.org X-Spam-Score: -4.0 (----) X-Spam-Report: ---- Start SpamAssassin results Content analysis details: (-4.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] 0.4 AWL AWL: From: address is in the auto white-list ---- End of SpamAssassin results X-Scan-Signature: bcea78e0c83c9361ffc318aa673ddd2b X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65069 Archived-At: Reiner Steib writes: > On Fri, Aug 17 2007, Wolfram Fenske wrote: > >> According to >> , >> smptmail.el still isn't fixed. > > ,----[ contrib/README ] > | sendmail.el > | smtpmail.el > | > | Copies of the corresponding files from the Emacs lisp/mail/ > | directory, to provide features (occasionally) needed by Gnus which > | may not be provided by the versions of these files in older Emacs > | distributions. XEmacs users should NOT use this, since it doesn't > | work. See the XEmacs mail-lib module instead. > `---- > > In contrib/smtpmail.el we even have: > > ;; This version of `smtpmail.el' should only be used with Emacs 21. > (if (featurep 'xemacs) > (error "Please use `smtpmail.el' from the mail-lib package.") > (when (>= emacs-major-version 22) > (error "Please use `smtpmail.el' bundled with Emacs."))) > > So it should be fixed in XEmacs or the smtpmail.el file in XEmacs > mail-lib package. Thanks for the pointer. However, it's not fixed in the XEmacs mail-lib module, either (see ). In fact, I *am* using the version from the XEmacs sumo-mule package collection, version 2007-04-27. I didn't realize there were two "sort of current" versions of smptmail.el. So I guess I should contact the package maintainer, which would be Simon Joseffson. >> ;;; XEmacs and older Emacs might not have `with-no-warnings' >> (unless (fboundp 'with-no-warnings) >> ;; Taken from Emacs' byte-run.el >> (defun with-no-warnings (&rest body) >> "Like `progn', but prevents compiler warnings in the body." >> ;; The implementation for the interpreter is basically trivial. >> (car (last body)))) > > This is a bad idea. > > ,----[ (info "(elisp)Coding Conventions") ] > | * If a package needs to define an alias or a new function for > | compatibility with some other version of Emacs, name it with the > | package prefix, not with the raw name with which it occurs in the > | other version. Here is an example from Gnus, which provides many > | examples of such compatibility issues. > | > | (defalias 'gnus-point-at-bol > | (if (fboundp 'point-at-bol) > | 'point-at-bol > | 'line-beginning-position)) > `---- Would this be better? --8<---------------cut here---------------start------------->8--- ;;; XEmacs and older Emacs might not have `with-no-warnings' (if (fboundp 'with-no-warnings) (defalias 'gnus-with-no-warnings 'with-no-warnings) ;; Taken from Emacs' byte-run.el (defun gnus-with-no-warnings (&rest body) "Like `progn', but prevents compiler warnings in the body." ;; The implementation for the interpreter is basically trivial. (car (last body)))) --8<---------------cut here---------------end--------------->8--- In any case, I think the specific piece code that caused my headaches is problematic because the "condtition-case" form simply swallows all errors (from "smtpmail-open-stream"): --8<---------------cut here---------------start------------->8--- ... (if (null (and cred (condition-case () (with-no-warnings (require 'starttls) (call-process (if starttls-use-gnutls starttls-gnutls-program starttls-program))) (error nil)))) ;; The normal case. (open-network-stream "SMTP" process-buffer host port) ... --8<---------------cut here---------------end--------------->8--- If there really isn't a more specific kind of error it could catch, then the "condition-case" should at least contain as few forms as possible. Otherwise real bugs like unbound functions (say, "with-no-warnings") might go unnoticed. -- Wolfram Fenske A: Yes. >Q: Are you sure? >>A: Because it reverses the logical flow of conversation. >>>Q: Why is top posting frowned upon?