packages feed

HaskellNet-SSL 0.4.0.0 → 0.4.0.1

raw patch · 3 files changed

+11/−2 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -6,3 +6,7 @@ - compatibility with GHCs up to ghc 9.8 (bump base and bytestring) - fix example - add tested-with stanza++## 0.4.0.1 -- 2025-01-17++- Ignore 502 error on helo - fixes communication with some servers
HaskellNet-SSL.cabal view
@@ -1,6 +1,6 @@ name:                HaskellNet-SSL synopsis:            Helpers to connect to SSL/TLS mail servers with HaskellNet-version:             0.4.0.0+version:             0.4.0.1 description:         This package ties together the HaskellNet and connection                      packages to make it easy to open IMAP and SMTP connections                      over SSL.
src/Network/HaskellNet/SMTP/SSL.hs view
@@ -52,7 +52,7 @@      hn <- getHostName     bsPut bs $ B.pack ("HELO " ++ hn ++ "\r\n")-    getResponse bs >>= failIfNot bs 250+    getResponse bs >>= failIfNotEx bs (`elem` [250, 502])     bsPut bs $ B.pack ("EHLO " ++ hn ++ "\r\n")     getResponse bs >>= failIfNot bs 250     bsPut bs $ B.pack "STARTTLS\r\n"@@ -71,6 +71,11 @@  failIfNot :: BSStream -> Integer -> (Integer, String) -> IO () failIfNot bs code (rc, rs) = when (code /= rc) closeAndFail+  where closeAndFail = bsClose bs >> fail ("cannot connect to server: " ++ rs)++-- | Extended version of fail if, can support multiple statuses+failIfNotEx :: BSStream -> (Integer -> Bool) -> (Integer, String) -> IO ()+failIfNotEx bs f (rc, rs) = unless (f rc) closeAndFail   where closeAndFail = bsClose bs >> fail ("cannot connect to server: " ++ rs)  -- This is a bit of a nasty hack.  Network.HaskellNet.SMTP.connectStream