packages feed

purebred-email-0.6.0.1: purebred-email.cabal

cabal-version:       2.2
name:                purebred-email
version:             0.6.0.1
synopsis:            types and parser for email messages (including MIME)
description:
  The purebred email library.  RFC 5322, MIME, etc.
  See "Data.MIME" for usage, examples and API documentation.
  .
  This is a general-purpose library for processing and constructing
  email messages, originally written to meet the needs of
  <https://github.com/purebred-mua/purebred purebred MUA>.
  Transmission and delivery of mail are not part of this library,
  but /purebred-email/ could be a useful building block for such
  systems.
  .
  Features and implemented specifications include:
  .
  - <https://tools.ietf.org/html/rfc5322 RFC 5322> message parsing and serialisation
  - MIME multipart messages (<https://tools.ietf.org/html/rfc2046 RFC 2046>)
  - Convenient APIs for replying and forward/bounce
  - Content transfer and charset decoding/encoding
  - MIME message header extensions for non-ASCII text (<https://tools.ietf.org/html/rfc2047 RFC 2047>)
  - MIME parameter value and encoded word extensions (<https://tools.ietf.org/html/rfc2231 RFC 2231>)
  - @Content-Disposition@ header field (<https://tools.ietf.org/html/rfc2183 RFC 2183>)
  - Address syntax in @From@ and @Sender@ fields (<https://tools.ietf.org/html/rfc6854 RFC 6854>)

license:             AGPL-3.0-or-later
license-file:        LICENSE
author:              Fraser Tweedale
maintainer:          frase@frase.id.au
copyright:           Copyright 2017-2021  Fraser Tweedale
category:            Data, Email
build-type:          Simple
extra-source-files:
  CHANGELOG.md
  README.rst
  test-vectors/*.eml
  tests/golden/*.golden
tested-with:
  GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.7 || ==9.4.5 || ==9.6.1

homepage:            https://github.com/purebred-mua/purebred-email
bug-reports:         https://github.com/purebred-mua/purebred-email/issues
source-repository head
  type: git
  location: https://github.com/purebred-mua/purebred-email.git

flag demos
  description: Build demonstration programs
  default: False

common common
  default-language: Haskell2010
  ghc-options:
    -Wall
    -Wcompat
    -Werror=missing-methods
    -Widentities
    -Wincomplete-record-updates
    -Wincomplete-uni-patterns
    -Wmissing-export-lists
    -Wnoncanonical-monad-instances
    -Wpartial-fields
    -Wredundant-constraints
    -fhide-source-paths
  if impl(ghc >= 8.10)
    ghc-options:
      -Wunused-packages
  if impl(ghc >= 9.0)
    ghc-options:
      -Winvalid-haddock
      -Werror=unicode-bidirectional-format-characters
  if impl(ghc >= 9.2)
    ghc-options:
      -Wimplicit-lift
      -Woperator-whitespace
      -Wredundant-bang-patterns
  if impl(ghc >= 9.4)
    ghc-options:
      -Wredundant-strictness-flags

  build-depends:
    base >= 4.11 && < 5
    , attoparsec >= 0.13 && < 0.15
    , bytestring >= 0.10 && < 0.12
    , case-insensitive >= 1.2 && < 1.3
    , lens >= 4 && < 6
    , text >= 1.2
    , time >= 1.9

library
  import: common
  exposed-modules:
    Data.IMF
    , Data.IMF.Syntax
    , Data.IMF.Text
    , Data.RFC5322
    , Data.RFC5322.Address.Text
    , Data.RFC5322.Address.Types
    , Data.RFC5322.Internal
    , Data.MIME
    , Data.MIME.Error
    , Data.MIME.Charset
    , Data.MIME.EncodedWord
    , Data.MIME.Types
    , Data.MIME.Parameter
    , Data.MIME.TransferEncoding
    , Data.MIME.Base64
    , Data.MIME.QuotedPrintable
  other-modules:
    Data.MIME.Boundary
    , Data.MIME.Internal
    , Data.IMF.DateTime
  build-depends:
    , base64-bytestring >= 1 && < 2
    , case-insensitive >= 1.2 && < 1.3
    , concise >= 0.1.0.1 && < 1
    , deepseq >= 1.4.2
    , random >= 1.2.0
    , semigroupoids >= 5 && < 7
    , stringsearch >= 0.3
  hs-source-dirs:      src
  default-language:    Haskell2010

test-suite tests
  import: common
  type: exitcode-stdio-1.0
  hs-source-dirs: tests
  main-is: Test.hs
  other-modules:
    ContentTransferEncodings
    , EncodedWord
    , Headers
    , MIME
    , Generator
    , Parser
    , Message
  build-depends:
    , purebred-email
    , random
    , tasty
    , tasty-hedgehog
    , tasty-quickcheck
    , tasty-hunit
    , tasty-golden
    , hedgehog
    , quickcheck-instances

executable purebred-email-parse
  import: common
  if !flag(demos)
    buildable: False
  hs-source-dirs: tools
  main-is: Parse.hs
  build-depends:
    , purebred-email