[GH-ISSUE #3609] SMTP authentication option for the webmail triggers DEV_MODE by default #1865

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

Originally created by @mirtouf on GitHub (Jul 25, 2025).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/3609

Impacted versions

  • OS Type: Debian
  • OS Version: 12
  • Database Type: MySQL
  • Database version: 10.11.11-0+deb12u1
  • Modoboa: 2.4.3
  • installer used: No
  • Webserver: Nginx

Steps to reproduce

In modoboa's admin page got to Settings, then Webmail then SMTP settings then select "Authentication required"

Current behavior

The usage of this mode triggers an error 500 from /api/v2/webmail/compose-sessions with this message:

<html><body>
<!--StartFragment--><h1>AttributeError
       at /api/v2/webmail/compose-sessions/ae41bccdaef24fe8847f1f75b1058555/send/</h1>
  <pre class="exception_value">'Settings' object has no attribute 'WEBMAIL_DEV_MODE'</pre>
  
Request Method: | POST
-- | --
https://mail-admin.mirtouf.fr/api/v2/webmail/compose-sessions/ae41bccdaef24fe8847f1f75b1058555/send/
5.2.4
AttributeError
'Settings' object has no attribute 'WEBMAIL_DEV_MODE'
/home/modoboa/env/lib/python3.11/site-packages/django/conf/__init__.py, line 83, in __getattr__
modoboa.webmail.viewsets.ComposeSessionViewSet
/usr/bin/uwsgi-core
3.11.2
['.',  '',  '/usr/lib/python311.zip',  '/usr/lib/python3.11',  '/usr/lib/python3.11/lib-dynload',  '/home/modoboa/env/lib/python3.11/site-packages']
Fri, 25 Jul 2025 08:57:00 +0200
<!--EndFragment-->
</body>
</html>

If I disable the authentication for SMTP, there is no such error but in my set-up, I prefer to keep the need for authentication when connecting through Postfix's ports.

The error is due to theses file I suppose:
/home/modoboa/env/lib/python3.11/site-packages/modoboa/webmail/lib/sendmail.py
/home/modoboa/env/lib/python3.11/site-packages/modoboa/webmail/lib/imaputils.py

Expected behavior

The mail should be sent and shall not trigger such request for dev mode as the variables are normally used only for testing purposes

#WEBMAIL_DEV_MODE = os.environ.get("WEBMAIL_DEV_MODE", "off") == "on"
#WEBMAIL_DEV_USERNAME = os.environ.get("WEBMAIL_DEV_USERNAME", "")
#WEBMAIL_DEV_PASSWORD = os.environ.get("WEBMAIL_DEV_PASSWORD", "")

Video/Screenshot link (optional)

Originally created by @mirtouf on GitHub (Jul 25, 2025). Original GitHub issue: https://github.com/modoboa/modoboa/issues/3609 # Impacted versions * OS Type: Debian * OS Version: 12 * Database Type: MySQL * Database version: 10.11.11-0+deb12u1 * Modoboa: 2.4.3 * installer used: No * Webserver: Nginx # Steps to reproduce In modoboa's admin page got to Settings, then Webmail then SMTP settings then select "Authentication required" # Current behavior The usage of this mode triggers an error 500 from /api/v2/webmail/compose-sessions with this message: ``` <html><body> <!--StartFragment--><h1>AttributeError at /api/v2/webmail/compose-sessions/ae41bccdaef24fe8847f1f75b1058555/send/</h1> <pre class="exception_value">'Settings' object has no attribute 'WEBMAIL_DEV_MODE'</pre> Request Method: | POST -- | -- https://mail-admin.mirtouf.fr/api/v2/webmail/compose-sessions/ae41bccdaef24fe8847f1f75b1058555/send/ 5.2.4 AttributeError 'Settings' object has no attribute 'WEBMAIL_DEV_MODE' /home/modoboa/env/lib/python3.11/site-packages/django/conf/__init__.py, line 83, in __getattr__ modoboa.webmail.viewsets.ComposeSessionViewSet /usr/bin/uwsgi-core 3.11.2 ['.', '', '/usr/lib/python311.zip', '/usr/lib/python3.11', '/usr/lib/python3.11/lib-dynload', '/home/modoboa/env/lib/python3.11/site-packages'] Fri, 25 Jul 2025 08:57:00 +0200 <!--EndFragment--> </body> </html> ``` If I disable the authentication for SMTP, there is no such error but in my set-up, I prefer to keep the need for authentication when connecting through Postfix's ports. The error is due to theses file I suppose: /home/modoboa/env/lib/python3.11/site-packages/modoboa/webmail/lib/sendmail.py /home/modoboa/env/lib/python3.11/site-packages/modoboa/webmail/lib/imaputils.py # Expected behavior The mail should be sent and shall not trigger such request for dev mode as the variables are normally used only for testing purposes ``` #WEBMAIL_DEV_MODE = os.environ.get("WEBMAIL_DEV_MODE", "off") == "on" #WEBMAIL_DEV_USERNAME = os.environ.get("WEBMAIL_DEV_USERNAME", "") #WEBMAIL_DEV_PASSWORD = os.environ.get("WEBMAIL_DEV_PASSWORD", "") ``` # Video/Screenshot link (optional)
kerem 2026-02-27 11:19:37 +03:00
  • closed this issue
  • added the
    bug
    label
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#1865
No description provided.