PDA

View Full Version : Postfix - autoforwarding of all messages to another server


ph0enix
September 17th, 2009, 16:11
Hi,
I'm trying to set up a "hot standby" server for a Postfix system that doesn't send e-mail (only receives). I would like to forward all messages coming to the main server to another machine running postfix (it will be at sitting at a different datacenter). Ideally, I would like for the headers to remain the same as on the original server. Can I do this? If so, how?

Thank you! :D

J.

hansaplast
September 18th, 2009, 10:47
Not sure what you mean here.

Do you just want to backup all incoming mail on another server? Then check the always_bcc option in main.cf. Keep in mind that at the backup server mail is bounced when no (local) user is found. You should redirect (alias) all mail to one or more accounts on the backup server.

If you want a backup mail server that catches all mail when the main server is down. Google: configure postfix as backup MX
O and don't forget to set the right dns entries. An excellent example can be found here (http://www.akadia.com/services/postfix_mx_backup.html).

Alt
September 18th, 2009, 11:09
Try this parameter
/usr/local/etc/postfix/main.cf
# The relayhost parameter specifies the default host to send mail to
# when no entry is matched in the optional transport(5) table. When
# no relayhost is given, mail is routed directly to the destination.

relayhost = blahblahblah

ph0enix
September 18th, 2009, 14:01
Not sure what you mean here.

Do you just want to backup all incoming mail on another server? Then check the always_bcc option in main.cf. Keep in mind that at the backup server mail is bounced when no (local) user is found. You should redirect (alias) all mail to one or more accounts on the backup server.

If you want a backup mail server that catches all mail when the main server is down. Google: configure postfix as backup MX
O and don't forget to set the right dns entries. An excellent example can be found here (http://www.akadia.com/services/postfix_mx_backup.html).

Yes, I'm trying to keep the mail on both servers in sync. I think the always_bcc setting will do the trick. The problem with using the second server as a backup is that the mail will only get delivered to the host that's currently up.

Thank you!

ph0enix
September 18th, 2009, 14:05
Try this parameter
/usr/local/etc/postfix/main.cf

That will make it deliver only to the realy host - no? I need the messages to be delivered to both servers.

Alt
September 18th, 2009, 14:24
Oh i dunno then =)

ph0enix
September 18th, 2009, 14:45
Not sure what you mean here.

Do you just want to backup all incoming mail on another server? Then check the always_bcc option in main.cf. Keep in mind that at the backup server mail is bounced when no (local) user is found. You should redirect (alias) all mail to one or more accounts on the backup server.

If you want a backup mail server that catches all mail when the main server is down. Google: configure postfix as backup MX
O and don't forget to set the right dns entries. An excellent example can be found here (http://www.akadia.com/services/postfix_mx_backup.html).

I'm having trouble figuring out how to use the always_bcc setting (can't find any info on it). Do I just put the backup domain there? ...or does it require an e-mail address with the username as a variable? $user1@seconddomain.com, for example?

Thanks! :D

J.

DutchDaemon
September 18th, 2009, 15:17
BCC is an 'email-userland' type of setting, so it requires an email address, not a hostname.

I don't know how relevant this information still is, but see if it helps:
http://www.phwinfo.com/forum/mailing-postfix-users/140893-postfix-always_bcc.html