This documentation is for Dovecot v1.x, see wiki2 for v2.x documentation.
Differences between revisions 1 and 2
Revision 1 as of 2007-05-21 22:35:52
Size: 1570
Editor: TimoSirainen
Comment:
Revision 2 as of 2007-07-26 13:56:01
Size: 2157
Editor: TimoSirainen
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
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. Dovecot isn't very forgiving if your system's time moves backwards. There are usually two possibilities why it's moving backwards:
Line 5: Line 5:
So what's the solution? You have two possibilities:  1. You're running ntpdate periodically. This isn't a good idea.
 1. You're using some kind of a virtual server and you haven't configured it right (or it's buggy).
Line 7: Line 8:
 * Run [http://www.ntp.org/ ntpd] (NOT ntpdate). It slows down the time instead moving it backwards (unless the difference is large)
 * If ntpd doesn't work well (e
g. a bad network connection), you can use [http://cr.yp.to/clockspeed.html clockspeed] 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.
Moving time backwards might cause various problems (see below), so for now Dovecot doesn't even try to handle the situation. Perhaps in some future version.

== Time synchronization ==

There are two choices for synchronizing your clock:

 1. Use
[http://www.ntp.org/ ntpd]. It periodically checks the current time from NTP server and slows down the time if necessary. Unlike ntpdate, it doesn't just move the time backwards (unless the difference is large).
 1.
If ntpd doesn't work well (e.g. a bad network connection), you can use [http://cr.yp.to/clockspeed.html clockspeed] 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.
Line 12: Line 20:

== Virtual servers ==

 * With Xen you should run ntpd only in dom0. Other domains should synchronize time automatically (see [http://xen.epiuse.com/xen-faq.txt this Xen FAQ]).

Time moved backwards error

Dovecot isn't very forgiving if your system's time moves backwards. There are usually two possibilities why it's moving backwards:

  1. You're running ntpdate periodically. This isn't a good idea.
  2. You're using some kind of a virtual server and you haven't configured it right (or it's buggy).

Moving time backwards might cause various problems (see below), so for now Dovecot doesn't even try to handle the situation. Perhaps in some future version.

Time synchronization

There are two choices for synchronizing your clock:

  1. Use [http://www.ntp.org/ ntpd]. It periodically checks the current time from NTP server and slows down the time if necessary. Unlike ntpdate, it doesn't just move the time backwards (unless the difference is large).

  2. If ntpd doesn't work well (e.g. a bad network connection), you can use [http://cr.yp.to/clockspeed.html clockspeed] 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.

Virtual servers

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?

None: TimeMovedBackwards (last edited 2012-08-16 15:16:18 by 178)