Closed Foxi352 closed 11 months ago
Hello @Foxi352, We just merged the rails7 branch to the main branch. Same for "pia" https://github.com/LINCnil/pia with some fixes.
Regarding the SMTP configuration you need to update the information inside: https://github.com/LINCnil/pia-back/blob/master/config/initializers/mailer.rb
The wiki is not updated for now, but you need to set your SMTP credentials in this file. We can help you if needed.
Thanks for your reply. I am new to ruby so updating pia-back, rails and gem's was not that easy :-) Pia was easier as i have Angular experience.
I now have latest versions of pia and pia-back running.
Re mail: If i edit mailer.rb directly, will that not make problems on future git pull
?
Can i use EDITOR='nano' bin/rails credentials:edit
and put something in there like:
smtp_address: srvexchange.xxx.xxx
smtp_post: 587
smtp_authentication: false
smtp_enable_starttls_auto: true
Or where does it get it's Rails.application.credentials.smtp_address
from ?
Yes it's better to update the credentials with EDITOR='nano' bin/rails credentials:edit
and set the value inside.
I still get the error production.log
:
F, [2023-02-01T14:23:20.526919 #229398] FATAL -- : [b7a116d1-c259-4c59-88bb-315d554eab29]
[b7a116d1-c259-4c59-88bb-315d554eab29] ArgumentError (SMTP From address may not be blank: nil):
[b7a116d1-c259-4c59-88bb-315d554eab29]
[b7a116d1-c259-4c59-88bb-315d554eab29] app/controllers/users_controller.rb:70:in `password_forgotten'
In .env
:
MAILER_SENDER=noreply@pia.xxx.xxx
In EDITOR='nano' bin/rails credentials:edit
:
smtp_address: srvexchange.xxx.xxx
smtp_post: 587
smtp_authentication: false
smtp_enable_starttls_auto: true
Did i miss something ?
Hi @Foxi352 sorry for the late answer.
You need to add email_from
into the credentials.
You have more information in the README
Hi,
I installed PIA backend and frontend with authentication. Debian 11 using Apache2. Everything works well, except that i can't get pia-back to send emails.
Postfix is installed and working. I tried sending the mail as user www-data and got the mail without problems.
But i do not receive any emails from PIA. The below example is when i user "Récupération du mot de passe":
pia-back access.log:
Nothing in mail.log except:
.env file in pia-back root:
production.log:
Do i need to configure anything more ? Why is the from address blank, shouldn't it use the MAILER_SENDER env variable?
Thanks for any hint / doc that could help.