rendered paste body--So this code doesn't work . I'm confused as to why.
module ProcessMail (processMail,printMail,fixEol,module Text.ParserCombinators.Parsec, module Text.ParserCombinators.Parsec.Rfc2822 ) where
-- Load the parser!
import Text.ParserCombinators.Parsec ( parse )
import Text.ParserCombinators.Parsec.Rfc2822
printMail input = do
print (processMail input)
processMail input = do
return (parse message "" (fixEol input))
-- Make sure all lines are terminated by CRLF.
fixEol :: String -> String
fixEol ('\r':'\n':xs) = '\r' : '\n' : (fixEol xs)
fixEol ('\n':xs) = '\r' : '\n' : (fixEol xs)
fixEol (x:xs) = x : (fixEol xs)
fixEol [] = []