Service Desk rejects Mails sometimes

Problem to solve

Since we switched the mailbox for service desk to a o356 mailbox using mircosoft_graph authentication, we sometimes get mail rejected response from our self hosted gitlab (omnibus) instance (Unfortunately, your email message to GitLab could not be processed.).

Interessting part is, that if I send the same message again, sometimes it then works.

Only thing in log is that sometimes the token outdates, but catches itself afterwards again. Like said, sending and receiving mails works fine. Just from time to time, it can’t process it and sending the same mail again works.


gitlab_rails['incoming_email_enabled'] = true
gitlab_rails['incoming_email_address'] = "issues+%{key}"
gitlab_rails['incoming_email_email'] = ""
gitlab_rails['incoming_email_delete_after_delivery'] = false
gitlab_rails['incoming_email_inbox_method'] = 'microsoft_graph'
gitlab_rails['incoming_email_inbox_options'] = {
   'tenant_id': 'xxxx',
   'client_id': 'xxxx',
   'client_secret': 'xxxx',
   'poll_interval': 60  # Optional

gitlab_rails['incoming_email_mailbox_name'] = "inbox"
gitlab_rails['incoming_email_idle_timeout'] = 60
gitlab_rails['incoming_email_log_file'] = "/var/log/gitlab/mailroom/mail_room_json.log"

gitlab_rails['service_desk_email_enabled'] = true
gitlab_rails['service_desk_email_address'] = "issues+%{key}"
gitlab_rails['service_desk_email_email'] = ""
gitlab_rails['service_desk_email_mailbox_name'] = "inbox"
gitlab_rails['service_desk_email_idle_timeout'] = 60
gitlab_rails['service_desk_email_log_file'] = "/var/log/gitlab/mailroom/service_desk_json.log"
gitlab_rails['service_desk_email_inbox_method'] = 'microsoft_graph'
gitlab_rails['service_desk_email_inbox_options'] = {
   'tenant_id': 'xxx',
   'client_id': 'xxxx',
   'client_secret': 'xxx',
   'poll_interval': 60  # Optional

gitlab_rails['incoming_email_delivery_method'] = "sidekiq"
gitlab_rails['service_desk_email_delivery_method'] = "sidekiq"