unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ian Jackson <ijackson@chiark.greenend.org.uk>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: sendmail.el bug or expected behavior?
Date: Fri, 23 Jan 2004 12:29:55 +0000	[thread overview]
Message-ID: <16401.5059.249741.523854@chiark.greenend.org.uk> (raw)
In-Reply-To: <iluwu7j7qbv.fsf@latte.josefsson.org>

Simon Josefsson writes ("Re: sendmail.el bug or expected behavior?"):
> I suspect that if the MTA is trying to deliver the message to its
> final destination, then it may hang regardless of what MTA is used.

IMO the correct way for a MUA to invoke sendmail (on Debian) is
  /usr/sbin/sendmail -odb -oee ...
(To be portable to non-FHS systems, use /usr/lib/sendmail)

This is supposed to
 (a) queue the message, exiting non-0 if unsuccessful
 (b) fork off a detached delivery attempt, which will
     deliver the message, leave it queued, or bounce it,
     as appropriate
 (c) exit 0, leaving the delivery attempting going

The problem that RMS mentions happens if you don't give any -odX
options: usually that means you'll get `foreground' delivery, which
typically means that the MTA will try one delivery attempt now.

This is even more unhelpful when combined with -oem (also sometimes
the default), which (AIUI[1]) exits 0 on success or if the first
delivery attempt fails but the message is queued, but exits nonzero if
the delivery failed straight away even if the message was successfully
bounced.

Emacs needs, from the MTA, the behaviour I specify above for
-odb -oee.  Ie, exit status 0 from sendmail should mean the same as
`250 OK' does after SMTP DATA final dot.

If it is difficult to get this behaviour portably (which seems
unlikely nowadays although may have been much harder in times past)
then I think it's still worth doing.  In any case any other behaviour
by the MTA will always result in at least one or more of these
symptoms:

 * Excessive delay when sending mail interactive.
 * Silently vanishing mail.  (`Mail sent' but not actually sent.)
 * Interactive report of a problem sending mail (`Mail could
   not be sent') followed _also_ by a bounce.
 * Interactive report of a problem sending mail (`Mail could
   not be sent') but in fact the mail is also later delivered.

Is there some way to configure Emacs to use -odb -oee ?  If so we
(FSF, or failing that, Debian) should change the default.

If not all MTAs support -odb -oee (or use it to mean the same thing)
then for Debian we should patch them, and probably FSF Emacs should
have a configuration option to work with broken MTAs (in this case
passing sendmail other options may be helpful).

I know that Exim does support -odb -oee (and last time I looked the
Exim docs are reasonably good about these questions).  Exim 3.35
(which I'm running here) has a bug where at least one of
stdin/stdout/stderr isn't properly closed by the asynchronous child,
which can cause things to hang if you run sendmail via ssh or userv,
but hopefully Emacs can be made to stop waiting when sendmail has
exited, even if one of the pipes to it hasn't been closed at the other
end.

Smail interprets -oee to mean the same as -oem, but with background
delivery you probably won't get too many false nonzero exits.

The copy of the Sendmail Installation and Operation Guide I have to
hand here is unhelpfully vague about the exact behaviour of the
various -oeX options.  (Search the document for the string
`ErrorMode'.)

Postfix seems to ignore -oeX and -odX completely.  I think it's
probably modern enough to do the right thing.

Ian.
(submitter of the Debian bug #114849, and long-time free software
developer and user)

  reply	other threads:[~2004-01-23 12:29 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-20  6:14 sendmail.el bug or expected behavior? Rob Browning
2004-01-20 11:53 ` Simon Josefsson
2004-01-21  9:21 ` Richard Stallman
2004-01-21 18:28   ` Kevin Rodgers
2004-01-21 22:33   ` Simon Josefsson
2004-01-22 19:00     ` Richard Stallman
2004-01-22 19:09       ` Simon Josefsson
2004-01-23 12:29         ` Ian Jackson [this message]
2004-01-23 15:13           ` Jan D.
2004-01-26 11:20             ` Ian Jackson
2004-01-26 13:28               ` Jan D.
2004-01-26 13:40                 ` Ian Jackson
2004-01-26 13:50                   ` Jan D.
2004-01-26 14:10                     ` Ian Jackson
2004-01-26 14:25                       ` Jan D.
2004-01-26 14:29                         ` Ian Jackson
2004-01-26 14:35                           ` Jan D.
2004-01-26 14:42                             ` Ian Jackson
2004-01-27 18:49                   ` Richard Stallman
2004-01-27 21:03                     ` Stefan Monnier
2004-01-29 17:52                       ` Richard Stallman
2004-01-25 14:46           ` Richard Stallman
2004-01-23 18:25         ` Richard Stallman
2004-01-23 18:33           ` Eli Zaretskii
2004-01-23 18:38           ` Simon Josefsson
2004-01-26 14:09             ` Ian Jackson
2004-01-26 16:21               ` Simon Josefsson
2004-01-26 18:22                 ` Stefan Monnier
2004-01-26 19:26                   ` Simon Josefsson
2004-01-26 20:47                     ` Stefan Monnier
2004-01-27 18:50                 ` Richard Stallman
2004-01-30  4:27 ` Rob Browning
2004-01-30 14:45   ` Stefan Monnier
2004-01-30 14:46   ` Stefan Monnier
2004-01-30 14:46     ` David Kastrup
2004-01-30 16:14       ` Stefan Monnier
2004-01-31  7:51   ` Richard Stallman
2004-01-31 17:26     ` Rob Browning

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=16401.5059.249741.523854@chiark.greenend.org.uk \
    --to=ijackson@chiark.greenend.org.uk \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).