Fork me on GitHub
#clojure-europe
<
2021-01-13
>
dharrigan05:01:18

Dia dhaoibh!

kardan06:01:00

Good morning

djm06:01:09

šŸ‘‹

borkdude09:01:56

Morning and welcome to @nic.youngster!

Nic09:01:02

Thank you and good morning šŸ™‚

Matt10:01:39

Morning!

pez10:01:15

Good morning! Today I am enjoying my time onboarding a new colleague. He is super skilled at a level where usually they are a bit less skilled socially, but this guy is just wonderfully empathic and a pleasant. And fun. Makes me laugh all the time. Amazing combo. Also find myself a bit in a conflict, because at the same time I wish the workday will end so that I can get back to converting bash/awk scripts to babashka in a non-profit project I am involved in. It is lovely to be able to work in a civilised language with important stuff, and also wonderful to see how things are quickly moving from maintenance hell to a situation where I can look at the requirements list and keep smiling.

ā¤ļø 21
orestis11:01:28

Good morning! Today I fell into a rabbit hole of implementing SMTP email support for a stubborn client who doesnā€™t accept our Mailgun provider. They want to use sendgrid instead šŸ˜ž

orestis11:01:42

Perhaps I should integrate Sendgrid and forget about SMTP at all?

slipset11:01:29

We use Amazon SES and smtp (via postal)

dharrigan11:01:51

I uses SES with the Cognitect AWS libraries.

borkdude11:01:51

@orestis fwiw we're using sendgrid + postal (clj lib)

orestis12:01:46

Oh weā€™re subject to DPAs so we canā€™t just switch providers. We use mailgun as our main provider via their API but, enterprise clients.

orestis12:01:57

@borkdude does postal handle things like retrying etc? SMTP is a complex thing. Using an http api to mailgun I donā€™t have to worry about those things. Perhaps though sendgrids SMTP endpoint is just a thin layer on top of their api.

borkdude12:01:31

Don't know, we just fire and forget ;)

borkdude12:01:54

we do log errors, but it seems to be working all fine

borkdude12:01:28

(doall
         (for [m mails]
           (try
             {:success
              (apply smtp/smtp-send
                     {:host host
                      :user user
                      :pass pass
                      :ssl true}
                     [m])}
             (catch Exception e
               (error e "exception when sending mail" m)
               {:error e}))))

borkdude12:01:24

afaik postal is a thin library around javax smtp. There is also another one by the vim-iced maintainer

otfrom14:01:03

that's interesting. For a lot of side effecting things where there is a status that is returned I like to do a into/map so that I can get the status msg for each thing I wanted to send

borkdude14:01:27

@otfrom that is why there is a doall + for here, I also collect the statuses

borkdude14:01:50

if this was purely for side effects, this would have been a doseq or something

thomas15:01:17

so what is the difference between doall and doseq?

borkdude15:01:47

doall realizes a (lazy) seq and returns it. doseq is just for side effects

šŸ‘ 3
otfrom15:01:36

yeah, doall remembering fail from me šŸ˜Š

orestis17:01:18

So in our Node.js app that weā€™re moving away from, weā€™re using a library called nodemailer: observe and marvel at thisā€¦ https://nodemailer.com/about/

orestis17:01:19

BTW I was talking about various 4xx SMTP codes that mean you should probably retry later: https://sendgrid.com/blog/smtp-server-response-codes-explained/

orestis17:01:28

I know by looking at our mailgun logs, when clients do bursts of emails, like messaging 10000 users at once, the remote servers will say ā€œback off, misterā€ and then mailgun throttles down and retries with smaller batches etc etc until weā€™re off the tarpitā€¦ which is something I donā€™t want to do manually šŸ™‚