From 7e6b1c97e617ba75b4c8fdedffa02133a8393552 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sat, 21 Mar 2020 17:47:33 +0100 Subject: mrep/mbnc: allow only one message as argument --- mcom | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'mcom') diff --git a/mcom b/mcom index c030b61..e2f7100 100755 --- a/mcom +++ b/mcom @@ -311,6 +311,12 @@ fi ) fi ;; *mbnc*) + set -- $(mseq -- "$@") + if [ "$#" -ne 1 ]; then + printf 'mbnc: needs exactly one mail to bounce\n' 1>&2 + exit 1 + fi + { printf '%s' "$hdrs" | mhdr -M -h resent-to /dev/stdin | commajoin | sed 's/^/Resent-To: /' @@ -324,10 +330,16 @@ fi printf 'Resent-Date: %s\n' "$(mdate)" ( IFS=$NL - cat $(mseq "${@:-.}") + cat $(mseq -- "$@") ) ;; *mrep*) + set -- $(mseq -- "$@") + if [ "$#" -ne 1 ]; then + printf 'mrep: needs exactly one mail to reply to\n' 1>&2 + exit 1 + fi + ng=$(mhdr -h newsgroups "$1") if [ "$ng" ]; then printf 'Newsgroups: %s\n' "$ng" -- cgit 1.4.1