1

So, I am setting up a backup mail server.

I got it relaying messages (saving them to queue and then, as soon as primary's up, deliver them to primary). It took following two lines:

relay_domains = $mydestination domain.tld
smtpd_recipient_restrictions = permit_mynetworks
                               check_relay_domains

However. I want a secondary not only to relay messages, but also to store them to local mailboxes (provided, the local mailboxes with needed names exist), so I could access them in case of emergency via, say, roundcube webmail.

How do I make Postfix both relay and receive messages at the same time?

2
  • An MX20 relay is not best practice for postfix redundancy, its better to go with 2 equivalent MX10. If you are able to read german, I can suggest you to read this article from Heinlein: heinlein-support.de/upload/mk4/…
    – Henrik
    Jan 18, 2015 at 10:36
  • Hell yes am I able to read German. Thanks for the article. Jan 19, 2015 at 16:56

1 Answer 1

0

One solution can be to have the relay server has a fake domain and then using recipient_bcc_maps BCC all the messages to local addresses with the fake domain.

Add to main.cf the following:

recipient_bcc_maps = hash:/etc/postfix/recipient_bcc_maps

and also add fake.domain.com to the end of mydestination = ..., this way this server will get the all of the [email protected] e-mails (if the user exists).

In /etc/postfix/recipient_bcc_maps put:

[email protected] [email protected]

than run postmap recipient_bcc_maps

This way to every message to [email protected] a BCC will be added to [email protected] so the message will be stored locally.

4
  • I think, it might be something that would work. Could you please explain in more detail? Jan 19, 2015 at 0:30
  • Can I apply some sort of wildcard, so that I'd not have to edit files every time users are added? Jan 20, 2015 at 13:42
  • Maybe by using prce based recipient_bcc_maps. Put recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc_maps in main.cf, and /^(.*@your\.domain\.com)/ ${1}@fake.domain.com in it. But haven't tried it myself.
    – Stone
    Jan 20, 2015 at 13:51
  • Looks like we're out of luck on this one, sadly. Or it needs to be addressed further. Anyway, thanks for the help, I really appreciate it. Jan 20, 2015 at 14:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .