SMTP

SMTP 421 Service Not Available vs 502 Command Not Implemented

SMTP 421 (Service Not Available) is a 4xx Transient Negative response, while 502 (Command Not Implemented) is a 5xx Permanent Negative response. 421 indicates that the SMTP service is not available and the server is closing the transmission channel. This may be sent as a greeting or during a session if the server needs to shut down. In contrast, 502 means that the command is recognized by the SMTP specification but is not implemented on this server. The server understands the command but has chosen not to support it.

説明

The SMTP service is not available and the server is closing the transmission channel. This may be sent as a greeting or during a session if the server needs to shut down.

このコードが表示される場合

When connecting to a mail server that is overloaded, undergoing maintenance, or shutting down. The server cannot handle your request right now.

解決方法

Retry the connection after a delay. If the issue persists, check server status and resources (CPU, memory, disk). Rate limiting or greylisting may also trigger this response.

説明

The command is recognized by the SMTP specification but is not implemented on this server. The server understands the command but has chosen not to support it.

このコードが表示される場合

When using optional SMTP commands like VRFY, EXPN, or TURN that the server administrator has disabled, often for security or anti-spam reasons.

解決方法

Use an alternative approach — for example, if VRFY is disabled, send a test email instead of verifying the address. Check the server's EHLO response for supported extensions.

主な違い

1.

421 is a 4xx Transient Negative response, while 502 is a 5xx Permanent Negative response.

2.

SMTP 421: The SMTP service is not available and the server is closing the transmission channel. This may be sent as a greeting or during a session if the server needs to shut down.

3.

SMTP 502: The command is recognized by the SMTP specification but is not implemented on this server. The server understands the command but has chosen not to support it.

4.

You encounter 421 when when connecting to a mail server that is overloaded, undergoing maintenance, or shutting down. The server cannot handle your request right now.

5.

You encounter 502 when when using optional SMTP commands like VRFY, EXPN, or TURN that the server administrator has disabled, often for security or anti-spam reasons.

どちらをいつ使うか

For 421 (Service Not Available): Retry the connection after a delay. If the issue persists, check server status and resources (CPU, memory, disk). Rate limiting or greylisting may also trigger this response. For 502 (Command Not Implemented): Use an alternative approach — for example, if VRFY is disabled, send a test email instead of verifying the address. Check the server's EHLO response for supported extensions.

詳しく見る