Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

According to RFC821 a RCPT command can return the following:

  • 250 OK
  • 251 User not local; will forward to <forward-path>
  • 551 User not local; please try <forward-path>

What exactly happens when the SMTP returns 551. Will the client try to send it to the correct mail server?

I'm implementing a simple SMTP server and am not sure if relaying email is a requirement or optional.

share|improve this question
up vote 2 down vote accepted

The client may do so (and generally would), but the behaviour is not guaranteed (you may find the word MAY when this is explained in the RFC). Whether it does or not is entirely implementation defined.

The difference between 251 and 551 is that if the SMTP server returns 251 then it will send the mail to the right place as a relay, and the client should not (but still may) send the message that way itself, but if 551 is returned, the client is expected to. This is not a protocol requirement.

If your goal when operating the SMTP server is to ensure the mails are delivered, you should send 251 and forward the mail.

Also, the most current SMTP RFC is RFC5321; generally you should implement SMTP according to that, as there are a large number of features introduced, and a very large part of RFC821 has been removed from the protocol.

share|improve this answer
Thanks, I'm aware of RFC5321. – Erik Aigner Oct 24 '12 at 17:03

I'm relatively new to server admin, but I'll try to answer as best I can. Relaying is optional. This is to control the flow of smtp traffic (such as for security reasons with anti-spam, etc.). If you relay on a smtp that live on the internet, and if it's attack surface is not well protected, then you might get spam traffic that spoofs a seemingly legitimate domain and account in your systems.

share|improve this answer

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.