newBike
newBike

Reputation: 15022

gitlab can not send email via smtp

Can I skip the email confirmation step and enable the user ?

I followed by https://github.com/gitlabhq/gitlabhq/blob/6-4-stable/doc/install/installation.md followed by each step. But I can not get email confirmation so that no user can be confirmed.

Then I run the server by rails s -p 1987 -e production on the port 1987

The identical setting, I can receive email by my own rails app on other machines,

it's annoying me very much.

sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
Checking Environment ...

Git configured for git user? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.9.3 ? ... OK (1.9.3)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
Satellites access is drwxr-x---? ... yes
update hook up-to-date? ... yes
update hooks in repos are links: ... can't check, you have no projects
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
    /home/git/repositories: OK
    /home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.2.12
Send ping to redis server: PONG
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned UsersGroups? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ... can't check, you have no projects
Projects have satellites? ... can't check, you have no projects
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/local/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.5)

Checking GitLab ... Finished

production.rb

 config.action_mailer.delivery_method = :smtp
 config.action_mailer.raise_delivery_errors = true
 config.action_mailer.default :charset => "utf-8"


 config.action_mailer.smtp_settings = {
  :address => "74.125.129.109",
  # :address => "smtp.gmail.com",
  :port => 587,
  :domain => "localhost",
  :authentication => 'plain',
  :user_name => XXX,
  :password => XXX,
  :enable_starttls_auto => true,
  :openssl_verify_mode  => 'none'
  }

Upvotes: 0

Views: 3963

Answers (1)

Edenshaw
Edenshaw

Reputation: 1757

Don't know how to skip email confirmation and enable user, but with gitlab 6.7.5 these are my smtp settings (for icloud email server. Make sure you have logged in first into iCloud's web-email app, at least once):

file: /Users/git/gitlab/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.mail.me.com",
    port: 587,
    user_name: "[email protected]",
    password: "yourpasswd",
    domain: "me.com",
    authentication: "plain",
    enable_starttls_auto: true
  }
end

Also remember to change the email_from attrbiute in your gitlab.yml file:

file: /Users/git/gitlab/config/gitlab.yml

## Email settings
# Email address used in the "From" field in mails sent by GitLab
email_from: [email protected]

After changing the smtp file, restart the gitlab service.

Hope this helps.

Cheers,

Upvotes: 1

Related Questions