From 7bd4d02e13dbd5d649482a622be5734f395f3180 Mon Sep 17 00:00:00 2001 From: David Levine Date: Wed, 13 Jun 2012 22:59:05 -0500 Subject: [PATCH] Added support to mhmail.in to read message from stdin. --- uip/mhmail.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/uip/mhmail.in b/uip/mhmail.in index 809668a..2caea10 100755 --- a/uip/mhmail.in +++ b/uip/mhmail.in @@ -8,7 +8,8 @@ # # Emulation of compiled mhmail(1) using nmh send(1) or post(8). # Differences from compiled mhmail: -# * Supports all send(1) (with -profile) or post(8) (without -profile) options. +# * Supports all post(8) (by default, without -profile) or send(1) +# (with -profile) options. # * Optionally (with -profile) obeys the users profile, including # AliasFile and send entries. # * Adds -debug option for debugging (sending, not incorporating new mail). @@ -107,6 +108,11 @@ else " fi + #### If no -body, read message from stdin the easy way. + if [ "${body}"x = x ]; then + body=`cat` + fi + #### Set up a tmpfil and trap to remove it. send moves the file to a backup. tmpdir=${MHTMPDIR:-${TMPDIR:-${TMP:-`${nmhbindir}/mhpath +`}}} tmpfil=${tmpdir}/mhmail$$ -- 1.7.10.4