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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smtp validation loads always localhost #2001

Open
slim-azaiz opened this issue Mar 26, 2024 · 10 comments
Open

Smtp validation loads always localhost #2001

slim-azaiz opened this issue Mar 26, 2024 · 10 comments
Labels
question self-hosted Applies to self-hosted instances

Comments

@slim-azaiz
Copy link

slim-azaiz commented Mar 26, 2024

馃悰 Bug Report

I tried to test smtp validation, but it gets always localhost as server smtp even if i have well configured the settings.yml

馃敩 How To Reproduce

Steps to reproduce the behavior:

Code sample

./bin/rails console
Rails.application.config.action_mailer.smtp_settings

=>

{:address=>"server",
 :port=>24,
 :user_name=>nil,
 :password=>nil,
 :authentication=>"plain",
 :enable_starttls_auto=>true,
 :open_timeout=>10,
 :read_timeout=>10}
Mail.deliver do
  to '<mail>'
  from 'user'
  subject 'testing mail'
  body 'testing mail'
end
/opt/PasswordPusher/vendor/bundle/ruby/3.2.0/gems/net-smtp-0.4.0.1/lib/net/smtp.rb:631:in `initialize': Connection refused - connect(2) for "localhost" port 25 (Errno::ECONNREFUSED)
Copy link

Hello @slim-azaiz, thanks for contributing to the Password Pusher community! We will respond as soon as possible.

@pglombardo
Copy link
Owner

Hi @slim-azaiz - Thanks for reporting. I will take a close look at this soon. I know email is a problem for a subset of users and I haven't figured out why yet. I'll post back soon.

@pglombardo
Copy link
Owner

Hi @slim-azaiz - in v1.39.8, I added a tool to better flush out email issues. Could you update to that version and try this out? It should hopefully point us in the right direction.

@pglombardo pglombardo added the self-hosted Applies to self-hosted instances label Apr 18, 2024
@slim-azaiz
Copy link
Author

slim-azaiz commented Apr 19, 2024

Hello,
It is working better but i can not connect to the server without authentication

{:address=>"<server_url>",
 :port=>25,
 :user_name=>"",
 :password=>"",
 :authentication=>"plain",
 :enable_starttls_auto=>nil,
 :open_timeout=>10,
 :read_timeout=>10,
 :domain=>"mousquetaires.com",
 `:openssl_verify_mode=>:none}`

I got this errror
/opt/PasswordPusher/vendor/bundle/ruby/3.2.0/gems/net-smtp-0.5.0/lib/net/smtp/authenticator.rb:45:in `finish': 500 5.5.1 Command unrecognized: "AUTH PLAIN AAA=" (Net::SMTPAuthenticationError) irb(main):002> Rails.application.config.action_mailer.smtp_settings

@pglombardo
Copy link
Owner

Cool that is progress. This problem points to :authentication. Try setting it to nil or not setting it at all.

Here are the docs for :authentication:

:authentication - If your mail server requires authentication, you need to specify the authentication type here. This is a symbol and one of :plain (will send the password in the clear), :login (will send password Base64 encoded) or :cram_md5 (combines a Challenge/Response mechanism to exchange information and a cryptographic Message Digest 5 algorithm to hash important information)

@slim-azaiz
Copy link
Author

slim-azaiz commented Apr 20, 2024

Hello,

Thanks @pglombardo for your quick reponse.
I have already tried nil ( i deleted the parameter from setting file ) and false but i got always the same error.

I think that authentication field has default value that can not be redefined.

Regards,
Slim

@slim-azaiz
Copy link
Author

I am wondering if there is a bug in authentication field ?

@pglombardo
Copy link
Owner

Hi @slim-azaiz - In the latest releases I removed the defaults. Did you try with the latest tag yet? The update where I removed the defaults was in v1.40.7.

I think I neglected to update here. Apologies - it's a bit crazy here this week.

@slim-azaiz
Copy link
Author

slim-azaiz commented May 2, 2024

Hello,

I am using the latest version 1.40.10

{:address=>"<server_url>",
 :port=>25,
 :domain=>"<domain>",
 :open_timeout=>10,
 :read_timeout=>10,
 :openssl_verify_mode=>:none}
irb(main):002>
irb(main):003> TestMailer.send_test_email(<mail>).deliver_now

/opt/PasswordPusher/app/mailers/test_mailer.rb:7:in 
send_test_email : No SMTP username provided: smtp_user_name (StandardError)

There is no more the authentification field neither enable_starttls_auto

Regards,
Slim

@pglombardo
Copy link
Owner

Hey @slim-azaiz - what type of mail server are you using and how is it configured?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question self-hosted Applies to self-hosted instances
Projects
None yet
Development

No branches or pull requests

2 participants