Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 4ac0e4267c570fcc2fc826526fbddf5a > files > 205

dovecot-1.0.7-9.el5_11.4.x86_64.rpm

Time moved backwards error
==========================

Dovecot isn't very forgiving if your system's time moves backwards. There are
various problems that it might cause (see below), so for now it doesn't even
try to handle it.

So what's the solution? You have two possibilities:

 * Run ntpd [http://www.ntp.org/] (NOT ntpdate). It slows down the time instead
   moving it backwards (unless the difference is large)
 * If ntpd doesn't work well (eg. a bad network connection), you can use
   clockspeed [http://cr.yp.to/clockspeed.html] as well.
 * If all else fails, you can just go and remove the error checking code from
   'src/lib/ioloop.c'. It's unlikely that anything will break badly, but you
   might get some errors logged once in a while.

In some systems ntpd/ntpdate is run at boot, but only after Dovecot has
started. That can cause Dovecot to die immediately. If you have this problem,
fix your init scripts to run ntpd/ntpdate before Dovecot.

Why not just..?
---------------

It's not as simple as fixing timeout handling to work correctly. Even a full
Dovecot restart doesn't necessarily help, because some files' timestamps can be
in future. To make Dovecot correctly handle time moving backwards would require
verifying every single timestamp comparison code to make sure that it behaves
correctly with future timestamps or with the current timestamp suddenly
shrinking instead of growing. Perhaps all this will be made to work with future
Dovecot releases, but why bother when you can just fix the real problem, which
might fix some other random software failures as well?

(This file was created from the wiki on 2007-06-15 04:42)