Closed wrekklol closed 2 months ago
Hi,
No, you don't need to edit any .env
file as long as you set your env vars in the environment:
block of the docker-compose file.
Do you see any usefull error in the 2FAuth logs? (see 2fauth/storage/logs
)
Sadly I'm not on my work PC anymore, but no, it says the mail was sent to the user with id 1 or something like that. :)
I have checked my spam folder in case you were wondering.
Ok, so there is something wrong with the email configuration values.
Did you try ssl
in place of tls
for the encryption method?
Hmm no, my smtp uses tls, but I can try tomorrow and see if it helps. :)
You may also protect the MAIL_PASSWORD
value with quotes if your pwd contains a #
You may also protect the
MAIL_PASSWORD
value with quotes if your pwd contains a#
Sadly didn't work, I also tried ssl with no luck. :(
EDIT: This is the entry in the log file:
[2024-07-04 08:38:37] local.INFO: Notification of type App\Notifications\TestEmailSettingNotification sent via channel mail to user ID #1
I just tried having it just log the mail as well, and it prints the test mail just fine.
EDIT 2: I also changed from using docker compose to self hosted, and I still have the same issue. Not sure what I am doing wrong.
Unfortunately it seems to be an issue with the email provider. Is it a public provider? I could try to configure it on my side with a test account.
Ah alright. This is the provider: https://mysmtp.com/
Sorry I can't do anything, there is no free tier 😕 Maybe you could try to contact the mysmtp support?!
I'll try that, thanks for your help. I really appreciate it. :)
Hello,
I'm having the same issue, I can't make the email notifications to work. I'm using fastmail as a relay. It's working fine with my other setup (proxmox and openmediavault notifications). I'm using the same variables here :
- MAIL_HOST=smtp.fastmail.com
- MAIL_PORT=587
- MAIL_USERNAME=myusername
- MAIL_PASSWORD=mypassword (only letter / number)
- MAIL_ENCRYPTION=null
- MAIL_FROM_NAME=2FAuth
- MAIL_FROM_ADDRESS=random@mydomain
- MAIL_VERIFY_SSL_PEER=true
From the log, I can only see
[2024-07-06 12:11:14] local.INFO: Notification of type Illuminate\Auth\Notifications\ResetPassword sent via channel mail to user ID #1
When activating the debug level, I see the content of the email
[2024-07-06 12:12:24] local.DEBUG: From: 2FAuth <xxx>
To: xxx
Subject: Reset Password Notification
MIME-Version: 1.0
Date: Sat, 06 Jul 2024 12:12:24 +0200
Message-ID: <xxx>
Content-Type: multipart/alternative; boundary=SN6ZegWu
--SN6ZegWu
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
2FAuth: https://xxx
# Hello!
You are receiving this email because we received a password reset request for your account.
[...]
Any help would be appreciated !
OK nvm, I didn't notice the "MAIL_MAILER=log" default value.
I just cannot get mailing to work. I've tried both smtp and sendmail, but with no luck. I've tested both smtp and sendmail outside of 2FAuth, and they work. So I'm not sure what I am doing wrong. :(
Another quick question is, can/should I edit the .env file when using docker compose?
This is my docker compose file (I've removed sensitive data):