My goal is to add emails to a DB and then send them on to the user at a different domain.
My mail server is hosted elsewhere using my domain, ([email protected]). TO get this working, I set up postfix on a server that gets mail for sub-domain, say, "process.example.com". I followed these instructions to get the PHP piping working.
I have set this up using a PHP script that parses the email, logs it, then re-builds the email and sends it on. My issue is that some messages do not look great after being parsed and reassembled. I realized I might be doing this the hard way. This needs to take an email from [email protected], call my milter for processing, change the TO to [email protected] and send it on its way.
I have read about several postfix process like transport, relay and canonical. I am thinking I need to use one of these, but have not instructions. I also am not sure that my milter will be called if I use one of the processes like relay or canonical.
Can someone give me some help with my postfix config...
As requested, here is output for 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