Postfix Gateway with Exchange Mail With MX back-up

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Postfix Gateway with Exchange Mail With MX back-up
# 1  
Old 08-21-2014
Postfix Gateway with Exchange Mail With MX back-up

Hello,

We have been looking for ways of implementing some redundancy on our postfix gateways in our company. We have 4 Postfix Gateways.
mail2.domain.ro 10
mail.domain.ro 20
mail1.domain.ro 30
mail3.domain.ro 40
On nslookup we have like this:
domain.ro MX preference = 10, mail exchanger = mail2.domain.ro
domain.ro MX preference = 20, mail exchanger = mail.domain.ro
domain.ro MX preference = 30, mail exchanger = mail1.domain.ro
domain.ro MX preference = 40, mail exchanger = mail3.domain.ro

The postfix servers are only the gateways to the internet. In the company we use the Exchange from Microsoft.

So, every gateways points to a HUB.
mail2.domain.ro (10.10.9.10 ) points to the first hub ( hub 1 = 10.21.1.4 )
mail.domain.ro ( 10.10.9.99 ) points to the second hub ( hub 2 = 10.21.1.7 )
mail1.domain.ro ( 10.10.9.98 ) points to the 3rd hub ( hub 3 - at the moment is down )
mail.3.domain.ro - it will be emplented in other city.

For the 2 postfix gateways we have configured the files like this:

main.cf

$ cat /etc/postfix/main.cf | egrep -v "(^#.*|^$)" > /home/yo/main.cf
smtp_data_xfer_timeout = 600
smtpd_error_sleep_time = 2s
smtpd_soft_error_limit = 10
smtpd_hard_error_limit = 20
smtpd_tls_CAfile = /etc/postfix/tls/CA.txt
smtpd_tls_cert_file = /etc/postfix/tls/domain.ro.crt
smtpd_tls_key_file = /etc/postfix/tls/domain.ro.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_CAfile = /etc/postfix/tls/CA.txt
smtp_tls_cert_file = /etc/postfix/tls/domain.ro.crt
smtp_tls_key_file = /etc/postfix/tls/domain.ro.key
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtp_use_tls = yes
smtp_tls_security_level = may
smtpd_tls_received_header = yes
smtpd_tls_ask_ccert = yes
smtpd_tls_loglevel = 3
tls_random_source = dev:/dev/urandom
smtpd_tls_session_cache_timeout = 3600s
smtpd_client_restrictions = permit_mynetworks,
permit_sasl_authenticated,
smtpd_helo_required = yes
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
mydomain = domain.ro
inet_interfaces = all
mydestination =
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16
relay_domains = domain.ro
transport_maps = hash:/etc/postfix/transport
relayhost =

smtp_generic_maps = hash:/etc/postfix/generic
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

header_checks = regexp:/etc/postfix/header_checks
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $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.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
message_size_limit = 25600000



master.cf

$ cat /etc/postfix/master.cf | egrep -v "(^#.*|^$)" > /home/yo/master.cf

smtp inet n - n - - smtpd -o content_filter=spamassassin
submission inet n - n - - smtpd
-o smtpd_enforce_tls=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
smtps inet n - n - - smtpd
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
-o fallback_relay=
showq unix n - n - - showq
error unix - - n - - error
discard unix - - n - - discard
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
cyrus unix - n n - - pipe
user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}


transport

$ cat /etc/postfix/transport | egrep -v "(^#.*|^$)" > /home/yo/transport

domain.ro smtp:[10.21.1.4]
.domain.ro smtp:[10.21.1.4]



This is the actual configuration, so the postfix gateway points to a exchange HUB.

Our goal is : if the first hub drops from the first gateway, if we can manage to connect to the second hub .
We use the transport conf to connect to the hub, but how can we manage to points to a second hub if the first hub is dropped.

If we change in the master.cf with this: relay unix ... smtp -o smtp_fallback_relay=[fallback.example.com] and in the transport we still keep the current configuration it will work corectly?

How can we do this ?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Inconsistency between RedHat 6.5 global gateway and single gateway leads to loss of default gateway

Dear friends I use RedHat 6.5, which sets the gateway in the configuration file / etc / sysconfig / network as GATEWAY = 192.168.1.26, and the gateway in the configuration file / etc / sysconfig / network-scripts / ifcfg-eth11 as GATEWAY = 192.168.1.256. The two gateways are different.... (6 Replies)
Discussion started by: tanpeng
6 Replies

2. Linux

Configure Postfix to relay to Exchange Server with NTLM authentication

Hello I have a shell script, which should send email, if any error occurred. This script is running in Red Hat Linux 4.6, and want to configure postfix so it can relay to an Exchange Server. The Authorization method of Exchange server, I guess is: 250-AUTH NTLM. So I have: Server A ( Red... (1 Reply)
Discussion started by: viktor1985
1 Replies

3. HP-UX

[Solved] How do I configure Unix Mail Server to use another Mail Exchange Server

We have configured our mail unix server and can send out emails automatically from applications running on unix to different people in our company as well as outside our company. However there is an outside client who is not receiving these emails because the settings on their mail server cannot... (4 Replies)
Discussion started by: Tenyhwa
4 Replies

4. UNIX for Dummies Questions & Answers

Please help with Postfix config issue - How to allow remote Exchange server to relay to my postfix

Hi guys One of our clients have a problem with sending email to a certain domain. No matter what we try, the mails just dont get delivered. What I did then, is created a new connector on their Exchange server, pointing all mail sent to their client at "domain1" to relay to our Postfix mail... (0 Replies)
Discussion started by: wbdevilliers
0 Replies

5. IP Networking

postfix - reinject mail to postfix from hold queue directory

hi all. Am using smtpd_recipient_restrictions & check_recipient_access in postfix. The hash file looks like this: emailaddress1 HOLD emailaddress2 HOLD The aim is to place email from these recipients in the hold directory,check them then reinject them back in postfix on some... (0 Replies)
Discussion started by: coolatt
0 Replies

6. IP Networking

make ms exchange connect to postfix

hi all. i have setup postfix on a freebsd machine. we have a ms exchange server on the same domain. I want to configure postfix to accept email(n attachments) from the exchange server. can someone advise how to do that ? thanks. (0 Replies)
Discussion started by: coolatt
0 Replies

7. Debian

Postfix refuses POP clients after mysqlizing back end

Hello, I have attempted to mysqlize the backend of my postfix config. Since doing that I have not been able to connect to my server via pop clients. I am using courier as my pop server. I am suffering authentication failures even though the correct username and password are supplied. ... (0 Replies)
Discussion started by: bluethundr
0 Replies

8. UNIX for Dummies Questions & Answers

Mail Exchange Server

I've got a question regarding setting up mail between two unix boxes. Is it possible to setup two boxes conected via a hub and allow them to send mail using the Netscape Messenger. I know that I can be done so using the UNIX sendmail but I need to connect them via Messenger as my ultimate goal is... (0 Replies)
Discussion started by: GlockCW
0 Replies

9. UNIX for Dummies Questions & Answers

mail exchange

Hi everyone I am setting up my own web hosting and dns server - have got all the dns and web server things sorted out. I am wondering if anyone knows what I need to do to enable my customers to have their own pop and smtp access under their own domains which they host with me. I have two ip... (2 Replies)
Discussion started by: alwayslearningunix
2 Replies
Login or Register to Ask a Question