Configuring postfix to send to local Exchange server

Hi all,

I have been banging my head against the wall trying to get this sorted but don’t seem to be getting anywhere! I’m not very experienced with Linux OSes so you might have to be a bit patient with me!

Basically what I am trying to do is have postfix send voicemails to the local Exchange server. This server is running SBS 2011 and is on the same subnet as the FreePBX server.

The FreePBX server was installed using the distro download on this website: Stable-3.211.63-10
Release Date-06-02-13
FreePBX 2.11, Centos 6.3
Asterisk 1.8, 10 or 11

Asterisk 11 was selected during the install. E-mails don’t need to be routed outside the domain, all voicemails are going to mailboxes on the local Exchange server.

The FreePBX server isn’t joined to the domain but has been added to the list of IP addresses permitted to send mail through the Exchange server.

I know that I need to edit the file which I have been doing but must have something wrong in my configuration.

Any help would be greatly appreciated!!

You need to add the FreePBX IP as a trusted sender to exchange then just add the Exchange server IP as a “smart host”

An example is already in the file

Don’t forget to restart postfix after editing the file (service postfix restart). Check the /var/log/maillog for errors on startup and by all means edit the file on the machine (with vi or nano), don’t make the mistake of downloading the file,editing it on a Windows machine (changing the character set to Windows) the uploading it back.

I had a guy trying to edit the files in word and wondering why they didn’t work!

Let us know you got it sorted out.

Thanks, it is sending e-mails OK after adding the IP to the trusted senders list. Problem 1 down, about 100 to go!

I don’t see the section you’re talking about in the file. What do you mean by "add the Exchange server IP as a “smart host”?

I’m currently seeing the emails hit my Exchange server and get bounced back because of unknown user.

I’ve configured the pbx server as a hub transport, and set the server ip as the ‘relayhost’ in the file, but still no dice.

Can you at least point me to a good walkthrough for this setup. I’ve been futzing with this for 4 and a half hours now and haven’t gotten anywhere.

You need to update your localhost name to something that your Exchange will accept.

from the CLI hostname

Logoff and log back in. In exchange you have to add hostname as trusted sender.

I’ve verified that my hostname is set properly from the command line. I then added it to the Server Hub Transport Receive Connectors. I also added the server IP to the Allowed IP list. I even added the email address that is being generated ‘[email protected]’ to my Outlook Allowed Sender List.

I can get emails to send from postfix to gmail just fine, but all I get is a ‘connection timed out’ when trying to send to exchange.

You need to verify that your freepbx / postfix box can talk to the exchange box. There may be a port or firewall issue. My ISP blocks outgoing port 25 ( mail ) connections so if I send mail to a remote box, it has to be on something other than port 25. The remote box might be running something like fail2ban ( like we run on freepbx ) and has blocked your ip address from making connections to it becuase of too many failed mail attempts.

If you have not told postfix to use an ‘alternate’ port, then you are going to be using port 25 ( standard mail ) for your connection. You should be able to do something like telnet 25 and get:
telnet 0 25
Connected to 0.
Escape character is ‘^]’.
220 pbx.localdomain ESMTP Postfix
… type quit if this works…
if this does NOT work… then this is why your mail is timing out.