Allow configuring `delete_after_delivery` mailroom option in GitLab
Problem to Solve
When incoming email configuration was using IMAP to read Microsoft Exchange Online mailbox, GitLab had the ability to mark the email with the IMAP DELETED flag, but not expunge (permanently delete) the email from the inbox after delivery.
This would keep the email in the inbox after delivery. Users had the option to actually delete the emails from the inbox or not via the expunge_deleted
option:
- Omnibus: https://gitlab.com/gitlab-org/omnibus-gitlab/-/blob/ce63e5b489cd6fb84c71c456c276c7f4942bed07/files/gitlab-config-template/gitlab.rb.template#L297
- Within GitLab: https://gitlab.com/gitlab-org/gitlab/-/blob/cce0b82a996f6737223b52773e749c9f3bc4b216/lib/gitlab/mail_room.rb#L28
With the transition to use Microsoft Graph API to read a Microsoft Exchange Online mailbox , it looks like we no longer have the concept for "marking an email for deletion" and "expunging". From what I can see, the Graph API only knows to delete a message or not.
Because the delete_after_delivery
mailroom option is currently always set to true
, it's not possible to configure a similar behaviour to IMAP where it's possible to keep emails in the inbox after delivery.
Proposal
Allow configuring delete_after_delivery
mailroom option in GitLab.