X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/2315baa7a8223fbc2c9ec0d30818d8e2d8bfcba6..616f061f77605ce342e3068e5aacda3dffa24710:/.mutt/edit-header diff --git a/.mutt/edit-header b/.mutt/edit-header new file mode 100755 index 0000000..3a3a96a --- /dev/null +++ b/.mutt/edit-header @@ -0,0 +1,67 @@ +#!/bin/sh +# +# edit-header - helper script to append/replace/remove headers with mutt +# +# Based on an idea by David Champion +# +# Copyright © 2008 martin f. krafft +# Released under the terms of the Artistic Licence 2.0 +# +set -euvx + +if [ ! -x "$(command -v formail)" ]; then + echo E: formail not installed. >&2 + exit 1 +fi + +header="${1:-}" +if [ -z "$header" ]; then + echo "E: no header specified" >&2 + exit 1 +fi + +get_header_contents() +{ + local contents + printf "Enter ${1:-header} contents: " >/dev/tty + read contents &2 + exit 1 + ;; + +esac + +echo "set my_editor=\"\$editor\'" +echo "set editor=\"$editor\"" +echo "push " +# we need to push this so it happens after the editing +echo "push :set editor=\"\$my_editor\""