Dovecot Does Not Like Time to Move Backward!

by David on May 4, 2009

Dovecot running within a FreeBSD Jail can create some interesting issues. One issue that affected my mail server today was time moving backwards (37 seconds, according to Dovecot as reported in the /var/log/maillog):

May  4 21:45:17 mailhost dovecot: Fatal: Time just moved backwards
by 37 seconds.
This might cause a lot of problems, so I'll just kill myself now.

http://wiki.dovecot.org/TimeMovedBackwards

This happened after a reboot of the host system. I went to check the mail, using a Mail client, and I could not connect to the mail server. Upon examining /var/log/maillog, the above line got me to thinking that I had let the jail attempt to change the system clock. So the first step to tracking the problem down is to comment out the adjkerntz line in the /etc/crontab file:

# Adjust the time zone if the CMOS clock keeps local time, as opposed to
# UTC time.  See adjkerntz(8) for details.
#1,31	0-5	*	*	*	root	adjkerntz -a

Although this may not be the only thing necessary to fix the problem, I know from a quick search of “jail + adjkerntz” that it is customary to comment out this line as a matter of setting up the jail properly.

The error code references a hint into the nature of the problem: http://wiki.dovecot.org/TimeMovedBackwards

The quick way to work around the problem (should the above not work next time I restart) is to restart the jail once the host system has stabilized:

/etc/rc.d/jail restart jailname

As I dig out more details, I will post them as edits to this post.

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: