0

I need to setup 2 (physical) Postfix server and on one I want to install dovecot.

Both Postfix will have same MX priority. I would prefer to have the dovecot Mailstorage folder on a NFS share. Both postfix are responsible for same 2 domains.

What's the best way to get all incoming Mails Postfix on Server B to dovecot which stay on Server A? Or should I setup that both Postfix store Mail in the same NFS share?

Nenad
  • 375
  • 1
  • 5
  • 14

2 Answers2

2

You should consider using LMTP to deliver mail from both Postfix instances to Dovecot. This also eliminates the need for NFS and is simpler to setup.

See here for details.

Luca Corti
  • 171
  • 6
  • Ok this would work for the Postfix on same server as Dovecot but what's with the other Server? I can not use a socket as there is no dovecot. – Nenad Aug 09 '12 at 09:20
  • Nenad, see my answer for clarification on the role of the MTAs in this. – MadHatter Aug 09 '12 at 09:41
  • LMTP works over inet sockets too, not just UNIX ones. Just setup an IP listener in dovecot and point postfix to it. The configuration is the same. – Luca Corti Aug 09 '12 at 09:55
  • @Luca Corti Do you know how it can be pointed to a IP Listener, In the manual they only show local solutions like: argv=/usr/lib/dovecot/deliver – Nenad Aug 09 '12 at 12:30
  • Deliver is Dovecot `LDA`, which is an alternative delivery method to LMTP which works only locally. The link I gave you explains the LMTP setup and details the configuration using a unix socket as an example. The configuration for an IP socket is the same, you just need to specify an `inet_listener` instead of a `unix_listener` in Dovecot and in postfix specify the transport accordingly. See the documentation for all the details. – Luca Corti Aug 09 '12 at 12:53
2

Leaving aside the details of LTMP, about which I know little, Luca's answer seems sound. You have a Mail Transport Agent (MTA) on both servers, whether that's postfix, LMTP, sendmail, or whatever. On server A the MTA is configured to deliver locally. On server B the MTA is configured to deliver onward to server A. If B is up and A is down, B will still accept emails for onward delivery, but they'll be held in queue until A comes back up; once A comes back up, B will deliver onward all queued mails at its next configured queue run.

Note that any generalised anti-spam measures you put on A must be put on B as well, otherwise B will blindly accept a bunch of emails which A will later reject, leaving them to end up with the postmaster of servers A and B.

MadHatter
  • 79,770
  • 20
  • 184
  • 232
  • Thank you for the clarification. I don't planed to use some spam filter, as I we will read the Mails with Gmail (external Account -> IMAP) and think they will handle it, if not I must setup something :) – Nenad Aug 09 '12 at 12:36