[resolved] Service Desk behind reverse-proxy https issues

Hi folks,

im running an up to date gitlab-ce instance behind a traefik reverseproxy on docker, everything is running smooth so far. Now i tried to use Service Desk, incoming_email is set up and mailroom is able to fetch the mails, but then tries to use git.mydomain.tld:443, which fails because gitlab sets on startup a line in /etc/hosts, which points the Subdomain to the docker-ip on which nginx is not listening on port 443.

      GITLAB_OMNIBUS_CONFIG: |
        external_url 'https://git.mydomain.tld'
        nginx['listen_port'] = 80
        nginx['listen_https'] = false
        nginx['proxy_set_headers'] = {
          "X-Forwarded-Proto" => "https"
        }
        nginx['real_ip_trusted_addresses'] = [ '172.19.0.0/24' ]
        nginx['real_ip_header'] = 'X-Forwarded-For'
        nginx['real_ip_recursive'] = 'on'
gitlab  | ==> /var/log/gitlab/mailroom/mail_room_json.log <==
gitlab  | {"severity":"INFO","time":"2023-02-23T14:19:31.342+00:00","context":{"email":"git@mydomain.tld","name":"inbox"},"uid":15,"action":"sending to deliverer","deliverer":"MailRoom::Delivery::Postback","byte_size":42936}
gitlab  |
gitlab  | ==> /var/log/gitlab/mailroom/current <==
gitlab  | 2023-02-23_14:19:31.34744 #<Thread:0x00007fe99f666c60 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-mail_room-0.0.20/lib/mail_room/mailbox_watcher.rb:35 run> terminated with exception (report_on_exception is true):
gitlab  | 2023-02-23_14:19:31.34745 /opt/gitlab/embedded/lib/ruby/2.7.0/net/http.rb:960:in `initialize': Failed to open TCP connection to git.mydomain.tld:443 (Connection refused - connect(2) for "git.mydomain.tld" port 443) (Faraday::ConnectionFailed)
gitlab  | 2023-02-23_14:19:31.34746     from /opt/gitlab/embedded/lib/ruby/2.7.0/net/http.rb:960:in `open'
gitlab  | 2023-02-23_14:19:31.34746     from /opt/gitlab/embedded/lib/ruby/2.7.0/net/http.rb:960:in `block in connect'
gitlab  | 2023-02-23_14:19:31.34746     from /opt/gitlab/embedded/lib/ruby/2.7.0/timeout.rb:95:in `block in timeout'
gitlab  | 2023-02-23_14:19:31.34746     from /opt/gitlab/embedded/lib/ruby/2.7.0/timeout.rb:105:in `timeout'
gitlab  | 2023-02-23_14:19:31.34747     from /opt/gitlab/embedded/lib/ruby/2.7.0/net/http.rb:958:in `connect'
gitlab  | 2023-02-23_14:19:31.34747     from /opt/gitlab/embedded/lib/ruby/2.7.0/net/http.rb:943:in `do_start'
gitlab  | 2023-02-23_14:19:31.34747     from /opt/gitlab/embedded/lib/ruby/2.7.0/net/http.rb:932:in `start'
gitlab  | 2023-02-23_14:19:31.34748     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/faraday-net_http-3.0.2/lib/faraday/adapter/net_http.rb:112:in `request_with_wrapped_block'
gitlab  | 2023-02-23_14:19:31.34748     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/faraday-net_http-3.0.2/lib/faraday/adapter/net_http.rb:102:in `perform_request'
gitlab  | 2023-02-23_14:19:31.34748     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/faraday-net_http-3.0.2/lib/faraday/adapter/net_http.rb:66:in `block in call'
gitlab  | 2023-02-23_14:19:31.34749     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/faraday-2.7.4/lib/faraday/adapter.rb:45:in `connection'
gitlab  | 2023-02-23_14:19:31.34749     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/faraday-net_http-3.0.2/lib/faraday/adapter/net_http.rb:65:in `call'
gitlab  | 2023-02-23_14:19:31.34749     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/faraday-2.7.4/lib/faraday/request/url_encoded.rb:25:in `call'
gitlab  | 2023-02-23_14:19:31.34750     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/faraday-2.7.4/lib/faraday/rack_builder.rb:153:in `build_response'
gitlab  | 2023-02-23_14:19:31.34750     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/faraday-2.7.4/lib/faraday/connection.rb:444:in `run_request'
gitlab  | 2023-02-23_14:19:31.34750     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/faraday-2.7.4/lib/faraday/connection.rb:280:in `post'
gitlab  | 2023-02-23_14:19:31.34751     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-mail_room-0.0.20/lib/mail_room/delivery/postback.rb:78:in `deliver'
gitlab  | 2023-02-23_14:19:31.34751     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-mail_room-0.0.20/lib/mail_room/mailbox.rb:118:in `deliver'
gitlab  | 2023-02-23_14:19:31.34752     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-mail_room-0.0.20/lib/mail_room/mailbox_watcher.rb:32:in `block in run'
gitlab  | 2023-02-23_14:19:31.34752     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-mail_room-0.0.20/lib/mail_room/imap/connection.rb:138:in `map'
gitlab  | 2023-02-23_14:19:31.34752     from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-mail_room-0.0.20/lib/mail_room/imap/connection.rb:138:in `process_mailbox'
$ docker-compose exec gitlab grep git /etc/hosts
172.19.0.16     git.mydomain.tld git

I did not find a omnibus setting which is responsible for this, nor did i find something else somehwere on the internet regarding this problem. Maybe someone had the same issue or an idea and is able to point me into the right direction ?

Adding

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

fixed the issue for me.