What is the SMTP EXPN command?

  1. Home
  2. Knowledge Base
  3. GMS
  4. What is the SMTP EXPN command?

Question

I understand EXPN is a command that can be supported by mail servers that accept Enhanced SMTP. What exactly is the EXPN command?

Answer

EXPN can be used to request, or expand, a mailing list on the remote server. The sending server can query the receiving server to see if it will accept Enhanced SMTP commands. If it does it will send back to the connecting server the enhanced commands it will accept. If EXPN is listed, it can be used.
p>
If the receiving server accepts EXPN, your string should identify a particular mailing list. The multiline response may include the full name
of all users and must provide the mailboxes on the mailing list.

Sender: EXPN Test-List
Receiver: 250-Mr A 
Receiver: 250-Mrs B 
Receiver: 250-Miss C 

If EXPN wasn’t an authorised command, or a particular mailing list was restricted, you would see a similar response preceded with a
"550" error code.

Sender: EXPN Test-List
Receiver: 550 Access Denied!

Most messaging systems disable the EXPN command since it is now considered to be a security risk. I define "security risk" by spammers being able to harvest valid e-mail addresses via each mailing list.

See Also:

Keywords:SMTP EXPN command expand

Was this article helpful?

Related Articles