[GH-ISSUE #693] Domain removal fails when manual learning is enabled #646

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

Originally created by @piwats on GitHub (Feb 16, 2015).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/693

Originally assigned to: @tonioo on GitHub.

Hi,

I tried to add xx.domain.tld in the domain list as a domain in modoboa-1.2.0. It seems that this is not possible any more.

domain.tld seems to be not problematic.

Is it possible to revert to a previous state, when it was possible to do so?

-Paul

Originally created by @piwats on GitHub (Feb 16, 2015). Original GitHub issue: https://github.com/modoboa/modoboa/issues/693 Originally assigned to: @tonioo on GitHub. Hi, I tried to add xx.domain.tld in the domain list as a domain in modoboa-1.2.0. It seems that this is not possible any more. domain.tld seems to be not problematic. Is it possible to revert to a previous state, when it was possible to do so? -Paul
kerem 2026-02-27 11:12:49 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tonioo commented on GitHub (Feb 17, 2015):

Hi,

could you give more information? I don't reproduce your issue on the demo site.

<!-- gh-comment-id:74632466 --> @tonioo commented on GitHub (Feb 17, 2015): Hi, could you give more information? I don't reproduce your issue on the demo site.
Author
Owner

@piwats commented on GitHub (Feb 17, 2015):

I have a domain.tld in my domains list.

When I try to add a subdomain like the one described, xx.domain.tld, modoboa refuses to create it, stating that the name of the domain is invalid.

If I try to add a domain, which parent domain is not on the list already, then xy.domain2.tld will be created. Here domain2.tld was not in the list of created domains before xy.domain2.tld was created.

That is, when domain.tld is already added to modoboa, it is not possible to add subdomains of this domain.

<!-- gh-comment-id:74673945 --> @piwats commented on GitHub (Feb 17, 2015): I have a domain.tld in my domains list. When I try to add a subdomain like the one described, xx.domain.tld, modoboa refuses to create it, stating that the name of the domain is invalid. If I try to add a domain, which parent domain is not on the list already, then xy.domain2.tld will be created. Here domain2.tld was not in the list of created domains before xy.domain2.tld was created. That is, when domain.tld is already added to modoboa, it is not possible to add subdomains of this domain.
Author
Owner

@tonioo commented on GitHub (Feb 17, 2015):

Could you try on the official demo please ? (http://modoboa.sys4.de)

I've just created a sub domain... What is the role of the connected user?

<!-- gh-comment-id:74674879 --> @tonioo commented on GitHub (Feb 17, 2015): Could you try on the official demo please ? (http://modoboa.sys4.de) I've just created a sub domain... What is the role of the connected user?
Author
Owner

@piwats commented on GitHub (Feb 17, 2015):

Hmm, it seems that my installation of modoboa has some troubles:

2015/02/17 15:34:34 [error] 8740#0: *5876 open() "/var/www/admin/sitestatic/bootstrap-select/dist/js/bootstrap-select.js.map" failed (2: No such file or directory), client: XX.XX.XX.XX, server: server.tld, request: "GET /modoboa/sitestatic/bootstrap-select/dist/js/bootstrap-select.js.map HTTP/1.1", host: "server.tld"

If I add a completely new domain, be it "test.com" to my modoboa instance, and later add another subdomain "test.test.com", then it works - with no problems at all.

It seems that domains added by previous modoboa installations, <1.2.0, are affected so it is not possible to add domains in the scheme which leads to this problem.

<!-- gh-comment-id:74681179 --> @piwats commented on GitHub (Feb 17, 2015): Hmm, it seems that my installation of modoboa has some troubles: ``` 2015/02/17 15:34:34 [error] 8740#0: *5876 open() "/var/www/admin/sitestatic/bootstrap-select/dist/js/bootstrap-select.js.map" failed (2: No such file or directory), client: XX.XX.XX.XX, server: server.tld, request: "GET /modoboa/sitestatic/bootstrap-select/dist/js/bootstrap-select.js.map HTTP/1.1", host: "server.tld" ``` If I add a completely new domain, be it "test.com" to my modoboa instance, and later add another subdomain "test.test.com", then it works - with no problems at all. It seems that domains added by previous modoboa installations, <1.2.0, are affected so it is not possible to add domains in the scheme which leads to this problem.
Author
Owner

@piwats commented on GitHub (Feb 17, 2015):

Furthermore, when trying to delete the domain to which it is not possible to add subdomains I get this 500 Internal Server error:

AttributeError at /admin/domains/8/delete/
'QuerySet' object has no attribute 'full_address'

Request Method: POST
Request URL: https://server.tld/modoboa/admin/domains/8/delete/
Django Version: 1.6.10
Python Executable: /usr/bin/uwsgi
Python Version: 2.7.9
Python Path: ['.', '', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages']
Server time: Di, 17 Feb 2015 16:17:13 +0100
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'south',
 'reversion',
 'modoboa',
 'modoboa.core',
 'modoboa.lib',
 'modoboa.extensions.admin',
 'modoboa.extensions.postfix_relay_domains',
 'modoboa.extensions.limits',
 'modoboa.extensions.postfix_autoreply',
 'modoboa.extensions.webmail',
 'modoboa.extensions.stats',
 'modoboa.extensions.sievefilters',
 'modoboa.extensions.radicale',
 'modoboa.extensions.amavis')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'modoboa.lib.middleware.AjaxLoginRedirect',
 'modoboa.lib.middleware.CommonExceptionCatcher',
 'modoboa.lib.middleware.ExtControlMiddleware',
 'modoboa.lib.middleware.RequestCatcherMiddleware')

Traceback:
File "/usr/lib64/python2.7/site-packages/django/core/handlers/base.py" in get_response
  112.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib64/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  22.                 return view_func(request, *args, **kwargs)
File "/usr/lib64/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  22.                 return view_func(request, *args, **kwargs)
File "/usr/lib64/python2.7/site-packages/modoboa/extensions/admin/views/domain.py" in deldomain
  136.     dom.delete(request.user, keepdir)
File "/usr/lib64/python2.7/site-packages/modoboa/extensions/admin/models/domain.py" in delete
  124.             events.raiseEvent("MailboxAliasDeleted", self.alias_set.all())
File "/usr/lib64/python2.7/site-packages/modoboa/lib/events.py" in raiseEvent
  145.         callback(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/modoboa/lib/events.py" in wrapped_f
  98.             return f(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/modoboa/extensions/amavis/general_callbacks.py" in on_mailboxalias_deleted
  109.     if Users.objects.filter(email=alias.full_address).exists():

Exception Type: AttributeError at /admin/domains/8/delete/
Exception Value: 'QuerySet' object has no attribute 'full_address'
Request information:
GET: No GET data

POST: No POST data

FILES: No FILES data
<!-- gh-comment-id:74684956 --> @piwats commented on GitHub (Feb 17, 2015): Furthermore, when trying to delete the domain to which it is not possible to add subdomains I get this 500 Internal Server error: ``` AttributeError at /admin/domains/8/delete/ 'QuerySet' object has no attribute 'full_address' Request Method: POST Request URL: https://server.tld/modoboa/admin/domains/8/delete/ Django Version: 1.6.10 Python Executable: /usr/bin/uwsgi Python Version: 2.7.9 Python Path: ['.', '', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages'] Server time: Di, 17 Feb 2015 16:17:13 +0100 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.sites', 'django.contrib.staticfiles', 'south', 'reversion', 'modoboa', 'modoboa.core', 'modoboa.lib', 'modoboa.extensions.admin', 'modoboa.extensions.postfix_relay_domains', 'modoboa.extensions.limits', 'modoboa.extensions.postfix_autoreply', 'modoboa.extensions.webmail', 'modoboa.extensions.stats', 'modoboa.extensions.sievefilters', 'modoboa.extensions.radicale', 'modoboa.extensions.amavis') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'modoboa.lib.middleware.AjaxLoginRedirect', 'modoboa.lib.middleware.CommonExceptionCatcher', 'modoboa.lib.middleware.ExtControlMiddleware', 'modoboa.lib.middleware.RequestCatcherMiddleware') Traceback: File "/usr/lib64/python2.7/site-packages/django/core/handlers/base.py" in get_response 112. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib64/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view 22. return view_func(request, *args, **kwargs) File "/usr/lib64/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view 22. return view_func(request, *args, **kwargs) File "/usr/lib64/python2.7/site-packages/modoboa/extensions/admin/views/domain.py" in deldomain 136. dom.delete(request.user, keepdir) File "/usr/lib64/python2.7/site-packages/modoboa/extensions/admin/models/domain.py" in delete 124. events.raiseEvent("MailboxAliasDeleted", self.alias_set.all()) File "/usr/lib64/python2.7/site-packages/modoboa/lib/events.py" in raiseEvent 145. callback(*args, **kwargs) File "/usr/lib64/python2.7/site-packages/modoboa/lib/events.py" in wrapped_f 98. return f(*args, **kwargs) File "/usr/lib64/python2.7/site-packages/modoboa/extensions/amavis/general_callbacks.py" in on_mailboxalias_deleted 109. if Users.objects.filter(email=alias.full_address).exists(): Exception Type: AttributeError at /admin/domains/8/delete/ Exception Value: 'QuerySet' object has no attribute 'full_address' Request information: GET: No GET data POST: No POST data FILES: No FILES data ```
Author
Owner

@piwats commented on GitHub (Feb 17, 2015):

The role of the connected user is always the same - super admin

<!-- gh-comment-id:74694888 --> @piwats commented on GitHub (Feb 17, 2015): The role of the connected user is always the same - super admin
Author
Owner

@tonioo commented on GitHub (Feb 18, 2015):

Hi,
I've pushed a fix that should allow you to delete the domain. Can you please try it?

<!-- gh-comment-id:74836258 --> @tonioo commented on GitHub (Feb 18, 2015): Hi, I've pushed a fix that should allow you to delete the domain. Can you please try it?
Author
Owner

@piwats commented on GitHub (Feb 18, 2015):

Hello,
the fix allowed to remove the domain which prior to this couldn't be removed.

If I recreate the removed domain again and try to add a subdomain to it, modoboa fails with the same error, that the domain name is invalid.

<!-- gh-comment-id:74888805 --> @piwats commented on GitHub (Feb 18, 2015): Hello, the fix allowed to remove the domain which prior to this couldn't be removed. If I recreate the removed domain again and try to add a subdomain to it, modoboa fails with the same error, that the domain name is invalid.
Author
Owner

@piwats commented on GitHub (Feb 18, 2015):

I just noticed, that I am now able to create a test.domain.tld subdomain, but not a z.domain.tld.

Is it possible that one character subdomains are not allowed for creation in modoboa?

<!-- gh-comment-id:74891702 --> @piwats commented on GitHub (Feb 18, 2015): I just noticed, that I am now able to create a test.domain.tld subdomain, but not a z.domain.tld. Is it possible that one character subdomains are not allowed for creation in modoboa?
Author
Owner

@tonioo commented on GitHub (Feb 18, 2015):

It would be easier with the full backtrace or a screenshot.

<!-- gh-comment-id:74892123 --> @tonioo commented on GitHub (Feb 18, 2015): It would be easier with the full backtrace or a screenshot.
Author
Owner

@piwats commented on GitHub (Feb 18, 2015):

You get the same error on the official modoboa demo:

1.) create a domain "a.test.com" (it is not important to have a "test.com" domain prior to this)
2.) In the form-box where you enter the name you get a "Enter a valid domain name"-error.

I get following Errors in Chrome developer-tools:

form_errors: {name: ["Enter a valid domain name"]}
name: ["Enter a valid domain name"]
0: "Enter a valid domain name"
stepid: 1

and

Request URL:https://modoboaserver.tld/modoboa/admin/domains/new/
Request Method:POST
Status Code:400 BAD REQUEST
Response Headers
content-language:en
content-type:application/json
date:Wed, 18 Feb 2015 16:53:04 GMT
server:nginx
status:400 BAD REQUEST
vary:Accept-Language, Cookie
version:HTTP/1.1
x-frame-options:SAMEORIGIN

No other errors in logs are to be found.

<!-- gh-comment-id:74900526 --> @piwats commented on GitHub (Feb 18, 2015): You get the same error on the official modoboa demo: 1.) create a domain "a.test.com" (it is not important to have a "test.com" domain prior to this) 2.) In the form-box where you enter the name you get a "Enter a valid domain name"-error. I get following Errors in Chrome developer-tools: ``` form_errors: {name: ["Enter a valid domain name"]} name: ["Enter a valid domain name"] 0: "Enter a valid domain name" stepid: 1 ``` and ``` Request URL:https://modoboaserver.tld/modoboa/admin/domains/new/ Request Method:POST Status Code:400 BAD REQUEST Response Headers content-language:en content-type:application/json date:Wed, 18 Feb 2015 16:53:04 GMT server:nginx status:400 BAD REQUEST vary:Accept-Language, Cookie version:HTTP/1.1 x-frame-options:SAMEORIGIN ``` No other errors in logs are to be found.
Author
Owner

@piwats commented on GitHub (Feb 18, 2015):

Can you split this bug into two, one which affects the amavis extension, and another one which affects the subdomain/domain creation, if the two of them are not related to each other?

<!-- gh-comment-id:74910670 --> @piwats commented on GitHub (Feb 18, 2015): Can you split this bug into two, one which affects the amavis extension, and another one which affects the subdomain/domain creation, if the two of them are not related to each other?
Author
Owner

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

Sure. I'll create a new issue.

<!-- gh-comment-id:75025014 --> @tonioo commented on GitHub (Feb 19, 2015): Sure. I'll create a new issue.
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#646
No description provided.