简体   繁体   English

当我使用 openssl -starttls 命令连接 smtp 时,我无法停止编写 email 的正文。 (分 7)

[英]I can't stop writing the body of email when I connect smtp by using openssl -starttls command. (centos 7)

[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.在正常情况下,它会在输入点(.)时完成 email 主体的写入。 But I can't stop writing... How can I solve this problem?但我不能停止写作......我该如何解决这个问题?

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).您可以使用 ALT+10(在小键盘上键入 10)键入换行符 (◙)。

If you use this command to finalize your message, it will send:如果您使用此命令来完成您的消息,它将发送:

◙.◙

Alternatively, you could copy/paste the above in your session and confirm.或者,您可以将上述内容复制/粘贴到 session 中并确认。

You should use the -crlf option of OpenSSL (ie 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). You should use the -crlf option of OpenSSL (ie 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.另一方面,我注意到 Gmail 是否允许您跳过强制性的 header 字段以及 header 和正文之间的空行。

If you still struggle with this, here's a tool that I wrote .如果您仍然对此感到困扰,这 是我编写的一个工具

Run the QUIT command after dot.在点之后运行 QUIT 命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM