Closed puruzio closed 11 months ago
I don't see how this badmatch happens, given read_possible_multiline_reply
should not be able to return just an untagged binary.
ascii code 21 is "negative acknowledge", but I didn't think SMTP used ascii control characters. I think the server doesn't like your TLS handshake, or whatever.
Can you try supplying trace_fun
to the client options: https://github.com/gen-smtp/gen_smtp/blob/1.2.0/src/gen_smtp_client.erl#L946C30-L946C39
I suspect the TLS negotiaton goes wrong here https://github.com/gen-smtp/gen_smtp/blob/1.2.0/src/gen_smtp_client.erl#L777, and the server thinks we're doing TLS and the client doesn't
Changing to tls: :never
fixed the issue. Thank you!
It might be helpful if you could capture more information so we could fix the issue properly.
What's the suggested steps I should follow to do so?
You could privately let me try using the server, or you could pass [{trace_fun, fun io:format/2}]
to the client options and see what the trace gives you, or add a io:format around https://github.com/gen-smtp/gen_smtp/blob/1.2.0/src/gen_smtp_client.erl#L777
Else -> io:format("~p~n", [trace(Options, "~p~n", [Else])]), false
printed "ok"
Let me know if that's not what you meant.
Weird, that means that ssl:connect() is returning ok, not {ok, Socket}. What OTP version is this?
OTP 26
I am getting the same error mentioned in https://github.com/gen-smtp/gen_smtp/issues/94, but in a different situation. Debugging with io:format("~p~n", [Packet])` in gen_smtp_client.erl displays the following where the 4th item is <<21.3.3.0.2.2.10>>. I'm not sure what that represents.
FYI. The same program run on another machine doesn't generate this error, and it prints the following output. It appears to me that the network environment or cert authority setting of the first machine is somehow different from this other machine, leading to different outcomes.
Below is the full error message.