Kyle Jones wrote in message:
http://www.xemacs.org/list-archives/xemacs-beta/9901/msg00453.html
Gregory Neil Shapiro writes:
> Does exim's sendmail emulation support -odb (for background delivery)?
Makes no difference. call-process-region is called with 0 as the
fifth arg ,so Xemacs should not be waiting around for the process
to terminate. Both of these calls do the right thing for me.
(call-process-region 1 3 "/bin/sleep" nil 0 nil "10")
(call-process-region 1 3 "/bin/sleep" nil nil nil "10")
The first one should return immediately, the seonc d should
return after about 10 seconds. Change /bin/sleep to wherever the
sleep binary is on your system.
Sounds good in principle. However, in single-stepping through
sendmail-send-it using edebug, I see that the 5th arg to
call-process-region is *not* 0 but nil.
"errbuf" (arg 5) is set to nil if mail-interactive is not set. It
should be set to 0 instead. Setting it to zero causes a problem with
the code that checks the exit value of the sendmail process, since if
the process is executed without waiting, exit-value is nil. I think
this problem was introduced in Gregory's change of 1998-10-31
Here's a patch that deals with both problems:
ChangeLog for mail-lib:
1999-01-20 Charles G Waldman <cgw(a)pgt.com>
* sendmail.el (sendmail-send-it): Execute sendmail in
background if mail-interactive is nil, and don't
try to check error exit.
Index: libs/mail-lib/sendmail.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-packages/libs/mail-lib/sendmail.el,v
retrieving revision 1.3
diff -u -r1.3 sendmail.el
--- sendmail.el 1998/12/10 14:37:55 1.3
+++ sendmail.el 1999/01/21 05:59:09
@@ -579,7 +579,7 @@
(require 'mail-utils)
(let ((errbuf (if mail-interactive
(generate-new-buffer " sendmail errors")
- nil))
+ 0))
(tembuf (generate-new-buffer " sendmail temp"))
(case-fold-search nil)
resend-to-addresses
@@ -738,7 +738,7 @@
;; addresses.
(or resend-to-addresses
'("-t")))))
- (if (not (zerop exit-value))
+ (if (not (or (eq errbuf 0) (zerop exit-value)))
(error "Sending...failed with exit value %d" exit-value)))
(if mail-interactive
(save-excursion