nim-lang / smtp

SMTP client implementation, adapted from the Nim standard library
MIT License
10 stars 5 forks source link

Bad DATA command due to whitespace #3

Closed cmd410 closed 1 year ago

cmd410 commented 1 year ago

So, I've been trying to send mail using std/smtp module through my maddy mail server. However the server responded with 501 5.5.2 Bad command when DATA was issued to send message content. Full exchange log:

S:220 mx1.my.tld ESMTP Service Ready
C:HELO mx1.my.tld

S:250 2.0.0 Hello mx1.my.tld
C:AUTH LOGIN

S:334 VXNlcm5hbWU6
C:<redacted>

S:334 UGFzc3dvcmQ6
C:<redacted>

S:235 2.0.0 Authentication succeeded
C:MAIL FROM:<sender@my.tld>

S:250 2.0.0 Roger, accepting mail from <sender@my.tld>
C:RCPT TO:<recipient@my.tld>

S:250 2.0.0 I'll make sure <recipient@my.tld> gets this
C:DATA 

S:501 5.5.2 Bad command
C:QUIT

I've recreated the same command sequence with sockets manually, and it worked. Then I noticed that smpt module adds a space after DATA which I confirmed was the cause of Bad command error