Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitlab cannot send email to new user

Tags:

gitlab

I've just installed git git-1.8.1.2 and gitlab gitlab_6.7.2-omnibus-1.ubuntu.12.04_amd64.deb on fresh install of Ubuntu 12.04 lts following: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#ubuntu-12-04 and: https://www.gitlab.com/2014/03/12/packaged-gitlab-with-omnibus/

When setting up a new user in gitlab, it attempts to send out an email with temporary passwords but postfix gets an error from the relay host: Bad sender address syntax (in reply to MAIL FROM command)

My /etc/gitlab/config/environments/production.rb looks like this

config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true

config.action_mailer.smtp_settings = {
      :address              => 'mail.domain.com',
      :port                 => 587,
      :domain               => 'domain.com',
      :user_name            => '[email protected]',
      :password             => 'password',
      :authentication       => 'password',
      :enable_starttls_auto => true
}

I can send email via command line with postfix using I think the same relay host. echo “This will go into the body of the mail.” | sendmail “Hello world” [email protected]

What might be going wrong and where should I look?

like image 421
kbrown Avatar asked Nov 10 '22 10:11

kbrown


1 Answers

I have also had the same problem on AWS using SES. After wasting 2 days debugging, reading docs and forums, I tried to loose the Security Group inbound rules, which were restricted only to the ports 22, 80 and 443.

Firstly I opened all inbound traffic for debug purposes. As soon as I open all ports to the world (0.0.0.0/0), the issue was gone. But this cannot stay so, then I closed all inbound ports, except 22 (SSH), 90 (HTTP), 443 (HTTPS) and additionally 25 (SMTP) to the IP of the SMTP-Server and it is still working.

So, to sum up, the SES needs to be able to communicate with the server using the SMTP port. That's why the port must be open for inbound traffic as well.

like image 61
Елин Й. Avatar answered Jan 04 '23 01:01

Елин Й.