Setting up the email server - hamstar/Braincase GitHub Wiki

Back to User documentation

Braincase needs to send emails for user and event notification. To do this we have included an email server (exim4) that is run locally. This will be setup to send mail straight out to the internet or use a mail server on the local network.

Now there are two different ways you can setup emails with Braincase

  1. Option 1 is if you don't need to use an external SMTP server to send emails, and Braincase itself will be sending the emails out.

  2. Option 2 involves setting up Braincase to use an external SMTP server to send emails. This is useful in situations where port 25 is blocked on your network and you can use your networks SMTP server to send mail instead.

Option 1 - Default

  1. Run the following command:
dpkg-reconfigure exim4-config 
  1. Folow the below steps in order
1. Choose "internet site; mail is send and received directly using SMTP"
2. Press Enter
3. Press Enter
4. Press Enter
5. Press Enter
6. Press Enter
7. Choose "mbox format in /var/mail/" for "Delivery method for local mail".
8. Choose "YES" for "Split configuration into small files?".
  1. Run the following to complete
update-exim4.conf
invoke-rc.d exim4 restart
exim4 -qff

Option 2 - Using an external SMTP server

  1. Run the following command:
dpkg-reconfigure exim4-config 
  1. Folow the below steps in order. For this step, you will need the Hostname/IP Address and PORT of your SMTP server you want to use. The example below we use "smtp.gmail.com::587"
1. Choose "mail sent by smarthost; received via SMTP or fetchmail"
2. Set to "localhost" for "System mail name:".
3. Set to "127.0.0.1" for "IP-addresses to listen on for incoming SMTP connections" to disable external connection.
4. Leave as empty for "Other destinations for which mail is accepted:".
5. Leave as empty for "Machines to relay mail for:".
6. Set to "smtp.gmail.com::587" for "IP address or host name of the outgoing smarthost:".
7. Choose "NO" for "Hide local mail name in outgoing mail?".
8. Choose "NO" for "Keep number of DNS-queries minimal (Dial-on-Demand)?".
9. Choose "mbox format in /var/mail/" for "Delivery method for local mail".
10. Choose "YES" for "Split configuration into small files?".

The final edit must be made to /etc/exim4/passwd.client Adding the following line, as an example for GMAIL;

smtp.google.com:[email protected]:y0uRpaSsw0RD
  1. Run the following to complete
update-exim4.conf
invoke-rc.d exim4 restart
exim4 -qff