Use e-mail suffix for messages to admins
authorAdam Chlipala <adamc@hcoop.net>
Sat, 24 Sep 2005 17:51:37 +0000 (17:51 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Sat, 24 Sep 2005 17:51:37 +0000 (17:51 +0000)
mail.sml
request.sml

index 9d10a78..a06f36c 100644 (file)
--- a/mail.sml
+++ b/mail.sml
@@ -1,12 +1,22 @@
 structure Mail :> MAIL =
 struct
 
+fun writeToLog s =
+    let
+       val outf = TextIO.openAppend "/home/hcoop/mail.log"
+    in
+       TextIO.output (outf, s);
+       TextIO.closeOut outf
+    end
+
 type session = (TextIO.instream, TextIO.outstream) Unix.proc
 
 fun mopen () = Unix.execute ("/usr/sbin/exim4", ["-t"])
+              before writeToLog "\nNEW MESSAGE\n"
 
-fun mwrite (ses, s) = TextIO.output (Unix.textOutstreamOf ses, s)
+fun mwrite (ses, s) = (TextIO.output (Unix.textOutstreamOf ses, s);
+                      writeToLog s)
 
 fun mclose ses = Unix.reap ses
 
-end
\ No newline at end of file
+end
index 738c341..ed48c2a 100644 (file)
@@ -97,6 +97,7 @@ fun notify f req =
                    ()
                else
                    (Mail.mwrite (mail, name);
+                    Mail.mwrite (mail, emailSuffix);
                     Mail.mwrite (mail, ","))
            end
          | doOne r = rowError (table ^ ".doOne", r)