LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-27-2015, 03:12 PM   #1
dynaguy
LQ Newbie
 
Registered: May 2010
Location: Vancouver, Canada
Distribution: CentOS/Ubuntu
Posts: 17

Rep: Reputation: 1
Question Postfix mx backup server serve multiple domain issue


I setup a mx backup server to relay emails to two domains. The 2 main email servers(mail.domain1.tld and smtp.domain2.tld) are located on two different IP. I want all emails to @domain1.tld relay to mail.domain1.tld, and all email to @domain2.tld to smtp.domain.tld.

However, with my current configuration, all emails relay to mail.domain1.tld, even through I use "sender_dependent_relayhost_maps". I think it may because I have "relayhost = mail.domain1.tld:587". Once I disable this line and the server only try to relay to itself then eventually failed.

Could someone help me pls? Thanks a lot.

Here is my postfix configuration:



Code:
# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
maximal_backoff_time = 1w
maximal_queue_lifetime = 3w
minimal_backoff_time = 15m
mydestination = localhost.localdomain, localhost
myhostname = theta.domain1.tld
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
queue_run_delay = 300s
readme_directory = no
recipient_delimiter = +
relay_domains = hash:/etc/postfix/relaydomains
relay_recipient_maps =
relayhost = mail.domain1.tld:587
sender_dependent_relayhost_maps = hash:/etc/postfix/transport
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = login, plain
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_type = cyrus
smtp_sender_dependent_authentication = yes
smtp_tls_CAfile = /etc/postfix/sasl/smtpd.cert
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
Code:
# cat transport
@domain1.tld        mail.domain1.tld:587
@domain2.tld       smtp.domain2.tld:587
Code:
# cat relaydomains
domain1.tld OK
domain2.tld OK
Code:
# cat sasl_passwd
mail.domain1.ld:587  <username1>:<password1>
mail.domain2.ld:587  <username2>:<password2>
 
Old 10-29-2015, 03:14 AM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
You should set mydestination to include the correct domain that each server is handling itself and remove that domain from relaydomains file & transport file.
(and your transports shouldn't be 'sender dependent'!)
Also remove the relayhost directive.
You might also need to set a local transport (likely 'local' or 'virtual' depending on your setup).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix - Multiple Emails / 1 domain Panicker Linux - Newbie 2 11-17-2011 08:04 AM
1 DHCP server needs to serve multiple VLANs pridefc Linux - Networking 6 03-18-2010 11:32 AM
Multiple postfix smtp server for a single domain satish.apg Linux - Server 2 03-16-2010 07:36 AM
Single DHCP server to serve multiple subnets ImanVajdi Linux - Networking 7 01-05-2010 07:56 AM
Postfix for multiple domain talat Linux - Software 1 02-13-2006 04:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration