Commit 086f871b authored by charlie ablett's avatar charlie ablett

Merge branch 'feat/add-expunge-option-mailroom' into 'master'

feat: add expunge deleted messages option to mailroom

See merge request gitlab-org/gitlab!31531
parents ab2b2108 4d7c4fe9
---
title: Add expunge deleted messages option to mailroom
merge_request: 31531
author: Diego Louzán
type: added
......@@ -202,6 +202,9 @@ production: &base
#
# log_path: log/mail_room_json.log
# Whether to expunge (permanently remove) messages from the mailbox when they are deleted after delivery
expunge_deleted: false
## Build Artifacts
artifacts:
enabled: true
......
......@@ -17,6 +17,7 @@
:name: <%= config[:mailbox].to_json %>
:delete_after_delivery: true
:expunge_deleted: <%= config[:expunge_deleted].to_json %>
:delivery_method: sidekiq
:delivery_options:
......
......@@ -182,6 +182,9 @@ gitlab_rails['incoming_email_start_tls'] = false
gitlab_rails['incoming_email_mailbox_name'] = "inbox"
# The IDLE command timeout.
gitlab_rails['incoming_email_idle_timeout'] = 60
# Whether to expunge (permanently remove) messages from the mailbox when they are deleted after delivery
gitlab_rails['incoming_email_expunge_deleted'] = true
```
Example for source installs:
......@@ -214,6 +217,9 @@ incoming_email:
mailbox: "inbox"
# The IDLE command timeout.
idle_timeout: 60
# Whether to expunge (permanently remove) messages from the mailbox when they are deleted after delivery
expunge_deleted: true
```
#### Gmail
......@@ -249,6 +255,9 @@ gitlab_rails['incoming_email_start_tls'] = false
gitlab_rails['incoming_email_mailbox_name'] = "inbox"
# The IDLE command timeout.
gitlab_rails['incoming_email_idle_timeout'] = 60
# Whether to expunge (permanently remove) messages from the mailbox when they are deleted after delivery
gitlab_rails['incoming_email_expunge_deleted'] = true
```
Example for source installs:
......@@ -281,6 +290,9 @@ incoming_email:
mailbox: "inbox"
# The IDLE command timeout.
idle_timeout: 60
# Whether to expunge (permanently remove) messages from the mailbox when they are deleted after delivery
expunge_deleted: true
```
#### Microsoft Exchange Server
......
......@@ -57,6 +57,9 @@ See the [Rails guides](https://guides.rubyonrails.org/action_mailer_basics.html#
mailbox: "inbox"
# The IDLE command timeout.
idle_timeout: 60
# Whether to expunge (permanently remove) messages from the mailbox when they are deleted after delivery
expunge_deleted: false
```
As mentioned, the part after `+` is ignored, and this will end up in the mailbox for `gitlab-incoming@gmail.com`.
......
......@@ -151,6 +151,7 @@ service_desk_email:
log_path: "log/mailroom.log"
mailbox: "inbox"
idle_timeout: 60
expunge_deleted: true
```
In this case, suppose the `mygroup/myproject` project Service Desk settings has the project name
......
......@@ -19,7 +19,8 @@ module Gitlab
start_tls: false,
mailbox: 'inbox',
idle_timeout: 60,
log_path: RAILS_ROOT_DIR.join('log', 'mail_room_json.log')
log_path: RAILS_ROOT_DIR.join('log', 'mail_room_json.log'),
expunge_deleted: false
}.freeze
# Email specific configuration which is merged with configuration
......
......@@ -53,7 +53,8 @@ describe 'mail_room.yml' do
email: 'gitlab-incoming@gmail.com',
password: '[REDACTED]',
name: 'inbox',
idle_timeout: 60
idle_timeout: 60,
expunge_deleted: true
}
expected_options = {
redis_url: gitlab_redis_queues.url,
......
......@@ -9,6 +9,7 @@ test:
ssl: true
start_tls: false
mailbox: "inbox"
expunge_deleted: true
service_desk_email:
enabled: true
......@@ -20,3 +21,4 @@ test:
ssl: true
start_tls: false
mailbox: "inbox"
expunge_deleted: true
......@@ -13,7 +13,8 @@ describe Gitlab::MailRoom do
start_tls: false,
mailbox: 'inbox',
idle_timeout: 60,
log_path: Rails.root.join('log', 'mail_room_json.log').to_s
log_path: Rails.root.join('log', 'mail_room_json.log').to_s,
expunge_deleted: false
}
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment