同じVMホストでローカル接続を許可するようにpostfix / dovecoを変更しました。

同じVMホストでローカル接続を許可するようにpostfix / dovecoを変更しました。

一部のVMSを含むルートサーバーがあります。 10.77.77.101はメールサーバーで、10.77.77.107(vm07)はWordPressを実行しているPHP Webサーバーです。電子メールの送受信はThunderbirdでうまく機能します。dovecot / sieveを有効にするまでPHP経由でvm07からメールを送信するのはうまくいきました。postfix/main.cfには次の行が含まれています:

smtpd_sasl_type = dovecot
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
smtpd_sasl_path = private/auth

同じホスト(10.77.77.107)にある別の仮想マシンからPHPに電子メールを送信しようとすると、これらのエラーが発生します。

connect from vm07[10.77.77.107]
postfix/smtpd[3691]: Anonymous TLS connection established from vm07[10.77.77.107]: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
postfix/smtpd[3691]: warning: vm07[10.77.77.107]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
postfix/smtpd[3691]: disconnect from vm07[10.77.77.107] ehlo=2 starttls=1 auth=0/1 quit=1 commands=4/5

Thunderbirdを使用してメールを送受信することはまだうまく機能し、sieveは迷惑メールを迷惑メールフォルダに正常に分類できます。

これは私のmain.cfです。

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
myhostname = example.de
mydomain = example.de
mydestination = localhost localhost.$mydomain
mynetworks = 127.0.0.0/8 138.201.16.163 10.77.77.1 10.77.77.0/24 [::1]/128 [2a01:4f8:241:1d02::]/64

message_size_limit = 90000000 

mailbox_size_limit = 99999999

virtual_mailbox_limit = 90000000 

alias_maps = $alias_database
virtual_mailbox_base = /var/kunden/mail/
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_alias_maps.cf
virtual_uid_maps = static:2000
virtual_gid_maps = static:2000

smtpd_sasl_type = dovecot
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
smtpd_sasl_path = private/auth

smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes

smtpd_relay_restrictions =
        check_policy_service inet:127.0.0.1:10040
        permit_mynetworks
        permit_sasl_authenticated
        reject_non_fqdn_recipient
        reject_unknown_recipient_domain
        reject_unauth_pipelining
        reject_invalid_hostname
        check_helo_access pcre:/etc/postfix/helo_checks.pcre
    reject_rbl_client ix.dnsbl.manitu.net
        reject_unauth_destination


smtpd_helo_restrictions =
    permit_sasl_authenticated,
    permit_mynetworks,
    reject_unauth_destination,
    reject_non_fqdn_sender,
    reject_non_fqdn_recipient,
    reject_unknown_recipient_domain,
    reject_non_fqdn_hostname,
    reject_invalid_hostname,
    reject_rhsbl_client rhsbl.sorbs.net,
    reject_rhsbl_sender rhsbl.sorbs.net,
    reject_rbl_client cbl.abuseat.org,
    reject_rbl_client sbl.spamhaus.org,
    reject_unauth_pipelining

smtpd_sender_restrictions =
    permit_sasl_authenticated,
    permit_mynetworks,
    reject_unauth_destination,
    reject_rhsbl_client rhsbl.sorbs.net,
    reject_rhsbl_sender rhsbl.sorbs.net,
    reject_rbl_client sbl.spamhaus.org,
    reject_rbl_client cbl.abuseat.org,
    reject_non_fqdn_sender,
    reject_non_fqdn_recipient,
    reject_unknown_recipient_domain,
    reject_unauth_pipelining

smtpd_tls_auth_only = yes
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes

smtp_tls_key_file = /etc/ssl/selbst/example.de/privkey.pem
smtp_tls_cert_file = /etc/ssl/selbst/example.de/fullchain.pem

smtpd_tls_key_file = /etc/ssl/selbst/example.de/privkey.pem
smtpd_tls_cert_file = /etc/ssl/selbst/example.de/fullchain.pem

smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

smtpd_tls_mandatory_exclude_ciphers = aNULL, eNULL, EXPORT, DES, RC4, MD5, PSK, aECDH, EDH-DSS-DES-CBC3-SHA, EDH-RSA-DES-CDC3-SHA, KRB5-DE5, CBC3-SHA
smtpd_tls_dh1024_param_file = /etc/ssl/certs/dhparams.pem

smtpd_milters = inet:localhost:11332
non_smtpd_milters = inet:localhost:11332
milter_protocol = 6
milter_mail_macros =  i {mail_addr} {client_addr} {client_name} {auth_authen}
milter_default_action = accept

recipient_delimiter = +

ssmtpを使用して電子メールを送信します。

#/etc/ssmtp/ssmtp.conf
root=
mailhub=10.77.77.101
hostname=vm07.example.de
FromLineOverride=YES

コンソールからメールを送信することもうまくいきます。

echo "hello"|ssmtp [email protected]

この機能を使用して単一のPHPスクリプトに送信することもうまく機能するため、mail()WordPressでは電子メールを別々に送信するようです。

ベストアンサー1

おすすめ記事