aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-08-02 15:32:29 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-08-02 15:32:29 +0200
commit0e88f28e18b868474bd7418601074e2ac9ffbcf1 (patch)
tree9dc6b57dee121d814b33432ac93394ab465e3e2f
parentc4822a983be3726e6a07cabb245680c8b728e940 (diff)
downloadmblaze-0e88f28e18b868474bd7418601074e2ac9ffbcf1.tar.gz
mcomp: check message before sending
-rwxr-xr-xmcomp19
1 files changed, 12 insertions, 7 deletions
diff --git a/mcomp b/mcomp
index 1917ec6..6fdb433 100755
--- a/mcomp
+++ b/mcomp
@@ -109,16 +109,21 @@ while :; do
c=
fi
else
- if sendmail -t <$draft; then
- if [ "$outbox" ]; then
- mflag -d $draft
+ if mmime -c <$draft; then
+ if sendmail -t <$draft; then
+ if [ "$outbox" ]; then
+ mflag -d $draft
+ else
+ rm $draft
+ fi
+ exit 0
else
- rm $draft
+ echo "mcomp: sendmail failed, kept draft $draft"
+ exit 2
fi
- exit 0
else
- echo "mcomp: sendmail failed, kept draft $draft"
- exit 2
+ echo "mcomp: message needs to be MIME-encoded first."
+ c=
fi
fi
;;