Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
    
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 9 '12 at 9:20
    
Nenad, see my answer for clarification on the role of the MTAs in this. –  MadHatter Aug 9 '12 at 9: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 9 '12 at 9: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 9 '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 9 '12 at 12:53

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.

share|improve this answer
    
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 9 '12 at 12:36
    
Nenad, once you're happy with one of the answers to this question, may I encourage you to accept it? You might also want to revisit your older questions; some of those have as many as seven answers, so one must surely be acceptable. We see a warning by your username of "42% accept rate", and in any case accepting answers is both courteous and drives the SF reputation system both for questioner and answerer. –  MadHatter Aug 9 '12 at 12:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.