+ Stefan Paletta <[EMAIL PROTECTED]>:

| Balazs Nagy wrote/schrieb/scribsit:
| > Yes.  It's a problem with fixcr.  Just try it out as running 'qmail-smtpd'
| > then 'fixcr | qmail-smtpd' and fed them with a simple quit command.
| > 
| > Fixcr is bogus.
| 
| No, but doing s/qmail-smtpd/fixcr | qmail-smtpd/ is.
| Run 'sh -c "fixcr | qmail-smtpd"' instead.
| 
| Harald H.-O.: wouldn't 'pipe' do well here, too?

Having tcpserver control  pipe fixcr '|' qmail-smtpd  rather than
sh -c 'fixcr | qmail-smtpd'  does indeed save a fork and an extra
process per incoming connection.

But as far as I can see, none of these help against the problem that
started this thread.  That problem appears to be the following:

fixcr copies stdin to stdout (fixing isolated newslines) until it
reaches end-of-file on stdin, or until it's killed by SIGPIPE.

When the client sends "quit\r\n", that is passed on to qmail-smtp,
which promptly prints its exit message and quits.  However, fixcr will
not get its SIGPIPE until it actually tries to write more data to the
pipe.  Hence the need for an extra return.

The best fix is to replace fixcr by a program that sets up the
pipeline and runs a command itself, to be used as follows:

  newfixcr qmail-smtpd

And then it should expext SIGCHLD and die upon receiving it.

Adding the necessary code to fixcr.c in order to do this ought to be
rather trivial.

- Harald

Reply via email to