[root@ip-xxx-xxx-xxx-xxx xxxx]# openssl s_client -starttls smtp -connect smtp.gmail.com:587
CONNECTED(00000003)
~~~SKIP~~~
250 SMTPUTF8
AUTH PLAIN ~~~SKIP~~~
235 2.7.0 Accepted
MAIL FROM: <~~~SKIP~~~>
250 2.1.0 OK t2sm4646317pgh.89 - gsmtp
rcpt to: <~~~SKIP~~~>
250 2.1.5 OK t2sm4646317pgh.89 - gsmtp
DATA
354 Go ahead t2sm4646317pgh.89 - gsmtp
Test email!
.
Here is my command list.
In normal cases, it will finish writing the email body at the timing that the dot(.) is typed.
But I can’t stop writing…
How can I solve this problem?
3
Answers
Run the QUIT command after dot.
The dot needs to be alone on a new line, and you need to type this explicitly. You can type a new line character (◙) by using ALT+10 (type 10 on the numpad).
If you use this command to finalize your message, it will send:
Alternatively, you could copy/paste the above in your session and confirm.
You should use the -crlf option of OpenSSL (i.e.
openssl s_client -starttls smtp -connect smtp.gmail.com:587 -crlf
) to make sure you send a carriage return (CR) followed by a line feed (LF).And in order to have a dot on a line of its own, you have to enter another new line after the dot.
On a different note, I’m note sure whether Gmail allows you to skip mandatory header fields and the empty line between the header and the body.
If you still struggle with this, here’s a tool that I wrote.