I am using pipe over SSH to deliver some e-mails for special processing to another server, what I have configured in master.cf.
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?