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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth_failed is not working when gen_smtp_client:open/1 #339

Open
IciaCarroBarallobre opened this issue Apr 19, 2024 · 1 comment
Open

auth_failed is not working when gen_smtp_client:open/1 #339

IciaCarroBarallobre opened this issue Apr 19, 2024 · 1 comment

Comments

@IciaCarroBarallobre
Copy link

open(Options) ->

When gen_smtp_client:open/1 to check if the authorization credentials are correct:

  • In case of using right credentials -> all works perfectly
  • In case of using a wrong password instead of {error, send, {permanent_failure, smtp_host, auth_failed}} as doc said, an exception is thrown

Code:

        {ok, SocketDescriptor} = gen_smtp_client:open([{relay, ...},
                            {ssl, true},
                            {sockopts, [{depth, 20},
                                        {verify, verify_peer},
                                        {server_name_indication, SNI},
                                        {cacerts, certifi:cacerts()}]},
                            {username, ...},
                            {password, ...}]),
        gen_smtp_client:close(SocketDescriptor).

Exception trace:

{{case_clause,<<"y">>},
 [{gen_smtp_client, read_possible_multiline_reply, 1, [{file, "_build/default/lib/gen_smtp/src/gen_smtp_client.erl"}, {line,841}]},
 {gen_smtp_client, do_AUTH_each,5, [{file,"_build/default/lib/gen_smtp/src/gen_smtp_client.erl"},{line,623}]},
 {gen_smtp_client, try_AUTH,3, [{file,"_build/default/lib/gen_smtp/src/gen_smtp_client.erl"}, {line,556}]},
 {gen_smtp_client, open_smtp_session,2, [{file, "/_build/default/lib/gen_smtp/src/gen_smtp_client.erl"}, {line,384}]},
 {gen_smtp_client, try_smtp_sessions,3, [{file, "_build/default/lib/gen_smtp/src/gen_smtp_client.erl"}, {line,316}]},
 ...
@mworrell
Copy link
Collaborator

Can you check what the server is sending back?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants