You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 2, 2024. It is now read-only.
Hi!
I have found your setup scripts and especially the update function extremly usefull and I am really amazed by the work done here! Thank you so much.
Create an A-record that points sl.example.com to your server IP.
This needs to be setup at your domain. If you use DynDNS, make sure your WAN adress is updated correctly.
Create MX-record that points example.com. to sl.example.com. with priority 10
Also setup at your domain. Each registrar is different so please refer to to their documentation
Create TXT-record for dkim._domainkey.example.com.
sed "s/-----BEGIN PUBLIC KEY-----/v=DKIM1; k=rsa; p=/g"$(pwd)/dkim.pub.key | sed 's/-----END PUBLIC KEY-----//g'|tr -d '\n'| awk 1
Copy the output of that command into the DKIM record on your domain.
5.2 Copy the content of the posted main.cf into the /etc/postfix/main.cf.
sudo nano /etc/postfix/main.cf
# POSTFIX config file, adapted for SimpleLogin
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on# fresh installs.
compatibility_level = 2
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_tls_security_level = may
smtpd_tls_security_level = may
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for# information on enabling SSL in the smtp client.
alias_maps = hash:/etc/aliases
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.0.0.0/24
# Set your domain here
mydestination =
myhostname = sl.example.com
mydomain = example.com
myorigin = example.com
relay_domains = pgsql:/etc/postfix/pgsql-relay-domains.cf
transport_maps = pgsql:/etc/postfix/pgsql-transport-maps.cf
# HELO restrictions
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_helo_restrictions =
permit_mynetworks,
reject_non_fqdn_helo_hostname,
reject_invalid_helo_hostname,
permit
# Sender restrictions:
smtpd_sender_restrictions =
permit_mynetworks,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
permit
# Recipient restrictions:
smtpd_recipient_restrictions =
reject_unauth_pipelining,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
permit_mynetworks,
reject_unauth_destination,
reject_rbl_client zen.spamhaus.org=127.0.0.[2..11],
reject_rbl_client bl.spamcop.net=127.0.0.2,
permit
5.3 Copy the content of the posted pgsql-relay-domains.cf into the /etc/postfix/pgsql-relay-domains.cf.
sudo nano /etc/postfix/pgsql-relay-domains.cf
# postgres config
hosts = localhost
user = dbuser
password = MySuperStrongPassword
dbname = simplelogin
query = SELECT domain FROM custom_domain WHERE domain='%s' AND verified=true
UNION SELECT domain FROM public_domain WHERE domain='%s'
UNION SELECT '%s' WHERE '%s' = 'example.com' LIMIT 1;
5.4 Copy the content of the posted pgsql-transport-maps.cf into the /etc/postfix/pgsql-transport-maps.cf.
sudo nano /etc/postfix/pgsql-transport-maps.cf
# postgres config
hosts = localhost
user = dbuser
password = MySuperStrongPassword
dbname = simplelogin
# forward to smtp:127.0.0.1:20381 for custom domain AND email domain
query = SELECT 'smtp:127.0.0.1:20381' FROM custom_domain WHERE domain = '%s' AND verified=true
UNION SELECT 'smtp:127.0.0.1:20381' FROM public_domain WHERE domain = '%s'
UNION SELECT 'smtp:127.0.0.1:20381' WHERE '%s' = 'example.com' LIMIT 1;
Restart Postfix
sudo systemctl restart postfix
Install pwgen
sudo apt install pwgen
Generate Flask Secret, copy output of command into Flask Secret in simplelogin.env
pwgen -B -s -y 64 -N 1
Create environment configuration for hosting SimpleLogin via docker
nano $(pwd)/simplelogin.env
# WebApp URL
URL=http://sl.example.com
# domain used to create alias
EMAIL_DOMAIN=example.com
# transactional email is sent from this email address[email protected]# custom domain needs to point to these MX servers
EMAIL_SERVERS_WITH_PRIORITY=[(10, "sl.example.com.")]
# By default, new aliases must end with ".{random_word}". This is to avoid a person taking all "nice" aliases.# this option doesn't make sense in self-hosted. Set this variable to disable this option.
DISABLE_ALIAS_SUFFIX=1
# the DKIM private key used to compute DKIM-Signature
DKIM_PRIVATE_KEY_PATH=/dkim.key
# DB Connection
DB_URI=postgresql://dbuser:MySuperStrongPassword@sl-db:5432/simplelogin
FLASK_SECRET=*copy output of pwgen -B -s -y 64 -N 1*
GNUPGHOME=/sl/pgp
LOCAL_FILE_UPLOAD=1
POSTFIX_SERVER=10.0.0.1
If you encounter the problem of not being able to add your custom domain in your mailbox, follow this Github Error.
In short:
sudo docker exec -it sl-db psql -U dbuser simplelogin
-- Get your user ID
SELECT id,email FROM users;
-- Add your domain
INSERT INTO custom_domain
(created_at,user_id,domain,verified)
VALUES (NOW(),#YOUR_USER_ID#,'#YOUR.DOMAIN#',FALSE);
Github is always a good place to check for Simplelogin app issues. Even though the guide is pretty outdated. MX Toolbox is handy for tracing any bugs in postfix or email sending.
Upgrading simplelogin-app
Check docker-hub for latest version of simplelogin-app.
1.1 If there is a new image on docker, pull latest image and if folder upload is non existent, create it.
1.2 If there is no new image but in the release section of github you see a higher version number than the latest image, you can build the image on your own with:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I have found your setup scripts and especially the update function extremly usefull and I am really amazed by the work done here! Thank you so much.
I am currently hosting a simple login instance and wrote a little tutorial for myself, as the guide on their website (https://github.com/simple-login/app/) is pretty outdated.
I would love to have this added as a full automation and update script.
To give a little headup start, I added the tutorial in here:
SimpleLogin app with docker
Server prerequisites:
sl.example.com
) and add entry in/etc/hosts
:sudo apt update && sudo apt upgrade -y
sudo ufw enable
The
-traditional
flag is needed if using openssl version 3 (check version withopenssl version
)DNS records
Create an A-record that points
sl.example.com
to your server IP.This needs to be setup at your domain. If you use DynDNS, make sure your WAN adress is updated correctly.
Create MX-record that points
example.com
. tosl.example.com
. with priority 10Also setup at your domain. Each registrar is different so please refer to to their documentation
Create TXT-record for
dkim._domainkey.example.com
.Copy the output of that command into the DKIM record on your domain.
example.com
.v=spf1 mx ~all
_dmarc.example.com
.Preparing Docker environment
sudo curl -fsSL https://get.docker.com | sh
Replace
MySuperStrongPassword
with your preferred secure password.sudo docker exec -it sl-db psql -U dbuser simplelogin
Install and configure postfix
5.1 install postfix
5.2 Copy the content of the posted
main.cf
into the/etc/postfix/main.cf
.5.3 Copy the content of the posted
pgsql-relay-domains.cf
into the/etc/postfix/pgsql-relay-domains.cf
.5.4 Copy the content of the posted
pgsql-transport-maps.cf
into the/etc/postfix/pgsql-transport-maps.cf
.Restart Postfix
simplelogin.env
nano $(pwd)/simplelogin.env
simplelogin/app:4.6.2-beta
with the version you just builtNginx
Aquire SSL certificate from Let's Encrypt (if not using NPM)
All steps taken from SimpleLogin Github
sudo snap install core; sudo snap refresh core sudo snap install --classic certbot sudo ln -s /snap/bin/certbot /usr/bin/certbot sudo certbot --nginx
Enable HSTS
Reload nginx
Make account premium
Disable registrations in
simplelogin.env
Restart web-app
Troubleshooting
If encountering problems visit this tutorial: SimpleLogin Setup
If you encounter the problem of not being able to add your custom domain in your mailbox, follow this Github Error.
In short:
Upgrading simplelogin-app
Check docker-hub for latest version of simplelogin-app.
1.1 If there is a new image on docker, pull latest image and if folder
upload
is non existent, create it.1.2 If there is no new image but in the release section of github you see a higher version number than the latest image, you can build the image on your own with:
Run the db container
Beta Was this translation helpful? Give feedback.
All reactions