home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous Section Next Section

-F

Set the sender's full name All versions

The -F command-line switch specifies the full name of the sender, which is used in mail headers and the envelope. The form of the -F switch is:

-Ffullname
-F fullname

Space between the -F and the fullname is optional. If fullname is missing and the -F is the last argument, sendmail prints the following error and exits:

sendmail: option requires an argument -- F

If the -F is followed by any other switches, the following switch is taken as the full name.

When specifying the sender's full name, be sure to quote any internal spaces or shell special characters. For example, for the C shell the following would be needed to specify the full name Happy Guy!:

"Happy Guy\!"

In the absence of this switch, sendmail finds the sender's full name in any of several places. These are described in the section discussing the $x sendmail macro ($x).

The -F command-line switch is used by programs and shell scripts that send email. Consider the following administrative shell script that is run by cron(8) once per night:

#!/bin/sh
DISKUSE="du -s"
ARCHDIR=/admin/mail/lists
LIMIT=10
NOTIFY=root@localhost

# Run this nightly to detect an overgrown archive directory
BLOCKS=`$DISKUSE $ARCHDIR | awk '{print $1}'`
if [ $BLOCKS -gt $LIMIT ]; then
        echo $BLOCKS over $LIMIT in $ARCHDIR |\
        /usr/sbin/sendmail -F"DU Report by root" -f du-report $NOTIFY
fi

Here, in the full-name portion of the From: header, the delivered warning email message will include the notation "DU Report by root":

From: "DU Report by root" <du-report@your.domain>
    Previous Section Next Section