commit 062e70b6aa09488a468564fdc6597fcdfb9a3b6b parent 24dbc2a46b1a558c0ba66e68b56b64ac73112e70 Author: parazyd <parazyd@dyne.org> Date: Thu, 1 Mar 2018 03:09:17 +0100 Replace rpcomp with its template. It's easier to use a thing like: rpcomp | vipe | rpsend Diffstat:
M | bin/rpcomp | | | 32 | ++++++++++++++++++-------------- |
D | rplib/compose.sh | | | 25 | ------------------------- |
2 files changed, 18 insertions(+), 39 deletions(-)
diff --git a/bin/rpcomp b/bin/rpcomp @@ -1,21 +1,25 @@ #!/bin/sh -profile="${RPPROFILE:-$HOME/.rp/default}" -. "$HOME"/.rp/rplib/common.sh - to="" [ $# -gt 0 ] && to="$1" -tmpfile=$(mktemp /tmp/rpcomp.XXXXXX.eml) -signalh() { - rm -f "$tmpfile" -} -trap 'signalh' 3 6 9 15 - -sh "$profile/../rplib/compose.sh" "$to" > "$tmpfile" +printf "Date: %s +From: %s +Subject: Subject +To: %s +Cc: +Bcc: +User-Agent: rp +MIME-Version: 1.0 +Content-Type: text/plain; charset=\"utf-8\" +Content-Transfer-Encoding: 8bit\n" \ + "$(LANG=C date "+%a, %d %b %Y %T %Z")" \ + "$(rpcfg -v defaultfrom)" \ + "$to" -"$EDITOR" "$tmpfile" -mv "$tmpfile" "$profile/tmp/outbox" -echo "$profile/tmp/outbox/$(basename $tmpfile)" -signalh +printf "\nText\n\n" +[ -e "$HOME/.signature" ] && { + printf -- "-- \n" + cat "$HOME/.signature" +} diff --git a/rplib/compose.sh b/rplib/compose.sh @@ -1,25 +0,0 @@ -#!/bin/sh - -to="" -[ $# -gt 0 ] && to="$1" - -printf "Date: %s -From: %s -Subject: Subject -To: %s -Cc: -Bcc: -User-Agent: rp -MIME-Version: 1.0 -Content-Type: text/plain; charset=\"utf-8\" -Content-Transfer-Encoding: 8bit\n" \ - "$(LANG=C date "+%a, %d %b %Y %T %Z")" \ - "$(rpcfg -v defaultfrom)" \ - "$to" - -printf "\nText\n\n" - -[ -e "$HOME/.signature" ] && { - printf -- "-- \n" - cat "$HOME/.signature" -}