4.2. SMTP 応答
SMTP コマンドに対する応答は、メール転送の過程における要求と動作の同期を確保し、送信側 SMTP が常に受信側 SMTP の状態を把握できることを保証するために考案されている。すべてのコマンドは、必ずちょうど一つの応答を生成しなければならない。
コマンドと応答のシーケンスの詳細は、順序に関する 5.3 節と、状態遷移図に関する 5.4 節で明示する。
SMTP 応答は、(三つの英数字として伝送される) 3 桁の数字と、それに続くテキストで構成される。数字は、オートマトンが次にどの状態へ入るかを判断するためのものであり、テキストは人間のユーザー向けである。3 桁の数字には、送信側 SMTP がテキストを調べる必要がなく、適宜、破棄するかユーザーに渡すかのどちらかを選べるだけの符号化された情報が含まれることを意図している。特に、テキストは受信側に依存する場合があるため、応答コードごとにさまざまなテキストが存在しうる。応答コードの理論については付録 E で述べる。形式的には、応答は、3 桁のコード、<SP>、1 行のテキスト、<CRLF> からなるシーケンス、または (付録 E で定義される) 複数行の応答として定義される。通常の状況で複数行の応答になると想定されるのは EXPN コマンドと HELP コマンドだけであるが、複数行の応答はどのコマンドに対しても許される。
4.2.1. 機能グループ別の応答コード
500 Syntax error, command unrecognized
[This may include errors such as command line too long]
501 Syntax error in parameters or arguments
502 Command not implemented
503 Bad sequence of commands
504 Command parameter not implemented
211 System status, or system help reply
214 Help message
[Information on how to use the receiver or the meaning of a
particular non-standard command; this reply is useful only
to the human user]
220 <host> Service ready
221 <host> Service closing transmission channel
421 <host> Service not available, closing transmission channel
[This may be a reply to any command if the service knows it
must shut down]
250 Requested mail action okay, completed
251 User not local; will forward to <forward-path>
450 Requested mail action not taken: mailbox unavailable
[E.g., mailbox busy]
550 Requested action not taken: mailbox unavailable
[E.g., mailbox not found, no access]
451 Requested action aborted: error in processing
551 User not local; please try <forward-path>
452 Requested action not taken: insufficient system storage
552 Requested mail action aborted: exceeded storage allocation
553 Requested action not taken: mailbox name not allowed
[E.g., mailbox syntax incorrect]
354 Start mail input; end with <CRLF>.<CRLF>
554 Transaction failed
4.2.2. 応答コードの数値順一覧
211 System status, or system help reply
214 Help message
[Information on how to use the receiver or the meaning of a
particular non-standard command; this reply is useful only
to the human user]
220 <host> Service ready
221 <host> Service closing transmission channel
250 Requested mail action okay, completed
251 User not local; will forward to <forward-path>
354 Start mail input; end with <CRLF>.<CRLF>
421 <host> Service not available, closing transmission channel
[This may be a reply to any command if the service knows it
must shut down]
450 Requested mail action not taken: mailbox unavailable
[E.g., mailbox busy]
451 Requested action aborted: local error in processing
452 Requested action not taken: insufficient system storage
500 Syntax error, command unrecognized
[This may include errors such as command line too long]
501 Syntax error in parameters or arguments
502 Command not implemented
503 Bad sequence of commands
504 Command parameter not implemented
550 Requested action not taken: mailbox unavailable
[E.g., mailbox not found, no access]
551 User not local; please try <forward-path>
552 Requested mail action aborted: exceeded storage allocation
553 Requested action not taken: mailbox name not allowed
[E.g., mailbox syntax incorrect]
554 Transaction failed