mirror of
https://github.com/penpot/penpot.git
synced 2025-05-21 07:46:10 +02:00
🐛 Fix sendmail to console unexpected exception.
This commit is contained in:
parent
c3ca59ac93
commit
ef01caf829
2 changed files with 10 additions and 9 deletions
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
:image-process-max-threads 2
|
:image-process-max-threads 2
|
||||||
|
|
||||||
:smtp-enable false
|
:smtp-enabled false
|
||||||
:smtp-default-reply-to "no-reply@example.com"
|
:smtp-default-reply-to "no-reply@example.com"
|
||||||
:smtp-default-from "no-reply@example.com"
|
:smtp-default-from "no-reply@example.com"
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
(s/def ::media-uri ::us/string)
|
(s/def ::media-uri ::us/string)
|
||||||
(s/def ::media-directory ::us/string)
|
(s/def ::media-directory ::us/string)
|
||||||
(s/def ::secret-key ::us/string)
|
(s/def ::secret-key ::us/string)
|
||||||
(s/def ::smtp-enable ::us/boolean)
|
(s/def ::smtp-enabled ::us/boolean)
|
||||||
(s/def ::smtp-default-reply-to ::us/email)
|
(s/def ::smtp-default-reply-to ::us/email)
|
||||||
(s/def ::smtp-default-from ::us/email)
|
(s/def ::smtp-default-from ::us/email)
|
||||||
(s/def ::smtp-host ::us/string)
|
(s/def ::smtp-host ::us/string)
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
::secret-key
|
::secret-key
|
||||||
::smtp-default-from
|
::smtp-default-from
|
||||||
::smtp-default-reply-to
|
::smtp-default-reply-to
|
||||||
::smtp-enable
|
::smtp-enabled
|
||||||
::smtp-host
|
::smtp-host
|
||||||
::smtp-port
|
::smtp-port
|
||||||
::smtp-username
|
::smtp-username
|
||||||
|
@ -205,6 +205,7 @@
|
||||||
:default-reply-to (:smtp-default-reply-to cfg)
|
:default-reply-to (:smtp-default-reply-to cfg)
|
||||||
:default-from (:smtp-default-from cfg)
|
:default-from (:smtp-default-from cfg)
|
||||||
:tls (:smtp-tls cfg)
|
:tls (:smtp-tls cfg)
|
||||||
|
:enabled (:smtp-enabled cfg)
|
||||||
:username (:smtp-username cfg)
|
:username (:smtp-username cfg)
|
||||||
:password (:smtp-password cfg)})
|
:password (:smtp-password cfg)})
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,9 @@
|
||||||
[app.metrics :as mtx]))
|
[app.metrics :as mtx]))
|
||||||
|
|
||||||
(defn- send-console!
|
(defn- send-console!
|
||||||
[cfg email]
|
[config email]
|
||||||
(let [baos (java.io.ByteArrayOutputStream.)
|
(let [baos (java.io.ByteArrayOutputStream.)
|
||||||
mesg (emails/smtp-message cfg email)]
|
mesg (emails/smtp-message config email)]
|
||||||
(.writeTo mesg baos)
|
(.writeTo mesg baos)
|
||||||
(let [out (with-out-str
|
(let [out (with-out-str
|
||||||
(println "email console dump:")
|
(println "email console dump:")
|
||||||
|
@ -31,10 +31,10 @@
|
||||||
(defn handler
|
(defn handler
|
||||||
{:app.tasks/name "sendmail"}
|
{:app.tasks/name "sendmail"}
|
||||||
[{:keys [props] :as task}]
|
[{:keys [props] :as task}]
|
||||||
(if (:smtp-enable cfg/config)
|
(let [config (cfg/smtp cfg/config)]
|
||||||
(-> (cfg/smtp cfg/config)
|
(if (:enabled config)
|
||||||
(emails/send! props))
|
(emails/send! config props)
|
||||||
(send-console! props)))
|
(send-console! config props))))
|
||||||
|
|
||||||
(mtx/instrument-with-summary!
|
(mtx/instrument-with-summary!
|
||||||
{:var #'handler
|
{:var #'handler
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue