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


Previous Section Next Section

20.7 Pitfalls

  • The F=f and F=r delivery agent flags are similar in their implementation but can differ in their result. Consider, for example, the SunOS 4.x version of /bin/mail. That program expects the -r command-line argument to specify the sender's name. Setting the F=r delivery agent flag correctly causes mail to be seen as being from the sender (-r sender), but mistakenly using the F=f delivery agent flag invokes /bin/mail with -f sender instead. This fails because the SunOS 4.x version of /bin/mail expects the -f command-line argument to mean that it should interactively read mail from the mailbox named sender.

  • The F=C delivery agent flag can cause problems when it is specified for delivery agents for which the @domain form of address is inappropriate. This delivery agent flag should be avoided for DECnet and the local delivery agents. Note that LMTP-aware local delivery agents that can handle domain addresses can use this delivery agent flag.

  • A common problem with SysV versions of /bin/mail is their annoying habit of prefixing a "From " line to the beginning of each message, even if one is already there. This confuses users because it makes their mail appear to come from uucp or daemon instead of the real sender. The problem stems from the fact that the SysV /bin/mail lacks a -r command-line argument (or its equivalent) to indicate who the sender is. Instead, that program assumes that the sender's identity can be taken from the identity of the person who ran the program. This works correctly with local mail; but when mail comes in from the outside world, /bin/mail is being run by root, daemon, or uucp. The best fix is to get a newer /bin/mail[23] from one of the many anonymous FTP sites. A less satisfactory fix is to delete the F=n delivery agent flag from the appropriate (usually local) delivery agent. This leaves two "From " lines, the second prefixed with a > character (the correct line).

    [23] The BSD /bin/mail requires considerable hacking to get it to work on a SysV machine. Alternatives are deliver, the mh suite's slocal, and mail.local, the latter which is supplied with the sendmail source distribution.

  • Never use either the F=f or F=r delivery agent flags with the prog delivery agent. That delivery agent usually runs programs by evoking the Bourne shell, which misinterprets both delivery agent flags. The -f command-line argument tells /bin/sh to disable filename generation. The -r command-line argument is unknown to /bin/sh. Both command-line arguments produce the wrong result.

    Previous Section Next Section