[GH-ISSUE #2429] Creating a disabled account imply an active (internal) alias #1598

Closed
opened 2026-02-27 11:18:00 +03:00 by kerem · 6 comments
Owner

Originally created by @fpoulain on GitHub (Dec 29, 2021).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/2429

Testing against behavior similarly to #2120 it appears that creating a disabled account imply creation of an active (internal) alias.

Impacted versions

  • OS Type: Debian
  • OS Version: Buster
  • Database Type: PostgreSQL
  • Database version: 11
  • Modoboa: 1.17.3 (also on master branch)

Steps to reproduce

  • Create an account with Simple user role and disable it at the creation
  • Send an email to this account

Here is a (failling) test case: github.com/fpoulain/modoboa@05dda3cdcd

Current behavior

In [1]: from modoboa.core.models import User
In [2]: from modoboa.admin.models import Alias
In [3]: u = User.objects.get(email='tester@test.com')
In [4]: u.enabled
Out[4]: False
In [5]: a = Alias.objects.get(address=u.email)
In [6]: a.enabled
Out[6]: True
In [7]: a.internal
Out[7]: True

Expected behavior

In [1]: from modoboa.core.models import User
In [2]: from modoboa.admin.models import Alias
In [3]: u = User.objects.get(email='tester@test.com')
In [4]: u.enabled
Out[4]: False
In [5]: a = Alias.objects.get(address=u.email)
In [6]: a.enabled
Out[6]: False
In [7]: a.internal
Out[7]: True
Originally created by @fpoulain on GitHub (Dec 29, 2021). Original GitHub issue: https://github.com/modoboa/modoboa/issues/2429 Testing against behavior similarly to #2120 it appears that creating a disabled account imply creation of an active (internal) alias. # Impacted versions * OS Type: Debian * OS Version: Buster * Database Type: PostgreSQL * Database version: 11 * Modoboa: 1.17.3 (also on master branch) # Steps to reproduce * Create an account with Simple user role and disable it at the creation * Send an email to this account Here is a (failling) test case: https://github.com/fpoulain/modoboa/commit/05dda3cdcd27f6b4d651cf9622fa62ba03244a74 # Current behavior ```ipython In [1]: from modoboa.core.models import User In [2]: from modoboa.admin.models import Alias In [3]: u = User.objects.get(email='tester@test.com') In [4]: u.enabled Out[4]: False In [5]: a = Alias.objects.get(address=u.email) In [6]: a.enabled Out[6]: True In [7]: a.internal Out[7]: True ``` # Expected behavior ```ipython In [1]: from modoboa.core.models import User In [2]: from modoboa.admin.models import Alias In [3]: u = User.objects.get(email='tester@test.com') In [4]: u.enabled Out[4]: False In [5]: a = Alias.objects.get(address=u.email) In [6]: a.enabled Out[6]: False In [7]: a.internal Out[7]: True ```
kerem 2026-02-27 11:18:00 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@fpoulain commented on GitHub (Dec 29, 2021):

I may provide a PR if you confirm that the current behavior is a bug.

<!-- gh-comment-id:1002691369 --> @fpoulain commented on GitHub (Dec 29, 2021): I may provide a PR if you confirm that the current behavior is a bug.
Author
Owner

@tonioo commented on GitHub (Jan 7, 2022):

@fpoulain Does it mean you can send an email to this account anyway? What is the underlying issue here?

<!-- gh-comment-id:1007506294 --> @tonioo commented on GitHub (Jan 7, 2022): @fpoulain Does it mean you can send an email to this account anyway? What is the underlying issue here?
Author
Owner

@fpoulain commented on GitHub (Jan 7, 2022):

Does it mean you can send an email to this account anyway?

Yes.

<!-- gh-comment-id:1007517164 --> @fpoulain commented on GitHub (Jan 7, 2022): > Does it mean you can send an email to this account anyway? Yes.
Author
Owner

@tonioo commented on GitHub (Jan 7, 2022):

Then indeed, it's a bug.The internal alias state should be synchronized with the account one.

<!-- gh-comment-id:1007518378 --> @tonioo commented on GitHub (Jan 7, 2022): Then indeed, it's a bug.The internal alias state should be synchronized with the account one.
Author
Owner

@fpoulain commented on GitHub (Jan 7, 2022):

Ok, will try to fix it and opening a PR.

<!-- gh-comment-id:1007533602 --> @fpoulain commented on GitHub (Jan 7, 2022): Ok, will try to fix it and opening a PR.
Author
Owner

@stale[bot] commented on GitHub (Mar 9, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

<!-- gh-comment-id:1062474578 --> @stale[bot] commented on GitHub (Mar 9, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
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#1598
No description provided.