1

Topic: notify_quarantined_recipients.py - Bug with timezones in settings.py

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Linux/BSD distribution name and version: Ubuntu 16 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello Zhang Huangbin,

we got an issue with the notifiy script. When i set the timezone in /opt/www/iredadmin/settings.py from LOCAL_TIMEZONE = 'GMT' to LOCAL_TIMEZONE = 'GMT+01:00' and one or more user have spam in the quarantine then the script failed:

/usr/bin/python /opt/www/iredadmin/tools/notify_quarantined_recipients.py --force-all
* 8 users are willing to receive notification email.
Traceback (most recent call last):
  File "/opt/www/iredadmin/tools/notify_quarantined_recipients.py", line 301, in <module>
    time_tuple = time_with_tz.timetuple()
AttributeError: 'str' object has no attribute 'timetuple'

when i change it back to LOCAL_TIMEZONE = 'GMT the script is working well:
/usr/bin/python /opt/www/iredadmin/tools/notify_quarantined_recipients.py --force-all
* 8 users are willing to receive notification email.
* + *****@******.de: 1 mails.

Maybe i do something wrong? Or your script has a problem? Please help us smile

Best wiches
Vincent

2

Re: notify_quarantined_recipients.py - Bug with timezones in settings.py

I tried this time zone locally, it works for me.
I wonder whether you have any incorrect char in LOCAL_TIMEZONE value. could you double check?

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3

Re: notify_quarantined_recipients.py - Bug with timezones in settings.py

ZhangHuangbin wrote:

I tried this time zone locally, it works for me.
I wonder whether you have any incorrect char in LOCAL_TIMEZONE value. could you double check?

Hello,

yes i check this many times, change the timezone, change the line etc. :


#LOCAL_TIMEZONE = 'GMT'
LOCAL_TIMEZONE = 'GMT+01:00' 

do you have any idea? I already set up a new server to reproduce this script error with the same issue. First Ubuntu 18 and on the second try with Ubuntu 16.

4

Re: notify_quarantined_recipients.py - Bug with timezones in settings.py

I can not reproduce this issue on my local machine. Is it possible to give me direct ssh access with root privilege? contact me: https://www.iredmail.org/support.html

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee