LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix as SMTP relay to exchange help (https://www.linuxquestions.org/questions/linux-server-73/postfix-as-smtp-relay-to-exchange-help-743011/)

GGlinux 07-27-2009 12:33 AM

Postfix as SMTP relay to exchange help
 
Can anyone help? I have a linux box on my DMZ with postfix on it. I have exchange on our internal LAN on 10.152.0.104.

I edited main.conf in /etc/postfix and made these ammendments:

myhostname = mail.premiereit.com.au
mydomain = premiereit.com.au
myorigin = $mydomain
inet_interfaces = 203.38.180.211
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 203.38.180.193/224, 10.152.0.0/24
relay_domains = 10.152.0.104
home_mailbox = Maildir/


This doesn't work. Can anyone give me a clue?

Thanks

EricTRA 07-27-2009 02:14 AM

Hello,

I have also set up postfix as a relay server and the first difference I notice is that you set the relay_domain to you LAN. the relay_domain parameter indicates what domains you are relaying for. In your case you'll be relaying for your LAN? I imagine it should be your external network that sends to your postfix server which in his turn has to relay it to the LAN (Exchange).
I'll provide my setup which is functional and relays all mails sent to srvnagios to our Google Mail domain without any problems.
Code:

myhostname = srvnagios.ourdomain.es
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = smtp.gmail.com, localhost, srvnagios.ourdomain.es
relayhost =
mynetworks = 172.25.0.0/16,127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = localhost,172.25.192.35
canonical_maps = hash:/etc/postfix/canonical
relay_domains = srvnagios.ourdomain.es

Notice that relay_domains is set only to srvnagios, meaning that only mail directed to this server gets relayed to smtp.gmail.com.

Also check if your Exchange allows relaying from your postfix server.

Hope this helps you out.

Kind regards,

Eric

GGlinux 07-27-2009 02:34 AM

Hi My Fellow Espanol (my dad is from Barcelona :))

Thankyou for this, Ill try it and give it a go. I see a few difference between your config and mine, am I missing something I should be adding also?

And another thing, the mynetworks field, am I correct in placing both the DMZ and local LAN IP in there?

EricTRA 07-27-2009 02:53 AM

Hola,

Que tal?

I'm not Spanish, I'm from Belgium but I do work in Barcelona and live in Terrassa.

If you don't have local mail accounts on the relay server than it should suffice to only put the DMZ in the mynetworks variable. In my config I have it this way because it's my monitoring server and the monitoring process uses a local account to mail the alerts.

Let me know if you get it working,

Un saludo y hasta luego,

Eric

dxangel 07-27-2009 06:22 AM

Dude,

not a good idea to post real IP addresses and hostnames to a public forum!!!

GGlinux 07-27-2009 06:52 PM

hi dxangel, its not the correct hostnames, changed them for the purpose of this post. THE wan IP is well secured :)

GGlinux 07-29-2009 09:10 PM

Hi Electrica,

Ive been doing a lot of reading on this and I will be configuring this today and tomorrow. I hope you are available for some walkthrough help. Ill let you know as issues arise.

Thanks once again. Viva barca!


All times are GMT -5. The time now is 12:16 AM.