SMTP Config
Introduction
This manual describes the procedure to configure and install an SMTP service suitable for the GBDS Email Notification Service on Ubuntu Linux. This procedure was tested on Ubuntu 20.04 LTS.
Sending Emails
To send emails locally, set these on the enotifier.setting table:
mail.smtp.host = localhost
mail.smtp.port = 25Postfix
Install and configure Postfix. To install, run the following command:
sudo apt update
sudo DEBIAN_PRIORITY=low apt install postfixThe installation will begin. Configure the installation with the following:
General type of mail configuration:
Internet SiteSystem mail name:
alpha-01.pd.griauleRoot and postmaster mail recipient:
<linux-account-name>Other destinations to accept mail for:
localhost.$myhostname, localhost, $mydomainnameForce synchronous updates on mail queue?:
NoLocal networks:
127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128Mailbox size limit:
0Local address extension character:
+Internet protocols to use:
all
Access the main.cf file at /etc/postfix/ and modify the following:
Enable postfix on the firewall, then restart the service. Install the mailutils package and enable port 80 on the firewall. Those can be done with:
Reconfigure postfix:
TLS Self-signed key
To operate the service needs a self-signed certificated key. To create one and move it in the correct location run the following commands:
Access the main.cf file at /etc/postfix/ and modify the following:
Then, reload and restart postfix.
SPF and DKIM
For authentication to work, SPF and DKIM must be configured:
SPF and DKIM configurations should be made by the DNS account admin.
SPF
Include DNS TXT value on the DNS domain control panel.
Name/Host/Alias:
@or leave blank.Time to Live (TTL):
3600or leave the default.Value/Answer/Destination:
v=spf1 ip4:x.x.x.x ~all(where x.x.x.x is your server IP).
DKIM
Generate DKIM public and private keys on: https://dkimcore.org/tools/keys.html
Copy private key as dkim-private.pem to /etc/ssl/certs
Include DNS TXT value.
Name/Host/Alias:
mail._domainkeyValue:
v=DKIM1; h=sha256; k=rsa; t=y; p=<public value on site generated>
Access the main.cf file at /etc/postfix/ and modify the following:
Then, reload and restart postfix.
OpenDKIM
To install OpenDKIM, run:
Open the opendkim.conf at /etc/ and edit the following:
Then open the opendkim file at /etc/default/ and modify as shown:
To apply the changes, restart postfix and opendkim.
SASL
The Simple Authentication and Security Layer configuration makes postfix send emails using known relay hosts on port 25 to authenticate properly, preventing emails from being marked as spam.
Open main.cf at etc/postfix and modify:
Then, go to /etc/postfix/ and open the saslpass file and edit:
The password needed is a new app-generated password. This is generated in the Gmail account security settings.
To finish the configuration, run the following:
Last updated
Was this helpful?

