Re: [Mailman-Users] Incorrect timezone in mailman-generated messages

2011-10-24 Thread Ivan Kuznetsov

Hello!

The Date: header is definitly put by Mailman process (Python library) 
not by MTA. The MTA (postfix 2.7.1) uses system tzdata and works correctly.


The Mailman was restarted just after the system tzdata update. And more, 
we have a power blackout last week so all the company servers were 
rebooted. The problem still exists


Setting the TZ enviroment variable as 'TZ=MSK-4' in Mailman startup 
script solves the problem. So we have a workaround now and have a time 
for more deep investigations :)


Python interactive tests:

Python 2.4.3 (#1, Jul  2 2009, 15:50:05)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type help, copyright, credits or license for more information.

import time;
import email.Utils;
print (time.localtime());

(2011, 10, 24, 12, 8, 2, 0, 297, 0)

print (time.altzone);

-14400

print (time.daylight);

1

print (email.Utils.formatdate(localtime=1));

Mon, 24 Oct 2011 12:08:33 +0300

As I can understand (I'm not a Python guru) the time.localtime() returns 
correct data and shows that DST is not active (tm_isdst=0). time.altzone 
is correct too (UTC-4). But time.daylight is incorrectly shows that DST 
is active. So the problem is a Python issue, you are right.


I will try to update the Python package and see the result

--
Regards, Ivan Kuznetsov
SOLVO ltd
St.Petersburg, Russia
--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Incorrect timezone in mailman-generated messages

2011-10-24 Thread Ivan Kuznetsov

Hello!

24.10.2011 12:32, Ivan Kuznetsov wrote:

I will try to update the Python package and see the result


Updated Python (package python26-2.6.5-6.el5.i386.rpm) shows the same 
incorrect results on interactive tests:


[kia@pine ~]$ python26
Python 2.6.5 (r265:79063, Feb 28 2011, 21:55:56)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type help, copyright, credits or license for more information.

import time;
import email.Utils;
print (time.localtime());
time.struct_time(tm_year=2011, tm_mon=10, tm_mday=24, tm_hour=13, 
tm_min=1, tm_sec=45, tm_wday=0, tm_yday=297, tm_isdst=0)

print (time.altzone);

-14400

print (time.daylight);

1

print (email.Utils.formatdate(localtime=1));

Mon, 24 Oct 2011 13:02:02 +0300





--
С уважением, И.А.Кузнецов
Системный администратор СОЛВО
тел. +7 812 6060555
сотовый +7 921 7407261
ICQ 346624981
http://www.solvo.ru
--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

[Mailman-Users] Incorrect timezone in mailman-generated messages

2011-10-21 Thread Ivan Kuznetsov

Hello!

After the local timezone rules change the mailman sends messages with 
incorrect timezone in Date: header.


Acording to the Russian Govnerment statement Russia is abolishing 
daylight saving time from this year. E.g. Moscow time (which daylight 
saving was GMT+4) will now has standard GMT+4. To adopt this we install 
new timezone calculation rules (tzdata-2011l). Now the mailman thinks 
that timezone is GMT+3. All the mailman-generated messages (moderation 
requests, errors, reminders and so on) looks like the time is +1h in 
future. E.g.


Return-Path: mailman-boun...@domain.ru
Received: from gate2.solvo.ru (gate2-vlan10.solvo.ru [172.16.80.4])
 by hippo.solvo.ru (Cyrus v2.2.12-Invoca-RPM-2.2.12-8.1.RHEL4) with 
LMTPA;
 Thu, 20 Oct 2011 15:54:42 +0400
X-Sieve: CMU Sieve 2.2
Received: from gate2.solvo.ru (localhost.localdomain [127.0.0.1])
by gate2.solvo.ru (Postfix) with ESMTP id 2ADCC52E802D
for listmas...@solvo.ru; Thu, 20 Oct 2011 15:54:42 +0400 (MSK)
Subject: =?koi8-r?b?7sXEz9PUwdfMxc7Oz8UgydrXxd3FzsnFIM/CIM/bycLLxQ==?=
From: mailman-boun...@solvo.ru
To: all-ow...@solvo.ru
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary0258393610==
Message-ID: mailman.20.1319111680.3169@solvo.ru
Date: Thu, 20 Oct 2011 15:54:40 +0300
Precedence: bulk
X-BeenThere: a...@solvo.ru
X-Mailman-Version: 2.1.14
List-Id: =?koi8-r?b?6c7Gz9LNwcPJ0SDEzNEg19PFyCDTz9TS1cTOycvP1yDz7+z37w==?=
all.solvo.ru
X-List-Administrivia: yes
Errors-To: mailman-boun...@solvo.ru
Sender: mailman-boun...@solvo.ru

Local time in mailman logs are still correct:

/var/log/mailman/smtp:
Oct 20 15:54:42 2011 (3173) mailman.20.1319111680.3169@solvo.ru 
smtp to all for 1 recips, completed in 0.102 seconds


/var/log/mailman/bounce:
Oct 20 15:54:40 2011 (3169) all: bounce message w/no discernable 
addresses: 35292842.20111020185...@87.subnet125-163-181.speedy.telkom.net.
Oct 20 15:54:40 2011 (3169) all: forwarding unrecognized, message-id: 
35292842.20111020185...@87.subnet125-163-181.speedy.telkom.net.id


We are using mailman for years without such a problem before. All other 
software run at this host now have the correct understanding the local 
time as MSK standard time = GMT+4


[root@gate2 mailman]# date '+%Z %::z'
MSK +04:00:00

I found the similar mailman bug #266314 
(https://bugs.launchpad.net/mailman/+bug/266314) but it was years ago 
and was fixed at version 2.1.7.


Now we run mailman 2.1.14 with Python 2.4.3 under Oracle Enterprise 
Linux 5 (a clone of RHEL5)


--
Regards, Ivan Kuznetsov
SOLVO ltd
St.Petersburg, Russia
--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Incorrect timezone in mailman-generated messages

2011-10-21 Thread Mark Sapiro
On 10/20/2011 7:09 AM, Ivan Kuznetsov wrote:
 
 After the local timezone rules change the mailman sends messages with
 incorrect timezone in Date: header.
[...]
 Date: Thu, 20 Oct 2011 15:54:40 +0300
[...]
 We are using mailman for years without such a problem before. All other
 software run at this host now have the correct understanding the local
 time as MSK standard time = GMT+4
 
 [root@gate2 mailman]# date '+%Z %::z'
 MSK +04:00:00


This is the part that I find strange. Mailman uses Python's
email.Utils.formatdate(localtime=1) function to get the date/time string
for the Date header. This in turn uses Python's time module to get the
actual time and timezone values and that in turn uses C library
functions to get them from the underlying OS. See
http://docs.python.org/library/time.html.

Try seeing in an interactive Python session what things like
email.Utils.formatdate(localtime=1), time.localtime(), time.daylight and
time.altzone return. If they are not returning what you expect, this is
a Python issue.

-- 
Mark Sapiro m...@msapiro.netThe highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Incorrect timezone in mailman-generated messages

2011-10-21 Thread Brad Knowles
On Oct 20, 2011, at 9:09 AM, Ivan Kuznetsov wrote:

 After the local timezone rules change the mailman sends messages with 
 incorrect timezone in Date: header.

Mailman itself knows nothing about timezones.  Anything to do with timezones 
being incorrect is almost certainly an Operating System issue, although it 
could be a library problem.

 Received: from gate2.solvo.ru (gate2-vlan10.solvo.ru [172.16.80.4])
by hippo.solvo.ru (Cyrus v2.2.12-Invoca-RPM-2.2.12-8.1.RHEL4) with 
 LMTPA;
Thu, 20 Oct 2011 15:54:42 +0400
 X-Sieve: CMU Sieve 2.2
 Received: from gate2.solvo.ru (localhost.localdomain [127.0.0.1])
   by gate2.solvo.ru (Postfix) with ESMTP id 2ADCC52E802D
   for listmas...@solvo.ru; Thu, 20 Oct 2011 15:54:42 +0400 (MSK)

These two headers were put on the message by the MTAs, and note that time the 
time is 15:54 with a timezone offset of +0400.

 Subject: =?koi8-r?b?7sXEz9PUwdfMxc7Oz8UgydrXxd3FzsnFIM/CIM/bycLLxQ==?=
 From: mailman-boun...@solvo.ru
 To: all-ow...@solvo.ru
 MIME-Version: 1.0
 Content-Type: multipart/mixed; boundary0258393610==
 Message-ID: mailman.20.1319111680.3169@solvo.ru
 Date: Thu, 20 Oct 2011 15:54:40 +0300

This date header may have been put on by the local MTA on this machine, or it 
may have been put on by a Python library, but I don't think it was put on by 
Mailman itself.  Note that the time is still 15:54, but the timezone is wrong.

 Local time in mailman logs are still correct:
 
 /var/log/mailman/smtp:
 Oct 20 15:54:42 2011 (3173) mailman.20.1319111680.3169@solvo.ru smtp to 
 all for 1 recips, completed in 0.102 seconds
 
 /var/log/mailman/bounce:
 Oct 20 15:54:40 2011 (3169) all: bounce message w/no discernable addresses: 
 35292842.20111020185...@87.subnet125-163-181.speedy.telkom.net.
 Oct 20 15:54:40 2011 (3169) all: forwarding unrecognized, message-id: 
 35292842.20111020185...@87.subnet125-163-181.speedy.telkom.net.id

These are all references to 15:54, but there is no mention of timezone, so it's 
impossible to know if they are in reference to +0300 or +0400.

 We are using mailman for years without such a problem before. All other 
 software run at this host now have the correct understanding the local time 
 as MSK standard time = GMT+4
 
 [root@gate2 mailman]# date '+%Z %::z'
 MSK +04:00:00

Okay, so the OS has been updated with an appropriate time zone definition.  
That's good to know.

 I found the similar mailman bug #266314 
 (https://bugs.launchpad.net/mailman/+bug/266314) but it was years ago and was 
 fixed at version 2.1.7.
 
 Now we run mailman 2.1.14 with Python 2.4.3 under Oracle Enterprise Linux 5 
 (a clone of RHEL5)

Sometimes, problems like this are as simple as a program reading the timezone 
definition on startup, and then never reading it again.  Have you tried 
stopping and restarting Mailman, in order to get it (and the various Python 
libraries we use) to read the updated timezone definition?

--
Brad Knowles b...@shub-internet.org
LinkedIn Profile: http://tinyurl.com/y8kpxu

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Incorrect timezone in mailman-generated messages

2011-10-21 Thread Ralf Hildebrandt
* Brad Knowles b...@shub-internet.org:
 On Oct 20, 2011, at 9:09 AM, Ivan Kuznetsov wrote:
 
  After the local timezone rules change the mailman sends messages with 
  incorrect timezone in Date: header.
 
 Mailman itself knows nothing about timezones.  Anything to do with timezones 
 being incorrect is almost certainly an Operating System issue, although it 
 could be a library problem.
 
  Received: from gate2.solvo.ru (gate2-vlan10.solvo.ru [172.16.80.4])
   by hippo.solvo.ru (Cyrus v2.2.12-Invoca-RPM-2.2.12-8.1.RHEL4) with 
  LMTPA;
   Thu, 20 Oct 2011 15:54:42 +0400
  X-Sieve: CMU Sieve 2.2
  Received: from gate2.solvo.ru (localhost.localdomain [127.0.0.1])
  by gate2.solvo.ru (Postfix) with ESMTP id 2ADCC52E802D
  for listmas...@solvo.ru; Thu, 20 Oct 2011 15:54:42 +0400 (MSK)
 
 These two headers were put on the message by the MTAs, and note that time the 
 time is 15:54 with a timezone offset of +0400.
 
  Subject: =?koi8-r?b?7sXEz9PUwdfMxc7Oz8UgydrXxd3FzsnFIM/CIM/bycLLxQ==?=
  From: mailman-boun...@solvo.ru
  To: all-ow...@solvo.ru
  MIME-Version: 1.0
  Content-Type: multipart/mixed; boundary0258393610==
  Message-ID: mailman.20.1319111680.3169@solvo.ru
  Date: Thu, 20 Oct 2011 15:54:40 +0300
 
 This date header may have been put on by the local MTA on this machine, or it 
 may have been put on by a Python library, but I don't think it was put on by 
 Mailman itself.  Note that the time is still 15:54, but the timezone is wrong.

Since it's From: mailman-boun...@solvo.ru To: all-ow...@solvo.ru
isn't that a mailman generated approval mail?

-- 
Ralf Hildebrandt
  Geschäftsbereich IT | Abteilung Netzwerk
  Charité - Universitätsmedizin Berlin
  Campus Benjamin Franklin
  Hindenburgdamm 30 | D-12203 Berlin
  Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
  ralf.hildebra...@charite.de | http://www.charite.de

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Re: [Mailman-Users] Incorrect timezone in mailman-generated messages

2011-10-21 Thread Brad Knowles
On Oct 21, 2011, at 10:04 AM, Ralf Hildebrandt wrote:

 This date header may have been put on by the local MTA on this machine, or 
 it may have been put on by a Python library, but I don't think it was put on 
 by Mailman itself.  Note that the time is still 15:54, but the timezone is 
 wrong.
 
 Since it's From: mailman-boun...@solvo.ru To: all-ow...@solvo.ru
 isn't that a mailman generated approval mail?

The message may have been generated by Mailman, but I am not 100% certain that 
Mailman always puts on whatever headers are required for a message, such as the 
Date header -- many MTAs will add headers like this for people/programs who 
generate messages to be sent but don't include them.

Moreover, even if that header were put on before the message is handed to the 
MTA, I don't know that Mailman itself would be putting that header on -- I 
suspect that Mailman would use a Python library to do that, as opposed to doing 
it internally.

--
Brad Knowles b...@shub-internet.org
LinkedIn Profile: http://tinyurl.com/y8kpxu

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Incorrect timezone in mailman-generated messages

2011-10-21 Thread Ralf Hildebrandt
* Brad Knowles b...@shub-internet.org:
 On Oct 21, 2011, at 10:04 AM, Ralf Hildebrandt wrote:
 
  This date header may have been put on by the local MTA on this machine, or 
  it may have been put on by a Python library, but I don't think it was put 
  on by Mailman itself.  Note that the time is still 15:54, but the timezone 
  is wrong.
  
  Since it's From: mailman-boun...@solvo.ru To: all-ow...@solvo.ru
  isn't that a mailman generated approval mail?
 
 The message may have been generated by Mailman, but I am not 100%
 certain that Mailman always puts on whatever headers are required for a
 message, such as the Date header -- many MTAs will add headers like
 this for people/programs who generate messages to be sent but don't
 include them.

Yes, indeed. If postfix is involved, copies of the TZ info IN THE
CHROOT may be old! Thus issue a postfix check command.

 Moreover, even if that header were put on before the message is handed
 to the MTA, I don't know that Mailman itself would be putting that
 header on -- I suspect that Mailman would use a Python library to do
 that, as opposed to doing it internally.

-- 
Ralf Hildebrandt
  Geschäftsbereich IT | Abteilung Netzwerk
  Charité - Universitätsmedizin Berlin
  Campus Benjamin Franklin
  Hindenburgdamm 30 | D-12203 Berlin
  Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
  ralf.hildebra...@charite.de | http://www.charite.de

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Re: [Mailman-Users] Incorrect timezone in mailman-generated messages

2011-10-21 Thread Mark Sapiro
Brad Knowles wrote:

Moreover, even if that header were put on before the message is handed to the 
MTA, I don't know that Mailman itself would be putting that header on -- I 
suspect that Mailman would use a Python library to do that, as opposed to 
doing it internally.


In the case of this particular message, Mailman creates the Date:
header using the Python library functions and data indicated in my
reply at
http://mail.python.org/pipermail/mailman-users/2011-October/072389.html.

If these Python routines, particularly
email.Utils.formatdate(localtime=1), are returning the expected
results, this is almost certainly, as Brad suggested previously, a
case of needing to restart Mailman to refresh internally stored data.

-- 
Mark Sapiro m...@msapiro.netThe highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org