Entry
How can I set the timezone used in headers?
Why is the time wrong in headers?
Mar 27th, 2001 05:51
Dave Sill,
qmail uses Greenwich Mean Time (GMT), instead of the local
timezone, in any timestamps it creates. This is indicated by the "-0000"
at the end of the date specification. It means "no offset from GMT".
(Eastern Standard Time has an offset of "-0500" which means five hours
before GMT.)
qmail uses GMT for two reasons: first, it makes it easier to track
messages that pass through multiple timezones, and second, converting to
the local timezone requires linking with the standard C runtime library,
which DJB has gone to great lengths to avoid since it can be a source of
security and reliability problems.
There are two headers fields where qmail puts a time: Received and Date.
qmail will only add a Date field to locally-injected (not SMTP) messages
that don't already have a Date field. If you don't like the Date header
qmail adds, either configure your mail user agent (MUA) to add them, or
use the "datemail" command to inject messages instead of qmail-inject.
Some people even replace /var/qmail/bin/sendmail with a symbolic link to
datemail.
Received fields are always stamped in UTC. Changing this would require a
source code patch, and would be ill-advised for the reasons stated
above.