Skip to content

Commit

Permalink
Release 0.3.4.4 (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazelfire authored Jun 15, 2021
1 parent 6507c51 commit c124405
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
26 changes: 7 additions & 19 deletions HaskellNet-SSL.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: HaskellNet-SSL
synopsis: Helpers to connect to SSL/TLS mail servers with HaskellNet
version: 0.3.4.3
version: 0.3.4.4
description: This package ties together the HaskellNet and connection
packages to make it easy to open IMAP and SMTP connections
over SSL.
Expand All @@ -15,10 +15,6 @@ build-type: Simple
cabal-version: >=1.10
data-files: README.md

flag NoUpperBounds
Description: Removes upper bounds from all packages
Default: False

flag network-bsd
description: Get Network.BSD from the network-bsd package
default: True
Expand All @@ -30,27 +26,19 @@ source-repository head
library
hs-source-dirs: src
ghc-options: -Wall
default-language: Haskell2010
exposed-modules: Network.HaskellNet.IMAP.SSL
Network.HaskellNet.POP3.SSL
Network.HaskellNet.SMTP.SSL
Network.HaskellNet.SSL
other-modules: Network.HaskellNet.SSL.Internal
if flag(NoUpperBounds)
build-depends: base >= 4,
HaskellNet >= 0.3,
tls >= 1.2,
connection >= 0.2.7,
bytestring,
data-default
else
build-depends: base >= 4 && < 5,
build-depends: base >= 4 && < 5,
HaskellNet >= 0.3 && < 0.7,
tls >= 1.2 && < 1.6,
connection >= 0.2.7 && < 0.4,
bytestring,
data-default
bytestring >= 0.9 && < 0.12,
data-default >= 0.2 && < 0.8
if flag(network-bsd)
build-depends: network >= 3.0,
network-bsd >= 2.7
build-depends: network >= 3.0 && < 3.2,
network-bsd >= 2.7 && < 2.9
else
build-depends: network >= 2.4 && < 3.0
4 changes: 4 additions & 0 deletions src/Network/HaskellNet/IMAP/SSL.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- | IMAP SSL Connections
module Network.HaskellNet.IMAP.SSL
( -- * Establishing connection
connectIMAPSSL
Expand All @@ -15,11 +16,14 @@ import Network.HaskellNet.SSL

import Network.HaskellNet.SSL.Internal

-- | Create IMAP connection with default settings
connectIMAPSSL :: String -> IO IMAPConnection
connectIMAPSSL hostname = connectIMAPSSLWithSettings hostname defaultSettingsIMAPSSL

-- | Create IMAP connection with given settings
connectIMAPSSLWithSettings :: String -> Settings -> IO IMAPConnection
connectIMAPSSLWithSettings hostname cfg = connectSSL hostname cfg >>= connectStream

-- | Default IMAP SSL settings, port 993
defaultSettingsIMAPSSL :: Settings
defaultSettingsIMAPSSL = defaultSettingsWithPort 993
10 changes: 6 additions & 4 deletions src/Network/HaskellNet/SSL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import Network.Socket (PortNumber)
import Network.Socket.Internal (PortNumber)
#endif

-- | Settings for configuring HaskellNet connections
data Settings = Settings
{ sslPort :: PortNumber
, sslMaxLineLength :: Int
, sslLogToConsole :: Bool
, sslDisableCertificateValidation :: Bool
{ sslPort :: PortNumber -- ^ Port number to connect to
, sslMaxLineLength :: Int -- ^ Max line lengths
, sslLogToConsole :: Bool -- ^ Log info to console
, sslDisableCertificateValidation :: Bool -- ^ Disable certificate validation
} deriving(Eq, Ord, Show)

-- | Construct default settings for a port
defaultSettingsWithPort :: PortNumber -> Settings
defaultSettingsWithPort p = Settings
{ sslPort = p
Expand Down

0 comments on commit c124405

Please sign in to comment.