Email delivery problems with MailGun

Hi there!

I’m using a DigitalOcean GitLab appliance. It’s all up to date and I’ve made minimal configuration changes.

I’m not able to send email directly as the IP address of this new VM appears to have fallen afoul of bulk mail spam violations in the past. If I do try to send I get a rejection message detailing this back from Google.

So instead I’m using MailGun to try to send email. I can do a test via MG from the VM using curl that is successful, but sending via a password reset or new user froom GitLab fails to ever reach MailGun and there’s nothing in the MG remote logs. I know, probably a question for the MailGun staff and I’ve already filed a ticket, but I thought I’d try here as well.

This is my config:

gitlab_rails['smtp_enable'] = true                                       
gitlab_rails['smtp_address'] = "smtp.mailgun.org"                        
gitlab_rails['smtp_port'] = 587                                          
gitlab_rails['smtp_user_name'] = "postmaster@mg.skull.nz"                
gitlab_rails['smtp_password'] = "<removed>"       
gitlab_rails['smtp_domain'] = "mg.skull.nz"                              
gitlab_rails['smtp_authentication'] = "plain"                            
gitlab_rails['smtp_enable_starttls_auto'] = true                         
gitlab_rails['smtp_openssl_verify_mode'] = "peer"                                  
external_url "http://git.skull.nz"                                       
gitlab_rails['gitlab_email_from'] = "gitlab@mg.skull.nz"                 
gitlab_rails['gitlab_support_email'] = "gitlab@mg.skull.nz"              

I’ve tried every example and configuration I can get my hands on, still no luck. Tailing the gitlab-ctl log doesn’t give me any useful info either.

Has anyone done this before, or can you see what I’ve done wrong please?

Edit: I also located the delivery_method setting and changed it from :sendmail to :smtp and reconfigured. No improvement. Also checked the smtp_settings.rb file and it has had all of my settings injected into it.

Edit2: Also set RAILS_ENV to production to be sure. No improvement.

It worked for me with the same settings before I updated to 8.15.2 (before 8.13.5).

Now nothing arrives at mailgun although in /var/log/gitlab/gitlab-rails/production.log it says:

Sent mail to tux@example.com (30016.4ms)
[ActiveJob] [ActionMailer::DeliveryJob] [b931c871-5457-4354-8b13-b6ba7348658f] Performed ActionMailer::DeliveryJob from Sidekiq(mailers) in 30128.81ms

The problem wasn’t related to the update.

Because I also moved to a new server and my cloud provider is blocking SMTP by default the mails couldn’t be sent.

Disabling SMTP-blocking made it work again.