[Solved] Strato.de SMTP not working

Hi all,

I need your help setting up SMTP mail support (GitLab 11.6, Ubuntu 18.04).
I took all settings from here but mail is not working SMTPFatalError (550 HELO refused by local policy (MBL-B)).

irb(main):001:0> Notify.test_email('user@domain.tld', 'Message Subject', 'Message Body').deliver_now
Notify#test_email: processed outbound mail in 445.4ms
Sent mail to tobi@teckl.de (180.3ms)
Date: Sat, 29 Dec 2018 17:35:51 +0000
From: GitLab <gitlab@domain.tld>
Reply-To: GitLab <gitlab@domain.tld>
To: user@domain.tld
Message-ID: <5c27b0779b16e_20b33fcbc5fdc5fc657e@hostname.mail>
Subject: Message Subject
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>Message Body</p></body></html>

Traceback (most recent call last):
       16: from /opt/gitlab/embedded/lib/ruby/gems/2.5.0/gems/mail-2.7.0/lib/mail/message.rb:260:in `deliver'
       15: from /opt/gitlab/embedded/lib/ruby/gems/2.5.0/gems/actionmailer-5.0.7/lib/action_mailer/base.rb:541:in `deliver_mail'
       14: from /opt/gitlab/embedded/lib/ruby/gems/2.5.0/gems/activesupport-5.0.7/lib/active_support/notifications.rb:164:in `instrument'
       13: from /opt/gitlab/embedded/lib/ruby/gems/2.5.0/gems/activesupport-5.0.7/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
       12: from /opt/gitlab/embedded/lib/ruby/gems/2.5.0/gems/activesupport-5.0.7/lib/active_support/notifications.rb:164:in `block in instrument'
       11: from /opt/gitlab/embedded/lib/ruby/gems/2.5.0/gems/actionmailer-5.0.7/lib/action_mailer/base.rb:543:in `block in deliver_mail'
       10: from /opt/gitlab/embedded/lib/ruby/gems/2.5.0/gems/mail-2.7.0/lib/mail/message.rb:260:in `block in deliver'
        9: from /opt/gitlab/embedded/lib/ruby/gems/2.5.0/gems/mail-2.7.0/lib/mail/message.rb:2160:in `do_delivery'
        8: from /opt/gitlab/embedded/lib/ruby/gems/2.5.0/gems/mail-2.7.0/lib/mail/network/delivery_methods/smtp.rb:100:in `deliver!'
        7: from /opt/gitlab/embedded/lib/ruby/gems/2.5.0/gems/mail-2.7.0/lib/mail/network/delivery_methods/smtp.rb:109:in `start_smtp_session'
        6: from /opt/gitlab/embedded/lib/ruby/2.5.0/net/smtp.rb:518:in `start'
        5: from /opt/gitlab/embedded/lib/ruby/2.5.0/net/smtp.rb:554:in `do_start'
        4: from /opt/gitlab/embedded/lib/ruby/2.5.0/net/smtp.rb:600:in `do_helo'
        3: from /opt/gitlab/embedded/lib/ruby/2.5.0/net/smtp.rb:826:in `helo'
        2: from /opt/gitlab/embedded/lib/ruby/2.5.0/net/smtp.rb:937:in `getok'
        1: from /opt/gitlab/embedded/lib/ruby/2.5.0/net/smtp.rb:969:in `check_response'
Net::SMTPFatalError (550 HELO refused by local policy (MBL-B))

It was working one year ago. I didn’t change any settings since then.

First I blamed strato - then I used rubys action mailer with the same config and it is working

require 'action_mailer'

ActionMailer::Base.smtp_settings = {
    :address              => "smtp.strato.de",
    :port                 => 465,
    :domain               => "statro.de",
    :user_name            => "...", # Real email account
    :password             => "...", # Password that corresponds to that email account
    :authentication       => "login",
    :enable_starttls_auto => true,
    :tls                  => true,
    :openssl_verify_mode  => 'none'
}

class TestMailer < ActionMailer::Base
  def mail(args)
    super
  end
end

TestMailer.mail(From: 'GitLab <gitlab@domain.tld>', To: 'user@domain.tld', Subject: 'Message Subject', body: 'Test Mail').deliver_now

I also tried a new installation of GitLab 11.6 where only the SMTP config values are changed - same behavior.

Has anybody experienced such problems before?

UPDATE

It is working once the domain is set to “www.strato.de” instead of “strato.de” like written here
No idea why the action mailer ruby script was working without the leading “www.” as well.

1 Like