1

Topic: cron job python delete_mailboxes.py fails each hour

==== Required information ====
- iRedMail version (check /etc/iredmail-release):  * 0.9.7 Mariadb
- Linux/BSD distribution name and version: * Debian 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  * MariaDB SQL
- Web server (Apache or Nginx): * Apache
- Manage mail accounts with iRedAdmin-Pro? * no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
My email admin gets cron error messages each hour about the same failed job - delete_mailboxes.py
I am also unable to delete some old user mailboxes in the web gui and I believe they are related.

I am currently running 0.9.7, but the database is a migration from an earlier release (0.8 I believe), so there may be a few lingering field names hanging around in the database or the files that work on them like delete_mailboxes.py.

I had the older system running fine for around 2yrs before purchasing new hardware and creating a fresh new install of debian and installing the latest available version of iredmail. I then followed the guide to migrate the mailboxes accross and all seemed to go fine. All mail actions seem to be working correctly, but this error has now appeared. Admittedly I have not needed to remove any old mailboxes until now.

Is there anything I can check to see where the fault is?

Here is the contents of the mail:
Traceback (most recent call last):
  File "/opt/www/iredadmin/tools/delete_mailboxes.py", line 158, in <module>
    qr = conn.select('deleted_mailboxes', where=sql_where)
  File "/usr/lib/python2.7/dist-packages/web/db.py", line 682, in select
    return self.query(qout, processed=True)
  File "/usr/lib/python2.7/dist-packages/web/db.py", line 644, in query
    self._db_execute(db_cursor, sql_query)
  File "/usr/lib/python2.7/dist-packages/web/db.py", line 587, in _db_execute
    out = cur.execute(query, params)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1054, "Unknown column 'delete_date' in 'where clause'")

----

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

2

Re: cron job python delete_mailboxes.py fails each hour

SQL column 'delete_date' in table "vmail.deleted_mailboxes" was introduced in iRedMail-0.9.3:
https://docs.iredmail.org/upgrade.iredm … 0.9.3.html

3

Re: cron job python delete_mailboxes.py fails each hour

Thanks heaps, that fixed it!