From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Default of message-send-mail-function (was: error from new Gnus / sendmail) Date: Tue, 30 Oct 2007 23:55:19 +0100 Message-ID: References: <200710302106.l9UL6Fa1023166@oogie-boogie.ics.uci.edu> Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1193785005 31973 80.91.229.12 (30 Oct 2007 22:56:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Oct 2007 22:56:45 +0000 (UTC) Cc: ding@gnus.org, emacs-devel@gnu.org To: Stefan Monnier , Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 30 23:56:45 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1In00i-0007Gq-2A for ged-emacs-devel@m.gmane.org; Tue, 30 Oct 2007 23:56:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1In00Y-0002Wa-Jj for ged-emacs-devel@m.gmane.org; Tue, 30 Oct 2007 18:56:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1In00Q-0002Ub-PE for emacs-devel@gnu.org; Tue, 30 Oct 2007 18:56:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1In00Q-0002UH-1N for emacs-devel@gnu.org; Tue, 30 Oct 2007 18:56:18 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1In00P-0002UC-Q5 for emacs-devel@gnu.org; Tue, 30 Oct 2007 18:56:17 -0400 Original-Received: from mail.uni-ulm.de ([134.60.1.11]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1In00P-0004Gi-3F for emacs-devel@gnu.org; Tue, 30 Oct 2007 18:56:17 -0400 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.41.37]) by mail.uni-ulm.de (8.14.1/8.14.1) with ESMTP id l9UMuBZV019098; Tue, 30 Oct 2007 23:56:12 +0100 (MET) Original-Received: from localhost (bridgekeeper.physik.uni-ulm.de [134.60.41.37]) by bridgekeeper.physik.uni-ulm.de (Postfix) with ESMTP id 7CD8212C8E; Tue, 30 Oct 2007 23:56:11 +0100 (CET) X-Face: :6KQZ[nyoS_edmB.%gw-=)BYth^|2+Y+^cu%I$FSx!&>-'om>3H7A|M&n(V7fIo3P.; yo.b yq4$p; ZaBtkv)\}biaiBQe"mD}iib1AA@99-fZ7i*bLhNRVC&0Wkxg9)SH?oWc@{ In-Reply-To: <200710302106.l9UL6Fa1023166@oogie-boogie.ics.uci.edu> (Dan Nicolaescu's message of "Tue, 30 Oct 2007 14:06:15 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-DCC-HP_X86_64_8CPU-Metrics: poseidon 1245; Body=4 Fuz1=4 Fuz2=4 X-Virus-Scanned: by amavisd-new X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:82175 gmane.emacs.gnus.general:65498 Archived-At: On Mon, Oct 29 2007, Stefan Monnier wrote: > I needed the following patch to get Emacs to use > message-send-mail-with-sendmail like it used to. Not sure if that's > the right fix. I'm also not sure about this. > +(require 'sendmail) ;So as to define sendmail-program. > ;; Useful to set in site-init.el > (defcustom message-send-mail-function > (let ((program (if (boundp 'sendmail-program) If we require sendmail, there's no point in testing (boundp 'sendmail-program). Additionally, in `message-send-mail-with-sendmail' there are more tests. In March 2006 there was some discussion about this on ding/emacs-devel: . Back then, I suggested: --8<---------------cut here---------------start------------->8--- (defun message-send-mail-function () "Return suitable value for the variable `message-send-mail-function'." (cond ((and sendmail-program (executable-find sendmail-program)) 'message-send-mail-with-sendmail) ((and (locate-library "smtpmail") (require 'smtpmail) smtpmail-default-smtp-server) 'message-smtpmail-send-it) ((locate-library "mailclient") 'message-send-mail-with-mailclient) (t (lambda () (error "Don't know how to send mail. Please customize `message-send-mail-function'."))))) --8<---------------cut here---------------end--------------->8--- Below is a patch (with an earlier version of the function `message-send-mail-function'). I will look at the old messages tomorrow. Unless there's a better suggestion, I'll install something alone these lines. On Tue, Oct 30 2007, Dan Nicolaescu wrote: > Sending... > Sending via mail... > smtpmail-via-smtp: `smtpmail-smtp-server' not defined > > It worked fine before, mail was sent with the local sendmail, I don't > have any special settings. > > Shouldn't this continue to work by default? Yes. I wonder why nobody complained about this before. Bye, Reiner. --8<---------------cut here---------------start------------->8--- Index: message.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/gnus/message.el,v retrieving revision 1.102 diff -u -r1.102 message.el --- message.el 24 Feb 2006 05:02:12 -0000 1.102 +++ message.el 16 Mar 2006 21:09:33 -0000 @@ -48,6 +48,7 @@ (require 'mml) (require 'rfc822) (eval-and-compile + (autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/ (autoload 'gnus-find-method-for-group "gnus") (autoload 'nnvirtual-find-group-art "nnvirtual") (autoload 'gnus-group-decoded-name "gnus-group")) @@ -584,16 +585,37 @@ :link '(custom-manual "(message)Canceling News") :type 'string) +(defun message-send-mail-function () + "Return suitable value for the variable `message-send-mail-function'." + (cond ((and sendmail-program + (executable-find program)) + 'message-send-mail-with-sendmail) + ((and (locate-library "mailclient") + window-system + (memq system-type '(darwin windows-nt))) + 'message-send-mail-with-mailclient) + (t + 'message-smtpmail-send-it))) + +;; Prevent problems with `window-system' not having the correct value +;; when loaddefs.el is loaded. `custom-reevaluate-setting' needs the +;; standard value. +;;;###autoload +(put 'message-send-mail-function 'standard-value + '((message-send-mail-function))) + ;; Useful to set in site-init.el ;;;###autoload -(defcustom message-send-mail-function 'message-send-mail-with-sendmail +(defcustom message-send-mail-function (message-send-mail-function) "Function to call to send the current buffer as mail. The headers should be delimited by a line whose contents match the variable `mail-header-separator'. -Valid values include `message-send-mail-with-sendmail' (the default), +Valid values include `message-send-mail-with-sendmail', `message-send-mail-with-mh', `message-send-mail-with-qmail', -`message-smtpmail-send-it', `smtpmail-send-it' and `feedmail-send-it'. +`message-smtpmail-send-it', `smtpmail-send-it', +`feedmail-send-it' and `message-send-mail-with-mailclient'. The +default is system dependent. See also `send-mail-function'." :type '(radio (function-item message-send-mail-with-sendmail) @@ -602,8 +624,11 @@ (function-item message-smtpmail-send-it) (function-item smtpmail-send-it) (function-item feedmail-send-it) + (function-item message-send-mail-with-mailclient + :tag "Use Mailclient package") (function :tag "Other")) :group 'message-sending + :initialize 'custom-initialize-default :link '(custom-manual "(message)Mail Variables") :group 'message-mail) @@ -3982,6 +4007,13 @@ (run-hooks 'message-send-mail-hook) (smtpmail-send-it)) +(defun message-send-mail-with-mailclient () + "Send the prepared message buffer with `mailclient-send-it'. +This only differs from `smtpmail-send-it' that this command evaluates +`message-send-mail-hook' just before sending a message." + (run-hooks 'message-send-mail-hook) + (mailclient-send-it)) + (defun message-canlock-generate () "Return a string that is non-trivial to guess. Do not use this for anything important, it is cryptographically weak." --8<---------------cut here---------------end--------------->8--- -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/