From: David Levine Date: Thu, 14 Jun 2012 03:59:05 +0000 (-0500) Subject: Added support to mhmail.in to read message from stdin. X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=7bd4d02e13dbd5d649482a622be5734f395f3180;p=mmh Added support to mhmail.in to read message from stdin. --- 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$$