Gnus development mailing list
 help / color / mirror / Atom feed
From: Daimrod <daimrod@gmail.com>
To: Gnus <ding@gnus.org>
Subject: [PATCH] don't kill err-buffer if `sendmail-send-it' fails
Date: Wed, 27 Feb 2013 20:07:33 +0100	[thread overview]
Message-ID: <87fw0hk22y.fsf@tanger.home> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 222 bytes --]

Hi,

Here is a small patch for `sendmail-send-it' that I've made while I was
trying to understand why I couldn't connect to my imap server.

I've just added a boolean to avoid to kill the error buffer if an error
occurs.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: sendmail-sent-it.patch --]
[-- Type: text/x-diff, Size: 1618 bytes --]

--- old	2013-02-27 19:53:00.000000000 +0100
+++ new	2013-02-27 19:57:03.000000000 +0100
@@ -6,6 +6,7 @@
   (let ((errbuf (if mail-interactive
 		    (generate-new-buffer " sendmail errors")
 		  0))
+        err?
 	(tembuf (generate-new-buffer " sendmail temp"))
 	(multibyte enable-multibyte-characters)
 	(case-fold-search nil)
@@ -170,21 +171,27 @@
 		     (exit-value (apply 'call-process-region args)))
 		(cond ((or (null exit-value) (eq 0 exit-value)))
 		      ((numberp exit-value)
+               (setq err? t)
 		       (error "Sending...failed with exit value %d" exit-value))
 		      ((stringp exit-value)
+               (setq err? t)
 		       (error "Sending...terminated by signal: %s" exit-value))
 		      (t
+               (setq err? t)
 		       (error "SENDMAIL-SEND-IT -- fall through: %S" exit-value))))
-	    (or fcc-was-found
-		(error "No recipients")))
+	    (unless fcc-was-found
+          (setq err? t)
+          (error "No recipients")))
 	  (if mail-interactive
 	      (with-current-buffer errbuf
 		(goto-char (point-min))
 		(while (re-search-forward "\n\n* *" nil t)
 		  (replace-match "; "))
-		(if (not (zerop (buffer-size)))
-		    (error "Sending...failed to %s"
-			   (buffer-substring (point-min) (point-max)))))))
+		(when (not (zerop (buffer-size)))
+          (setq err? t)
+          (error "Sending...failed to %s"
+                 (buffer-substring (point-min) (point-max)))))))
       (kill-buffer tembuf)
-      (if (bufferp errbuf)
-	  (kill-buffer errbuf)))))
+      (when (and (bufferp errbuf)
+                 (not err?))
+        (kill-buffer errbuf)))))

[-- Attachment #1.3: Type: text/plain, Size: 21 bytes --]


-- 
Daimrod/Greg

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

             reply	other threads:[~2013-02-27 19:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-27 19:07 Daimrod [this message]
2013-03-13 21:53 ` Daimrod
2013-05-05 15:03 ` Daimrod
2013-08-01 16:21 ` Lars Magne Ingebrigtsen
2013-08-06 17:54   ` Daimrod
2013-08-06 20:24     ` Lars Magne Ingebrigtsen
2013-08-07 11:02       ` Daimrod
2013-08-12 17:24         ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fw0hk22y.fsf@tanger.home \
    --to=daimrod@gmail.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).