diff options
author | Raúl Benencia <rul@kalgan.cc> | 2013-08-25 17:56:39 -0300 |
---|---|---|
committer | Raúl Benencia <rul@kalgan.cc> | 2013-08-25 17:56:39 -0300 |
commit | f25d0d8d82dff0be2d68476148479004b2888bd7 (patch) | |
tree | 1e80bb8f47e5fce07f4a69050ebcb1fac93daf55 /Email.hs | |
parent | 56dce7c4feada1d4ca93a312e48813fb1918b93b (diff) |
Finished porting to state monad
Diffstat (limited to 'Email.hs')
-rw-r--r-- | Email.hs | 29 |
1 files changed, 10 insertions, 19 deletions
@@ -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 |