pglombardo / PasswordPusher

πŸ” Securely share sensitive information with automatic expiration & deletion after a set number of views or duration. Track who, what and when with full audit logs.
https://docs.pwpush.com
Apache License 2.0
2.09k stars 358 forks source link

Cannot send emails on a IPv6-only host #2692

Open olegbliaher opened 2 weeks ago

olegbliaher commented 2 weeks ago

πŸ› Bug Report

πŸ”¬ How To Reproduce

Steps to reproduce the behavior:

  1. Start console
  2. TestMailer.send_test_email("oleg@mydomain.com").deliver_now

Code sample

--> Configured FROM: address: 'pwpush@oderland.se' --> Default port is 25 but will only be used if smtp_address is set.

The settings.yml mail configuration is:

raise_delivery_errors: true smtp_port: 25 smtp_enable_starttls_auto: true smtp_open_timeout: 10 smtp_read_timeout: 10 mailer_sender: pwpush@domain.com smtp_starttls: true smtp_password: [HIDDEN] smtp_openssl_verify_mode: none smtp_user_name: username smtp_address: smtp.server.com

The Mail subsystem SMTP configuration is:

address: smtp.server.com port: 25 open_timeout: 10 read_timeout: 10 user_name: user password: [HIDDEN] openssl_verify_mode: none enable_starttls_auto: true

Environment

Where are you running/using Password Pusher?

If applicable, what version of Password Pusher?

1.47.3

Screenshots

The error:

/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/irb-1.14.1/lib/irb.rb:1260:in `full_message': Network unreachable (Errno::ENETUNREACH)

πŸ“ˆ Expected behavior

I expect an email to be sent :)

πŸ“Ž Additional context

Since IPv6 is always a bit tricky, I had to define a subnet explicitly in my docker-compose.yml file:

networks:
  default:
    enable_ipv6: true
    ipam:
      config:
        - subnet: fd40:3457:518e:725b::/64

If I set the subnet to 2001:db8::/64 (the prefix reserved for documentation), it works. I would also like to point out that networking works, I just have reason to believe that the application prioritizes IPv4, which doesn't work on that host+container.

I tried to define the SMTP server by IP address only, but that doesn't work.

pglombardo commented 11 hours ago

Hi @olegbliaher - that's an interesting report. Admittedly I've never tried ipv6 only (yet). Thanks for the compose config. I'll try to test this locally soon. Thanks for reporting!