1

Topic: notify_quarantined_recipients.py ERROR message

I am trying to notify users but getting the following error:

cmd$   python notify_quarantined_recipients.py

Traceback (most recent call last):
  File "notify_quarantined_recipients.py", line 79, in <module>
    import settings
ImportError: No module named settings


==== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.9.5
- Linux/BSD distribution name and version: CentOS Linux release 7.2.1511 (Core)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? YES
- Related log if you're reporting an issue:

====

----

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 message

Kvisko wrote:

cmd$   python notify_quarantined_recipients.py

Did you run it as 'root' user or a normal user? Normal user doesn't have permission to read iRedAdmin config file (settings.py).

3

Re: notify_quarantined_recipients.py ERROR message

I run it as a root user. Here are permissions for settings.py file:

$ ls -la /var/www/iRedAdmin-Pro-SQL-2.4.0/settings.py
-r-------- 1 iredadmin iredadmin 3925 May 24 16:05 /var/www/iRedAdmin-Pro-SQL-2.4.0/settings.py

4

Re: notify_quarantined_recipients.py ERROR message

Please show me output of command below (path ends with a '*'):

ls -la /var/www/iRedAdmin-Pro-SQL-2.4.0/settings.py*

5

Re: notify_quarantined_recipients.py ERROR message

ls -la /var/www/iRedAdmin-Pro-SQL-2.4.0/settings.py*
-r-------- 1 iredadmin iredadmin 3925 May 24 16:05 /var/www/iRedAdmin-Pro-SQL-2.4.0/settings.py
-r-------- 1 root      root      3651 May 24 15:42 /var/www/iRedAdmin-Pro-SQL-2.4.0/settings.py~
-r-------- 1 root      root      1593 May 24 17:01 /var/www/iRedAdmin-Pro-SQL-2.4.0/settings.pyc
-r-xr-xr-x 1 iredadmin iredadmin 3927 May 24 15:42 /var/www/iRedAdmin-Pro-SQL-2.4.0/settings.py.mysql.sample
-r-xr-xr-x 1 iredadmin iredadmin 3907 May 24 15:42 /var/www/iRedAdmin-Pro-SQL-2.4.0/settings.py.pgsql.sample

6

Re: notify_quarantined_recipients.py ERROR message

I have same file owner and permission, it works fine:

# ls -l settings.py*
-r-------- 1 iredadmin iredadmin 5095 Apr 27 15:58 settings.py
-r-------- 1 root      root      2106 Apr 27 23:01 settings.pyc

Could you please try command below to show us detailed run-time log:

script
strace python notify_quarantined_recipients.py
exit

Note: it will print a lot message on terminal, and log to file "typescript", please send me compressed file "typescript" via email (zhb _at_ iredmail.org).

7 (edited by Kvisko 2016-05-25 01:28:10)

Re: notify_quarantined_recipients.py ERROR message

attached is file.

8

Re: notify_quarantined_recipients.py ERROR message

Why the log shows you're running file "/usr/src/iRedAdmin-Pro-SQL-2.4.0/tools/notify_quarantined_recipients.py"?

It should be "/var/www/iRedAdmin-Pro-SQL-2.4.0/tools/notify_quarantined_recipients.py", (better use directory /var/www/iredadmin/tools/notify_quarantined_recipients.py), and you must have /var/www/iRedAdmin-Pro-SQL-2.4.0/settings.py.

9

Re: notify_quarantined_recipients.py ERROR message

no more error!

just sent you a coffee :-)

keep on good work

10

Re: notify_quarantined_recipients.py ERROR message

Thanks for your coffee. smile