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

From: zsentient (zsentient@anosc-e.5sigcmd.army.mil)
Date: Tue Aug 05 2003 - 11:57:39 EDT


I know this question has been asked, but want to put it out there again with the hope some fresh brain matter can give it a spin.

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.

I am aware of mimedefang, but it only runs with Sendmail version 12 (at this time I can not upgrade) and it is a little more than I actually need...

-This is the mail command that I must use:
# /usr/ucb/mail -r "reply_address@domain.com" -s "E-Mail Subject" "recipeint@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 "$@"
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:26:52 EDT