all repos — navani @ 87e4e39f51426e49685961140dfe3499c83378d9

forlater's primary mail processing service

Improve logging
Anirudh Oppiliappan x@icyphox.sh
Thu, 16 Sep 2021 16:37:06 +0530
commit

87e4e39f51426e49685961140dfe3499c83378d9

parent

06308722160bc479f00281c4c09c7d5e0de70a5b

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M main.gomain.go

@@ -16,12 +16,13 @@ http.HandleFunc("/webhook", func(w http.ResponseWriter, r *http.Request) {

m := mail.Mail{} json.NewDecoder(r.Body).Decode(&m) body, err := mail.MailBody(m.Parts) - log.Printf("recieved webhook: %v\n", m) + log.Printf("recieved webhook: %v\n", m.From) if err != nil { log.Println(err) } for _, u := range distinct(mail.ExtractURLs(body)) { + log.Printf("url: %s\n", u) parsedURL, err := url.Parse(u) if err != nil { log.Printf("url parse: %s\n", err)