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
Best wiches
Vincent
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.