[GH-ISSUE #3174] Internal Error trying to Reply #1789

Closed
opened 2026-02-27 11:19:08 +03:00 by kerem · 2 comments
Owner

Originally created by @pgehres on GitHub (Jan 27, 2024).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/3174

Impacted versions

  • OS Type: Ubuntu
  • OS Version: 22.04.1
  • Database Type: MySQL
  • Database version: 10.11.6-MariaDB
  • Modoboa: 2.2.4
  • installer used: Yes
  • Webserver: Nginx

Steps to reproduce

  1. Run installer
  2. Login with admin:password
  3. Add domain and super user with mailbox
  4. Receive email
  5. Attempt to reply

Current behavior

Screenshot 2024-01-27 at 3 09 44 PM
Traceback (most recent call last):
  File "/srv/modoboa/env/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/srv/modoboa/env/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/srv/modoboa/env/lib/python3.10/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
    return view_func(request, *args, **kwargs)
  File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa/admin/lib.py", line 47, in wrapped_f
    return f(request, *args, **kwargs)
  File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/views.py", line 656, in index
    response = globals()[action](request)
  File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/views.py", line 523, in reply
    return new_compose_form(request, "reply", mbox, mailid)
  File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/views.py", line 508, in new_compose_form
    email = modclass(form, request, "%s:%s" % (mbox, mailid), links=True)
  File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/lib/imapemail.py", line 282, in __init__
    super().__init__(*args, **kwargs)
  File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/lib/imapemail.py", line 257, in __init__
    getattr(self, "_modify_%s" % self.dformat)()
  File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/lib/imapemail.py", line 312, in _modify_plain
    super(ReplyModifier, self)._modify_plain()
  File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/lib/imapemail.py", line 260, in _modify_plain
    self.body = re.sub("</?pre>", "", self.body)
  File "/usr/lib/python3.10/re.py", line 209, in sub
    return _compile(pattern, flags).sub(repl, string, count)

Exception Type: TypeError at /webmail/
Exception Value: expected string or bytes-like object

Expected behavior

I can reply to an email.

Video/Screenshot link (optional)

I can reliably reproduce this. Happy to provide additional information or perform additional debugging.

Originally created by @pgehres on GitHub (Jan 27, 2024). Original GitHub issue: https://github.com/modoboa/modoboa/issues/3174 # Impacted versions * OS Type: Ubuntu * OS Version: 22.04.1 * Database Type: MySQL * Database version: 10.11.6-MariaDB * Modoboa: 2.2.4 * installer used: Yes * Webserver: Nginx # Steps to reproduce 1. Run installer 2. Login with admin:password 3. Add domain and super user with mailbox 4. Receive email 5. Attempt to reply # Current behavior <img width="846" alt="Screenshot 2024-01-27 at 3 09 44 PM" src="https://github.com/modoboa/modoboa/assets/357174/2e913082-8a3e-4f79-9d0d-b5c21117e6b2"> ``` Traceback (most recent call last): File "/srv/modoboa/env/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/srv/modoboa/env/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python3.10/contextlib.py", line 79, in inner return func(*args, **kwds) File "/srv/modoboa/env/lib/python3.10/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view return view_func(request, *args, **kwargs) File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa/admin/lib.py", line 47, in wrapped_f return f(request, *args, **kwargs) File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/views.py", line 656, in index response = globals()[action](request) File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/views.py", line 523, in reply return new_compose_form(request, "reply", mbox, mailid) File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/views.py", line 508, in new_compose_form email = modclass(form, request, "%s:%s" % (mbox, mailid), links=True) File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/lib/imapemail.py", line 282, in __init__ super().__init__(*args, **kwargs) File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/lib/imapemail.py", line 257, in __init__ getattr(self, "_modify_%s" % self.dformat)() File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/lib/imapemail.py", line 312, in _modify_plain super(ReplyModifier, self)._modify_plain() File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa_webmail/lib/imapemail.py", line 260, in _modify_plain self.body = re.sub("</?pre>", "", self.body) File "/usr/lib/python3.10/re.py", line 209, in sub return _compile(pattern, flags).sub(repl, string, count) Exception Type: TypeError at /webmail/ Exception Value: expected string or bytes-like object ``` # Expected behavior I can reply to an email. # Video/Screenshot link (optional) I can reliably reproduce this. Happy to provide additional information or perform additional debugging.
kerem 2026-02-27 11:19:08 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tonioo commented on GitHub (Feb 2, 2024):

Is there anything special with the email you're trying to reply to?

<!-- gh-comment-id:1923525459 --> @tonioo commented on GitHub (Feb 2, 2024): Is there anything special with the email you're trying to reply to?
Author
Owner

@pgehres commented on GitHub (Feb 6, 2024):

Not at all. It was a plaintext email with a subject line like "TEST" sent from one instance of modoboa to another.

<!-- gh-comment-id:1928575980 --> @pgehres commented on GitHub (Feb 6, 2024): Not at all. It was a plaintext email with a subject line like "TEST" sent from one instance of modoboa to another.
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#1789
No description provided.