SMTP の基本の応答コード (3 桁の数値) および拡張応答コード (X.X.X) についてのべる. SMTP によってかえせる情報はかぎられている.
SMTP は RFC 2821 によって規定されている. ここで規定されている応答コードはつぎのとおりである.
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 (see section 4.2.4)
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 Service ready
221 Service closing transmission channel
421 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
(See section 3.4)
252 Cannot VRFY user, but will accept message and attempt
delivery
(See section 3.5.3)
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, or command rejected
for policy reasons)
451 Requested action aborted: error in processing
551 User not local; please try
(See section 3.4)
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 .
554 Transaction failed (Or, in the case of a connection-opening
response, "No SMTP service here")
送信先のメイルボックスの情報がわかるときは比較的きめこまかい応答をかえすことができるが,現在のインターネット・メイル環境では,たいていは 250 をかえすしかないことがわかる.
RFC 3463 にはよりきめこまかい応答が規定されている. たとえば,メッセージの内容やメディアの状態に関するコードとして,つぎのものが規定されている (X は正常化エラーかなど,メッセージの種類をあらわす).
X.6.0 Other or undefined media error
X.6.1 Media not supported
X.6.2 Conversion required and prohibited
X.6.3 Conversion required but not supported
X.6.4 Conversion with loss performed
それでも,メッセージの内容に関して SMTP サーバ / プロキシがえた情報のうち,ごく一部しか SMTP ではかえせないことがわかる. コードとあわせて返送する文字列には任意性があるので,そこに情報をもたせることはできるが,そこに日本語の文字列などをいれることはできないとかんがえられる. したがって,やはりかぎられた情報しかおくれない.
- [RFC 2821] J. Klensin, Ed., "Simple Mail Transfer Protocol", IETF, April 2001.
- [RFC 3463] G. Vaudreuil, "Enhanced Mail System Status Codes", IETF, January 2003.
