Postfixは外部SMTPサーバーの問題を使用します。

Postfixは外部SMTPサーバーの問題を使用します。

これが私の問題に合ったスタック交換かどうかはわかりません。私の問題に合うスタック交換がいくつかあります。

外部SMTPサーバー(私のISPのSMTPが必要なので...)を介して電子メールを送信するようにpostfix設定を設定しました。ただし、外部のメールアドレスに電子メールを送信するたびに電子メールが届かず、エラーの電子メールも受信されません(「あなたはブロックされました」電子メールなど、私のSMTPサーバーを使用するとこの種の電子メールを受け取ります)。電子メール)。

これは私のメール履歴です。私はraspbianを実行しており、確実にするためにすべてのIPアドレスとドメイン名を変更しました。私はsquirrelmailからこのテストメールを送ったのでlocalhostと書かれています。

Feb  2 16:37:41 raspberrypi postfix/smtpd[1468]: connect from localhost[127.0.0.1]
Feb  2 16:37:41 raspberrypi postfix/smtpd[1468]: D7AEEC3940: client=localhost[127.0.0.1]
Feb  2 16:37:41 raspberrypi postfix/cleanup[1472]: D7AEEC3940: message-id=<[email protected]>
Feb  2 16:37:41 raspberrypi postfix/qmgr[1372]: D7AEEC3940: from=<[email protected]>, size=717, nrcpt=1 (queue active)
Feb  2 16:37:41 raspberrypi postfix/smtpd[1468]: disconnect from localhost[127.0.0.1]
Feb  2 16:37:42 raspberrypi postfix/smtp[1473]: D7AEEC3940: to=<[email protected]>, relay=smtp.myisp.com[IPmyisp]:587, delay=0.35, delays=0.07/0.01/0.19/0.07, dsn=2.6.0, status=sent (250 2.6.0  <[email protected]> Queued mail for delivery)
Feb  2 16:37:42 raspberrypi postfix/qmgr[1372]: D7AEEC3940: removed

postfixの私のmain.cfファイル(一部の内容が再置き換えされました):

smtpd_banner = $myhostname ESMTP $mail_name (Raspbian)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mydomain.com, raspberrypi, localhost.localdomain, localhost
relayhost = [smtp.myisp.com]:587 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
home_mailbox = Maildir/
mailbox_command =
smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks,
        reject_unauth_destination
smtpd_helo_required = yes
smtpd_helo_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_invalid_helo_hostname,
        reject_non_fqdn_helo_hostname,
        reject_unknown_helo_hostname
        check_helo_access hash:/etc/postfix/helo_access
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_tls_auth_only = yes
#################################
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_tls_CAfile = /etc/ssl/certs/ssl-cert-snakeoil.pem

私の/etc/postfix/sasl_passwd形式は smtp.myisp.com:587 username:password.ここで、ユーザー名とパスワードは私のISPのユーザー名とパスワードです。

私のISPのSMTPサーバーはTLSとポート587を使用しています。

なぜ電子メールが届かなかったのかわかりません。ご存知の方は、よろしくお願いします。

編集:電子メールクライアントを自分の電子メールアカウント(Outlookなど)として使用し、ISPのSMTPサーバーの詳細をクライアントに直接入力すると、電子メールが届きます。しかし、それは私が望む方法ではありません。

EDIT2:新しいログは次のとおりです。

Feb  2 19:48:12 raspberrypi postfix/smtps/smtpd[2469]: connect from myhostname[myIP]
Feb  2 19:48:13 raspberrypi postfix/smtps/smtpd[2469]: 76CCBC3ABC: client=myhostname[myIP], sasl_method=PLAIN, sasl_username=username                        
Feb  2 19:48:13 raspberrypi postfix/cleanup[2482]: 76CCBC3ABC: message-id=<[email protected]>                                                  
Feb  2 19:48:13 raspberrypi postfix/qmgr[2467]: 76CCBC3ABC: from=<[email protected]>, size=1277, nrcpt=1 (queue active)                                                                 
Feb  2 19:48:13 raspberrypi postfix/smtp[2483]: Untrusted TLS connection established to smtp.myisp.com[IPmyisp]:587: TLSv1 with cipher AES128-SHA (128/128 bits)
Feb  2 19:48:14 raspberrypi postfix/smtp[2483]: 76CCBC3ABC: to=<[email protected]>, relay=smtp.myisp.com[IPmyisp]:587, delay=0.58, delays=0.23/0.12/0.16/0.07, dsn=2$ dsn=2.6.0, status=sent (250 2.6.0  <[email protected]> Queued mail for delivery)    
Feb  2 19:48:14 raspberrypi postfix/qmgr[2467]: 76CCBC3ABC: removed

ベストアンサー1

ISPリレーサーバーが正しく構成されていないようです。あなたのメッセージはすぐに拒否されることがあります。

設定の問題は、postfixがISPリレーに対して自己認証しないことです。置く

smtp_sasl_auth_enable = yes

サフィックスをリロードします。その後、メールを再送信してください。

postfixドキュメントから:

smtp_sasl_auth_enable (デフォルト: no)
Postfix SMTPクライアントでSASL認証を有効にします。デフォルトでは、Postfix SMTPクライアントは認証を使用しません。

おすすめ記事