[GH-ISSUE #694] "Internal error" accessing some folders #647

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

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

It does not seems to be #556

I got "internal error" when accessing some folders, seem related to encondings:

LookupError at /webmail/

unknown encoding: 

Request Method:     GET
Request URL:    http://SERVER/webmail/?action=listmailbox&reset_page=true&_=1424126281144
Django Version:     1.6.10
Exception Type:     LookupError
Exception Value:    

unknown encoding: 

Exception Location:     /usr/lib/python2.7/email/header.py in __unicode__, line 220
Python Executable:  /usr/bin/python
Python Version:     2.7.8
Python Path:    

['/root/modoboa_install',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/pymodules/python2.7']

Server time:    Mon, 16 Feb 2015 22:38:27 +0000

Environment:


Request Method: GET
Request URL: http://SERVER/webmail/?action=listmailbox&reset_page=true&_=1424126281144

Django Version: 1.6.10
Python Version: 2.7.8
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/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  112.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py" in _wrapped_view
  22.                 return view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/admin/lib.py" in wrapped_f
  26.                 return f(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/webmail/views.py" in index
  572.         response = globals()[action](request)
File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/webmail/views.py" in listmailbox
  366.             "with_top_div": request.GET.get("scroll", "false") == "false"
File "/usr/local/lib/python2.7/dist-packages/modoboa/lib/webutils.py" in _render_to_string
  25.                             context_instance=template.RequestContext(request))
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string
  169.         return t.render(context_instance)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  140.             return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render_node
  854.         return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py" in render
  203.                     nodelist.append(node.render(context))
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  891.             output = self.filter_expression.resolve(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in resolve
  613.                 new_obj = func(obj, *arg_vals)
File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/webmail/templatetags/webmail_tags.py" in parse_imap_header
  217.         value = getattr(imapheader, "parse_%s" % header)(value)
File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/webmail/lib/imapheader.py" in parse_subject
  110.         subject = u2u_decode.u2u_decode(value)
File "/usr/local/lib/python2.7/dist-packages/modoboa/lib/u2u_decode.py" in u2u_decode
  52.     u = mre.sub(decode_mime, s)
File "/usr/local/lib/python2.7/dist-packages/modoboa/lib/u2u_decode.py" in decode_mime
  31.         u = unicode(make_header(h))
File "/usr/lib/python2.7/email/header.py" in __unicode__
  220.             uchunks.append(unicode(s, str(charset)))

Exception Type: LookupError at /webmail/
Exception Value: unknown encoding: 
Originally created by @fompi on GitHub (Feb 16, 2015). Original GitHub issue: https://github.com/modoboa/modoboa/issues/694 It does not seems to be #556 I got "internal error" when accessing some folders, seem related to encondings: ``` LookupError at /webmail/ unknown encoding: Request Method: GET Request URL: http://SERVER/webmail/?action=listmailbox&reset_page=true&_=1424126281144 Django Version: 1.6.10 Exception Type: LookupError Exception Value: unknown encoding: Exception Location: /usr/lib/python2.7/email/header.py in __unicode__, line 220 Python Executable: /usr/bin/python Python Version: 2.7.8 Python Path: ['/root/modoboa_install', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7'] Server time: Mon, 16 Feb 2015 22:38:27 +0000 Environment: Request Method: GET Request URL: http://SERVER/webmail/?action=listmailbox&reset_page=true&_=1424126281144 Django Version: 1.6.10 Python Version: 2.7.8 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/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 112. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py" in _wrapped_view 22. return view_func(request, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/admin/lib.py" in wrapped_f 26. return f(request, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/webmail/views.py" in index 572. response = globals()[action](request) File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/webmail/views.py" in listmailbox 366. "with_top_div": request.GET.get("scroll", "false") == "false" File "/usr/local/lib/python2.7/dist-packages/modoboa/lib/webutils.py" in _render_to_string 25. context_instance=template.RequestContext(request)) File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string 169. return t.render(context_instance) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render 140. return self._render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _render 134. return self.nodelist.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render 840. bit = self.render_node(node, context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render_node 854. return node.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py" in render 203. nodelist.append(node.render(context)) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render 891. output = self.filter_expression.resolve(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in resolve 613. new_obj = func(obj, *arg_vals) File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/webmail/templatetags/webmail_tags.py" in parse_imap_header 217. value = getattr(imapheader, "parse_%s" % header)(value) File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/webmail/lib/imapheader.py" in parse_subject 110. subject = u2u_decode.u2u_decode(value) File "/usr/local/lib/python2.7/dist-packages/modoboa/lib/u2u_decode.py" in u2u_decode 52. u = mre.sub(decode_mime, s) File "/usr/local/lib/python2.7/dist-packages/modoboa/lib/u2u_decode.py" in decode_mime 31. u = unicode(make_header(h)) File "/usr/lib/python2.7/email/header.py" in __unicode__ 220. uchunks.append(unicode(s, str(charset))) Exception Type: LookupError at /webmail/ Exception Value: unknown encoding: ```
kerem closed this issue 2026-02-27 11:12:49 +03:00
Author
Owner

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

What's your main language? Is there any special charset for it?

<!-- gh-comment-id:74632318 --> @tonioo commented on GitHub (Feb 17, 2015): What's your main language? Is there any special charset for it?
Author
Owner

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

My main language is Spanish. Now I can't get these messages because I've migrated all my mail and now I'm hitting #635 on these folders.

<!-- gh-comment-id:74776060 --> @fompi commented on GitHub (Feb 17, 2015): My main language is Spanish. Now I can't get these messages because I've migrated all my mail and now I'm hitting #635 on these folders.
Author
Owner

@tonioo commented on GitHub (Mar 11, 2015):

I see. #635 will require some internal work so I don't know when I will be able to work on it...

I close this one since you solved your issue.

<!-- gh-comment-id:78229753 --> @tonioo commented on GitHub (Mar 11, 2015): I see. #635 will require some internal work so I don't know when I will be able to work on it... I close this one since you solved your 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#647
No description provided.