about summary refs log tree commit diff
path: root/mcom
diff options
context:
space:
mode:
authorMatthieu Rakotojaona <m@rako.space>2023-11-11 02:01:19 +0100
committerLeah Neukirchen <leah@vuxu.org>2024-09-11 21:45:52 +0200
commit8bac54fab7c7657940b30915abb36f61093d11c9 (patch)
treed4af69a0b88a5b3df85cfb3a8ab8a3d4e1d8a3f7 /mcom
parent75cb6729f053e0050fcbbd974de9e8dff22d94f5 (diff)
downloadmblaze-8bac54fab7c7657940b30915abb36f61093d11c9.tar.gz
mblaze-8bac54fab7c7657940b30915abb36f61093d11c9.tar.xz
mblaze-8bac54fab7c7657940b30915abb36f61093d11c9.zip
Attach all files when forwarding in raw mode
Diffstat (limited to 'mcom')
-rwxr-xr-xmcom13
1 files changed, 13 insertions, 0 deletions
diff --git a/mcom b/mcom
index 4e834c6..4d0362a 100755
--- a/mcom
+++ b/mcom
@@ -306,6 +306,19 @@ fi
 		msgid
 		museragent
 		cat "$MBLAZE/headers" 2>/dev/null
+		if [ -n "$raw" ]; then
+			prev=$(pwd)
+			attachdir=$(mktemp -d)
+			cd $attachdir
+			trap 'rm -r "$attachdir"' EXIT
+
+			mseq -r "$@" \
+				| xargs -I {} mshow -Bx {} \
+				| xargs -I {} realpath {} \
+				| sed '/^$/d; s/^/Attach: /'
+			cd $prev
+		fi
+
 		printf '\n\n'
 		if [ -z "$raw" ]; then
 			mseq -r "$@" | sed 's:^:#message/rfc822#inline :; s:$:>:'