From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/58382 Path: main.gmane.org!not-for-mail From: Jari Aalto Newsgroups: gmane.emacs.gnus.general Subject: [patch] message.el - more safe message-send-mail-function Date: Fri, 3 Sep 2004 00:08:45 +0300 Sender: ding-owner@lists.math.uh.edu Message-ID: <20040902210845.QLDS14814.fep19-app.kolumbus.fi@W2KPICASSO> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1094159568 27195 80.91.224.253 (2 Sep 2004 21:12:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 2 Sep 2004 21:12:48 +0000 (UTC) Original-X-From: ding-owner+M6924@lists.math.uh.edu Thu Sep 02 23:12:40 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C2ysq-00068R-00 for ; Thu, 02 Sep 2004 23:12:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1C2ypH-0000mV-00; Thu, 02 Sep 2004 16:08:59 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1C2ypA-0000mP-00 for ding@lists.math.uh.edu; Thu, 02 Sep 2004 16:08:52 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1C2yp8-00089j-Jj for ding@lists.math.uh.edu; Thu, 02 Sep 2004 16:08:50 -0500 Original-Received: from fep19-app.kolumbus.fi (fep19-0.kolumbus.fi [193.229.0.45]) by justine.libertine.org (Postfix) with ESMTP id DE1D63A0056 for ; Thu, 2 Sep 2004 16:08:47 -0500 (CDT) Original-Received: from W2KPICASSO ([81.197.3.110]) by fep19-app.kolumbus.fi with ESMTP id <20040902210845.QLDS14814.fep19-app.kolumbus.fi@W2KPICASSO> for ; Fri, 3 Sep 2004 00:08:45 +0300 Original-To: Gnus-L Mail-Copies-To: poster Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:58382 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:58382 The patch is against CVS. Win32 Emacs does not come woth program "fakemail" which is set in path.el as default value for `sendmail-program'. The following will use more sensible default. 2004-09-02 Jari Aalto * message.el (message-send-mail-function): Check existence of sendmail-program first before using default value `message-send-mail-with-sendmail'. Oterwise use more generic `smtpmail-send-it'. Index: message.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/message.el,v retrieving revision 7.41 diff -u -IId: -b -w -u -r7.41 message.el --- message.el 22 Aug 2004 22:06:18 -0000 7.41 +++ message.el 2 Sep 2004 20:32:01 -0000 @@ -560,7 +560,20 @@ ;; Useful to set in site-init.el ;;;###autoload -(defcustom message-send-mail-function 'message-send-mail-with-sendmail +(defcustom message-send-mail-function + (let ((program (if (boundp 'sendmail-program) + ;; see paths.el + sendmail-program))) + (cond + ((and program + (string-match "/" program) ;; Skip path + (file-executable-p program)) + 'message-send-mail-with-sendmail) + ((and program + (executable-find program)) + 'message-send-mail-with-sendmail) + (t + 'smtpmail-send-it))) "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'. @@ -1557,9 +1570,6 @@ (autoload 'rmail-msg-restore-non-pruned-header "rmail") (autoload 'rmail-output "rmailout")) -(eval-when-compile - (autoload 'sha1 "sha1-el")) - ;;; @@ -3860,7 +3870,7 @@ (save-excursion (set-buffer errbuf) (goto-char (point-min)) - (while (re-search-forward "\n\n* *" nil t) + (while (re-search-forward "\n+ *" nil t) (replace-match "; ")) (if (not (zerop (buffer-size))) (error "Sending...failed to %s" @@ -3942,7 +3952,7 @@ (defun message-canlock-generate () "Return a string that is non-trivial to guess. Do not use this for anything important, it is cryptographically weak." - (require 'sha1-el) + (require 'sha1) (let (sha1-maximum-internal-length) (sha1 (concat (message-unique-id) (format "%x%x%x" (random) (random t) (random)) @@ -5194,7 +5204,7 @@ (when (looking-at "[ \t]*$") (message-delete-line)) (goto-char begin) - (re-search-forward ":" nil t) + (search-forward ":" nil t) (when (looking-at "\n[ \t]+") (replace-match " " t t)) (goto-char (point-max)))) @@ -6493,7 +6503,7 @@ (let ((end1 (make-marker))) (move-marker end1 (max start end)) (goto-char (min start end)) - (while (re-search-forward "\b" end1 t) + (while (search-forward "\b" end1 t) (if (eq (char-after) (char-after (- (point) 2))) (delete-char -2))))))