My mailboxes are on a Dovecot (IMAP) server.On DNS there is an MX record pointing to the server.To read the mail I use Roundcube.If the server is down, I lose the new mail. I would like to do two things, alternatively. First option.1) I keeep the mail on the provider's server, restoring the original MX record.2) Dovecot does not receive the mail, but should go to download it.3) I can access the server with Roundcube to read the downloaded mail, but if the server is down I can always go to read the mail on the provider's server with its webmail Second optionI install a second mail server and the two have to replicate the mail.But I don't know how to do it, so I need a guide with instructions.Furthermore Roundcube would always access only one server and if this is down, how can I connect to the second one?This is a typical situation for webmail like Yahoo, Outlook or GMail, but I'm not Yahoo, Microsoft and Google ;)
Thanks in advance for any advice.
Andrea Miconi wrote:
My mailboxes are on a Dovecot (IMAP) server. On DNS there is an MX record pointing to the server. To read the mail I use Roundcube. If the server is down, I lose the new mail.
Really? What kind of downtime makes you loose emails?
If your server is down, mail delivery is tried every couple of hours for days. So - if your server is down for a day or two, no email should get lost.
You might loose a couple of spam mails, as they don't do retries for performance reasons, but every halfway correctly configured MTA these days is doing this properly.
It can take some time until all emails arrive after the server comes online again. If this is an issue or if you need something more professional for a business environemnt, then configure a second MX with the same SMTP and dovecot configuration, then configure replication between the two dovecot instances. https://wiki.dovecot.org/Replication
HTTP is another topic. If you also need high availibilty of your roundcube frontend, then you'd need a reverse proxy/load balancer in front of your server that can detect the outage and then direct the user to the other frontend on the second MX.
HTH, Stefan
PS: The text part in you email is broken (no line breaks).
If your server is down, mail delivery is tried every couple of hours for days. So - if your server is down for a day or two, no email should get lost.
Fortunately the server went down very few times, but the last one lasted almost two daysand I lost a lot of mail on multiple mailboxes.Even though I work alone, it is still a business server and I can't afford these things.
then configure a second MX with> the same SMTP and dovecot configuration, then configure replication> between the two dovecot instances. https://wiki.dovecot.org/Replication I had read this page on replication, but I didn't understand how I can access the second server.Roundcube/Thunderbird are configured to access an IMAP / SMTP server that matchestheir respective IP addresses, but here the IPs would become 2x2 = 4 HTTP is another topic. If you also need high availibilty of your> roundcube frontend, then you'd need a reverse proxy/load balancer in> front of your server that can detect the outage and then direct the user> to the other frontend on the second MX. I already have Nginx as Reverse Proxy for Apache on my server.However, if I understand your suggestion, I should install a third server for this purpose only.Isn't there a guide to refer to?I wouldn't even know what to look for on Google? PS: The text part in you email is broken (no line breaks).I do not understand.I am writing from the yahoo webmail.
Many thanksA.
On 03/06/2020 11:06, Andrea Miconi wrote:
My mailboxes are on a Dovecot (IMAP) server. On DNS there is an MX record pointing to the server. To read the mail I use Roundcube. If the server is down, I lose the new mail.
I would like to do two things, alternatively.
First option. provider's server with its webmail
- I keeep the mail on the provider's server, restoring the original MX record.
- Dovecot does not receive the mail, but should go to download it.
- I can access the server with Roundcube to read the downloaded mail, but if the server is down I can always go to read the mail on the
This is pretty much exactly what I do. I use fetchmail [1] to download mail from my ISP and feed it to exim, which delivers everything to dovecot. I don't know whether it's possible to configure dovecot alone for this.
[1] It's horrible, but it worked in 2007 and I'm intensely lazy.
Nick
I read about fetchmail.I understand that it doesn't work if the mail server uses an MTA.
Il mercoledì 3 giugno 2020, 15:07:51 CEST, Nicholas Taylor <net20@cam.ac.uk> ha scritto:
This is pretty much exactly what I do. I use fetchmail [1] to download mail from my ISP and feed it to exim, which delivers everything to dovecot. I don't know whether it's possible to configure dovecot alone for this.
[1] It's horrible, but it worked in 2007 and I'm intensely lazy.
Nick
Fetchmail connects to your provider's e-mail server as if it were an MUA, then feeds mail to your server's MTA as if it were a peer MTA. If your provider doesn't allow client connections (by IMAP or POP), then you're right that fetchmail won't help.
It sounds as though you need to set up some kind of failover for your MTA: a second SMTP server, probably configured to feed your primary SMTP server (which then feeds mails to dovecot), but with a very long queue and many retry attempts. Then set your Internet-facing router to direct SMTP connections to your primary SMTP server (if it's up), falling back to your secondary server if the primary is down.
That's not really a dovecot problem: dovecot replication solves the problem "I cannot read my e-mail when my IMAP server is down" [1], and I think the problem you want to solve is "My provider throws away e-mail when my SMTP server is down"?
[1] And load management, and backup, and probably other stuff, none of which is relevant here.
Nick
On 04/06/2020 06:13, Andrea Miconi wrote:
I read about fetchmail. I understand that it doesn't work if the mail server uses an MTA.
Il mercoledì 3 giugno 2020, 15:07:51 CEST, Nicholas Taylor net20@cam.ac.uk ha scritto:
This is pretty much exactly what I do. I use fetchmail [1] to download mail from my ISP and feed it to exim, which delivers everything to dovecot. I don't know whether it's possible to configure dovecot alone for this.
[1] It's horrible, but it worked in 2007 and I'm intensely lazy.
Nick
On 4. Jun 2020, at 18.17, Nicholas Taylor net20@cam.ac.uk wrote:
Fetchmail connects to your provider's e-mail server as if it were an MUA, then feeds mail to your server's MTA as if it were a peer MTA. If your provider doesn't allow client connections (by IMAP or POP), then you're right that fetchmail won't help.
It sounds as though you need to set up some kind of failover for your MTA: a second SMTP server, probably configured to feed your primary SMTP server (which then feeds mails to dovecot), but with a very long queue and many retry attempts. Then set your Internet-facing router to direct SMTP connections to your primary SMTP server (if it's up), falling back to your secondary server if the primary is down.
SMTP actually has this behaviour built in. Mail Exchanger priorities.
Just setup your own MX with priority 10 and your providers spooling MX with priority 20 in DNS records and you are good to go.
Sami
Use Fetchmail on the link between your provider and your email server. Schedule a fetch every 5 minutes or so.. This makes for a very flexible and resilient system.
On 6/3/20 5:06 AM, Andrea Miconi wrote:
My mailboxes are on a Dovecot (IMAP) server. On DNS there is an MX record pointing to the server. To read the mail I use Roundcube. If the server is down, I lose the new mail.
I would like to do two things, alternatively.
First option. provider's server with its webmail
- I keeep the mail on the provider's server, restoring the original MX record.
- Dovecot does not receive the mail, but should go to download it.
- I can access the server with Roundcube to read the downloaded mail, but if the server is down I can always go to read the mail on the
Second option I install a second mail server and the two have to replicate the mail. But I don't know how to do it, so I need a guide with instructions. Furthermore Roundcube would always access only one server and if this is down, how can I connect to the second one? This is a typical situation for webmail like Yahoo, Outlook or GMail, but I'm not Yahoo, Microsoft and Google ;)
Thanks in advance for any advice.
participants (5)
-
Andrea Miconi
-
Bob Gustafson
-
Nicholas Taylor
-
Sami Ketola
-
Stefan Hagen