From 1f0635b67aa7f7055b238540bad5a10369f8c9ea Mon Sep 17 00:00:00 2001 From: Alex Curtis Date: Thu, 18 Jun 2015 09:39:45 +0100 Subject: [PATCH] Throw an exception if sendmail is not installed on system. --- src/postal/sendmail.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/postal/sendmail.clj b/src/postal/sendmail.clj index 9f72bc6..852251a 100644 --- a/src/postal/sendmail.clj +++ b/src/postal/sendmail.clj @@ -58,7 +58,8 @@ (defn find-sendmail [] (if-let [SENDMAIL (System/getenv "SENDMAIL")] SENDMAIL - (first (filter #(.isFile (java.io.File. ^String %)) sendmails)))) + (or (first (filter #(.isFile (java.io.File. ^String %)) sendmails)) + (throw (ex-info "Can't find sendmail executable. Is sendmail installed?" {:searched-for sendmails}))))) (defn sanitize [^String text] (.replaceAll text "\r\n" (System/getProperty "line.separator")))