packages feed

purebred-email-0.7: purebred-email.cabal

cabal-version:       2.2
name:                purebred-email
version:             0.7
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>)
  - @Author@ header field (<https://tools.ietf.org/html/rfc9057 RFC 9057>)

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-doc-files:
  CHANGELOG.md
  README.rst
extra-source-files:
  test-vectors/*.eml
  tests/golden/*.golden
tested-with:
  GHC ==9.6.7 || ==9.8.4 || ==9.10.2 || ==9.12.2 || ==9.14.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 language
  default-language: GHC2021
  default-extensions: LambdaCase
  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
    -Wunused-packages
    -Winvalid-haddock
    -Werror=unicode-bidirectional-format-characters
    -Wimplicit-lift
    -Woperator-whitespace
    -Wredundant-bang-patterns
    -Wredundant-strictness-flags

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

library
  import: language
  import: deps
  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
    , concise >= 0.1.0.1 && < 1
    , deepseq >= 1.4.2
    , random >= 1.2.0
    , semigroupoids >= 5 && < 7
    , stringsearch >= 0.3
  hs-source-dirs:      src

test-suite tests
  import: language
  import: deps
  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: language
  if !flag(demos)
    buildable: False
  hs-source-dirs: tools
  main-is: Parse.hs
  build-depends:
    base
    , bytestring
    , purebred-email