
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
[email protected]
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フォルダから削除したファイルとまったく同じです! ㅎㅎこれで、信頼できない証明書を作成すると、ある程度のことが起こることがわかりました。
答え1
コメントアウトされていない最初の項目がmailhub=mail
この問題を引き起こしているようです。
FQDNとポート番号がない場合は、ポート25に存在しない可能性があるプライマリドメインから呼び出されたホスト(ただし、そのホストはローカルに設定されている)ssmtp
に接続しようとするように設定されていると思います。mail
答え2
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
なります。
[email protected]
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
答え3
私もこのようなことを経験しました! !
インターネットで私が望む結果を得るための答えはありませんでした。
ssmtp を使用してメールを送信する前に、必要なすべてのリポジトリとパッケージをインストールしたことを確認してください。
このコマンドを試した後..その後は本当に効果がありました!
mv /usr/sbin/sendmail /usr/sbin/sendmail.ORIG
ln -s /usr/sbin/ssmtp /usr/sbin/sendmail