about summary refs log tree commit diff
path: root/mcom
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-11-08 15:10:04 +0100
committerLeah Neukirchen <leah@vuxu.org>2020-11-08 15:10:04 +0100
commit5e6151e3bf8aa13a3849997ed49953362887ff5a (patch)
tree3cdf881a486a157a969e9f8eaf35a756a3e2d1c7 /mcom
parent48c20b7efac8e4094c9bf5fdeeb149e546aebffd (diff)
downloadmblaze-5e6151e3bf8aa13a3849997ed49953362887ff5a.tar.gz
mblaze-5e6151e3bf8aa13a3849997ed49953362887ff5a.tar.xz
mblaze-5e6151e3bf8aa13a3849997ed49953362887ff5a.zip
mcom: detect and report mmime errors
Closes #191.
Diffstat (limited to 'mcom')
-rwxr-xr-xmcom6
1 files changed, 5 insertions, 1 deletions
diff --git a/mcom b/mcom
index 7bb3ce6..f0de75c 100755
--- a/mcom
+++ b/mcom
@@ -92,6 +92,10 @@ do_mime() {
 	else
 		mmime -r <"$draft" >"$draftmime"
 	fi
+	if [ $? -ne 0 ]; then
+ 	     	printf 'mcom: fix above errors before continuing\n' 1>&2
+		rm -f "$draftmime"
+	fi
 }
 
 MBLAZE=${MBLAZE:-$HOME/.mblaze}
@@ -450,7 +454,7 @@ while :; do
 				continue
 			fi
 		else
-			if mmime -c <"$draft"; then
+			if mmime -c <"$draft" && ! [ "$automime" = 1 ]; then
 				stampdate "$draft"
 				if $sendmail <"$draft"; then
 					if [ "$outbox" ]; then