aboutsummaryrefslogtreecommitdiff
path: root/Email.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Email.hs')
-rw-r--r--Email.hs29
1 files changed, 10 insertions, 19 deletions
diff --git a/Email.hs b/Email.hs
index 78ffff6..40d1c4c 100644
--- a/Email.hs
+++ b/Email.hs
@@ -1,19 +1,10 @@
--- This module is part of Lazymail, a Haskell email client.
---
--- Copyright (C) 2013 Raúl Benencia <rul@kalgan.cc>
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see <http://www.gnu.org/licenses/>.
+{- Email accessors.
+ -
+ - Copyright 2013 Raúl Benencia <rul@kalgan.cc>
+ -
+ - Licensed under the GNU GPL version 3 or higher
+ -
+ -}
module Email where
import Network.Email.Mailbox(Flag(..), Flags)
@@ -25,7 +16,7 @@ import Text.ParserCombinators.Parsec.Rfc2822
data Email = Email { emailPath :: String
, parsedEmail :: Message
}
-
+
parseEmail :: String -> Message
parseEmail msg = unwrapEmail $ parse message "<stdin>" $ fixEol msg
@@ -55,7 +46,7 @@ getResentBcc fs = do { ResentBcc f <- fs; f }
getResentMessageID fs = do { ResentMessageID f <- fs; f }
--getReceived fs = do { Received f <- fs; f }
-getBody (Message _ []) = "Empty body"
+getBody (Message _ []) = "Empty body"
getBody (Message _ body) = body
-- Make sure all lines are terminated by CRLF.
@@ -72,6 +63,6 @@ fixEol [] = []
-- emailDescription = emailDescriptionWithPP defaultDescriptionPP
--- emailDescriptionWithPP pp
+-- emailDescriptionWithPP pp
nihil fit ex nihilo