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

Persisting connection after sending error #24

Open
adueck opened this issue Jul 22, 2024 · 0 comments
Open

Persisting connection after sending error #24

adueck opened this issue Jul 22, 2024 · 0 comments

Comments

@adueck
Copy link

adueck commented Jul 22, 2024

First of all thank you for this excellent library!

I have encountered one issue or question. I am trying to open a connection using connectSMTPS, then send a login command, and then send multiple seperate e-mails using renderAndSend.

conn <- connectSMTPS domain
_ <- login conn loginName password
renderAndSend conn mail1
renderAndSend conn mail2
renderAndSend conn mail3
closeSMTP conn
-- etc...

(Exception handling left out for simplicity)

The problem is that if the sending for mail2 fails (for instance, if a bad address is given) the SMTPConnection is destroyed. Any subsequent attempts to use the connection throw an exception with the following message:

Network.Socket.sendBuf: invalid argument (Bad file descriptor)

If we want to and are able to send a number of seperate messages using one connection, it would be great if this connection was fault tolerant. Is there another way to do this? Am I using the wrong methods? Or do I need to check the connection and potentially create a new one for each renderAndSend attempt?

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

1 participant