Skip to content

Commit

Permalink
🐛(dimail) fix imported mailboxes should be enabled instead of pending
Browse files Browse the repository at this point in the history
Importing mailboxes creates pending mailboxes ... but these mailboxes are,
for most, already active. We thus mark them as "enabled".
  • Loading branch information
mjeammet committed Jan 22, 2025
1 parent 615d589 commit df39a70
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to

## [Unreleased]

### Fixed

- 🐛(dimail) fix imported mailboxes should be enabled instead of pending

## [1.10.0] - 2025-01-21

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def test_dimail_synchronization__synchronize_mailboxes(mock_warning):

mailbox = models.Mailbox.objects.get()
assert mailbox.local_part == "oxadmin"
assert mailbox.status == enums.MailboxStatusChoices.ENABLED
assert imported_mailboxes == [mailbox_valid["email"]]


Expand Down
6 changes: 3 additions & 3 deletions src/backend/mailbox_manager/utils/dimail.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@ def import_mailboxes(self, domain):
last_name=dimail_mailbox["surName"],
local_part=address.username,
domain=domain,
secondary_email=dimail_mailbox[
"email"
], # secondary email is mandatory. Unfortunately, dimail doesn't
secondary_email=dimail_mailbox["email"],
# secondary email is mandatory. Unfortunately, dimail doesn't
# store any. We temporarily give current email as secondary email.
status=enums.MailboxStatusChoices.ENABLED,
)
imported_mailboxes.append(str(mailbox))
else:
Expand Down

0 comments on commit df39a70

Please sign in to comment.