Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup of email for password recovery #245

Closed
1 task done
rouilj opened this issue Nov 23, 2023 · 3 comments
Closed
1 task done

Setup of email for password recovery #245

rouilj opened this issue Nov 23, 2023 · 3 comments
Labels
setup Runtime environment or usage issue

Comments

@rouilj
Copy link
Contributor

rouilj commented Nov 23, 2023

Version

c765bfd

Details & Steps to reproduce

I'm trying to configure email to use the docker host's smtp server running on port 25.

I have the following values:

#MAIL_DRIVER=log
MAIL_HOST=172.x.y.z
MAIL_PORT=25
MAIL_FROM=2fauth@localhost
MAIL_FROM_NAME=2fauth
MAIL_FROM_ADDRESS=2fauth@localhost

I had originally left off:

MAIL_FROM_NAME=2fauth
MAIL_FROM_ADDRESS=2fauth@localhost

but got the error:

local.ERROR: An email must have a "From" or a "Sender" header. {"exception":"[object] (Symfony\\Component\\Mime\\Exception\\LogicException(code: 0): An email must have a \"From\" or a \"Sender\" header. at /srv/vendor/symfony/mime/Message.php:138)

Adding the MAIL_FROM_NAME and MAIL_FROM_ADDRESS fixed that error,
but MAIL_FROM was defined as above. Why was setting MAIL_FROM not sufficient?

Once all this was straight, i get the following error:

Unable to connect with STARTTLS: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:0A000086:SSL routines::certificate verify failed

What are the possible values for MAIL_DRIVER? Should it be smtp perhaps to disable TLS?

Expectation

I expect email to be sent via the smtp server on the docker host on port 25.

Error & Logs

See above.

Execution environment

Date: Thu, 23 Nov 2023 02:54:04 +0000
userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Version: 4.2.4
Environment: local
Install path: /2fauth
Debug: true
Cache driver: file
Log channel: daily
Log level:
DB driver: sqlite
PHP version: 8.1.22
Operating system: Linux
interface: fpm-fcgi

Containerization

  • Docker

Additional information

No response

@Bubka
Copy link
Owner

Bubka commented Nov 23, 2023

hi,

MAIL_FROM should be removed, it's a useless var I forgot to removed from the Docker stuff (.env.example doesn't use it anymore).

Regarding your cert issue, you can set MAIL_VERIFY_SSL_PEER = false in your env vars to disable ssl verification (see #219).

@Bubka Bubka added the setup Runtime environment or usage issue label Nov 23, 2023
rouilj added a commit to rouilj/2FAuth that referenced this issue Nov 23, 2023
@rouilj
Copy link
Contributor Author

rouilj commented Nov 23, 2023

Hello:

MAIL_FROM should be removed, it's a useless var I forgot to removed from the Docker stuff (.env.example doesn't use it anymore).

The file you link to still has MAIL_FROM in it.

Regarding your cert issue, you can set MAIL_VERIFY_SSL_PEER = false in your env vars to disable ssl verification (see #219).

This works and I can send a reset email successfully.

I have created pull#247 that removes MAIL_FROM and adds MAIL_VERIFY_SSL_PEER with a comment.

Thanks for your help.

@Bubka
Copy link
Owner

Bubka commented Nov 23, 2023

The file you link to still has MAIL_FROM in it.

Sorry I mixed up with the Laravel one: https://github.com/laravel/laravel/blob/10.x/.env.example

@Bubka Bubka closed this as completed Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
setup Runtime environment or usage issue
Projects
None yet
Development

No branches or pull requests

2 participants