diff --git a/mcom b/mcom index 4e834c6..6d882ed 100755 --- a/mcom +++ b/mcom @@ -104,6 +104,7 @@ sendmail=$(mhdr -h sendmail "$MBLAZE/profile") sendmail_args=$(mhdr -h sendmail-args "$MBLAZE/profile") sendmail="${sendmail:-sendmail} ${sendmail_args:--t}" default_from=$(mhdr -h local-mailbox "$MBLAZE/profile") +sendhook=$(mhdr -h sendhook "$MBLAZE/profile") defaultc=e @@ -448,7 +449,11 @@ while :; do if $sendmail <"$draftmime"; then if [ "$outbox" ]; then mv "$draftmime" "$draft" - mrefile "$(mflag -d -S "$draft")" "$outbox" + if test -z "${sendhook}"; then + mrefile "$(mflag -d -S "$draft")" "$outbox" + else + ${sendhook} "$draft" + fi else rm "$draft" "$draftmime" fi @@ -466,7 +471,11 @@ while :; do stampdate "$draft" if $sendmail <"$draft"; then if [ "$outbox" ]; then - mrefile "$(mflag -d -S "$draft")" "$outbox" + if test -z "${sendhook}"; then + mrefile "$(mflag -d -S "$draft")" "$outbox" + else + ${sendhook} "$draft" + fi else rm "$draft" fi