我想将一个特定的地址管道传输到PHP脚本,但似乎我的transport_maps没有触发,而是使用了virtual_transport。这是我的配置:
@example.com在virtual_mailbox_domains中列出,对虚拟邮箱的投递工作正常。
但我需要将所有针对foo@example.com的消息转发到另一个服务,而不是指定为virtual_transport的dovecot-lda。
这是virtual_transport的投递方法:
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/dovecot-lda -f ${sender} -d ${recipient}
这是我想要管道传输所有foo@example.com的地方
php_script unix - n n - - pipe flags=Fq user=www-data argv=/home/script.php
postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
dovecot_destination_recipient_limit = 1
mailbox_size_limit = 0
milter_default_action = accept
milter_protocol = 2
mydestination = localhost
myhostname = localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
non_smtpd_milters = net:localhost:12301
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_milters = inet:localhost:12301
smtpd_recipient_restrictions =
smtpd_relay_restrictions = permit_sasl_authenticated permit_mynetworks
defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/mailserver.pem
smtpd_tls_key_file = /etc/ssl/private/mailserver.pem
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = hash:/etc/postfix/transport
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-
domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = dovecot
/etc/postfix/transport中的内容
看起来postfix忽略了transport_map,我总是得到“在虚拟邮箱表中找不到用户”的错误。这是正确的,因为没有这样的用户,但我想在检查是否有虚拟用户之前通过transport_maps转发邮件。
有人可以帮忙吗?我已经花了两天时间搜索、阅读手册和尝试,但似乎它只是不起作用。
virtual_mailbox_maps
设置阻止了postfix查看transport_maps
设置。 - Stephan Klein