일부 VMS가 포함된 루트 서버가 있습니다. 10.77.77.101은 메일 서버이고 10.77.77.107(vm07)은 WordPress를 실행하는 PHP 웹 서버입니다. 이메일 보내기 및 받기는 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에서는 이메일을 다르게 보내는 것 같습니다.