commit 3eecc7d5473f28d9d125437015d0d1039c2a7b61
parent c396c2921a4e9434a35a2d797035ba9f46d7fcd4
Author: parazyd <parazyd@dyne.org>
Date: Wed, 4 Jul 2018 23:13:45 +0200
Rework rpcomp to support Cc: as args.
Diffstat:
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/bin/rpcomp b/bin/rpcomp
@@ -2,34 +2,30 @@
profile="${RPPROFILE:-$HOME/.rp/default}"
-content_head="Content-Type: text/plain; charset=\"utf-8\""
-
to=""
[ $# -gt 0 ] && to="$1"
[ $# -gt 1 ] && {
-
- exit 1
-
- # added attachments
shift 1
for i in $@; do
- attach="$i,$attach"
+ ccs="${ccs}${i}, "
done
+ ccs="$(echo $ccs | rev | cut -c2- | rev)"
}
printf "Date: %s
From: %s
Subject: Subject
To: %s
-Cc:
+Cc: %s
Bcc:
Message-ID: %s
User-Agent: rp
MIME-Version: 1.0
-%s\n" \
+Content-Type: text/plain; charset=\"utf-8\"\n" \
"$(LANG=C date "+%a, %d %b %Y %T %Z")" \
"$(rpheaders defaultfrom < $profile/config)" \
"$to" \
+ "$ccs" \
"$(rputil -e genmsgid)" \
"$content_head"