首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ssmtp:无法打开邮件:25

ssmtp:无法打开邮件:25
EN

Unix & Linux用户
提问于 2014-06-07 14:16:11
回答 3查看 60K关注 0票数 9

我已经安装了ssmtp,然后编辑了ssmtp.conf文件,所以可以尝试发送邮件,但是不能打开邮件:25但是,在conf文件中,我将它设置为gmail端口467,并且我非常肯定其他一切都是正确的。

具体而言,我需要通过这个错误查找什么,或者它是否是配置文件内外的任意数量的设置?

代码语言:javascript
复制
#
# /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文件夹中删除的文件!哈哈,现在我知道在创建一个不可信的证书时发生了一定数量的生意。

EN

回答 3

Unix & Linux用户

发布于 2016-09-24 19:01:03

代码语言:javascript
复制
ssmtp: Cannot open mail:25 

可由/etc/ssmtp/ssmtp.conf上的文件权限错误引起。无论应用程序试图运行什么,ssmtp都无法读取该文件。

代码语言:javascript
复制
chmod 640 /etc/ssmtp/ssmtp.conf
chown root:mail /etc/ssmtp/ssmtp.conf

&将发送电子邮件的应用程序添加到mail组(例如,如果logcheck不是adm组的一部分)

为了完整起见,您的smtp.conf应该如下所示:

代码语言:javascript
复制
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.crt
  • 对于任何使用Debian的人,我也有支持红帽补丁,这样sSMTP就可以使用256 bit密码&验证CA
票数 4
EN

Unix & Linux用户

发布于 2017-04-19 06:48:19

第一个未注释的mailhub=mail似乎是造成这种情况的原因。

如果没有FQDN和端口号,我想它会将ssmtp配置为试图将端口25上的主机连接到默认域中名为mail的主机(但是您已经在本地设置了该主机),而该主机可能并不存在。

票数 3
EN

Unix & Linux用户

发布于 2022-04-11 17:21:54

同样的事情发生在我身上!!

网上没有任何答案给我想要的结果。

在使用ssmtp发送邮件之前,请确保已安装了所有所需的repos和包。

试着执行这些命令。在这之后,它真的对我有效!!

代码语言:javascript
复制
mv /usr/sbin/sendmail /usr/sbin/sendmail.ORIG
ln -s /usr/sbin/ssmtp /usr/sbin/sendmail
票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/135009

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档