[GH-ISSUE #510] handle_mailbox_operations command not working #491

Closed
opened 2026-02-27 11:12:02 +03:00 by kerem · 18 comments
Owner

Originally created by @carragom on GitHub (Jan 18, 2014).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/510

Originally assigned to: @tonioo on GitHub.

Hello,

This is a new Modoboa 1.1.0 installation. When I try to run:

python /opt/modoboa_admin/manage.py handle_mailbox_operations

I get the following error:

NotDefined: Application 'admin' and/or parameter 'HANDLE_MAILBOXES' not defined

According to the documentation there should be an option in Modoboa->Parameters->General to activate this HANDLE_MAILBOXES. But I don't see it anywhere.

I tried to outsmart the system by inserting the value in the lib_parameter table but no luck. I guess something else is required.

insert into lib_parameter (name, value) values ('admin.HANDLE_MAILBOXES', 'yes')

Am I missing something ? Here is the screenshot of my admin interface, logged as the default admin user:
modoba-admin

Originally created by @carragom on GitHub (Jan 18, 2014). Original GitHub issue: https://github.com/modoboa/modoboa/issues/510 Originally assigned to: @tonioo on GitHub. Hello, This is a new Modoboa 1.1.0 installation. When I try to run: ``` python /opt/modoboa_admin/manage.py handle_mailbox_operations ``` I get the following error: ``` NotDefined: Application 'admin' and/or parameter 'HANDLE_MAILBOXES' not defined ``` According to the [documentation](http://modoboa.readthedocs.org/en/1.1.0/getting_started/configuration.html#admin-params) there should be an option in Modoboa->Parameters->General to activate this HANDLE_MAILBOXES. But I don't see it anywhere. I tried to outsmart the system by inserting the value in the lib_parameter table but no luck. I guess something else is required. ``` insert into lib_parameter (name, value) values ('admin.HANDLE_MAILBOXES', 'yes') ``` Am I missing something ? Here is the screenshot of my admin interface, logged as the default admin user: ![modoba-admin](https://f.cloud.github.com/assets/970403/1948128/247a46f0-807e-11e3-89ae-94fb9b7ec902.png)
kerem 2026-02-27 11:12:02 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tonioo commented on GitHub (Jan 19, 2014):

Hi,

this option will be automatically hidden if one of the following condition is true:

  • The filesystem containing the mailboxes is not accessible (hosted on another server for example)
  • Modoboa can't find the 'doveadm' command (check your path)
  • Dovecot < 2 is in use
<!-- gh-comment-id:32704007 --> @tonioo commented on GitHub (Jan 19, 2014): Hi, this option will be automatically hidden if one of the following condition is true: - The filesystem containing the mailboxes is not accessible (hosted on another server for example) - Modoboa can't find the 'doveadm' command (check your path) - Dovecot < 2 is in use
Author
Owner

@tonioo commented on GitHub (Jan 19, 2014):

Actually, modoboa looks for dovecot (not doveadm) to check if it must hide the setting or not.

https://github.com/tonioo/modoboa/blob/master/modoboa/extensions/admin/app_settings.py#L46

<!-- gh-comment-id:32706907 --> @tonioo commented on GitHub (Jan 19, 2014): Actually, modoboa looks for dovecot (not doveadm) to check if it must hide the setting or not. https://github.com/tonioo/modoboa/blob/master/modoboa/extensions/admin/app_settings.py#L46
Author
Owner

@carragom commented on GitHub (Jan 21, 2014):

Hello,

Using dovecot 2.1.7 package that ships with Debian Wheezy. The dovecot command is in /usr/sbin/dovecot which is not in the path of normal users and so which dovecot will never find it unless you run it as root or with sudo. Does Modoboa requires the dovecot command in any way to handle the mailbox operations to go as far as hide the feature if it can't find the command ?. What is the actual purpose of this validation ?

Cheers

<!-- gh-comment-id:32813660 --> @carragom commented on GitHub (Jan 21, 2014): Hello, Using dovecot 2.1.7 package that ships with Debian Wheezy. The dovecot command is in _/usr/sbin/dovecot_ which is not in the path of normal users and so `which dovecot` will never find it unless you run it as root or with sudo. Does Modoboa requires the dovecot command in any way to handle the mailbox operations to go as far as hide the feature if it can't find the command ?. What is the actual purpose of this validation ? Cheers
Author
Owner

@tonioo commented on GitHub (Jan 21, 2014):

Actually, modoboa needs the doveadm command which comes with Dovecot > 2 so we call dovecot --version to know the version in use. doveadm is usefull to find where home directories are stored.

If we can't find where mailboxes are stored, we can't rename or remove them, that's why the parameter is hidden. What do you think?

I'll make a quick fix to make the handle_mailbox_operations command quit properly.

<!-- gh-comment-id:32837362 --> @tonioo commented on GitHub (Jan 21, 2014): Actually, modoboa needs the doveadm command which comes with Dovecot > 2 so we call dovecot --version to know the version in use. doveadm is usefull to find where home directories are stored. If we can't find where mailboxes are stored, we can't rename or remove them, that's why the parameter is hidden. What do you think? I'll make a quick fix to make the handle_mailbox_operations command quit properly.
Author
Owner

@carragom commented on GitHub (Jan 22, 2014):

Well, I can't think of any other way that is not OS specific to find the dovecot version. So I guess looking a bit more for the dovecot command is what it's needed. I mean which dovecot would be the first check and then we could look in /usr/sbin/dovecot and /usr/local/sbin/dovecot. Would that make sense ?

<!-- gh-comment-id:33035043 --> @carragom commented on GitHub (Jan 22, 2014): Well, I can't think of any other way that is not OS specific to find the dovecot version. So I guess looking a bit more for the dovecot command is what it's needed. I mean `which dovecot` would be the first check and then we could look in _/usr/sbin/dovecot_ and _/usr/local/sbin/dovecot_. Would that make sense ?
Author
Owner

@tonioo commented on GitHub (Jan 22, 2014):

Yes, I can add additional checks.

<!-- gh-comment-id:33042195 --> @tonioo commented on GitHub (Jan 22, 2014): Yes, I can add additional checks.
Author
Owner

@tonglil commented on GitHub (Feb 19, 2014):

The crontab job to handle_mailbox_operations sends an email that reads: NotDefined: Application 'admin' and/or parameter 'HANDLE_MAILBOXES' not defined
Dovecot and Postfix are both in default locations.

<!-- gh-comment-id:35480651 --> @tonglil commented on GitHub (Feb 19, 2014): The crontab job to handle_mailbox_operations sends an email that reads: `NotDefined: Application 'admin' and/or parameter 'HANDLE_MAILBOXES' not defined` Dovecot and Postfix are both in default locations.
Author
Owner

@tonioo commented on GitHub (Feb 19, 2014):

Can you please tell me:

  • where dovecot is installed
  • what version you are using

Thanks.

<!-- gh-comment-id:35487967 --> @tonioo commented on GitHub (Feb 19, 2014): Can you please tell me: - where dovecot is installed - what version you are using Thanks.
Author
Owner

@tonglil commented on GitHub (Feb 19, 2014):

which dovecot => /usr/sbin/dovecot
dovecot --version => 2.0.19
which postfix => /usr/sbin/postfix

<!-- gh-comment-id:35493811 --> @tonglil commented on GitHub (Feb 19, 2014): `which dovecot` => `/usr/sbin/dovecot` `dovecot --version` => `2.0.19` `which postfix` => `/usr/sbin/postfix`
Author
Owner

@tonioo commented on GitHub (Feb 19, 2014):

Ok. Which system user is running modoboa? Have you defined a DOVECOT_LOOKUP_PATH variable into your settings.py file?

<!-- gh-comment-id:35494642 --> @tonioo commented on GitHub (Feb 19, 2014): Ok. Which system user is running modoboa? Have you defined a DOVECOT_LOOKUP_PATH variable into your settings.py file?
Author
Owner

@tonglil commented on GitHub (Feb 19, 2014):

The path variable is commented out.
DEBUG = True (if that is relevant, the app won't run if it is set to false)
ADMINS = ()
root is running modoboa from ps -aux

root      1620  0.0  0.2  53580 10300 ?        S    05:49   0:01 /usr/bin/python /usr/local/bin/gunicorn --error-log /var/log/modoboa.log -c gunicorn.conf.py mailadmin.wsgi:application
root      1635  0.0  0.9 172480 38664 ?        S    05:49   0:00 /usr/bin/python /usr/local/bin/gunicorn --error-log /var/log/modoboa.log -c gunicorn.conf.py mailadmin.wsgi:application
root      1654  0.0  0.9 172584 38692 ?        S    05:49   0:00 /usr/bin/python /usr/local/bin/gunicorn --error-log /var/log/modoboa.log -c gunicorn.conf.py mailadmin.wsgi:application
1001      4527  0.0  0.0   9396   896 pts/1    S+   07:45   0:00 grep --color=auto modoboa
<!-- gh-comment-id:35494943 --> @tonglil commented on GitHub (Feb 19, 2014): The path variable is commented out. DEBUG = True (if that is relevant, the app won't run if it is set to false) ADMINS = () root is running modoboa from ps -aux ``` root 1620 0.0 0.2 53580 10300 ? S 05:49 0:01 /usr/bin/python /usr/local/bin/gunicorn --error-log /var/log/modoboa.log -c gunicorn.conf.py mailadmin.wsgi:application root 1635 0.0 0.9 172480 38664 ? S 05:49 0:00 /usr/bin/python /usr/local/bin/gunicorn --error-log /var/log/modoboa.log -c gunicorn.conf.py mailadmin.wsgi:application root 1654 0.0 0.9 172584 38692 ? S 05:49 0:00 /usr/bin/python /usr/local/bin/gunicorn --error-log /var/log/modoboa.log -c gunicorn.conf.py mailadmin.wsgi:application 1001 4527 0.0 0.0 9396 896 pts/1 S+ 07:45 0:00 grep --color=auto modoboa ```
Author
Owner

@tonioo commented on GitHub (Feb 19, 2014):

You need to define the ALLOWED_DOMAINS variable if you want to set Debug to False.

And what about the cron job? Which user?

<!-- gh-comment-id:35495144 --> @tonioo commented on GitHub (Feb 19, 2014): You need to define the ALLOWED_DOMAINS variable if you want to set Debug to False. And what about the cron job? Which user?
Author
Owner

@tonglil commented on GitHub (Feb 19, 2014):

ALLOWED_HOSTS = [
'ubyssey.ca',
]
Cron job run by vmail user, not sure how to get it to run as root.

<!-- gh-comment-id:35495562 --> @tonglil commented on GitHub (Feb 19, 2014): ALLOWED_HOSTS = [ 'ubyssey.ca', ] Cron job run by vmail user, not sure how to get it to run as root.
Author
Owner

@tonioo commented on GitHub (Feb 19, 2014):

I guess 'ubyssey.ca' is you domain name. Can you try to set the FQDN of your mail/webmail server ?

Can you also try to login as vmail and check the following commands :

$ which dovecot
$ <path>/dovecot --version
<!-- gh-comment-id:35496247 --> @tonioo commented on GitHub (Feb 19, 2014): I guess 'ubyssey.ca' is you domain name. Can you try to set the FQDN of your mail/webmail server ? Can you also try to login as vmail and check the following commands : ``` bash $ which dovecot $ <path>/dovecot --version ```
Author
Owner

@tonglil commented on GitHub (Feb 19, 2014):

sudo -i -u vmail
which dovecot => /usr/sbin/dovecot
/usr/sbin/dovecot --version => 2.0.19
which postfix => /usr/sbin/postfix

Do you know what I should define in ADMINS?

<!-- gh-comment-id:35541169 --> @tonglil commented on GitHub (Feb 19, 2014): `sudo -i -u vmail` `which dovecot` => `/usr/sbin/dovecot` `/usr/sbin/dovecot --version` => `2.0.19` `which postfix` => `/usr/sbin/postfix` Do you know what I should define in ADMINS?
Author
Owner

@tonioo commented on GitHub (Feb 19, 2014):

I really don't understand what's happening... Would it be possible to access your server ?

In ADMINS, just enter an email address to receive notifications about 500 errors. It is only used when Debug = False.

<!-- gh-comment-id:35545618 --> @tonioo commented on GitHub (Feb 19, 2014): I really don't understand what's happening... Would it be possible to access your server ? In ADMINS, just enter an email address to receive notifications about 500 errors. It is only used when Debug = False.
Author
Owner

@tonglil commented on GitHub (Feb 20, 2014):

I have no idea either, going to wait and see if other cron jobs has this issue.

<!-- gh-comment-id:35645935 --> @tonglil commented on GitHub (Feb 20, 2014): I have no idea either, going to wait and see if other cron jobs has this issue.
Author
Owner

@tonioo commented on GitHub (Mar 4, 2014):

Hi Tony,

what about the other jobs?

<!-- gh-comment-id:36671047 --> @tonioo commented on GitHub (Mar 4, 2014): Hi Tony, what about the other jobs?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#491
No description provided.