diff options
Diffstat (limited to 'src/main.hs')
-rw-r--r-- | src/main.hs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/main.hs b/src/main.hs index bd2bc73..6c4b061 100644 --- a/src/main.hs +++ b/src/main.hs @@ -5,6 +5,7 @@ import qualified Data.Aeson import Data.Aeson.Encode.Pretty import qualified Data.ByteString.Lazy.Char8 import Data.MIME.Extended +import Data.MIME.Untweaked (toUntweaked) import qualified Options.Applicative import qualified System.Exit import System.IO (hPutStrLn,stderr) @@ -42,12 +43,6 @@ optionsParser = ) -newtype MIMENoTweak = MIMENoTweak MIME - -instance RenderMessage MIMENoTweak where - buildBody h (MIMENoTweak b) = buildBody h b - - main :: IO () main = do options <- @@ -71,8 +66,8 @@ main = do if optionDecode options then case Data.Aeson.decode s :: Maybe MIMEMessage of - Just (Message h b) -> - output $ renderMessage (Message h (MIMENoTweak b)) + Just m -> + output $ renderMessage (toUntweaked m) Nothing -> do hPutStrLn stderr "error: failed to decode MIME message" |