Closed johnjelinek closed 10 years ago
@johnjelinek please check the config/initializers/smtp_settings.rb
file for the smtp configuration.
address: "smtp.example.com",
port: 25,
domain: "www.example.com",
authentication: "none",
enable_starttls_auto: true
This is what I see (I replaced the address and domain with fake values here). The only difference here is that, I see authentication: :none
in my 6.5.1
instance where e-mail works.
6.5.1
# cat config/initializers/smtp_settings.rb
# To enable smtp email delivery for your GitLab instance do next:
# 1. Change config/environments/production.rb to use smtp
# config.action_mailer.delivery_method = :smtp
# 2. Rename this file to smtp_settings.rb
# 3. Edit settings inside this file
# 4. Restart GitLab instance
#
if Gitlab::Application.config.action_mailer.delivery_method == :smtp
ActionMailer::Base.smtp_settings = {
address: "smtp.example.com",
port: 25,
# user_name: "smtp",
# password: "123456",
domain: "www.example.com",
authentication: :none,
enable_starttls_auto: true
}
end
7.1.1
# cat config/initializers/smtp_settings.rb
# To enable smtp email delivery for your GitLab instance do next:
# 1. Rename this file to smtp_settings.rb
# 2. Edit settings inside this file
# 3. Restart GitLab instance
#
if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
address: "smtp.example.com",
port: 25,
domain: "www.example.com",
authentication: "none",
enable_starttls_auto: true
}
end
@johnjelinek the newer actionmail has dropped the :
character from the authentication parameter. :none
now becomes none
, at least that is the case for login
. Since you do not require authentication, you can just drop the -e "SMTP_AUTHENTICATION=none"
parameter from the run command.
@johnjelinek If it does not help. Then you can enter the container (nsenter/nsinit) and try to manually update the config/initializers/smtp_settings.rb
. You can reload the unicorn server by executing kill -s USR2 $(cat /home/git/gitlab/tmp/pids/unicorn.pid)
. Once you get the mailer working let me know the changes and lets try to incorporate them into the image.
ok, I think I'm going to try to jump in with nsinit
and change config.action_mailer.delivery_method = :sendmail
to config.action_mailer.delivery_method = :smtp
in config/environments/production.rb
@johnjelinek I think you need to change it in the config/initializers/smtp_settings.rb
since any configs in the initializers folder override other configs. Or you can just remove the config/initializers/smtp_settings.rb
file first.
Even though the production.rb
says changes there take precedence?
https://github.com/gitlabhq/gitlabhq/blob/master/config/environments/production.rb#L2
@johnjelinek ok.. maybe your right
hmm .. modifying the config.action_mailer.delivery_method
didn't seem to resolve it. Any thoughts? Does SMTP work for you?
Maybe I'm not issuing commands that would send out e-mails? In 6.5.1
, whenever I create a repo I'd get an e-mail.
lol, nvm -- I wasn't doing any actions that were causing e-mails to get sent. SMTP works when you do something like creating a new user. No special changes necessary.
@johnjelinek haha... so you were able to use the existing config options to get the mailer working right?
Yup, no changes. On Aug 6, 2014 2:33 AM, "Sameer Naik" notifications@github.com wrote:
@johnjelinek https://github.com/johnjelinek haha... so you were able to use the existing config options to get the mailer working right?
— Reply to this email directly or view it on GitHub https://github.com/sameersbn/docker-gitlab/issues/118#issuecomment-51302504 .
Its not Working. Specified the conf. Do i need to expose any port in Docker compose yml.
my Host machine : Centos7 running it on Docker for gitlab,
mails are working for Host machine. But when try to send mail from gitlab. Nothing happens.
1.) Do i need to install postfix on Docker machine? 2.) Do i need to expose any port. 3.) Tried using Gmail smtp as well as extrernal mailserver. : Which 1 suggested?
@hsitaa please create a new issue report.
Even with STMP settings set,
production.rb
still says sendmail.