From e8ef1050cb7ca51fa35abf15d162b0e6acdd3ff0 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Mon, 14 Jun 2010 12:19:50 +0200 Subject: [PATCH 1/1] migrate draft checking to sendmail check --- .mutt/hooks | 2 -- .mutt/sendmail-checks.d/prevent-draft | 13 +++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100755 .mutt/sendmail-checks.d/prevent-draft 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 -- 2.39.5