Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH] don't kill err-buffer if `sendmail-send-it' fails
@ 2013-02-27 19:07 Daimrod
  2013-03-13 21:53 ` Daimrod
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Daimrod @ 2013-02-27 19:07 UTC (permalink / raw)
  To: Gnus


[-- 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 --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-08-12 17:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27 19:07 [PATCH] don't kill err-buffer if `sendmail-send-it' fails Daimrod
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

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).