mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 2a9c1668ebc48eb0077f289970a348944b78010d
parent e7969bf0545363e0cb8f0ef8e8d8829bbc5820bd
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Mon,  1 Aug 2016 18:00:52 +0200

mquote: extract from mcomp, refine

Diffstat:
mcomp | 5+----
mquote | 12++++++++++++
2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/mcomp b/mcomp @@ -76,10 +76,7 @@ fi msgid echo - echo "$(mhdr -d -h from "$1") wrote:" - mshow -R "$1" | - sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' | - sed 's/^/> /' + mquote "$1" echo esac diff --git a/mquote b/mquote @@ -0,0 +1,12 @@ +#!/bin/sh +# mquote MSG - format MSG as a quotation + +: ${from=$(mhdr -d -h x-original-from "$1")} +: ${from=$(mhdr -d -h from "$1")} +: ${from=Someone} + +echo "$from wrote:" +mshow -R "$1" | + sed -n '/^-- $/!p;//q' | # strip signature + sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' | # strip empty lines + sed 's/^/> /' # prefix with >