simple-login / app

The SimpleLogin back-end and web app
https://simplelogin.io
GNU Affero General Public License v3.0
5k stars 420 forks source link

sl installed and working but no verificationmail sent #1249

Closed swoop124 closed 2 years ago

swoop124 commented 2 years ago

Hello everyone,

I installed Simple-Login, following the doc, on this github, step by step. I'am able to send Mails from the Dockerhost via swaks but simple-login doesn't send the verifivation mail from registering. In the mail.info log i can only see this:

 /opt/sl# tail /var/log/mail.info 
Aug 26 15:21:21 SL postfix/smtpd[6412]: connect from unknown[10.0.0.4]
Aug 26 15:21:28 SL postfix/smtpd[6412]: disconnect from unknown[10.0.0.4] quit=1 commands=1
Aug 26 15:33:21 SL postfix/postfix-script[6619]: stopping the Postfix mail system
Aug 26 15:33:21 SL postfix/master[5660]: terminating on signal 15
Aug 26 15:33:21 SL postfix/postfix-script[6771]: starting the Postfix mail system
Aug 26 15:33:21 SL postfix/master[6773]: daemon started -- version 3.5.13, configuration /etc/postfix
Aug 26 15:33:26 SL postfix/postfix-script[6804]: stopping the Postfix mail system
Aug 26 15:33:26 SL postfix/master[6773]: terminating on signal 15
Aug 26 15:33:26 SL postfix/postfix-script[6956]: starting the Postfix mail system
Aug 26 15:33:26 SL postfix/master[6958]: daemon started -- version 3.5.13, configuration /etc/postfix
docker ps
CONTAINER ID   IMAGE                    COMMAND                  CREATED       STATUS          PORTS                                                                                            NAMES
6ea920bd7701   postgres:12.1            "docker-entrypoint.s…"   3 hours ago   Up 3 hours      127.0.0.1:5432->5432/tcp                                                                         sl-db
27ba5671a77f   simplelogin/app:3.4.0    "python job_runner.py"   4 hours ago   Up 17 minutes   7777/tcp                                                                                         sl-job-runner
f2983a07ea87   simplelogin/app:3.4.0    "python email_handle…"   4 hours ago   Up 16 minutes   7777/tcp, 0.0.0.0:20381->20381/tcp, :::20381->20381/tcp                                          sl-email
7067d78d466e   simplelogin/app:3.4.0    "gunicorn wsgi:app -…"   4 hours ago   Up 17 minutes   0.0.0.0:7777->7777/tcp, :::7777->7777/tcp                                                        sl-app

I have tried to increase the loglevel in master.cf but nothing is been logged.

Here my simplelogin.env

# Server url
URL=https://app.mydomain.com

# apply colored log to facilitate local development
COLOR_LOG=true

# Only print email content, not sending it, for local development
NOT_SEND_EMAIL=true

# domain used to create alias
EMAIL_DOMAIN=mydomain.com

# Allow SimpleLogin to enforce SPF by using the extra headers from postfix
# ENFORCE_SPF=true

# other domains that can be used to create aliases, in addition to EMAIL_DOMAIN
# OTHER_ALIAS_DOMAINS=["domain1.com", "domain2.com"]

# domains that can be used to create aliases. If set, override OTHER_ALIAS_DOMAINS
# ALIAS_DOMAINS=["domain1.com", "domain2.com"]

# (optional) domains that are only available to premium accounts
# PREMIUM_ALIAS_DOMAINS=["premium.com"]

# the alias domain used when creating the first alias for user, default to EMAIL_DOMAIN if not set
# FIRST_ALIAS_DOMAIN = another-domain.com

# transactional email is sent from this email address
SUPPORT_EMAIL=support@mydomain.com
SUPPORT_NAME=Sent from SimpleLogin

# to receive general stats.
 ADMIN_EMAIL=office@my-otherdomain.com

# Max number emails user can generate for free plan
# Set to 5 by default
MAX_NB_EMAIL_FREE_PLAN=5

# Close registration. Avoid people accidentally creating new account on a self-hosted SimpleLogin
# DISABLE_REGISTRATION=1

# custom domain needs to point to these MX servers
EMAIL_SERVERS_WITH_PRIORITY=[(10, "mail.mydomain.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

# If you want to use another MTA to send email, you could set the address of your MTA here
# By default, emails are sent using the the same Postfix server that receives emails
POSTFIX_SERVER=10.0.0.1

# the DKIM private key used to compute DKIM-Signature
DKIM_PRIVATE_KEY_PATH=/dkim.key

# DB Connection
DB_URI=postgresql://user:password@sl-db:5432/simplelogin

FLASK_SECRET=4F9xophqSDX9irML8D2ghjK7uw43vq

# Flask profiler
# FLASK_PROFILER_PATH=/tmp/flask-profiler.sql
# FLASK_PROFILER_PASSWORD=password

# Where to store GPG Keyring
GNUPGHOME=/sl/pgp

# By default, files are uploaded to s3
# Set this variable to use the local "static/upload/" directory instead
LOCAL_FILE_UPLOAD=true

# Disable onboarding emails
# For self-hosted instance
DISABLE_ONBOARDING=true

# By default use postfix port 25. This param is used to override the Postfix port,
# useful when using another SMTP server when developing locally
# POSTFIX_PORT=26

# domains that can be present in the &next= section when using absolute urls
ALLOWED_REDIRECT_DOMAINS=[]

# DNS nameservers to be used by the app
# Multiple nameservers can be specified, separated by ','
#NAMESERVERS="my.dns.server"
PARTNER_API_TOKEN_SECRET="token"

There are some other lines in the config file but they are all commentet out.

telnet from ths sl-app container to postfix on host is connecting fine.

Did i miss something? I don't get it. For me it looks good, sl-app seems not to send the verification mail or i have it missconfigured and it sends it to nowhere, but schouldn'n there be some errormessages?

please help.

oh, btw in the future i would like to use a relayhost for outgoing and incomming mails is that possible?

regards

swoop124 commented 2 years ago

i saw the mails html code, that schould be sent as e-mail, in the sl-app container-logs.

What does that mean?

2022-08-26 16:41:17 - SL - DEBUG - "/code/app/auth/views/resend_activation.py:32" - resend_activation() -  - user <User 1  user@email-domain.tld> is not activated
2022-08-26 16:41:17 - SL - DEBUG - "/code/app/email_utils.py:246" - send_email() -  - send email with subject 'Just one more step to join SimpleLogin' to 'user@email-domain.tld', plaintext: Thank you for choosing SimpleLogin.
To get started, please confirm that user@email-domain.tld is your email address using this link https://app.mydomain.com/auth/activate?code=uadffaergherztnsfiksqlmxarfnbk within 1 hour.
Thanks,
SimpleLogin Team., html: 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
:
:
2022-08-26 16:41:17 - SL - DEBUG - "/code/server.py:444" - after_request() -  - some:ip:v6:IP:add:ress POST /auth/resend_activation ImmutableMultiDict([]) 200

so the mail is generated? but where is it then?

swoop124 commented 2 years ago

For everyone who stumbles about this problem!!

After about two hours testing i am now certain that it is working now!!!!

i think the problem was this configfileentry:

# Only print email content, not sending it, for local development
NOT_SEND_EMAIL=false

I komm the 2nd line out and restartet all containers. After about ten fifeteen minutes it began to work.