[Dovecot] dovecot and ntp: Fatal: Time just moved backwards

Arno Wald arno.wald at netcologne.de
Sat Jun 6 21:19:14 EEST 2009


Hallo,

I am running dovecot on a PC (a workstation) to have a mail client 
independent storage for my mails. Now I would like to have the system 
clock set correctly by using ntpd or ntpdate (using debian/sid).

The problem is, that the PC is not online at boot time, but is set 
online on demand manually using "pon" to start the pppd later. So ntpd 
cannot sync the time on boot time before dovecot gets started.

First I was using ntpdate that was started in ppp's if.up.d/ directory. 
This tool does set the time very hard instead of just slightly shifting 
some milliseconds. So dovecot did stop itself, reporting:

"Fatal: Time just moved backwards by 118 seconds. This might cause a lot 
of problems, so I'll just kill myself now."

So I have tried ntpd as I thought it shifts the time in smaller time 
deltas. But this takes much time (several seconds) when booting, giving 
up on all configured servers, because they are not reachable when 
booting (as going online later manually). This turns off ntp 
functionality because ntpd does think that all servers are unreachable 
for ever. (I have tried a command "dynamic" in ntp.conf but this did not 
change anything and ntpd reports it to be obsolete.)

My idea now is to not start ntpd on system boot, but only on if-up. But 
this brings up the same fatal error of dovecot as ntpd seems to hardly 
set the time, too. The only idea I have left is to stop dovecot, start 
ntpd and then start dovecot again on if-up.

Is there a more elegant way to use dovecot and ntpd on a manually dialed 
in PC?

Thanks,
Arno


More information about the dovecot mailing list