From 2ed06d33b75c170d997a55de6543b9e206fbf92b Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sat, 5 Jun 2021 15:57:32 -0400 Subject: Add -H flag to fetch only headers Basically to quickly test which messages are getting matched without having to scroll through their bodies. --- git-fetch-email.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'git-fetch-email.sh') diff --git a/git-fetch-email.sh b/git-fetch-email.sh index e3fc953..574d04f 100644 --- a/git-fetch-email.sh +++ b/git-fetch-email.sh @@ -18,6 +18,7 @@ set -u idle= apply= +headers= verbose= host=$(git config fetchemail.imapServer) port=$(git config fetchemail.imapServerPort) @@ -40,6 +41,7 @@ git fetch-email [] -- C,cc= fetch patches with matching Cc headers F,from= fetch patches with matching From headers +H,headers fetch only patch headers M,move-to= move patches to mailbox S,subject= fetch patches with matching Subject headers T,to= fetch patches with matching To headers @@ -61,6 +63,7 @@ while [ $# -gt 0 ]; do case "${opt}" in (-C) cc=$1; shift;; (-F) from=$1; shift;; + (-H) headers=yes;; (-M) move=$1; shift;; (-S) subject=$1; shift;; (-T) to=$1; shift;; @@ -76,6 +79,7 @@ while [ $# -gt 0 ]; do (--no-apply) apply=;; (--no-cc) cc=;; (--no-from) from=;; + (--no-headers) headers=;; (--no-idle) idle=;; (--no-mark-seen) seen=;; (--no-move-to) move=;; @@ -107,7 +111,7 @@ fi fetch() { printf '%s' "${pass}" | imbox -w \ - ${verbose:+-v} ${idle:+-i} ${unseen:+-U} ${seen:+-s} \ + ${verbose:+-v} ${idle:+-i} ${headers:+-H} ${unseen:+-U} ${seen:+-s} \ ${host:+-h "${host}"} \ ${port:+-p "${port}"} \ ${mailbox:+-m "${mailbox}"} \ -- cgit 1.4.1