I installed GitLab on my Ubuntu 12.04 server. Now I can login as an Administrator, do some stuffs, however, my question is the email seems to be not workin. I need to confirm the confirmation email sent to my address.
I installed postfix as per instruction by our the readme. How can I test my postfix or configure GitLab configuration.
In this step, you'll test whether Postfix can send emails to an external email account using the mail command, which is part of the mailutils package that was installed in Step 1. To send a test email, type: echo "This is the body of the email" | mail -s "This is the subject line" your_email_address.
In our setup, Postfix sends and receives mail from Internet and stores them in the user mailboxes while clients on the Internet can retrieve their mails via Courier IMAP or POP3.
Check configurationRun the postfix check command. It should output anything that you might have done wrong in a configuration file. To see all of your configs, type postconf . To see how you differ from the defaults, try postconf -n .
If the mail server is different from the server running GitLab, open up port 143 on your server so that GitLab can read email from the server over IMAP. Install the postfix package if it is not installed already: When asked about the environment, select ‘Internet Site’. When asked to confirm the hostname, make sure it matches gitlab.example.com .
Open up port 25 on your server so that people can send email into the server over SMTP. If the mail server is different from the server running GitLab, open up port 143 on your server so that GitLab can read email from the server over IMAP. Install the postfix package if it is not installed already:
This document will take you through the steps of setting up a basic Postfix mail server with IMAP authentication on Ubuntu, to be used with incoming email .
See Configure Postfix to receive email from the Internet ._ Check if the incoming user received the email: You should see output like this: Sign out of the incoming account, and go back to being root :
In case your ISP is blocking port 25 (this happens apparently quite often and was the case for me as well) you can use Gmail as a Relay. The following instructions are from here and walk you step-by-step through the process:
In /etc/postfix/main.cf
add:
# Relaying Postfix SMTP via GMAIL
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
Then you need to setup the Gmail credentials. For this open/create /etc/postfix/sasl_passwd
and write:
[smtp.gmail.com]:587 [email protected]:PASSWORD
Where (as you might have guessed) USERNAME
and PASSWORD
are your credentials. Then change permissions for the file:
$ sudo chmod 400 /etc/postfix/sasl_passwd
$ sudo postmap /etc/postfix/sasl_passwd
Now we need to add the certificate to Postfix:
$ cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem
Just restart postfix and you should be good:
$ sudo service postfix restart
If you want to test:
$ echo "Hello World" | mail -s "Test Message" [email protected]
And check what the mail log thinks about it:
$ tail /var/log/mail.log
Note: You only have 500 emails per day using Gmail's SMTP Server as Relay.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With