From: martin f. krafft Date: Mon, 14 Jun 2010 10:19:50 +0000 (+0200) Subject: migrate draft checking to sendmail check X-Git-Url: https://git.madduck.net/etc/mutt.git/commitdiff_plain/e8ef1050cb7ca51fa35abf15d162b0e6acdd3ff0?ds=sidebyside migrate draft checking to sendmail check --- diff --git a/.mutt/hooks b/.mutt/hooks index 4c809eb..227247a 100644 --- a/.mutt/hooks +++ b/.mutt/hooks @@ -1,7 +1,5 @@ save-hook . =store -send2-hook '~C notyet' "set sendmail='~/.mutt/error 1 I will not send this draft yet!'" - send2-hook '~C @packages\.qa\.debian\.org' 'my_hdr X-PTS-Approved: please' fcc-hook -request@ '=discard' diff --git a/.mutt/sendmail-checks.d/prevent-draft b/.mutt/sendmail-checks.d/prevent-draft new file mode 100755 index 0000000..5c83ceb --- /dev/null +++ b/.mutt/sendmail-checks.d/prevent-draft @@ -0,0 +1,13 @@ +#!/bin/sh +# +# prevent-draft – prevent sending a message while an X-Draft header exists +# +# Copyright © 2010 martin f. krafft +# Released under the terms of the Artistic Licence 2.0 +# +set -eu + +if grep -q '^X-Draft:' $1; then + echo >&2 "E: will not send this message while the X-Draft header is present" + exit 1 +fi