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=<admin@example.com>, 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=<54f9f961dca8d_4cc8fc2c6882575@ubuntu.mail> 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=<matoni@yahoo.com>, 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
Best Answer
Your mail from the gitlab instance has been accepted by your postfix
But delivery to the destination does not work here:
Your server tries to use IPv6, but can't connect. It seems you have to disable IPv6 manually, using this in your
main.cf
:But relaying (sending) to yahoo, results in an error:
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
You should probably read your mails that get back to the user
gitlab
or configure it as an alias for an admin account.