Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Error trying to Reply #3174

Open
pgehres opened this issue Jan 27, 2024 · 2 comments
Open

Internal Error trying to Reply #3174

pgehres opened this issue Jan 27, 2024 · 2 comments
Labels

Comments

@pgehres
Copy link

pgehres commented Jan 27, 2024

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.

@tonioo
Copy link
Member

tonioo commented Feb 2, 2024

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

@pgehres
Copy link
Author

pgehres commented 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.

@tonioo tonioo added the bug label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants