Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab, docker and sendmail ports

I have got gitlab running through docker using this image. In the image documentation there are instructions for how to configure an optional SMTP server for emails, but little information on what happens if SMTP is not set up. The gitlab documentation indicates that sendmail is used by default, so I assume that is what happens, and for my purposes (a few private repositories with only a couple of users) I don't think I really need any more than sendmail. I tried just ignoring the SMTP configuration and it all runs fine, but emails are not sent. I don't know enough about email servers or sendmail to know how to find the problem, but my guess is that some port it needs is blocked.

My questions:

  1. Can anyone confirm than sendmail is used, and that I don't need to configure something?
  2. Is there some easy way to test sendmail locally to see if there are issues with blocked ports? All the guides I find start out with several pages of configuration details.
  3. What ports would sendmail need open to work? Do I need to expose additional ports on the container or on my firewall?
like image 693
aquavitae Avatar asked Oct 06 '14 06:10

aquavitae


1 Answers

Shuo's answer worked for me except I changed:

supervisord reload # restart the service

to

supervisorctl reload

Another approach is to build your own Docker image and update the production.rb environment file. Here's what you're Dockerfile might look like.

FROM sameersbn/gitlab:7.14.0

MAINTAINER "leo.o'[email protected]"

# sed the production.rb environment file to use a configured email method converting
#
#  config.action_mailer.delivery_method = :sendmail
# 
# to
#  config.action_mailer.delivery_method = (ENV['SMTP_DELIVERY_METHOD'] || :sendmail).to_sym
RUN sed -E -e "s/(action_mailer.delivery_method[^\:]+)([^ \t\#]+)(.*)/\1\(ENV\[\'SMTP_DELIVERY_METHOD\'\] \|\| \2\).to_sym\3/" -i config/environments/production.rb

or you can just use my image

docker pull leopoldodonnell/gitlab

like image 57
Leo O'Donnell Avatar answered Oct 02 '22 02:10

Leo O'Donnell