PHPで空メール登録システムを作成しています。
Postfixで、設定したメールアドレスにメールを受信すると、PHPを起動させて登録案内メールが送信されます。
この空メール登録システムは出来上がりましたが、その代償として、サイトのドメインのメールアドレスでメールが受信できなくなってしまいました。
(例)今回のサイトのドメイン・・・example.com
・メールアドレスを作成
info@example.com
entry@example.com ・・・空メール受信用として作成
・空メール機能を実装前は、上記メールアドレスにて送信・受信ともOK(メーラー使用)
・空メール機能を実装(Postfix関連ファイルを設定〜再起動)
・entry@example.comに空メール送信〜PHP起動OK(entry.php)
・メーラーにて、info@example.comにメール送信・・・送信NG、デーモンエラーメール
あり(幾つか作成したメールアドレスによってエラー内容が違う 2パターン確認)
①Host not found
②unknown user: "info"
(環境)
GMOクラウドVPS 2G
Cent OS 7.2 (Plesk 12.5)
MTA:Postfix
php5.4.16
(空メール登録システム構築の上で行なったPostfix関連ファイルの設定)
●/etc/postfix/main.cf
myhostname = sv.example.com ・・・Pleskでの「フルホスト名」
mydomain = example.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
smtpd_banner = $myhostname ESMTP unknown
disable_vrfy_command = yes
smtpd_helo_required = yes
mynetworks = .../28, 127.0.0.0/8 ※IPアドレスを適応
●/etc/aliases
entry: "| /usr/bin/php /var/www/vhosts/example.com/httpdocs/entry.php"
(設定の反映 ※コマンド)
newaliases
(空メール受信のアカウント作成 コマンド)
$ sudo useradd -s /sbin/nologin -M entry
Postfix再起動
●空メールシステムは正常に稼働します。
●ドメインのメールが受信できません。(メーラーの他、PleskよりWebメールも確認)
※デーモンからのエラーメールが来ます。
(確認事項) Postfix main.cf
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
上記を、デフォルトの値にすると、今度はメールは受信できるが、空メール送信でPHPが実行されなくなります。
(上記のデフォルト値)
mydestination = $myhostname, localhost.$mydomain, localhost
上記のような状況となっており、困っております。
ご教示頂けましたら誠に幸いです。
よろしくお願い致します。
「postconf -n」を実行して出力される内容を追記
[root@sv ~]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases, hash:/var/spool/postfix/plesk/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
disable_vrfy_command = yes
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_size_limit = 0
mailman_destination_recipient_limit = 1
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 10240000
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = example.com
myhostname = sv.example.com
mynetworks =
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
plesk_virtual_destination_recipient_limit = 1
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sender_dependent_default_transport_maps = hash:/var/spool/postfix/plesk/sdd_transport_maps
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_send_xforward_command = yes
smtp_tls_security_level = may
smtp_use_tls = no
smtpd_authorized_xforward_hosts = 127.0.0.0/8 [::1]/128
smtpd_banner = $myhostname ESMTP unknown
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated
smtpd_helo_required = yes
smtpd_milters = , inet:127.0.0.1:12768
smtpd_proxy_timeout = 3600s
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sender_restrictions = check_sender_access hash:/var/spool/postfix/plesk/blacklists, permit_sasl_authenticated
smtpd_timeout = 3600s
smtpd_tls_cert_file = /etc/postfix/postfix_default.pem
smtpd_tls_ciphers = medium
smtpd_tls_key_file = $smtpd_tls_cert_file
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_protocols = TLSv1 TLSv1.1 TLSv1.2
smtpd_tls_protocols = TLSv1 TLSv1.1 TLSv1.2
smtpd_tls_security_level = may
smtpd_use_tls = yes
tls_medium_cipherlist = HIGH:!aNULL:!MD5
transport_maps = , hash:/var/spool/postfix/plesk/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual
virtual_gid_maps = static:31
virtual_mailbox_base = /var/qmail/mailnames
virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains
virtual_mailbox_limit = 0
virtual_mailbox_maps = , hash:/var/spool/postfix/plesk/vmailbox
virtual_transport = plesk_virtual
virtual_uid_maps = static:30