How to configure sendmail.postfix to relay on exchange 2010?

22,332

To use the postfix relay function, modify your /etc/postfix/main.cf file to include the following configuration:

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
mydomain = domain.com
myorigin = $myhostname
inet_interfaces = localhost
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
relayhost = exchange2010.domain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
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
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES

Where the key entires that will need modifying to suit your local settings are:

mydomain = domain.com

Set this to your local domain.

myorigin = $myhostname

If you want the mail to originate from the hostname of the client.

relayhost = exchange2010.domain.com

This is the FQDN of your exchange server.

Then reload / restart your postfix service:

service postfix reload / restart
Share:
22,332

Related videos on Youtube

Ricardo
Author by

Ricardo

Updated on September 18, 2022

Comments

  • Ricardo
    Ricardo almost 2 years

    I'm currently trying to figure out how to configure sendmail.postfix in Red Hat 6 to work with exchange 2010 relay. I've already configured our exchange server to allow our web server to relay. What are the commands to do so?

  • geedoubleya
    geedoubleya over 9 years
    No problem, if this works for you then accept it as the answer to avoid other users spending time on the solution.
  • Ricardo
    Ricardo over 9 years
    Hey Geeoubleya question for you yesterday I made all the changes on the our web server but I'm still getting the SMTP error on the website. What else should I look? On the exchange server I've tested the relay using putty and I don't get any errors. Please Advice
  • geedoubleya
    geedoubleya over 9 years
    @Ricardo Does echo Test email | mailx -v -s "Test Email" email@address work?
  • Ricardo
    Ricardo over 9 years
    No it doesn't work. I've also tried to make the changes on joomla and I still can't send mail. I tripple checl the exchange server as well and I can send test email back and fourth via powershell. Any more ideas??
  • Mike
    Mike over 9 years
    @Ricardo It could be the exchange server force to have e.g an authenticated user?