4.2. Risposte SMTP
Le risposte ai comandi SMTP sono concepite per garantire la sincronizzazione di richieste e azioni nel processo di trasferimento della posta e per assicurare che il sender-SMTP conosca sempre lo stato del receiver-SMTP. Ogni comando deve generare esattamente una risposta.
I dettagli della sequenza comando-risposta sono resi espliciti nella sezione 5.3 sulla sequenza e nella sezione 5.4 sui diagrammi di stato.
Una risposta SMTP è composta da un numero di tre cifre (trasmesso come tre caratteri alfanumerici) seguito da del testo. Il numero è destinato all'uso da parte di automi per determinare in quale stato entrare successivamente; il testo è destinato all'utente umano. Si intende che le tre cifre contengano informazioni codificate sufficienti perché il sender-SMTP non debba esaminare il testo e possa scartarlo oppure passarlo all'utente, a seconda dei casi. In particolare, il testo può dipendere dal ricevente e dal contesto, quindi è probabile che per ciascun codice di risposta esistano testi diversi. Una discussione sulla teoria dei codici di risposta è data nell'appendice E. Formalmente, una risposta è definita come la sequenza: un codice di tre cifre, <SP>, una riga di testo e <CRLF>, oppure una risposta su più righe (come definita nell'appendice E). In circostanze normali ci si aspetta che solo i comandi EXPN e HELP producano risposte su più righe; tuttavia le risposte su più righe sono ammesse per qualsiasi comando.
4.2.1. Codici di risposta per gruppi funzionali
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 <domain> Service ready
221 <domain> Service closing transmission channel
421 <domain> 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. Elenco dei codici di risposta in ordine numerico
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 <domain> Service ready
221 <domain> 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 <domain> 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