X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fhalcyon.git;a=blobdiff_plain;f=src%2FMail.hs;h=7f0fd8ba805049aa51371e0a0440fc12fb2523b5;hp=3304d7677dd501734b027bf43158876cc6672a6e;hb=5f1220bd5d1b6893a4e2c0a179b3244a12eae6c8;hpb=6954f707adaa34e2fdc6df78b6bcce79e35279ee diff --git a/src/Mail.hs b/src/Mail.hs index 3304d76..7f0fd8b 100644 --- a/src/Mail.hs +++ b/src/Mail.hs @@ -4,7 +4,6 @@ module Mail where import Control.Concurrent -import Control.Concurrent.MVar import Control.Exception (evaluate) import Data.List (intercalate) import System.Exit @@ -22,6 +21,10 @@ data Message = Message { headers :: [Header], to :: String } deriving (Eq) +default_headers :: [Header] +default_headers = ["MIME-Version: 1.0", + "Content-type: text/plain; charset=UTF-8"] + -- |Showing a message will print it in roughly RFC-compliant -- form. This form is sufficient for handing the message off to -- sendmail. @@ -118,9 +121,9 @@ sendmail message = do errm <- newEmptyMVar errs <- hGetContents errh - forkIO $ hPutStr inh (show message) >> hClose inh - forkIO $ evaluate (length outs) >> putMVar outm () - forkIO $ evaluate (length errs) >> putMVar errm () + _ <- forkIO $ hPutStr inh (show message) >> hClose inh + _ <- forkIO $ evaluate (length outs) >> putMVar outm () + _ <- forkIO $ evaluate (length errs) >> putMVar errm () readMVar outm readMVar errm