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 mail.relay-server.net[] 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.


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

  • 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? – Emil Orol 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? – Emil Orol 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. – Emil Orol Sep 20 '12 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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