1

Topic: Error after cron delete_mailboxes.py every hour

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer? Downloadable
- Linux/BSD distribution name and version: Ubuntu 18.04.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx):NGINX
- Manage mail accounts with iRedAdmin-Pro?NO
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
When crontab or I run manually "python /opt/www/iredadmin/tools/delete_mailboxes.py" I get the following error:
<<< ERROR >>> Cannot connect to SQL database, aborted. Error: AttributeError("'module' object has no attribute 'app'",).
It also sends the message to my postmaster/root mailbox every hour from Cron Daemon.

I doesnt know how to fix this attribute error and cannot find this topic in support forum.

Please help!

----

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

2

Re: Error after cron delete_mailboxes.py every hour

Please upgrade iRedAdmin open source edition to the latest 0.9.5, it fixes this issue.
FYI: https://docs.iredmail.org/migrate.or.up … admin.html

3

Re: Error after cron delete_mailboxes.py every hour

I already installed iRedAdmin 0.9.5 before that error started. I tried re-upgrade to 0.9.5 but the problem continiue.

4

Re: Error after cron delete_mailboxes.py every hour

My mistake, you need this patch:
https://bitbucket.org/zhb/iredadmin-ose … 8bbb70575a

5

Re: Error after cron delete_mailboxes.py every hour

ZhangHuangbin wrote:

My mistake, you need this patch:
https://bitbucket.org/zhb/iredadmin-ose … 8bbb70575a

Excellent!

Thank you. It worked smile No error when I ran the command manually and this is what I got when I rain it whit --debug
* No mailbox is scheduled to be removed.
* To remove mailboxes without schedule date, please run this script with argument '--delete-null-date'.
* To remove mailboxes without timesamp in maildir path, please run this script with argument '--delete-without-timestamp'. [WARNING] It's RISKY.


Looks like it is as it should be!