mblaze

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

commit 0e88f28e18b868474bd7418601074e2ac9ffbcf1
parent c4822a983be3726e6a07cabb245680c8b728e940
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Tue,  2 Aug 2016 15:32:29 +0200

mcomp: check message before sending

Diffstat:
mcomp | 19++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)

diff --git 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 ;;