about summary refs log tree commit diff
path: root/mcom
diff options
context:
space:
mode:
authorIvy Foster <ivy.foster@gmail.com>2016-09-03 17:56:12 -0500
committerChristian Neukirchen <chneukirchen@gmail.com>2016-09-04 18:20:33 +0200
commit7b5055f7abf4ac3617dacc64bd32e08268d7b709 (patch)
tree5e2a547050857263900b5dac81f2ea9c497c695d /mcom
parentb9f09fc581b50114938ac542dd87bf2457664c58 (diff)
downloadmblaze-7b5055f7abf4ac3617dacc64bd32e08268d7b709.tar.gz
mblaze-7b5055f7abf4ac3617dacc64bd32e08268d7b709.tar.xz
mblaze-7b5055f7abf4ac3617dacc64bd32e08268d7b709.zip
mcom: allow user to specify sendmail, sendmail-args in $MBLAZE/profile
Closes: #6 [via git-merge-pr]
Diffstat (limited to 'mcom')
-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