作为 SSMTP不作为守护进程运行本身,你怎么测试它正在工作吗?
nicholas@mordor:~$
nicholas@mordor:~$ telnet localhost 25
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
nicholas@mordor:~$
nicholas@mordor:~$ telnet mordor.saundersconsulting.tech 25
Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused
nicholas@mordor:~$
nicholas@mordor:~$ swaks --to [email protected] --from [email protected] --server mordor.saundersconsulting.tech
=== Trying mordor.saundersconsulting.tech:25...
*** Error connecting to mordor.saundersconsulting.tech:25:
*** IO::Socket::INET6: connect: Connection refused
nicholas@mordor:~$
nicholas@mordor:~$ sudo cat /etc/ssmtp/ssmtp.conf
[sudo] password for nicholas:
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
[email protected]
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587
[email protected]
AuthPass=fdsfdsfdsf
UseTLS=YES
UseSTARTTLS=YES
# Where will the mail seem to come from?
#rewriteDomain=
rewriteDomain=gmail.com
# The full hostname
#hostname=mordor.saundersconsulting.tech
[email protected]
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
nicholas@mordor:~$
nicholas@mordor:~$ sudo cat /etc/ssmtp/revaliases
# sSMTP aliases
#
# Format: local_account:outgoing_address:mailhub
#
# Example: root:[email protected]:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.
root:[email protected]:smtp.gmail.com:587
nicholas@mordor:~$
nicholas@mordor:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 23.10
Release: 23.10
Codename: mantic
nicholas@mordor:~$
不确定在这种情况下要测试什么。
直接尝试该命令会产生:
nicholas@mordor:~$
nicholas@mordor:~$ ssmtp [email protected]
to:[email protected]
from:[email protected]
subject:ping
testingssmtp: Cannot open smtp.gmail.com:587
nicholas@mordor:~$
/var/log/mail.err 日志显示以下链接:
HELO/EHLO 电子邮件错误
如果您尝试发送电子邮件并收到退回邮件,内容包括“HELO/EHLO 参数无效”,您可以采取以下步骤:
Contact your email administrator. You should have an administrator if you’re using Gmail for a work, school, or organization account.
否则,您可以联系您的电子邮件提供商。请要求您的管理员在联系 Gmail 服务器时发送发送服务器的完全限定域名或 IP 地址。
此错误通常出现在打印机、扫描仪和传真机等同时发送邮件的设备上。
如此:
nicholas@mordor:~$
nicholas@mordor:~$ cat /var/log/mail.err
2023-12-19T09:37:13.183560+00:00 mordor sSMTP[11658]: Invalid response: 501 5.5.4 https://support.google.com/mail/?p=helo s17-20020a170902b19100b001d366f8cfd7sm7380648plr.182 - gsmtp ([email protected])
2023-12-19T09:37:13.184272+00:00 mordor sSMTP[11658]: Cannot open smtp.gmail.com:587
2023-12-19T13:10:01.378049+00:00 mordor sSMTP[14174]: Invalid response: 501 5.5.4 https://support.google.com/mail/?p=helo y20-20020a056a00191400b00688435a9915sm20054254pfi.189 - gsmtp ([email protected])
2023-12-19T13:10:01.378702+00:00 mordor sSMTP[14174]: Cannot open smtp.gmail.com:587
2023-12-19T13:10:36.241185+00:00 mordor sSMTP[14186]: Invalid response: 501 5.5.4 https://support.google.com/mail/?p=helo b18-20020a170902d51200b001cf511aa772sm20973353plg.145 - gsmtp ([email protected])
2023-12-19T13:10:36.241851+00:00 mordor sSMTP[14186]: Cannot open smtp.gmail.com:587
2023-12-19T13:11:49.694632+00:00 mordor sSMTP[14213]: Invalid response: 501 5.5.4 https://support.google.com/mail/?p=helo l15-20020a170902f68f00b001c9c5a1b477sm21000470plg.169 - gsmtp ([email protected])
2023-12-19T13:11:49.695296+00:00 mordor sSMTP[14213]: Cannot open smtp.gmail.com:587
nicholas@mordor:~$