-Opened ports with EC2 instance
-Already tried with other stmp email server, that’s working
-jumped through the hoops with protonmail to get the domain cname, mx etc. all working
-updated php artisan optimize, etc.
-have endered the data manually in the .env file, not working
-tried TLS, and STARTTLS
I have seen the error with other threads, but advice has not solved the issue.
Describe the bug
When trying
""422: The given data was invalid.
• The smtp username field is required.
• The smtp password field is required.
“”
Steps To Reproduce
-set up smtp email with protonmail and use port 587 and STARTLS, collect token
-enter token information into email settings, and save
-try to send test email
Expected Behavior
Successful email sent.
Additional context
If this is some bs with aws Ec2 port 587 firewall i’m gonna shit.
I tried converting back to my other stmp server on port 465, however the email settings were not updating after saving in Settings > Email Settings, then optimizing with php.
Email, with the old smtp server is working with a manual edit of .env, then sending out a client email invoice, however sending test email still fails in Settings >Email Settings.
doesn’t update .env file, when saving, probably due to permission error. I am not sure if there is a temp file that is created somewhere in the DB. It would be nice to have multiple email settings to select between two, or three addresses stored.
I did try some troubleshooting with openssl and the smtp.protonmail.ch client.
As far as I can tell it uses AUTH PLAIN. Not sure if this is in the working code yet or not.
It looks like the headers are getting sent with the registered gmail account, which was used to set up the server, and not accepting the new email settings. I also tried to add the @proton.ch email as admin under user management as well, but to no avail…
/storage/logs/invoiceninja.log
[2025-01-14 00:08:33] production.INFO: Mailer failed with a Transport Exception Expected response code “250/251/252” but got code “553”, with message “553 5.7.1 <[email-protected]@gmail.com>: Sender address rejected: not owned by user [email-protected]@proton.ch”.
[2025-01-14 00:09:09] production.INFO: Using mailer => smtp 2025-01-14 00:09:09
[2025-01-14 00:09:10] production.INFO: Mailer failed with a Transport Exception Expected response code “250/251/252” but got code “553”, with message “553 5.7.1 <[email-protected]@gmail.com>: Sender address rejected: not owned by user [email-protected]@proton.ch”.
So I figured out settings to get the emails working:
.env file mail settings permissions inherit from email data in User Details
As long as these two emails are the same in, .env and User Details, sending invoice emails works.
However, I still get the same 422 errors, with the ‘Send Test Email Button’ with the working smtp.protonmail.ch settings in email settings , concurrently. Go figure.