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

Send error receiving e-mail from Hikvision DVR #259

Open
igormq opened this issue Mar 28, 2021 · 2 comments
Open

Send error receiving e-mail from Hikvision DVR #259

igormq opened this issue Mar 28, 2021 · 2 comments

Comments

@igormq
Copy link

igormq commented Mar 28, 2021

Hello, I am using the gen_smtp to receive e-mail messages from Hikvision DVR and it's returning {:send_error, :closed} messages, but before this, I am receiving some weird other commands, see the image below

image

I have activated older versions of tls, but I don't know what I am doing wrong. I am using the tcp procotol, and STARTTLS.

Could you guys help me?

@igormq igormq changed the title Send error receiving from Hikvision DVR Send error receiving e-mail from Hikvision DVR Mar 28, 2021
@bamorim
Copy link

bamorim commented Jul 12, 2021

I think I figured out the problem here.

gen_smtp_server_session sends 221 Bye whenever it receives a QUIT (code here), the problem is that most clients (gen_smtp_client included) close the TCP socket as soon as they send the QUIT message (gen_smtp_client exampe) and with that, there is a chance that the socket will be already closed and since any error on Transport:send will make the session throw, it generates this error.

My suggestion would be to set the state to have something that informs that we are "quitting" so send doesn't throw in case of a Transport:send error.

If you think this makes sense, I can try to write a PR that does that.

@bamorim
Copy link

bamorim commented Jul 12, 2021

I think it is the same as #239

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

No branches or pull requests

2 participants