Technical article 104904

The time zones in my mail header don't correspond to the system time.

OpenServer 5.0.0

Written · Last revised

Problem

The "From", "Received:", and "Date:" lines give different times in the same mail header.

Cause

Most processes in UNIX look for the local time zone using the
environment variable TZ.  Sendmail is run as a SUID process
and will not trust those environment variables.  Therefore, it
is necessary to use the "t" option to give sendmail the correct
time zone information.

Solution

The "t" option can be set in the sendmail.cf or from the command line.

Using the sendmail.cf:
The time zone can be set by configuring the Ot option in the
sendmail.cf file.   In the /usr/lib/sendmail.cf file, edit the
"Ot" macro to read:
Ot<STD#DST>

where 'STD' is the abbreviation for local standard time, '#' is the number of hours local standard time differs from Greenwich Mean Time, and 'DST' is the abbreviation for local daylight savings time.

For example, in California, the macro reads:

OtPST8PDT

If you were on the east coast of the United States, the macro would read:

OtEST5EDT

To invoke this option from the command line, type (omitting the #):

#/usr/lib/sendmail -otSTD#DST -bd -q1h

where 'STD', '#', and 'DST' are the same as above.

WARNING: Invoking the "t" option from the command line poses a security risk as it may cause sendmail to relinquish its root privilege.

See also

sendmail(ADMN)

From the Xinuos technical article database, record 104904. Reproduced with permission. The original is at www.sco.com/ta/104904, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.