Skip to content

Commit

Permalink
added exception catching for badly formatted to email addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
zippy committed Oct 29, 2011
1 parent 0505e3f commit 8b53976
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/anansi/streamscapes/channels/email_bridge_in.clj
Expand Up @@ -44,7 +44,9 @@
ids (get-scape ss :id)
da (s-> address->resolve ids id)]
(if (empty? da)
(let [recipients (.getRecipients message javax.mail.Message$RecipientType/TO)
(let [recipients (try (.getRecipients message javax.mail.Message$RecipientType/TO)
(catch Exception e [(javax.mail.internet.InternetAddress. (str "\"" e "\" <_err_@unknown.err>"))])
)
[to to-name] (parseInternetAddress (first recipients))
[from from-name] (parseInternetAddress
(first (try (.getFrom message)
Expand Down

0 comments on commit 8b53976

Please sign in to comment.