我正在尝试使用 telnet 和一个命令文件通过远程 shell 访问 SMTP 远程服务器,该命令文件command.txt
包含发送到该 SMTP 服务器的命令,如https://tecadmin.net/ways-to-send-email-from-linux上所示-command-line/#(注意:在上面的网站上,这是交互完成的)但在这里我想在命令文件中执行此操作(我刚刚将黄色/红色(用户输入))复制到命令文件中。
HELO yahoo.com
mail from: sender@tecadmin.net
rcpt to: myemail@mail.com
data
Hey
This is test email only
Thanks
.
quit
Run Code Online (Sandbox Code Playgroud)
然后使用telnet IP smtp < command.txt
always返回:
Trying 1.1.65.49...
Connected to 1.1.65.49.
Escape character is '^]'.
Connection closed by foreign host.
Run Code Online (Sandbox Code Playgroud)
而当我与以下人员交互时:
perlhook@bbis:~/temp_25$ telnet 1.1.65.49 smtp
Trying 1.1.65.49...
Connected to 1.1.65.49.
Escape character is '^]'.
220 miraino-manabi.jp ESMTP Postfix
HELO yahoo.com
250 miraino-manabi.jp
mail from: sender@tecadmin.net
250 2.1.0 Ok …
Run Code Online (Sandbox Code Playgroud)