Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using pipe over SSH to deliver some e-mails for special processing to another server, what I have configured in

foobar   unix    -   n   n   -   -   pipe
  flags=RF user=foobar:foobar argv=/usr/bin/ssh -T foobar@foobar /usr/local/bin/foobar ${recipient}

The problem I am having is that if this server is not available (or for some other reason SSH connection fails) whole delivery fails and sender receives message about that. What I would like is that if it fails that e-mail is put back into the queue for later retry. And only if for few days this delivery is not made that sender is notified about that. How can I configure Postfix in this way?

share|improve this question
up vote 3 down vote accepted

Add -o soft_bounce=yes to the definition in


foobar   unix    -   n   n   -   -   pipe
  -o soft_bounce=yes
  flags=RF user=foobar:foobar argv=/usr/bin/ssh -T foobar@foobar /usr/local/bin/foobar ${recipient}

This will keep mail in the deferred queue forever (or until the machine comes back to life and postfix retries it), and will not bounce after a few days, but it's the best I could find (and even that was quite well hidden).

share|improve this answer
Thanks. This looks like what I need. It is not really a problem for me if it does not bounce after a few days. Will test it now and we will see. – Mitar May 16 '11 at 13:58

If the command that pipe is delivering to returns an exit code of 75, then that causes the delivery to be deferred rather than bounced. Alternatively, if the first line of output appears to have an extended SMTP status (e.g. "4.2.0") that takes priority.

I would wrap up the ssh command in a shell script or something that detects a failure and converts that to the right output/exit status.

This allows the delivery program to flag messages as undeliverable as opposed to always having them retried. And keeps the soft_bounce option as a debugging safety net.

(I appreciate you already have an answer, but thought this might be useful as an alternative for anyone else finding this question)

share|improve this answer
Very interesting! How did you find out about that? Could you post any references? Thanks. – Ricardo Pardini Aug 20 '11 at 4:31
+1 for knowing this, but next time give a reference! I found a detailed reference here See for a shorter answer.!topic/mailing.postfix.users/… as well. Here is a link with all the standard status codes The pipe man page ( alludes to this, but I personally found a bit confusing at first. – deuberger Aug 4 '14 at 19:32
Also see for info on the extended status codes. – deuberger Aug 4 '14 at 19:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.