diff options
author | tv <tv@krebsco.de> | 2022-08-28 23:58:14 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2022-08-29 00:19:29 +0200 |
commit | e89946f0e51365969cb2097a4a31205806475f80 (patch) | |
tree | 205db30e3b105dfa1064bae5cfb94ccbf8428c9c /src/main.hs | |
parent | 0dc6dbcca7a2e7ac813bb7511d27b781babb6d67 (diff) |
properly render untweaked MIME messages
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" |