citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

commit 1483813bb4e60afec176ef99467f74b60314746d
parent aaab2caa23c1acdff99823d4727fef34737ce980
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 21 Jun 2021 16:24:36 -0700

sendmail: no hashcash for now

seems to be bugging on on git-send-email

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mbin/sendmail | 20+++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/bin/sendmail b/bin/sendmail @@ -1,8 +1,22 @@ #! /usr/bin/env sh -file="$(mktemp)" -cat > "$file" -sendmail-bg "$file" -t --read-envelope-from "$@" & disown +export EMAIL_CUSTOM_CONN_TEST=/home/jb55/bin/email-conn-test +export EMAIL_CONN_TEST=c + +#file="$(mktemp)" +#cat > "$file" +#sendmail-bg "$file" -t --read-envelope-from "$@" & disown + +output=$(msmtpq "$@" 2> /tmp/msmtp.err) +echo "$output" >> /tmp/msmtp.log + +if grep -E '^\s+enqueued' <<<"$output" +then + if command -v notify-send &> /dev/null; then + notify-send -u critical "$output" + fi +fi + # always succeed, even on connection/mail failure # we'll simply queue the mail in our outbox