drewr / postal

Clojure email support
MIT License
587 stars 85 forks source link

SSL syntax from README.md #81

Closed jhajek closed 7 years ago

jhajek commented 7 years ago

Hi in the README.md under Gmail authentication the example to use SSL uses this syntax

postal.core> (send-message {:host "smtp.gmail.com"
                            :user "jsmith"
                            :pass "sekrat!!1"
                            :ssl :yes!!!11}

But an example in https://github.com/drewr/postal/issues/22 shows this syntax for using :ssl

(postal/send-message #^{:host "email-smtp.us-east-1.amazonaws.com"
                      :user (get (System/getenv) "AWS_SMTP_USER")
                      :pass (get (System/getenv) "AWS_SMTP_PASSWORD")
                      :ssl true }

What is the correct method for enabling :ssl?

drewr commented 7 years ago

This is confusing because of the dynamic nature truthiness in Clojure (and many langs). Basically, anything not nil or false will usually satisfy truth in a predicate, in this case an if expression. The documentation above subtly implies that this is the case by using a boolean in one place and a keyword in another, but it's not very clear. I'll fix that.