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