Re: Opensmtpd failover

2018-11-23 Thread Peter J. Philipp
If I only knew what others use when they do this successfully then all 
my problems would be solved.   Just kidding.


However here is a try.  In 1998 I was a sysadmin and our setup was with 
sendmail and postfix not smtpd.  We had 3 Sun Ultra Sparc computers 
connected with a small switch to a Netapp NFS filer, the MX priority was 
all the same in DNS so as to achieve a load-share (probably not a true 
share).  The problems back then were NFS related particularily locking 
meaning the Sun computers ran Solaris because it at the time did this 
best.  Back then it was proper to have backup MX's too I think with a 
higher priority field in DNS, this ran postfix and all they did was 
queue the mail and wait for the main mail hosts to come back from 
whatever caused them to be down, then they'd deliver the mail there.  It 
was just a relayer.


You can try making a NFS solution, but the NFS filer is a single point 
of failure itself, ours had multiple power supplies and I was there too 
short a time to see it work over a few years.  I don't know how well 
CARP'ed NFS servers behave, I don't know if it creates problems, that's 
for you to find out.  I also don't know how well the locking works with 
NFS and OpenBSD these days.  A solution is to use dot-lock files which 
gets its atomicity around an NFS stat operation (if that even exists, if 
not then open operation).


The removal of the single point of failure is the tough part, it isn't 
simple, IMO.  Now that I've tried giving you insights to the holy grail 
of mail, I wish you luck building your own system.


Regards,

-peter


On 11/24/18 1:15 AM, Mik J wrote:

Hello,

I'm wondering how to do a proper mail server failover.

Let's say smtp1 is down, the internet client resolves the other mx 
with a lower priority and the mail goes to smtp2.

Now smtp2 writes the message on the disk in order to store it.
What do you people do in order to have a common storage for both smtp 
which can be correct regardless whether a smtp goes up or down.

How do you manage the failover ?

Thank you


--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org



Re: Opensmtpd failover

2018-11-23 Thread Thomas Bohl

Hello,


Now smtp2 writes the message on the disk in order to store it.
What do you people do in order to have a common storage for both smtp 
which can be correct regardless whether a smtp goes up or down.


I'm afraid my answer has little to do with OpenSMTPD.
The common storage for my emails is managed by Dovecot.
I simply use its replication function between two machines.
https://wiki.dovecot.org/Replication

The replication is instantaneous. It's also super convenient for when 
you have to install a new server. You only setup the config and the live 
mailboxes will be pushed onto the system.

(Of course that doesn't excuse one from doing backups!)

HTH
Interested in what other people do as well.

--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org



Opensmtpd failover

2018-11-23 Thread Mik J
Hello,

I'm wondering how to do a proper mail server failover.

Let's say smtp1 is down, the internet client resolves the other mx with a lower 
priority and the mail goes to smtp2.
Now smtp2 writes the message on the disk in order to store it.
What do you people do in order to have a common storage for both smtp which can 
be correct regardless whether a smtp goes up or down.
How do you manage the failover ?

Thank you