Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab postfix configuration mail not sending

Tags:

git

nginx

gitlab

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.

like image 333
Leandro Garcia Avatar asked Nov 09 '13 01:11

Leandro Garcia


People also ask

How do I send test mail Postfix?

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.

Does Postfix support IMAP?

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.

How do I check my Postfix configuration?

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 .

How do I install postfix on a GitLab server?

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 .

How do I set up email on a GitLab server?

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:

Can I use Postfix mail server with IMAP authentication on Ubuntu?

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 .

How to check if an incoming user received email from postfix?

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 :


1 Answers

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.

like image 100
jojo Avatar answered Nov 07 '22 00:11

jojo