-
Notifications
You must be signed in to change notification settings - Fork 30
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
smtp-example gives exception #2
Comments
Hmm, it works for me, although I had to fiddle with the version numbers of some of the dependent libraries to get it to build. I've pushed those changes, along with a tweak to If it still happens for you in a sandbox with the latest .cabal file we can probably rule out it being a problem with one of the dependencies... |
I got the latest HaskellNet and HaskellNet-SSL, and I upgraded tls from 1.1.5 to 1.2.2, connection from 0.1.3.1 to 0.2.0 (although not in a sandbox) but same result. I upgraded network 2.4.1.2 to 2.4.2.2 as well, but was unable to use it as PortNumber insisted on coming from 2.4.1.2 causing a version mismatch. The error messages changed after this. While gmail stays the same, Office365 now reports *** Exception: user error (authentication failed.) on known good credentials. So definitely, something is up with the different versions here. But I also tested with a third email provider pair.com, which works perfectly both before and after upgrade. I forgot to mention earlier that IMAP works perfectly with all three providers (gmail, office365, pair). While testing I also found the default connection timeout to be extremely long (2 minutes?). Edit: the reason i did not try sandbox is that my windows install is still on cabal 1.16 and fails on cabal install cabal-install (even when running as administrator). |
I tried running on Windows in case that was the issue (I've been testing on Linux until now), but gmail still connected. When I tried sending with mailgun, however, I got an authentication failure, which is when I realised that the I am still not entirely sure why I was getting the authentication failure. I took a quick glance at the I've updated the example to use Thanks! |
Strangely enough, all of the providers now work fine! Except that Office365 takes a very long time, almost 30 secs, on the initial sendCommand. ∷ Finn Espen Gundersen From: Daniel P. Wright [mailto:notifications@github.com] I tried running on Windows in case that was the issue (I've been testing on Linux until now), but gmail still connected. When I tried sending with mailgun, however, I got an authentication failure, which is when I realised that the smtpTest example doesn't actually check the response of the AUTH command and just tries to send the email regardless. I've updated the example to check the response and print it out on failure. I am still not entirely sure why I was getting the authentication failure. I took a quick glance at the Network.HaskellNet.Auth.plain function and it looks reasonable to me, and connecting manually through openssl s_client -starttls smtp -crlf -connect smtp.mailgun.org:587 authenticates fine. At any rate, I think this is at the authentication level, not the SSL level, and so the problem likely lies closer to HaskellNet than HaskellNet-SSL. I've updated the example to use AUTH LOGIN rather than AUTH PLAIN, and to print out the response when authentication fails. Could you try with the latest and see if it still fails for both mailservers? That way we'll know if it is an authentication problem (even the one reporting differently), or if there are other problems as well. Thanks! — |
Unsure if this is an issue with HaskellNet or HaskellNet-SSL, but when I download the most recent versions from Github and try smtpTest in example.hs I get, on both Mac and Windows:
*** Exception: <socket: 11>: hPutBuf: illegal operation (handle is closed)
If I try the same code on an Office365 account I get:
*** Exception: HandshakeFailed Error_EOF
Please let me know if you need any more information. I would be happy to help out.
The text was updated successfully, but these errors were encountered: