about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xmcom13
1 files changed, 9 insertions, 4 deletions
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