about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-08-01 17:45:59 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-08-01 17:45:59 +0200
commite7969bf0545363e0cb8f0ef8e8d8829bbc5820bd (patch)
treece614aafc9018f1ba4a91a17f373f7d796a56c59
parent311232d244b77b3ad9ce9d23564580d0af7730d4 (diff)
downloadmblaze-e7969bf0545363e0cb8f0ef8e8d8829bbc5820bd.tar.gz
mblaze-e7969bf0545363e0cb8f0ef8e8d8829bbc5820bd.tar.xz
mblaze-e7969bf0545363e0cb8f0ef8e8d8829bbc5820bd.zip
mcomp: support Attach: header
-rwxr-xr-xmcomp13
1 files changed, 10 insertions, 3 deletions
diff --git a/mcomp b/mcomp
index f740cd4..a812f1b 100755
--- a/mcomp
+++ b/mcomp
@@ -20,7 +20,7 @@ if [ -z "$outbox" ]; then
 		i=$((i+1))
 	done
 	draft="snd.$i"
-	draftmime="snd.$i.mime"
+	draftmime="./snd.$i.mime"
 else
 	draft="$(true | mdeliver -v -XD "$outbox")"
 	if [ -z "$draft" ]; then
@@ -130,8 +130,15 @@ while :; do
 		exit 1
 		;;
 	m|mime)
-		mmime <$draft >$draftmime
-		mshow -t ./$draftmime
+		(
+			IFS='
+'
+			msed '/attach/d' $draft
+			for f in $(mhdr -M -h attach $draft); do
+				echo "#$(file -Lbi $f | sed 's/ //g') $f"
+			done
+		) | tee /tmp/v | mmime >$draftmime
+		mshow -t $draftmime
 		c=
 		;;
 	e|edit)