Does anyone know what SMTP reply code I can give to a sender trying to deliver mail to my server so it knows the mail can not be delivered to my server. But not a hard fail so it bounces the email back to the sender.

I want it to attempt to deliver the email to the other MX records for that domain. Now the sender may attempt any number of times to deliver it to my server, but each time I want it to not be accepted and attempt the other MX record.

1 Answer 1


The first digit of the reply code will tell the sender whether the transaction can be retried or not. If the first digit is 4 the transaction can be retried at a later time or right away to a different MX, and it will have a chance of succeeding. If the first digit is 5 it indicates a permanent failure which should be bounced to the user since retrying the transaction would cause the same error again.

the relevant section of RFC 2821 says this:

4yz Transient Negative Completion reply

The command was not accepted, and the requested action did not occur. However, the error condition is temporary and the action may be requested again. The sender should return to the beginning of the command sequence (if any). It is difficult to assign a meaning to "transient" when two different sites (receiver- and sender-SMTP agents) must agree on the interpretation. Each reply in this category might have a different time value, but the SMTP client is encouraged to try again. A rule of thumb to determine whether a reply fits into the 4yz or the 5yz category (see below) is that replies are 4yz if they can be successful if repeated without any change in command form or in properties of the sender or receiver (that is, the command is repeated identically and the receiver does not put up a new implementation.)

5yz Permanent Negative Completion reply

The command was not accepted and the requested action did not occur. The SMTP client is discouraged from repeating the exact request (in the same sequence). Even some "permanent" error conditions can be corrected, so the human user may want to direct the SMTP client to reinitiate the command sequence by direct action at some point in the future (e.g., after the spelling has been changed, or the user has altered the account status).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .