New guide: how to warm up a dedicated IP without hurting your reputation. Read now →
Log in
MigoSMTP
TroubleshootingUpdated 26 Oct 2026

Clock Sync and Email: How Wrong Server Time Breaks DKIM, Dates, Tokens and Delivery

How incorrect system time affects email: Date headers, DKIM timestamps and expiry, TLS certificate validation, one-time codes, queue retries, log correlation. How to use NTP, monitor drift and diagnose time-related failures.

KW
Written by Kenji Watanabe
HTML Email Developer
Reviewed by Aarav Mehta
  • Published5 Jan 2025
  • Read time6 min
  • Length1,240 words
Share this guide

Computers keep time with a small crystal and a battery, and left alone they drift. A virtual machine that was paused, a container host with a bad time source or a firewall that blocks NTP can run minutes or even days away from real time. Email is surprisingly sensitive to this. The Date header looks wrong, DKIM signatures appear to come from the future, TLS certificates are rejected as not yet valid or expired, one-time codes arrive "expired", retries fire at the wrong moment and logs from different servers cannot be lined up. Because the symptoms appear in so many places, time problems are easy to miss. This guide lists what clock errors break, how to diagnose them, how to keep servers in sync and what to monitor. It builds on the Date header, DKIM signed headers and reading mail logs.

RuleEvery host that sends, relays or logs mail must have synchronised time, ideally within a second
ToolsNTP or chrony with several reliable sources; a monitored offset
SymptomsFuture or past dates, DKIM failures, TLS errors, expired codes, confusing logs
CheckCompare the server clock with a trusted source and with the Date and Received headers of a test message

What a wrong clock affects

AreaWhat goes wrongWhat you see
Date headerThe sender stamps the message with its own clock. Large errors look suspicious. See Date headerSpam points for dates far in the past or future; messages sorted wrongly in inboxes
DKIM signingThe t= tag records the signing time and x= the expiry. A fast clock produces signatures "from the future"; a slow clock can produce signatures that appear already expiredVerification failures or "signature not yet valid" on some receivers
DKIM verificationA receiving server with a wrong clock rejects valid signatures with x= in the past or timestamps in the futureIntermittent dkim=fail from one receiver only
TLS certificatesValidity periods are checked against the local clock"Certificate is not yet valid" or "certificate has expired" even though the certificate is fine. See certificates
MTA-STS and DANE policiesPolicy lifetimes and signature validity depend on timePolicies treated as expired or not yet valid
Authentication tokensOAuth2 access tokens, JWTs and signed URLs include timestamps. See OAuth2 for SMTPInvalid-token errors or unexpectedly short lifetimes
One-time codes and magic linksExpiry is calculated from the server clockCodes expire before the user reads them, or never expire
Queue and retry schedulingRetry intervals and queue lifetime use local time. See retry schedulesMail retried too soon, or bounced early, after a clock jump
Logs and tracingTimestamps from several servers cannot be correlatedImpossible sequences, such as delivery before submission
Rate limitsPer-hour and per-day counters reset on local timeLimits that reset at the wrong moment
Scheduled campaignsSend times are based on server time and time zone settingsCampaigns delivered hours early or late. See time zones

Time zone is not the same as clock accuracy

Two different problems are often confused. Clock accuracy is whether the machine's notion of the absolute moment is right; the time zone merely affects how that moment is displayed. Email headers carry an explicit zone offset (for example +0530), so a message stamped in a different zone is correct if the offset is right. A server with the right clock but a missing or wrong zone setting produces headers that show an offset of +0000 while local time is something else, which is harmless to machines but confusing to people reading logs. Run servers in UTC, convert for display and make applications store UTC timestamps. The real danger is a wrong absolute time, which misleads every system that uses it for validation.

Keeping time right

  1. Use a time daemon. chrony (preferred on modern Linux, especially virtual machines) or ntpd, or systemd-timesyncd for simple cases. Windows servers use the Windows Time service, configured to follow a domain controller or a public pool.
  2. Use several sources. Configure at least three or four servers (a public pool, your provider's time service and an internal source). One source gives no way to detect a bad one.
  3. Allow the traffic. NTP uses UDP port 123. Many hardened networks block it; open it to the chosen sources only.
  4. Handle virtual machines properly. After a pause, snapshot restore or live migration the clock can jump. Enable the hypervisor time-sync feature or configure chrony to step the clock quickly when the offset is large (the makestep directive).
  5. Check containers. Containers share the host clock; fix the host, not the container.
  6. Set the zone to UTC on mail servers and application hosts to avoid daylight-saving surprises.
  7. Guard against drift on a schedule. A host that is fine today can drift after a reboot or a firewall change. Monitor, do not assume.
# chrony: status and offset
chronyc tracking
chronyc sources -v

# systemd hosts
timedatectl status          # look for "System clock synchronized: yes"

# Quick comparison with a reference (prints offset in seconds)
chronyc -a 'burst 4/4' && chronyc -a makestep   # only when you intend to step the clock

# Sample /etc/chrony/chrony.conf lines
pool 2.pool.ntp.org iburst
makestep 1.0 3
rtcsync

Diagnosing a suspected time problem

  1. Compare the server's clock with a trusted reference (a phone synchronised to the network, a public time site, or a second server you trust).
  2. Send a test message and look at three timestamps in its headers: the Date header (set by the sender), the first Received line (set by the first server) and the last Received line (set by the recipient's system). They should agree within a few seconds. See reading Received headers.
  3. Read the DKIM-Signature t= value (a Unix time) and convert it. It should be the moment the message was sent.
  4. Check TLS errors in the logs for "not yet valid" or "expired" messages while the certificate dates are correct.
  5. Look for sudden jumps in the log timeline, which suggest the clock was stepped.
  6. Fix the time source, then retest and verify that queued and scheduled mail is still correct. Mail queued during a large clock error may have wrong due times.
# Convert the DKIM t= value to a readable date
date -u -d @1738490400
# Show the server's current UTC time for comparison
date -u

Monitoring

MetricAlert when
NTP offset per hostAbsolute offset above 0.5 seconds (warning) or 5 seconds (critical)
Time source reachabilityNo source reachable for more than a few minutes
Clock step eventsAny step larger than one second outside planned maintenance
Certificate validity errors in logsAny occurrence of "not yet valid"
DKIM failures at one receiver onlySustained, with no change in your signing
Gap between Date header and first Received timestampAbove a few seconds on average

Special cases

  • Leap seconds. Providers handle them with smearing or stepping; avoid mixing smeared and non-smeared sources in one configuration.
  • Hosts restored from backup. A restored machine may wake with an old clock and send mail with old dates until it syncs; delay the start of mail services until time is synchronised.
  • Embedded devices and printers that send scan-to-email often have unset clocks (dated 1970 or years ago) and no time sync. Spam filters flag such messages; give them a time source or route them through a relay that rewrites the Date header if policy allows.
  • Multiple data centres. Use the same source set everywhere so that offsets between sites stay small.

Time synchronisation is dull infrastructure that nobody notices until it fails. Run a proper time daemon with several sources, keep servers on UTC, monitor offsets and treat unexplained date, signature or certificate problems as a possible clock issue before changing anything else.

Test a message end to end Check authentication and headers on your sending domain.

Open the checker

References and further reading

Frequently asked questions

How does a wrong server clock affect email?

It can produce bad Date headers, DKIM timestamps in the future or past, TLS certificate errors, expired codes and confusing logs.

Which time service should a mail server use?

chrony or ntpd on Linux with several reliable sources, or the Windows Time service configured to a trusted source.

Should servers run in UTC?

Yes. UTC avoids daylight-saving problems; convert to local time only for display.

How can I tell if the clock is the problem?

Compare the Date header, Received timestamps and DKIM t= value with a trusted reference.

What offset is acceptable?

Keep it within a second if you can and alert above about half a second to a few seconds.

Topics#ntp#time#dkim#tls#dates
Was this guide helpful?Your answer helps us improve our documentation.

Start sending in minutes.

Create an account, add your domain and send your first email.

Get started Talk to sales