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

Dia dhaoibh!

kardan06:01:00

Good morning

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 🙂