home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous Section Next Section

TimeZoneSpec

Set time zone All versions

Under System V, Unix processes must look for the local time zone in the environment variable TZ. Because V8.12 and earlier sendmail was often run as a set-user-id root program, it cannot (and should not) trust its environment variables. Consequently, on System V machines it is necessary to use the TimeZoneSpec option to give sendmail the correct time zone information.

The forms for the TimeZoneSpec option are as follows:

O TimeZoneSpec=zone           configuration file (V8.7 and later) 
-OTimeZoneSpec=zone           command line (V8.7 and later) 
define(`confTIME_ZONE',`zone')    mc configuration (V8.7 and later) 
Otzone                        configuration file (deprecated) 
-otzone                       command line (deprecated) 

Here, the zone is of type string and is usually three arguments in one:[72] the local abbreviation for standard time, the number of hours the local time differs from GMT, and the local abbreviation for daylight savings time. For example, on the West Coast of the United States, you might declare:

[72] This is actually a convention that is not used by all versions of Unix. Consult your online documentation to find the correct form for your system.

O TimeZoneSpec=PST8PDT

If the entire TimeZoneSpec option is missing, the default is to unset (clear) the TZ environment variable (use the system default). If zone is missing, the default is to import the TZ variable from the environment. If zone is present, the time zone is set to that specified.

The system default varies depending on the operating system. For BSD Unix it is the value returned by the gettimeofday(3) call. For SysV Unix it is whatever was compiled into the C library (usually New Jersey time).

For the mc declaration, zone should be either a literal USE_SYSTEM, which causes the entire option to be omitted, or a literal USE_TZ, which causes the option to be declared but the zone to be omitted (thus importing the TZ variable from the calling environment). Otherwise, a time zone declaration is as described earlier:

define(`confTIME_ZONE',`USE_SYSTEM')   use system default
#O TimeZoneSpec=                   the same 

define(`confTIME_ZONE',`USE_TZ')   use environment TZ
O TimeZoneSpec=                    the same 

define(`confTIME_ZONE',`EST5EDT')  use EST5EDT
O TimeZoneSpec=EST5EDT             the same 

The TimeZoneSpec (t) option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

    Previous Section Next Section