Greetings Everyone,
I m working on setting up a CentOS 7.2 host running Postfix 2.10 as a mail relay host to forward mail from things like printers and applications running on servers to our Exchange server running on office 365.
I have set up the host so that it does not deliver any mail locally, and I have it working when mail is sent from the mail relay host, but not when mail is is sent from another client to the relay host.
For local mail, the system connects to exchange and authenticates itself as a valid email user and passes the mail along. I have been trying to get postfix to rewrite the sender address on the mail envelope to the same valid email user so that when postfix connects, it will deliver all of the mail as if it were coming from my valid email user, but I am not having any luck getting this to work.
My idea is that if I can have all the mail sent to the mail relay forwarded roti the exchange server as if it were from the valid user, then when the relay host connects as the valid user, it will be able to send all the mail on to the end users.
I'm more than open to alternative methods and any suggestions.
Here is my latest postconf -n output
Some of these things might be left over from testing various methods of re-writing.
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
debug_peer_list = smtp.office365.com
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_protocols = all
local_header_rewrite_clients = permit_mynetworks
local_recipient_maps =
local_transport = error:local mail delivery is disabled
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 20480000
mydestination =
myhostname = pet-mail-01.mydomain.com
mynetworks = cidr:/etc/postfix/mynets
myorigin = enphaseenergy.com
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
relayhost = [smtp.office365.com]:587
remote_header_rewrite_domain = mydomain.com
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sender_canonical_classes = envelope_sender,header_sender
sender_canonical_maps = hash:/etc/postfix/sender_canonical_maps
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_ciphers = export
smtp_tls_mandatory_ciphers = high
smtp_tls_protocols = !SSLv2, !SSLv3
smtp_tls_security_level = encrypt
smtp_use_tls = yes
unknown_local_recipient_reject_code = 550
and here are the contents of my supporting files:
header_checks
#/^From:.*/ From:kemail@mydomain.com
sender_canonical_maps
#@/.+/ kemail@mydomain.com
@mydomain.com kemail@mydomain.com
smtp_sasl_passwd
# foo.com usernameassword
[smtp.office365.com]:587 kemail@mydomain.comassword
transport
mydomain.com smtp:[smtp.office365.com]:587
At this link, (
http://pastebin.com/7ju7dDYc) is a copy of the log output when postfix tried to forward mail from a host it-lnx-03, to my yahoo mail account.