summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Server.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Server.hs b/Server.hs
index 136aefa..d7a43a0 100644
--- a/Server.hs
+++ b/Server.hs
@@ -256,10 +256,13 @@ doneSessionLog email o sid = do
else return ()
emailSessionLog :: EmailAddress -> ServerOpts -> FilePath -> IO ()
-emailSessionLog email o logfile = renderSendMail
- =<< simpleMail to from subject body body [("text/plain", logfile)]
+emailSessionLog email o logfile
+ | isemail = renderSendMail
+ =<< simpleMail to from subject body body [("text/plain", logfile)]
+ | otherwise = return ()
where
to = Address Nothing email
from = Address Nothing $ fromMaybe "unknown@server" (serverEmail o)
subject = "Your recent debug-me session"
body = "Attached is the log from your recent debug-me session."
+ isemail = "@" `T.isInfixOf` email