2

I have sendmail running on my CentOS server. The server is set to BST and tzdata is correct.

$ date
Tue Jul  2 10:53:56 BST 2013
$ ll /etc/localtime
lrwxrwxrwx 1 root root 33 Jun 28 17:07 /etc/localtime -> /usr/share/zoneinfo/Europe/London

I have a bash script running on this server which sends mail through a cronjob. The cronjob is set to run everyday at 7am.

00 07 * * * sh /root/check_mail_process.sh

The log /var/log/cron shows that the server runs the job at specified time.

Jul  1 07:00:01 ukibimon01 crond[15407]: (root) CMD (sh /root/check_mail_process.sh)

The /etc/mail/sendmail.cf has the following settings:

# time zone handling:
#  if undefined, use system default
#  if defined but null, use TZ envariable passed in
#  if defined and non-null, use that info
#O TimeZoneSpec=

Also, no TZ variable is set on this machine.

The sendmail uses smart relay.

I also use smart relay to send mails to an Exchange server.

# "Smart" relay host (may be null)
DSexchange_server_address

The problem is, I receive the mail an hour later at 8am. The header information from Outlook is here:

Server (TLS) id 14.16.324.0; Tue, 2 Jul 2013 07:00:13 +0000
Received: from BY2PRD0411HT003.namprd04.prod.outlook.com (IP) by
 BY2PRD0411HT005.namprd04.prod.outlook.com (IP) with Microsoft SMTP

So, somehow sendmail is getting time from somewhere else and using

3 Answers 3

1

Are you SURE you put the blame right?

with Microsoft SMTP - it does not indicate sendmail.

Are you SURE sendmail is accepting connection to 127.0.0.1:25 at your CentOS?

1

The server runs on UTC. Your representation of the time as a user is in GMT/BST.

The 7am in the cron file is 0700 UTC, which right now (early October) is seen by you as 0800 BST. This corresponds to the time you receive the emails on Exchange.

0

For example you could set it as follows for Pacific Standard Time.

I would try insendmail.cf:

O TimeZoneSpec=PST8PDT

or in the sendmail.mc:

define(`confTIME_ZONE', `PST8PDT')dnl

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .