diff --git a/HaskellNet.cabal b/HaskellNet.cabal index 357380d..81d6de2 100644 --- a/HaskellNet.cabal +++ b/HaskellNet.cabal @@ -3,25 +3,32 @@ Version: 0.2.4 Author: Jun Mukai Maintainer: Robert Wills License: BSD3 +License-file: LICENSE Category: Network -Homepage: https://patch-tag.com/r/wrwills/HaskellNet/home +Homepage: https://patch-tag.com/r/wrwills/HaskellNet Description: Originally written for Google SOC, provides network related libraries such as POP3, SMTP, IMAP. - All I have done is get the project to compile using cabal and check that these libraries basically - work. -Build-Depends: base >= 4, haskell98, network, mtl, parsec, time, bytestring, pretty, array, Crypto > 4.2.1, base64-string, containers, old-locale, old-time, mime-mail, text + All I have done is get the project to compile using cabal, check that these libraries basically + work, and add some examples Synopsis: network related libraries such as POP3, SMTP, IMAP -cabal-version: >=1.2 -build-type: Simple +Cabal-version: >=1.6 +Build-type: Simple +Extra-Source-Files: README.md, example/*.hs -exposed-modules: +Library + Exposed-modules: Text.IMAPParsers, Text.Mime, Text.URI, -- Text.Bencode, - HaskellNet.IMAP, - HaskellNet.SMTP, - HaskellNet.POP3, - HaskellNet.BSStream, - HaskellNet.Auth -other-modules: Data.Record, Text.Packrat.Pos, Text.Packrat.Parse + Network.HaskellNet.IMAP, + Network.HaskellNet.SMTP, + Network.HaskellNet.POP3, + Network.HaskellNet.BSStream, + Network.HaskellNet.Auth + Other-modules: Data.Record, Text.Packrat.Pos, Text.Packrat.Parse + Build-Depends: base >= 4 && < 5, haskell98, network, mtl, parsec, time, bytestring, pretty, array, Crypto > 4.2.1, base64-string, containers, old-locale, old-time, mime-mail, text + +source-repository head + type: darcs + location: https://patch-tag.com/r/wrwills/HaskellNet diff --git a/LICENSE b/LICENSE index 0b5e41f..8787dc4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,28 +1,30 @@ -Copyright (c) 2006, Jun Mukai +Copyright (c)2010, Jun Mukai, Rob Wills + All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the author nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. + * Neither the name of Jun Mukai, Rob Wills nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/HaskellNet/Auth.hs b/Network/HaskellNet/Auth.hs similarity index 96% rename from HaskellNet/Auth.hs rename to Network/HaskellNet/Auth.hs index 419fcc8..8cbcba0 100644 --- a/HaskellNet/Auth.hs +++ b/Network/HaskellNet/Auth.hs @@ -1,6 +1,6 @@ ---------------------------------------------------------------------- -- | --- Module : HaskellNet.Auth +-- Module : Network.HaskellNet.Auth -- Copyright : (c) Jun Mukai 2006 -- License : BSD-style (see the file LICENSE) -- @@ -11,7 +11,7 @@ -- Authentication related APIs -- -module HaskellNet.Auth +module Network.HaskellNet.Auth where import Data.Digest.MD5 diff --git a/HaskellNet/BSStream.hs b/Network/HaskellNet/BSStream.hs similarity index 95% rename from HaskellNet/BSStream.hs rename to Network/HaskellNet/BSStream.hs index 6f55bf6..2a376dc 100644 --- a/HaskellNet/BSStream.hs +++ b/Network/HaskellNet/BSStream.hs @@ -1,6 +1,6 @@ ----------------------------------------------------------------------------- -- | --- Module : HaskellNet.Stream +-- Module : Network.HaskellNet.Stream -- Copyright : (c) Jun Mukai 2006 -- License : BSD -- @@ -13,7 +13,7 @@ -- ----------------------------------------------------------------------------- -module HaskellNet.BSStream +module Network.HaskellNet.BSStream ( BSStream(..) ) where diff --git a/HaskellNet/IMAP.hs b/Network/HaskellNet/IMAP.hs similarity index 98% rename from HaskellNet/IMAP.hs rename to Network/HaskellNet/IMAP.hs index 3df6b54..ee6578d 100644 --- a/HaskellNet/IMAP.hs +++ b/Network/HaskellNet/IMAP.hs @@ -1,6 +1,6 @@ ---------------------------------------------------------------------- -- | --- Module : HaskellNet.IMAP +-- Module : Network.HaskellNet.IMAP -- Copyright : (c) Jun Mukai 2006 -- License : BSD-style (see the file LICENSE) -- @@ -11,7 +11,7 @@ -- IMAP client implementation -- -module HaskellNet.IMAP +module Network.HaskellNet.IMAP ( -- * connection type and corresponding actions IMAPConnection , mailbox, exists, recent @@ -41,9 +41,9 @@ module HaskellNet.IMAP where import Network -import HaskellNet.BSStream -import HaskellNet.Auth hiding (auth, login) -import qualified HaskellNet.Auth as A +import Network.HaskellNet.BSStream +import Network.HaskellNet.Auth hiding (auth, login) +import qualified Network.HaskellNet.Auth as A import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as BS diff --git a/HaskellNet/POP3.hs b/Network/HaskellNet/POP3.hs similarity index 98% rename from HaskellNet/POP3.hs rename to Network/HaskellNet/POP3.hs index 617ee39..6940236 100644 --- a/HaskellNet/POP3.hs +++ b/Network/HaskellNet/POP3.hs @@ -1,6 +1,6 @@ ---------------------------------------------------------------------- -- | --- Module : HaskellNet.POP3 +-- Module : Network.HaskellNet.POP3 -- Copyright : (c) Jun Mukai 2006 -- License : BSD-style (see the file LICENSE) -- @@ -11,7 +11,7 @@ -- POP3 client implementation -- -module HaskellNet.POP3 +module Network.HaskellNet.POP3 ( -- * Types Command(..) , POP3Connection(..) @@ -45,10 +45,10 @@ module HaskellNet.POP3 ) where -import HaskellNet.BSStream +import Network.HaskellNet.BSStream import Network -import HaskellNet.Auth hiding (auth, login) -import qualified HaskellNet.Auth as A +import Network.HaskellNet.Auth hiding (auth, login) +import qualified Network.HaskellNet.Auth as A import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as BS diff --git a/HaskellNet/SMTP.hs b/Network/HaskellNet/SMTP.hs similarity index 98% rename from HaskellNet/SMTP.hs rename to Network/HaskellNet/SMTP.hs index 7d66b1f..88270e4 100644 --- a/HaskellNet/SMTP.hs +++ b/Network/HaskellNet/SMTP.hs @@ -1,7 +1,7 @@ {-# LANGUAGE ScopedTypeVariables #-} ---------------------------------------------------------------------- -- | --- Module : HaskellNet.SMTP +-- Module : Network.HaskellNet.SMTP -- Copyright : (c) Jun Mukai 2006 -- License : BSD-style (see the file LICENSE) -- @@ -12,7 +12,7 @@ -- SMTP client implementation -- -module HaskellNet.SMTP +module Network.HaskellNet.SMTP ( -- * Types Command(..) , Response(..) @@ -33,7 +33,7 @@ module HaskellNet.SMTP ) where -import HaskellNet.BSStream +import Network.HaskellNet.BSStream import Data.ByteString (ByteString, append) import qualified Data.ByteString.Char8 as BS import Network.BSD (getHostName) @@ -45,7 +45,7 @@ import Control.Monad (unless) import Data.List (intersperse) import Data.Char (chr, ord, isSpace, isDigit) -import HaskellNet.Auth +import Network.HaskellNet.Auth import System.IO diff --git a/example/DebugStream.hs b/example/DebugStream.hs index 9a3ffb7..f151971 100644 --- a/example/DebugStream.hs +++ b/example/DebugStream.hs @@ -1,4 +1,4 @@ -{-# OPTIONS_GHC -cpp -fglasgow-exts -package hsgnutls -package HaskellNet #-} +{-# OPTIONS_GHC -cpp -fglasgow-exts -package hsgnutls -package Network.HaskellNet #-} -- examples to connect server by hsgnutls module DebugStream @@ -11,7 +11,7 @@ module DebugStream where import Network -import HaskellNet.BSStream +import Network.HaskellNet.BSStream import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as BS diff --git a/example/TLSStream.hs b/example/TLSStream.hs index ebcb98e..9cfaa9f 100644 --- a/example/TLSStream.hs +++ b/example/TLSStream.hs @@ -1,4 +1,4 @@ --- {-# OPTIONS_GHC -cpp -fglasgow-exts -package hsgnutls -package HaskellNet #-} +-- {-# OPTIONS_GHC -cpp -fglasgow-exts -package hsgnutls -package Network.HaskellNet #-} -- examples to connect server by hsgnutls module TLSStream @@ -11,7 +11,7 @@ module TLSStream import Network.GnuTLS import Network -import HaskellNet.BSStream +import Network.HaskellNet.BSStream import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as BS diff --git a/example/imap.hs b/example/imap.hs index e9a9089..eaa9323 100644 --- a/example/imap.hs +++ b/example/imap.hs @@ -1,5 +1,5 @@ import System.IO -import HaskellNet.IMAP +import Network.HaskellNet.IMAP import Text.Mime import qualified Data.ByteString.Char8 as BS import Control.Monad diff --git a/example/pop3.hs b/example/pop3.hs index ee859a1..14fdc5f 100644 --- a/example/pop3.hs +++ b/example/pop3.hs @@ -1,5 +1,5 @@ import System.IO -import HaskellNet.POP3 +import Network.HaskellNet.POP3 import qualified Data.ByteString.Char8 as BSC import qualified Data.ByteString.Char8 as BS diff --git a/example/smtp.hs b/example/smtp.hs index aaf697b..160cc89 100644 --- a/example/smtp.hs +++ b/example/smtp.hs @@ -1,5 +1,5 @@ import System.IO -import HaskellNet.SMTP +import Network.HaskellNet.SMTP import Text.Mime import qualified Data.ByteString.Char8 as BS import Codec.Binary.Base64.String @@ -16,15 +16,15 @@ main = do messageHtml <- BS.readFile "example/message.html" let textP = SinglePart [("Content-Type", "text/plain; charset=utf-8")] message let htmlP = SinglePart [("Content-Type", "text/html; charset=utf-8")] messageHtml - let msg = MultiPart [("From", "HaskellNet <" ++ sendFrom ++ ">"),("Subject","Test")] [htmlP, textP] + let msg = MultiPart [("From", "Network.HaskellNet <" ++ sendFrom ++ ">"),("Subject","Test")] [htmlP, textP] sendMail sendFrom sendTo (BS.pack $ show $ showMime "utf-8" msg) con closeSMTP con - --let msg = ([("From", "HaskellNet <" ++ sendFrom ++ ">"),("Subject","Test")], MultiPart [] [textP, htmlP]) + --let msg = ([("From", "Network.HaskellNet <" ++ sendFrom ++ ">"),("Subject","Test")], MultiPart [] [textP, htmlP]) --sendMail sendFrom sendTo (BS.pack $ show $ showMessage "utf-8" msg) con --- let msg = ([("From", "HaskellNet <" ++ sendFrom ++ ">"),("Subject","Test")], BS.pack "\r\nhello 算法是指完成一个任from haskellnet") +-- let msg = ([("From", "Network.HaskellNet <" ++ sendFrom ++ ">"),("Subject","Test")], BS.pack "\r\nhello 算法是指完成一个任from haskellnet") --htmlP = SinglePart [("Content-Type", "text/html; charset=utf-8", "Content-Transfer-Encoding", ""] BS.pack $ encode $