[EMAIL PROTECTED] said:
> On Fri, Dec 01, 2000 at 12:22:57AM -0500 or thereabouts, Ken Weingold wrote:
> 
> > When mutt sits for a while on 'Sending message...', is it a mutt or
> > sendmail issue?  Or something else?
> 
> This is the same problem that I have mentioned earlier.  Many thought
> it was a sendmail problem.  However, I have made some trials with
> other MUAs, even Xemacs, and they all send normally without problems
> or waiting.  I have also gone over my sendmail rc files, and
> everything over again, and all see to be as it was previously.
> 
> I can't figure it out.   

Being a control freak, I patched mutt to have it show me the sendmail
dialog.  Somehow I thought there was a configuration option which would
do this, but I could not find it, hence the ugly patch.  Maybe it will
help you uncover your mutt/sendmail interaction issue.

To use:  set sendmail_wait=-1.  It's not pretty:  the curses handling is
a mess and overloading a well defined variable is a bad idea.  Caveat
patcher.
                -- Pete


diff -ruN mutt-1.3.12-stock/sendlib.c mutt-1.3.12/sendlib.c
--- mutt-1.3.12-stock/sendlib.c Tue Nov 28 11:35:05 2000
+++ mutt-1.3.12/sendlib.c       Tue Nov 28 11:36:27 2000
@@ -1740,6 +1740,7 @@
   if ((pid = fork ()) == 0)
   {
     struct sigaction act, oldalrm;
+    int fdmax;
 
     /* save parent's ID before setsid() */
     ppid = getppid ();
@@ -1751,16 +1752,20 @@
   
     /* next we close all open files */
 #if defined(OPEN_MAX)
-    for (fd = 0; fd < OPEN_MAX; fd++)
-      close (fd);
+    fdmax = OPEN_MAX;
 #elif defined(_POSIX_OPEN_MAX)
-    for (fd = 0; fd < _POSIX_OPEN_MAX; fd++)
-      close (fd);
+    fdmax = _POSIX_OPEN_MAX;
 #else
-    close (0);
-    close (1);
-    close (2);
+    fdmax = 3;
 #endif
+    for (fd = 0; fd < fdmax; fd++) {
+      if (fd == 1 && SendmailWait == -1) continue;
+      close (fd);
+    }
+
+    /* for showing sendmail output, end window mode */
+    if (SendmailWait == -1)
+       mutt_endwin(0);
 
     /* now the second fork() */
     if ((pid = fork ()) == 0)
@@ -1782,6 +1787,11 @@
        if (dup (1) < 0)
          _exit (S_ERR);
       }
+      else if (SendmailWait == -1)
+      {
+        if (dup(1) < 0)
+         _exit (S_ERR);
+      }
 
       execv (path, args);
       _exit (S_ERR);
@@ -1795,7 +1805,8 @@
 
     /* SendmailWait > 0: interrupt waitpid() after SendmailWait seconds
      * SendmailWait = 0: wait forever
-     * SendmailWait < 0: don't wait
+     * SendmailWait = -1: wait forever, and send stdout/err to console
+     * SendmailWait < -1: don't wait
      */
     if (SendmailWait > 0)
     {
@@ -1811,7 +1822,7 @@
       sigaction (SIGALRM, &act, &oldalrm);
       alarm (SendmailWait);
     }
-    else if (SendmailWait < 0)
+    else if (SendmailWait < -1)
       _exit (0xff & EX_OK);
 
     if (waitpid (pid, &st, 0) > 0)
@@ -1856,6 +1867,15 @@
     st = S_ERR;        /* error */
 
   mutt_unblock_signals_system (1);
+
+  /* for showing sendmail output, end window mode */
+  if (SendmailWait == -1) {
+    mutt_any_key_to_continue(0);
+    clear();
+    cbreak();
+    noecho();
+    refresh();
+  }
 
   return (st);

Reply via email to