Operating System - HP-UX
1748224 Members
4563 Online
108759 Solutions
New Discussion юеВ

Re: Problem sendmail time information

 
Luk Vandenbussche
Honored Contributor

Problem sendmail time information

Who can tell me exactly where sendmail gets its time info from.
In my case I have a TIMEZONE, TZ=WET0WETDST (for Belgium).
I don't use TimeZoneSpec in the file sendmail.cf
When I send a mail from my unix server at 15:03 (output of command date, exact time) to my exchange mailbox, in the file mail.log, the the mail is send at 13:03
When I look in my client mailbox, the arrival time is 15:03, but the send time in my mailbox, the time is 16:03.

How can I solve this problem? Who can explain this time difference?

Thanks a lot
12 REPLIES 12
LucianoCarvalho
Respected Contributor

Re: Problem sendmail time information

I think it's worthwile to test sendmail configuring it like this.

1. Specify a timezone in the /etc/mail/sendmail.cf file
in the following manner:

O TimeZoneSpec=GMT0BST

2. Execute the following commands to stop and re-start sendmail:

A. cd /sbin/init.d

B. ./sendmail stop

C. ./sendmail start

3. Send a test message.

regards.

Donny Jekels
Respected Contributor

Re: Problem sendmail time information

run this command.

echo \$Z | /usr/sbin/sendmail -bt -d

it will give you all your sendmail configs.

sendmail get its time from the system clock.

/etc/TIMEZONE
"Vision, is the art of seeing the invisible"
Luk Vandenbussche
Honored Contributor

Re: Problem sendmail time information

Luciano,

I performed a test : no difference.

Dony,

Which values says i am using my local timezone ??
Sergejs Svitnevs
Honored Contributor

Re: Problem sendmail time information

Try putting into sendmail.cf:

O TimeZoneSpec=

This will then get the TZ variable same way as every other programs and daemons.

Then restart sendmail daemon...
Regards,
Sergejs
Luk Vandenbussche
Honored Contributor

Re: Problem sendmail time information

Sergejs,

Problem is still the same.
Seth Parker
Trusted Contributor

Re: Problem sendmail time information

This may be a silly question, but have you checked that the timezone is set consistently?

Try using /sbin/set_parms timezone to set the timezone for the machine, make sure that the /etc/profile has the correct timezone in it, and check to see that your and/or the client's .profile don't have a timezone setting in them.

If you use set_parms, you're going to have to reboot before it will take effect.

Good luck!
Seth
Steven E. Protter
Exalted Contributor

Re: Problem sendmail time information

I'm not sure who the client is and where the client is. If all of this is happening on the same machine, this suggestion will not be useful.

Suggestion:
Make sure all machines involved are in synch with time. That includes local pc's.

This can be insured in hp-ux by having consistent time zone info on ALL machines as noted earlier.

This can be enhanced by connectiing to a time server on the Internet with the ntp.conf an xntpd daemon.


http://www.ntp.org/

http://developer.novell.com/research/appnotes/1999/july/03/02.htm

Included in the above site is a free program for any windows machines involved.

Here is some refernce material for HP-UX.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x3cf0e822e739d711abdc0090277a778c,00.html

Configuring ntp hp.docs

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90685/B2355-90685_top.html&con=/hpux/onlinedocs/B2355-90685/00/00/63-con.html&toc=/hpux/onlinedocs/B2355-90685/00/00/63-toc.html&searchterms=ntp&queryid=20030510-202545

Preparation(11.x)
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B5158-90019/B5158-90019_top.html&con=/hpux/onlinedocs/B5158-90019/00/00/32-con.html&toc=/hpux/onlinedocs/B5158-90019/00/00/32-toc.html&searchterms=ntp&queryid=20030510-202545

Troubleshooting
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90110/B2355-90110_top.html&con=/hpux/onlinedocs/B2355-90110/00/00/71-con.html&toc=/hpux/onlinedocs/B2355-90110/00/00/71-toc.html&searchterms=ntp&queryid=20030510-202545

Advanced ntp
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90685/B2355-90685_top.html&con=/hpux/onlinedocs/B2355-90685/00/00/65-con.html&toc=/hpux/onlinedocs/B2355-90685/00/00/65-toc.html&searchterms=ntp&queryid=20030510-202545

Good Luck

Prott-man


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kasper Haitsma
Trusted Contributor

Re: Problem sendmail time information

Hi Luc,

To find out which system thinks what the time is, take a look at the received message on the Exchange box. Examine the header information. This will show when the hosts (involved in the route) think they handled the mail. It is usually relative to GMT

Received: from by ; Sat, 10 May 2003 06:22:47 +0200
Received: from by for ; Fri, 9 May 2003 21:22:45 -0700 (PDT)

So this message was sent 21:22 local (San Fransisco) time, 7 hours west of GMT, and received 06:22 local time (Amsterdam), 2 hours east of GMT. In fact it took only 2 seconds for the mail to travel. I think your TIMEZONE setting on hp-ux are not in sync with 'the rest of the world' WET0WETDST means, default you run WET, and during Daylight Saving Time (DST) you add/substract 0. In Amsterdam, we use MET-1METDST, so that during DST, we are 2 hours east of GMT, instead of 1 hour during non-DST. This explaines the 1 hour difference, since at the moment we live in DST.

I suggest you leave '# O TimeZoneSpec' in sendmail.cf alone, also remove any TZ settings in /etc/profile, $HOME/.profile.

To test, in your login shell, you could force your session to MET-1METDST, either by setting TZ in .profile, logoff/logon, or:
$ date
$ echo $TZ
$ export TZ=MET-1METDST
$ date
and see what the time is set then...

Hope this helps.

Kasper
It depends
Kasper Haitsma
Trusted Contributor

Re: Problem sendmail time information

oops, ofcourse you need to set /etc/TIMEZONE either manually of through /sbin/set_parms, like perviously mentioned
It depends