smtp-mail 0.2.0.0 → 0.2.0.1
raw patch · 4 files changed
+18/−13 lines, 4 filesdep +cryptonitedep +memorydep −cryptohashdep ~basedep ~mime-mailPVP ok
version bump matches the API change (PVP)
Dependencies added: cryptonite, memory
Dependencies removed: cryptohash
Dependency ranges changed: base, mime-mail
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- Network/Mail/SMTP/Auth.hs +6/−10
- README.md +3/−0
- smtp-mail.cabal +5/−3
CHANGELOG.md view
@@ -19,6 +19,10 @@ - Describe change #2 - Indicate if changes are major, minor, or patch changes. ```+- [#30](https://github.com/jhickner/smtp-mail/pull/30) @typetetris+ - Replace `cryptohash` dependency with `cryptonite`.+ `cryptohash` is deprecated and `cryptonite` offers HMAC MD5+ directly. ## 0.2.0.0
Network/Mail/SMTP/Auth.hs view
@@ -6,13 +6,14 @@ auth, ) where -import Crypto.Hash.MD5 (hash)+import Crypto.MAC.HMAC (hmac, HMAC)+import Crypto.Hash.Algorithms (MD5)+import Data.ByteArray (copyAndFreeze) import qualified Data.ByteString.Base16 as B16 (encode) import qualified Data.ByteString.Base64 as B64 (encode) import Data.ByteString (ByteString) import Data.List-import Data.Bits import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as B8 (unwords) @@ -39,14 +40,9 @@ b64Encode = B64.encode . toAscii hmacMD5 :: ByteString -> ByteString -> ByteString-hmacMD5 text key = hash (okey <> hash (ikey <> text))- where key' = if B.length key > 64- then hash key <> B.replicate 48 0- else key <> B.replicate (64-B.length key) 0- ipad = B.replicate 64 0x36- opad = B.replicate 64 0x5c- ikey = B.pack $ B.zipWith xor key' ipad- okey = B.pack $ B.zipWith xor key' opad+hmacMD5 text key =+ let mac = hmac key text :: HMAC MD5+ in copyAndFreeze mac (const $ return ()) encodePlain :: UserName -> Password -> ByteString encodePlain user pass = b64Encode $ intercalate "\0" [user, user, pass]
README.md view
@@ -62,6 +62,9 @@ addresses you can import ```Network.Mail.Mime``` and construct ```Mail``` objects manually. +### Caveat++You will encounter authentication errors if you try to connect to an SMTP server that expects SSL. If that's what you're looking to do, try [HaskellNet-SSL](http://hackage.haskell.org/package/HaskellNet-SSL). ### Thanks
smtp-mail.cabal view
@@ -1,5 +1,5 @@ name: smtp-mail-version: 0.2.0.0+version: 0.2.0.1 synopsis: Simple email sending via SMTP description: This packages provides a simple interface for mail over SMTP. PLease see the README for more information. homepage: http://github.com/jhickner/smtp-mail@@ -10,7 +10,7 @@ -- copyright: category: Network build-type: Simple-cabal-version: >=1.8+cabal-version: >=1.10 extra-source-files: README.md@@ -21,6 +21,7 @@ location: git@github.com:jhickner/smtp-mail.git library+ default-language: Haskell2010 exposed-modules: Network.Mail.SMTP Network.Mail.SMTP.Auth@@ -34,11 +35,12 @@ , base64-bytestring , bytestring , connection- , cryptohash , filepath , mime-mail , network , network-bsd , text+ , cryptonite+ , memory ghc-options: -Wall -fwarn-tabs