know whether email was allegedly delivered or not
Find a file
2024-12-13 18:44:33 -06:00
.gitignore imap working 2024-12-09 03:36:15 -06:00
config.example.json first commit 2024-12-05 05:24:56 -06:00
config.go fix From address extraction regex bug and add raw DB query endpoint 2024-12-13 18:44:33 -06:00
go.mod imap working 2024-12-09 03:36:15 -06:00
go.sum imap working 2024-12-09 03:36:15 -06:00
imap_get_messages.go fix From address extraction regex bug and add raw DB query endpoint 2024-12-13 18:44:33 -06:00
main.go fix From address extraction regex bug and add raw DB query endpoint 2024-12-13 18:44:33 -06:00
model.go fix From address extraction regex bug and add raw DB query endpoint 2024-12-13 18:44:33 -06:00
openrc-file tmux deploy so far 2024-12-06 03:22:20 -06:00
pull.sh tmux deploy so far 2024-12-06 03:22:20 -06:00
ReadMe.md tmux deploy so far 2024-12-06 03:22:20 -06:00
run.sh tmux deploy so far 2024-12-06 03:22:20 -06:00

smtpd-delivery-monitor

A simple HTTP API which also tails the smtpd log.

Your application calls the smtpd-delivery-monitor POST /send API, passing an auth token and email address, subject, and body to send.

Then smtpd-delivery-monitor turns around and submits the email over SMTP to your smtpd server. However, the HTTP request continues to block until it sees a corresponding entry in the smtpd log (or times out after 30 seconds.)

Then the API responds with a JSON object that lets you know if smtpd said the email was delivered or not.

It will also refuse to send emails if a lot of emails have been bounced for that address recently.

usage example

domechild:/opt/smtpd-delivery-monitor# curl -H "Authorization: ..something long and un-guessable.." -X POST http://localhost:9184/send -d '{
>   "To": "forest.n.johnson@gmail.com",
>   "Subject": "test",
>   "Body": "teeeeeeeest"
> }'
{"Attempted":true,"Delivered":true,"Error":"The email server at gmail.com said: Ok: with a message of '250 2.0.0 OK  1733397156 00721157ae682-6efd3a28021si8558147b3.409 - gsmtp'.","WaitUntilTimestampMs":0}

deploy to domechild

I can't figure out how to get the damn openrc service to work. It always either hangs on stop or stops without shutting down the process.

So for now it runs on a tmux :X

go build -tags netgo,osusergo -o smtpd-delivery-monitor
curl https://webclip.sequentialread.com/smtpd-delivery-monitor | bash
  • ssh domechild.cyberia.club
  • tmux a
  • Ctrl - C
  • ./pull.sh
  • Ctrl - B
  • d

You can check the log with

tail -n 100 -f /var/log/smtpd-delivery-monitor.log