4.2. Réponses SMTP
Les réponses aux commandes SMTP sont conçues pour assurer la synchronisation des requêtes et des actions dans le processus de transfert du courrier, et pour garantir que l'émetteur-SMTP connaît toujours l'état du récepteur-SMTP. Chaque commande doit générer exactement une réponse.
Les détails de la séquence commande-réponse sont explicités à la section 5.3 sur l'enchaînement et à la section 5.4 sur les diagrammes d'états.
Une réponse SMTP se compose d'un nombre à trois chiffres (transmis sous la forme de trois caractères alphanumériques) suivi d'un texte. Le nombre est destiné à être utilisé par des automates pour déterminer l'état à adopter ensuite ; le texte est destiné à l'utilisateur humain. L'intention est que les trois chiffres contiennent suffisamment d'informations codées pour que l'émetteur-SMTP n'ait pas besoin d'examiner le texte et puisse soit l'écarter, soit le transmettre à l'utilisateur, selon le cas. En particulier, le texte peut dépendre du récepteur, de sorte qu'il y aura vraisemblablement des textes variables pour chaque code de réponse. Une discussion de la théorie des codes de réponse est donnée à l'annexe E. Formellement, une réponse est définie comme la séquence suivante : un code à trois chiffres, <SP>, une ligne de texte et <CRLF>, ou une réponse multiligne (telle que définie à l'annexe E). Seules les commandes EXPN et HELP sont censées produire des réponses multilignes dans des circonstances normales ; toutefois, les réponses multilignes sont autorisées pour n'importe quelle commande.
4.2.1. CODES DE RÉPONSE PAR GROUPES FONCTIONNELS
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. LISTE DES CODES DE RÉPONSE PAR ORDRE NUMÉRIQUE
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