diff options
-rw-r--r-- | Server.hs | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 |