我已经安装了ssmtp,然后编辑了ssmtp.conf文件,所以可以尝试发送邮件,但是不能打开邮件:25但是,在conf文件中,我将它设置为gmail端口467,并且我非常肯定其他一切都是正确的。
具体而言,我需要通过这个错误查找什么,或者它是否是配置文件内外的任意数量的设置?
#
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
#
# See the ssmtp.conf(5) man page for a more verbose explanation of the
# available options.
#
# The person who gets all mail for userids < 500
# Make this empty to disable rewriting.
root=postmaster
# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named mail.domain.com
# The example will fit if you are in domain.com and your mailhub is so named.
mailhub=mail
# Example for SMTP port number 2525
mailhub=smtp.gmail.com:465
# Example for SMTP port number 25 (Standard/RFC)
# mailhub=mail.your.domain
# Example for SSL encrypted connection
# mailhub=mail.your.domain:465
# Where will the mail seem to come from?
#RewriteDomain=
# The full hostname
#Hostname=
# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
#FromLineOverride=YES
# Use SSL/TLS to send secure messages to server.
UseTLS=YES
UseSTARTTLS=YES
AuthUser=user@gmail.com
AuthPass=xxxxxx
# Use SSL/TLS certificate to authenticate against smtp host.
#UseTLSCert=YES
# Use this RSA certificate.
#TLSCert=/etc/pki/tls/private/ssmtp.pem
TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt
# Get enhanced (*really* enhanced) debugging information in the logs
# If you want to have debugging of the config file parsing, move this option
# to the top of the config file and uncomment
#Debug=YES有趣的是,/etc/pki/tls/certs/中的所有文件都是我在/etc/ssl文件夹中删除的文件!哈哈,现在我知道在创建一个不可信的证书时发生了一定数量的生意。
发布于 2016-09-24 19:01:03
ssmtp: Cannot open mail:25 可由/etc/ssmtp/ssmtp.conf上的文件权限错误引起。无论应用程序试图运行什么,ssmtp都无法读取该文件。
chmod 640 /etc/ssmtp/ssmtp.conf
chown root:mail /etc/ssmtp/ssmtp.conf&将发送电子邮件的应用程序添加到mail组(例如,如果logcheck不是adm组的一部分)
为了完整起见,您的smtp.conf应该如下所示:
root=you@domain.com
mailhub=your-mailserver.com:465
#mailhub=gmail.com:587 ### -> note 587 for STARTTLS
hostname=your-vps.com
UseTLS=Yes
#UseSTARTTLS=Yes ### => gmail needs this (not all servers do)
AuthUser=xxxxxx
AuthPass=xxxxxx
FromLineOverride=NO
#Debug=YES
# on Fedora / Red Hat / or with ssmtp-validate-TLS-server-cert.patch
TLS_CA_File=/etc/ssl/certs/ca-certificates.crtsSMTP就可以使用256 bit密码&验证CA。发布于 2017-04-19 06:48:19
第一个未注释的mailhub=mail似乎是造成这种情况的原因。
如果没有FQDN和端口号,我想它会将ssmtp配置为试图将端口25上的主机连接到默认域中名为mail的主机(但是您已经在本地设置了该主机),而该主机可能并不存在。
发布于 2022-04-11 17:21:54
同样的事情发生在我身上!!
网上没有任何答案给我想要的结果。
在使用ssmtp发送邮件之前,请确保已安装了所有所需的repos和包。
试着执行这些命令。在这之后,它真的对我有效!!
mv /usr/sbin/sendmail /usr/sbin/sendmail.ORIG
ln -s /usr/sbin/ssmtp /usr/sbin/sendmailhttps://unix.stackexchange.com/questions/135009
复制相似问题