X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fhalcyon.git;a=blobdiff_plain;f=src%2FMail.hs;h=2e86a204e003ceda90bfb32994fe4e83f386ad48;hp=2da56639667b4b2b63d387aaab601934091f5f7e;hb=fdc80f514bfe9005f55768f63b619ad170ad1b56;hpb=46dd961be2bcb7de43c04d27282220ef2b088077 diff --git a/src/Mail.hs b/src/Mail.hs index 2da5663..2e86a20 100644 --- a/src/Mail.hs +++ b/src/Mail.hs @@ -33,7 +33,7 @@ default_headers = ["MIME-Version: 1.0", -- |Showing a message will print it in roughly RFC-compliant -- form. This form is sufficient for handing the message off to --- sendmail. +-- sendmail (or compatible). instance Show Message where show m = concat [ if (length (headers m) == 0) then "" else (intercalate "\n" (headers m)) ++ "\n", @@ -65,14 +65,14 @@ rfc822_now = do -- |Takes a message as an argument, and passes it to the system's --- sendmail binary. -sendmail :: Message -> IO (String, String, ExitCode) -sendmail message = do +-- sendmail (or compatible) binary. +sendmail :: FilePath -> Message -> IO (String, String, ExitCode) +sendmail sendmail_path message = do let sendmail_args = ["-f", (from message)] (inh, outh, errh, ph) <- - runInteractiveProcess "/usr/bin/sendmail" sendmail_args Nothing Nothing + runInteractiveProcess sendmail_path sendmail_args Nothing Nothing outm <- newEmptyMVar outs <- hGetContents outh