4

I have a Linux Ubuntu 14.04 installed on my VM. Recently I have installed GitLab 7.8.2 using the instructions on GitLab site, and encountered problems in making Gitlab to send mails.

for example, when I try to create a new user using the Web interface I am not getting any confirmation mail from the server.

  • I have configured postfix to my environment (setting "mynetworks", "myhostname"), and successfully sent a test mail to my yahoo account using sendmail.
  • I added this lines to the file /opt/gitlab/embedded/service/gitlab-ci/config/environments/production.rb:

    config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = { 
       address: "127.0.0.1", 
       port: 25,
       enable_starttls_auto: false 
    }
    
  • I have tailed /var/log/mail.log while registering to my GitLab instance and managed to see that GitLab actually interacting with postfix but unsuccessfully. The log was suggesting that the operation was't successful because the ip is blocked, but I don't think this is correct because I can send mails using sendmail command.

    /var/log/mail.log:

    Mar  6 10:58:32 ubuntu postfix/qmgr[12506]: 5BEE724E74: from=<gitlab@ubuntu>, size=630, nrcpt=1 (queue active)
    Mar  6 10:59:02 ubuntu postfix/smtp[19746]: connect to example.com[93.184.216.34]:25: Connection timed out
    Mar  6 10:59:02 ubuntu postfix/smtp[19746]: connect to example.com[2606:2800:220:1:248:1893:25c8:1946]:25: Network is unreachable
    Mar  6 10:59:02 ubuntu postfix/smtp[19746]: 5BEE724E74: to=<[email protected]>, relay=none, delay=30, delays=0.16/0.1/30/0, dsn=4.4.1, status=deferred (connect to example.com[2606:2800:220:1:248:1893:25c8:1946]:25: Network is unreachable)
    Mar  6 11:00:50 ubuntu postfix/pickup[12505]: 07BF424E7A: uid=999 from=<gitlab@ubuntu>
    Mar  6 11:00:50 ubuntu postfix/cleanup[19923]: 07BF424E7A: message-id=<[email protected]>
    Mar  6 11:00:50 ubuntu postfix/qmgr[12506]: 07BF424E7A: from=<gitlab@ubuntu>, size=626, nrcpt=1 (queue active)
    Mar  6 11:00:51 ubuntu postfix/smtp[19925]: 07BF424E7A: to=<[email protected]>, relay=mta6.am0.yahoodns.net[66.196.118.33]:25, delay=1.1, delays=0.02/0.01/0.86/0.18, dsn=5.7.1, status=bounced (host mta6.am0.yahoodns.net[66.196.118.33] said: 553 5.7.1 [BL21] Connections will not be accepted from 109.65.131.14, because the ip is in Spamhaus's list; see http://postmaster.yahoo.com/550-bl23.html (in reply to MAIL FROM command))
    Mar  6 11:00:51 ubuntu postfix/smtp[19925]: 07BF424E7A: lost connection with mta6.am0.yahoodns.net[66.196.118.33] while sending RCPT TO
    Mar  6 11:00:51 ubuntu postfix/cleanup[19923]: 1A85F24E7C: message-id=<20150306190051.1A85F24E7C@ubuntu>
    Mar  6 11:00:51 ubuntu postfix/qmgr[12506]: 1A85F24E7C: from=<>, size=2643, nrcpt=1 (queue active)
    Mar  6 11:00:51 ubuntu postfix/bounce[19929]: 07BF424E7A: sender non-delivery notification: 1A85F24E7C
    Mar  6 11:00:51 ubuntu postfix/qmgr[12506]: 07BF424E7A: removed
    
2
  • Can you share the actual mail.log entry rather than telling what it suggested?
    – Oldskool
    Mar 6, 2015 at 22:28
  • 3
    It says in your mail log that you're being rejected due to being on a spam list. Mar 7, 2015 at 0:16

2 Answers 2

2

Your mail from the gitlab instance has been accepted by your postfix

Mar  6 10:58:32 ubuntu postfix/qmgr[12506]: 5BEE724E74: from=<gitlab@ubuntu>, size=630, nrcpt=1 (queue active)

But delivery to the destination does not work here:

Mar  6 10:59:02 ubuntu postfix/smtp[19746]: 5BEE724E74: to=<[email protected]>, relay=none, delay=30, delays=0.16/0.1/30/0, dsn=4.4.1, status=deferred (connect to example.com[2606:2800:220:1:248:1893:25c8:1946]:25: Network is unreachable)

Your server tries to use IPv6, but can't connect. It seems you have to disable IPv6 manually, using this in your main.cf:

inet_protocols = ipv4

But relaying (sending) to yahoo, results in an error:

Mar  6 11:00:51 ubuntu postfix/smtp[19925]: 07BF424E7A: to=<[email protected]>, relay=mta6.am0.yahoodns.net[66.196.118.33]:25, delay=1.1, delays=0.02/0.01/0.86/0.18, dsn=5.7.1, status=bounced (host mta6.am0.yahoodns.net[66.196.118.33] said: 553 5.7.1 [BL21] Connections will not be accepted from 109.65.131.14, because the ip is in Spamhaus's list; see http://postmaster.yahoo.com/550-bl23.html (in reply to MAIL FROM command))

It gets rejected, because your dynamic IP 109.65.131.14 is on a mailinglist. It seems you have this instance at home, using a dynamic IP. But these are often on spamlists when one of the previous users of this IP tried to send spam. To probably need either a static IP (at home or at another place) or use a relay server. And use a proper FQDN, set a proper Reverse DNS Record (PTR) for the IP et cetera, see many other questions on how not to get classified as spam.

As the sending process failed, a non-delivery notification gets sent to the sender

Mar  6 11:00:51 ubuntu postfix/bounce[19929]: 07BF424E7A: sender non-delivery notification: 1A85F24E7C
Mar  6 11:00:51 ubuntu postfix/qmgr[12506]: 07BF424E7A: removed

You should probably read your mails that get back to the user gitlab or configure it as an alias for an admin account.

1

I found the problem. As you can see in the log:

Mar  6 11:00:51 ubuntu postfix/smtp[19925]: 07BF424E7A: to=<[email protected]>, relay=mta6.am0.yahoodns.net[66.196.118.33]:25, delay=1.1, delays=0.02/0.01/0.86/0.18, dsn=5.7.1, status=bounced (host mta6.am0.yahoodns.net[66.196.118.33] said: 553 5.7.1 [BL21] Connections will not be accepted from 109.65.131.14, because the ip is in Spamhaus's list; see http://postmaster.yahoo.com/550-bl23.html (in reply to MAIL FROM command))

It says the error was raised as a reply to MAIL FROM command. And as you can see in this log line:

Mar  6 11:00:50 ubuntu postfix/pickup[12505]: 07BF424E7A: uid=999 from=<gitlab@ubuntu>

My domain was @ubunto and it's a bad domain name!

I was needed to change my domain name by setting the "external_url" variable in GitLab's configuration file from "http://ubuntu" to a FQDN. (/etc/gitlab/gitlab.rb)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .