Queue bounced emails using Postfix with an SMTP relay

emailpostfix

I have setup a Postfix mail server that use a relay mail server to deliver the emails. The problem I am having is that from time to time the relay server goes crazy and block my relay username/password and the emails on postfix are lost when the emails bounce after the relay server reject the authentication.

Here is an error example:

to=<user@domain.com>, 
relay=mail.relay-server.net[0.0.0.0]:587, 
delay=0.57, 
delays=0.01/0/0.57/0, 
dsn=5.7.8, 
status=bounced (SASL authentication failed; server mail.relay-server.net[0.0.0.0] said: 535 5.7.8 Bad username or password (Authentication failed).)

So, my question is is there any way I can setup for Postfix to hold the messages in queue if the relay server start issuing those messages?

Thank you.

Best Answer

No, you can't. This would violate RFC 5321. Any 5xy error code MUST lead into a bounce message according to the SMTP specification.