From 7b5055f7abf4ac3617dacc64bd32e08268d7b709 Mon Sep 17 00:00:00 2001 From: Ivy Foster Date: Sat, 3 Sep 2016 17:56:12 -0500 Subject: mcom: allow user to specify sendmail, sendmail-args in $MBLAZE/profile Closes: #6 [via git-merge-pr] --- mcom | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'mcom') diff --git a/mcom b/mcom index 8ca3425..a282e34 100755 --- a/mcom +++ b/mcom @@ -19,6 +19,11 @@ msgdate() { } MBLAZE=${MBLAZE:-$HOME/.mblaze} + +sendmail=$(mhdr -h sendmail "$MBLAZE/profile") +sendmail_args=$(mhdr -h sendmail-args "$MBLAZE/profile") +sendmail="${sendmail:-sendmail} ${sendmail_args:--t}" + outbox=$(mhdr -h outbox "$MBLAZE/profile") if [ -z "$outbox" ]; then i=0 @@ -96,7 +101,7 @@ while :; do s|send) if [ -e $draftmime ]; then if [ $draft -ot $draftmime ]; then - if sendmail -t <$draftmime; then + if $sendmail <$draftmime; then if [ "$outbox" ]; then mv $draftmime $draft mflag -d $draft @@ -105,7 +110,7 @@ while :; do fi exit 0 else - echo "mcom: sendmail failed, kept draft $draft" + echo "mcom: $sendmail failed, kept draft $draft" exit 2 fi else @@ -114,7 +119,7 @@ while :; do fi else if mmime -c <$draft; then - if sendmail -t <$draft; then + if $sendmail <$draft; then if [ "$outbox" ]; then mflag -d $draft else @@ -122,7 +127,7 @@ while :; do fi exit 0 else - echo "mcom: sendmail failed, kept draft $draft" + echo "mcom: $sendmail failed, kept draft $draft" exit 2 fi else -- cgit 1.4.1