LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-11-2013, 03:54 AM   #1
pestka
Member
 
Registered: Dec 2012
Location: Southampton, UK
Posts: 36

Rep: Reputation: Disabled
Post [postfix] Auxiliary backup server


Hello there,

I was thinking of having an auxiliary backup server in case my postfix is down (maintenance, downtime, etc). I wanted to use my friends postfix for that purpose. I have added MX records which point to his server. Now, my idea of that is to put on HOLD all mails which come from my domain for as long as my server is down. When my server is up, I would do postsuper -r ALL which would send all mails to my mail server.

I've got a question regarding that though, :

- my friend's server is obviously hosting other domains than mine and has different accounts set up. For that purpose I would need to accept all mails that come for mydomain.com on his server regardless if the account exist or not. How to do that?
 
Old 06-11-2013, 08:55 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
hello. most of what you're asking is answered in here. there is no need to put mail in HOLD and requeue. the secondary mx will deliver to the primary when the primary comes back online. just make sure the secondary has a higher MX preference number (i.e. lower priority) than the primary.
 
1 members found this post helpful.
Old 06-14-2013, 04:25 PM   #3
pestka
Member
 
Registered: Dec 2012
Location: Southampton, UK
Posts: 36

Original Poster
Rep: Reputation: Disabled
Cool, but what to do with this?

550 5.1.1 <test@mydomain>: Recipient address rejected: User unknown in local recipient table;

I do not want to add all of them users on the backup mx...
 
Old 06-15-2013, 12:10 AM   #4
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
i don't understand what it is that you are showing. is it a log entry from the secondary mx for mydomain? on the secondary mx, mydomain should be listed under relay_domains, not mydestination. regarding your last comment, the link above says:

Quote:
If you can't maintain a list of valid recipients then you must specify "relay_recipient_maps =" (that is, an empty value), or you must specify an "@the.backed-up.domain.tld x" wild-card in the relay_recipients table.
 
Old 06-15-2013, 02:24 AM   #5
pestka
Member
 
Registered: Dec 2012
Location: Southampton, UK
Posts: 36

Original Poster
Rep: Reputation: Disabled
Hey Berhanie,

I'm sorry, that was the output on the backup mx server I can't get rid of. I followed your instructions and these given in a link above. I did a lot of tests but something is missing. I am getting the above "unknown recipient" message all the time. I'll post my config for my backup mx in a moment, maybe that will help.
 
Old 06-15-2013, 02:31 AM   #6
pestka
Member
 
Registered: Dec 2012
Location: Southampton, UK
Posts: 36

Original Poster
Rep: Reputation: Disabled
Post

Here's the backup mx conf:

Code:
alias_database = hash:/etc/aliases.db
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailbox_command = /usr/bin/procmail
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 40960000
mydestination = $myhostname, localhost.$mydomain, localhost
myhostname = backupmx.com
mynetworks = (...)
mynetworks_style = subnet
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
relay_domains = hash:/etc/postfix/relaydomains
relay_recipient_maps = hash:/etc/postfix/relay_recipients
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit_mynetworks	    permit_sasl_authenticated	    reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/dovecot/certs/server.crt
smtpd_tls_key_file = /etc/dovecot/certs/server.key
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
Here's relay_recipient_maps:
Code:
@mydomain x
@myanotherdomain x
@yetanotherdomain x
@whichiwanttobackup x
and relaydomains:
Code:
mydomain	OK
myanotherdomain	OK
yetanotherdomain	OK
whichiwanttobackup	OK
and transport maps:
Code:
mydomain                smtp:[mydomain]
myanotherdomain	              smtp:[mydomain]
yetanotherdomain              smtp:[mydomain]
whichiwanttobackup            smtp:[mydomain]
What's wrong here?
 
Old 06-15-2013, 05:48 AM   #7
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Quote:
What's wrong here?
i think the log that you posted may be of the smtp client (logged as "postfix/smtp") rather than the smtp listener (logged as "postfix/smtpd"). to be sure, you should post the log of the entire chain of events of that email, from submission to delivery (grep the mail log for the queue id). if my guess is correct, then the log you are seeing is of the secondary mx trying to deliver to the primary mx, but being rejected by it, since test@mydomain is not a valid recipient on the primary. you should also see that rejection on the primary mx logged by postfix/smtpd.

also, you should not have mydomain on the transport table if you are relying on mx records.

Last edited by Berhanie; 06-15-2013 at 05:50 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Backup Mail Server - Conf Issues ]SK[ Linux - Newbie 1 09-02-2008 12:08 AM
Postfix Backup Mail Server with Webmail ]SK[ Linux - Newbie 9 08-19-2008 03:56 PM
backup email server in Postfix LinuxLover Linux - Networking 1 12-28-2005 10:39 AM
Postfix relay backup server Nelson Linux - Software 0 12-08-2005 04:20 AM
backup postfix server on same LAN? SolidSnake Linux - Networking 10 06-04-2004 12:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration