emersion / go-smtp

📤 An SMTP client & server library written in Go
MIT License
1.69k stars 215 forks source link

Support (or allow) HELP command implementation #264

Open jackmahoney opened 3 months ago

jackmahoney commented 3 months ago

Currently conn.go does not support HELP SMTP command and throws a 502.

This presents a problem because many clients, like curl, request HELP upon connection.

curl -v "smtp://$SMTP_SERVER_HOST:$SMTP_SERVER_PORT"
*   Trying 34.212.234.28:2525...
* Connected to redacted (REDACTED) port 2525
< 220 redacted ESMTP Service Ready
> EHLO Jacks-MBP-3
< 250-Hello Jacks-MBP-3
< 250-PIPELINING
< 250-8BITMIME
< 250-ENHANCEDSTATUSCODES
< 250-CHUNKING
< 250-STARTTLS
< 250-AUTH PLAIN
< 250 SIZE 104857600
> HELP
< 502 5.5.1 HELP command not implemented
* Command failed: 502
> QUIT
< 221 2.0.0 Bye
* Closing connection
curl: (8) Command failed: 502

Do you have any plans to implement or allow implementation (by interface extension) of basic HELP response? I really admire and appreciate your work. Happy to add PR if this is acceptable.

emersion commented 3 months ago

Yeah, PRs welcome! What do typical servers send back as help message?