LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   [postfix] Auxiliary backup server (https://www.linuxquestions.org/questions/linux-software-2/%5Bpostfix%5D-auxiliary-backup-server-4175465520/)

pestka 06-11-2013 02:54 AM

[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?

Berhanie 06-11-2013 07:55 PM

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.

pestka 06-14-2013 03:25 PM

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...

Berhanie 06-14-2013 11:10 PM

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.

pestka 06-15-2013 01:24 AM

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.

pestka 06-15-2013 01:31 AM

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?

Berhanie 06-15-2013 04:48 AM

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.


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