Open tesudacochino opened 1 year ago
Hello @tesudacochino, thanks for contributing to the Password Pusher community! We will respond as soon as possible.
HI @tesudacochino - apologies for the issue. I've oddly had a couple reports of this lately despite no changes in the mail delivery.
To better diagnose, could you open a console in the pwpush container and run the following:
docker exec -it <containerId> /bin/bash
./bin/rails console
Rails.application.config.action_mailer.smtp_settings
That last command will output the Mail settings. Could you post that here without any sensitive information?
Then run this code snippet to manually send an email. Replace those email addresses with something valid:
Mail.deliver do
to 'your@email.com'
from 'your@email.com'
subject 'testing mail'
body 'testing mail'
end
Could you let me know what the output is. And did you get the email?
Setting PWP__MAIL__SMTP_STARTTLS
to true
may be worth trying too.
Hi @pglombardo
thanks for your quick reply. I have tried the configuration you asked for.
docker-compose.yml file
version: '2.1'
services:
passwordpusher:
image: pglombardo/pwpush-ephemeral:latest
container_name: passwordpusher
hostname: passwordpusher.local
restart: always
environment:
PWP__ENABLE_LOGINS: true
PWP__ALLOW_ANONYMOUS: true
PWP__MAIL__SMTP_STARTTLS: true
PWP__MAIL__SMTP_ENABLE_STARTTLS_AUTO: true
PWP__MAIL__RAISE_DELIVERY_ERRORS: true
PWP__HOST_PROTOCOL: http
PWP__MAIL__SMTP_ADDRESS: 192.168.1.113
PWP__MAIL__SMTP_PORT: 465
PWP__MAIL__SMTP_USER_NAME: ${USER_MAIL}
PWP__MAIL__SMTP_PASSWORD: ${USER_PASSWORD}
PWP__MAIL__MAILER_SENDER: ${MAILER_SENDER}
PWP__HOST_DOMAIN: ${HOST_DOMAIN}
ports:
- "5100:5100"
Ruby console:
$ /opt/PasswordPusher/bin/rails console
Loading private environment (Rails 7.0.4.1)
irb(main):001:0> Rails.application.config.action_mailer.smtp_settings
=>
{:address=>"192.168.1.113",
:port=>465,
:user_name=>"xxxx@xxxxx.com",
:password=>"xxxxx",
:authentication=>"plain",
:enable_starttls_auto=>true,
:open_timeout=>10,
:read_timeout=>10}
irb(main):002:1* Mail.deliver do
irb(main):003:1* to 'sxxxx@xxxx.com'
irb(main):004:1* from 'sxxxx@xxxxx.com'
irb(main):005:1* subject 'testing mail'
irb(main):006:1* body 'testing mail'
irb(main):007:0> end
/usr/local/lib/ruby/3.2.0/socket.rb:1217:in `__connect_nonblock': Cannot assign requested address - connect(2) for [::1]:25 (Errno::EADDRNOTAVAIL)
irb(main):008:0>
I don't understand really. The smtp_settings
have "192.168.1.113" on port 465 but the error message refers to [::1]:25
which is the IPv6 localhost port 25.
Are you running in any special environment, container setup or equivalent?
Another test that should tell us something. Could you shell into the docker container again and run:
docker exec -it <containerId> /bin/bash
ruby -e 'require "socket"' -e "TCPSocket.open('192.168.1.113', 465)"
I try different environment Docker in windows and Ubuntu 20.04.5 LTS and the same rsult.
pwpusher@passwordpusher:/opt/PasswordPusher/bin$ ruby -e 'require "socket"' -e "TCPSocket.open('192.168.1.113', 465)"
pwpusher@passwordpusher:/opt/PasswordPusher/bin$ rails console
Loading private environment (Rails 7.0.4.1)
irb(main):001:0> Rails.application.config.action_mailer.smtp_settings
irb(main):002:0*
=>
{:address=>"192.168.1.113",
:port=>465,
:user_name=>"zurmo@brainstorm3d.com",
:password=>"zurmo109238",
:authentication=>"plain",
:enable_starttls_auto=>true,
:open_timeout=>10,
:read_timeout=>10}
irb(main):003:1* Mail.deliver do
irb(main):004:1* to 'your@email.com'
irb(main):005:1* from 'your@email.com'
irb(main):006:1* subject 'testing mail'
irb(main):007:1* body 'testing mail'
irb(main):008:0> end
irb(main):009:0*
/usr/local/lib/ruby/3.2.0/socket.rb:1217:in `__connect_nonblock': Cannot assign requested address - connect(2) for [::1]:25 (Errno::EADDRNOTAVAIL)
Hi @tesudacochino - I just released 1.25.6 that includes a mail system update that claims:
Bug Fixes: Regression: sendmail accepts string :arguments (@sebbASF) Regression: accept enable_starttls_auto: false @ahorek
A regression in that library would explain this change of behavior despite no changes in Password Pusher. Let's see if this has any affect for you. 1.25.6 is building now.
Hi @tesudacochino - Other users have reported a work around in https://github.com/pglombardo/PasswordPusher/issues/755#issuecomment-1429803307
It seems to be a bug in a dependent library that Password Pusher uses.
i have play with PWPMAILSMTP_ENABLE_STARTTLS_AUTO option. If i set this to false, the error is gone and the mail is send, with true the error is persistent.
cc: @kuehnel-net thanks for digging on this!
Hi @tesudacochino - it's been a while on this issue - has anything changed on your side? Have you tried setting PWP__MAIL__SMTP_ENABLE_STARTTLS_AUTO=false
as mentioned in the comment above?
Hello, not the OP, but setting PWP__MAIL__SMTP_ENABLE_STARTTLS_AUTO
to false
fixed the error for me. I checked the Ruby logs and the error message was the same. After setting the env variable I can now send mails.
Hi all - as an update on the email story: in v1.39.8, I added a tool to test email configurations. Could you update to that version and try this out?
It should reveal where the issue is...
🐛 Bug Report
I try to send any notification by mail using an SSL/TLS connection and I get an error message on the server.
🔬 How To Reproduce
To reproduce it, all you have to do is register a new user These are the logs of my mail server
The error returned by passwordpusher with PWPMAILRAISE_DELIVERY_ERRORS: true![imagen](https://user-images.githubusercontent.com/13074983/214887429-8a02c644-242d-46f6-a1c0-b87dccfb2756.png)
Environment
Where are you running/using Password Pusher?
I tried latest and stable docker versión.
Screenshots
📈 Expected behavior
Receive an email :-)
📎 Additional context
This is my configuration of my Thunderbird mail client.![imagen](https://user-images.githubusercontent.com/13074983/214886858-6af917e0-d173-443c-bbf7-c2ee45d68bf6.png)