[SunHELP] Add header to the top of the body of every e-mail (sendmail)

Sandwich Maker adh at an.bradford.ma.us
Sun Aug 10 01:23:22 CDT 2003


"From: zsentient <zsentient at anosc-e.5sigcmd.army.mil>
"
"I am trying to echo an e-mail header (not mail header, header as in document terminolgy) to all text e-mail bodies coming from a solaris system using a shell script that is basically wrapping /usr/lib/sendmail. 
[]
"-This is the mail command that I must use: 
"# /usr/ucb/mail -r "reply_address at domain.com" -s "E-Mail Subject" "recipeint at domain.com"  < ./txt_file
"
"-Here is the script that is attempting to add (echo) "[For Official Use Only]"  into the top of the body of every e-mail. With the echo "\n[For Official Use Only]" the subject is wrongly moved to the body of the e-mail, but the header does appear; without the "\n" in the header does not appear at all: 
"
"#!/bin/sh
"# Sendmail wrap script to add header and footer.
"# Script is named as /usr/lib/sendmail and sendmail binary moved to /usr/lib/sendmail.nowrap
"# Permissions of script set to match original sendmail binary: 
"#-r-xr-sr-x   1 root     other        167 Aug  5 12:48 sendmail
"        {
"        #echo "[For Official Use Only]" 
"        echo "\n[For Official Use Only]" 
"        cat -
"        }| /usr/lib/sendmail.nowrap "$@"

how about:

#!/usr/bin/sh
# mail wrap script to add header and footer.
{
	echo "\nheader"
	cat ${1-$0: error!  no message!}
	echo "\nfooter"
} | /usr/ucb/mail -r "reply_address at domain.com" -s "E-Mail Subject" "recipeint at domain.com"

and leave sendmail alone?
________________________________________________________________________
Andrew Hay                                  the genius nature
internet rambler                            is to see what all have seen
adh at an.bradford.ma.us                       and think what none thought



More information about the SunHELP mailing list