1 (edited by rrosson 2018-04-05 21:34:39)

Topic: notify_quarantined_recipients.py error

======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.8-Pro
- Linux/BSD distribution name and version: Ubuntu 16.04.4 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- 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.
====

After the upgrade to 0.9.8 I am getting the below error from my cronjob.  Below is the output:

/usr/bin/python /opt/www/iredadmin/tools/notify_quarantined_recipients.py --force-all
* 11 users are willing to receive notification email.
Traceback (most recent call last):
  File "/opt/www/iredadmin/tools/notify_quarantined_recipients.py", line 339, in <module>
    mail_body = mail_body_template % {'quar_mail_info': quar_mail_info.encode('utf-8'),
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 393: ordinal not in range(128)

This was working fine before the upgrade. Any ideas?
-Ron

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: notify_quarantined_recipients.py error

Try this:

*) Backup file /opt/www/iredadmin/tools/notify_quarantined_recipients.py first.
*) Open file /opt/www/iredadmin/tools/notify_quarantined_recipients.py, find line (~= line 311) like below:

        info += '\t' + '<td class="td_sender">' + cgi_escape(rcd.from_addr) + '</td>' + '\n'

*) Replace it by:

        info += '\t' + '<td class="td_sender">' + cgi_escape(rcd.from_addr.encode('utf-8')) + '</td>' + '\n'

*) Save the change and try again.

3

Re: notify_quarantined_recipients.py error

Here is what I get after the change

/usr/bin/python /opt/www/iredadmin/tools/notify_quarantined_recipients.py --force-all
* 11 users are willing to receive notification email.
Traceback (most recent call last):
  File "/opt/www/iredadmin/tools/notify_quarantined_recipients.py", line 339, in <module>
    mail_body = mail_body_template % {'quar_mail_info': quar_mail_info.encode('utf-8'),
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 393: ordinal not in range(128)

-Ron

4

Re: notify_quarantined_recipients.py error

Is it possible to give me direct ssh access for debugging?

5

Re: notify_quarantined_recipients.py error

ZhangHuangbin wrote:

Is it possible to give me direct ssh access for debugging?

Zhang, Can you provide me with your contact information so I can get some details from you for this?

-Ron

6

Re: notify_quarantined_recipients.py error

Hi Ron,

Contact me via email: zhb _at_ iredmail _dot_ org