Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 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:

status=bounced (SASL authentication failed; server[] 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.

share|improve this question
up vote 3 down vote accepted

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

share|improve this answer
Is there any way I can check the relay SMTP server before sending the emails thru so that they don't get bounce and the error does not happen? – redhatlab Sep 19 '12 at 21:53
@redhatlab telnet?! But what if that succeeds but the real mail fails? What Postfix currently does is your check. Force your provider to fix their problem. You don't have a problem. They have! – mailq Sep 19 '12 at 22:06
Umm... what about queuing all messages and releasing them after X amount of time? and during that time fire up a cron job that call a PHP script that will try to send an email using the relay SMTP directly and if the email goes thru then push the emails out of the queue. Can it be done? – redhatlab Sep 19 '12 at 23:12
@redhatlab Sure. You can do everything. But this means to implement an MTA (in PHP) by yourself (with own SMTP client, bounce handling, queue management, retry handling and so on). Is that worth the time to fix other people's problems? – mailq Sep 20 '12 at 20:33
I totally get what you are saying, but in the end your boss does not want to hear the company X that is proving the mailing relay is blocking you from time to time. Thank you for you answers. – redhatlab Sep 20 '12 at 21:53

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.