后缀 – 需要logging电子邮件,然后redirect到相同的用户不同的域

我的目标是将电子邮件添加到数据库,然后将其发送给不同域中的用户。

我的邮件服务器是使用我的域托pipe的,([email protected])。 为了得到这个工作,我在一个服务器上设置了postfix,这个服务器为子域名获得邮件,比如“process.example.com”。 我按照这些说明来使PHPpipe道工作。

我已经使用parsing电子邮件的PHP脚本进行设置,logging它,然后重新生成电子邮件并发送。 我的问题是,一些消息分析和重新组装后看起来不太好。 我意识到我可能正在做这个艰难的方式。 这需要从[email protected]收到一封电子邮件,打电话给我的milter进行处理,将TO更改为[email protected]并发送。

我已经阅读了几个像传输,中继和规范的后缀过程。 我想我需要使用其中的一个,但没有指示。 我也不确定,如果我使用接力或规范的过程之一,我的米尔特将被称为。

有人可以给我一些帮助,我的后缀configuration…

根据要求,这里是postconf -n的输出

alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 default_privs = apache html_directory = no inet_interfaces = all inet_protocols = all local_recipient_maps = luser_relay = catchall mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man milter_default_action = accept milter_protocol = 2 mydestination = $myhostname, localhost.$mydomain, localhost, process.example.com mynetworks = 168.100.189.0/28, 127.0.0.0/8 mynetworks_style = host myorigin = $myhostname newaliases_path = /usr/bin/newaliases.postfix non_smtpd_milters = $smtpd_milters queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES sample_directory = /usr/share/doc/postfix-2.6.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtpd_milters = inet:127.0.0.1:8891 unknown_local_recipient_reject_code = 550 

每个由postfix收到的邮件总是被传递给milter。 所以你不应该担心。

要重写,可以在这里使用recipient_canonical_maps 。

在main.cf中添加这个参数

 recipient_canonical_maps = hash:/etc/postfix/process2main 

并在/etc/postfix/process2main添加这一行

 [email protected] [email protected] 

这会将接收者[email protected]重写为[email protected]

看到这个页面得到如何canonical作品