SUMMARY: How to email with footer added automatically

From: Johnny Hui (jhui@magma.COM)
Date: Wed May 19 1993 - 17:16:06 CDT

If you've seen this before, please delete it.

Most reply pointed to adding a ~/.signature file. However, the standard
mail or mailtool program from Sun doesn't pick up that file. If you're
using elm, it works, but I'm using Solaris 2.2 and I don't think there is
a copy of elm for Solaris 2.X yet, or does it exist?

Thanks to Alex Sarafian, Ed Arnold and Brian Decker who gave me some
good pointers on how to do it with standard mail. I included their replies
below. Some people suggested that I create a template with mailtool, which
I knew already. Some people misunderstand and tell me how to email with
attachment. Anyway, thanks to all who answered nicely.

1 person asked me not to post summary but 4 people asked me to. 1 person
from Aurora Technologies want to sell me consulting contract for this but
no thanks!

Thanks to the reply from the following people and more: - thank - thank - thank

The following people requested summary:

The following person request not to post summary: - Sorry! 3 to 1, they win.

I will include some good reply:


First, create a file in the home directory named ".signature"
which contains the footer.
Make sure it is no longer than 4 lines (this is the accepted .signature

Then, in your ".mailrc" file in your home directory (if you don't have one, then
create it), add the following line in the begining of the file:

        "set sendmail=my-mailer"

Then, in your home directory, create a file called "my-mailer" which
contains the following:

#! /bin/sh
# @(#)my-mailer v.1.0 21-MAY-91

#solves problem of read line discarding leading blanks which are necessary
#for correct interpretation of continuation lines in mail headers
while read line
        echo "$line"
        case $line in
        "") break ;;
cat -) | cat - $HOME/.signature 2> /dev/null | /usr/lib/sendmail "$@"


Make sure it has execute permissions (do a "chmod x+a my-mailer")


Write a executable script like the following and put it into an
accessible place ( like $HOME/bin/signmail )

# signmail - automatically add .signature to mail and then
# exec sendmail
if [ -f ${HOME}/.signature ]; then
   (cat - ; echo "" ; cat ${HOME}/.signature) | exec /usr/lib/sendmail $*
   exec /usr/lib/sendmail $*

Create a $HOME/.signature file with your choice of witty saying, etc..

Edit your $HOME/.mailrc file so that there is a line that reads

set sendmail=path_to_where_you_put_it/signmail


Some mailers include the ability to tack your ~/.signature file onto
a mail message, either when it's sent, or just before throwing you
into an editor to compose it.

I use the "elm" mailer. In my ~/.elm/elmrc file, I tell elm to tack
the .signature file onto my messages via the line:

remotesignature = .signature

If you use the old Berkeley "Mail" program, things are a little messier.
What I do with it, is to put a "set sendmail" reference in my ~/.mailrc
file, which causes "Mail" to call my "sendmail":

set sendmail=/crestone/home/era/bin/sendmail.era

That file is just a script that tacks .signature onto the message, then
calls the real sendmail:

# add From: & Reply-To: lines before forwarding mail to /usr/lib/sendmail.
# add also a signature automatically.
# This file referenced in $HOME/.mailrc.

echo "From: (Ed Arnold)"
echo "Reply-to: (Ed Arnold)"
cat -
echo "--------"
cat $HOME/.signature
) | /usr/lib/sendmail $*

Johnny Hui email:
MAGMA Tel: (619) 457-0750
6725 Mesa Ridge Road #100, Fax: (619) 457-0798
San Diego, CA 92124

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:07:51 CDT