Appendix E. A sendmail ReferenceThis appendix provides details of the syntax of the sendmail command, of the sendmail.cf file, and of the m4 macros that can be used to build that file. It describes where to obtain the latest source code for sendmail and how to compile it. This appendix is a reference, not a tutorial. Refer to Chapter 10, "sendmail " for a tutorial on sendmail configuration. We start the appendix with information on locating, downloading, and compiling the latest version of sendmail. E.1. Compiling sendmailThe source code for sendmail is available via anonymous FTP from ftp.sendmail.org, where it is stored in the pub/sendmail directory. sendmail is updated constantly. The following examples are based on sendmail 8.11.3. Remember that things will change for future releases. Always read the README files and installation documents that come with new software before beginning an installation. To compile the sendmail program, download the compressed tar file as a binary file, and then uncompress and extract it with the tar command, shown below: $ ftp ftp.sendmail.org Connected to ftp.sendmail.org. 220 pub2.pa.vix.com FTP server ready. Name (ftp.sendmail.org:craig): anonymous 331 Guest login ok, send your e-mail address as password. Password: 230 Guest login ok, access restrictions apply. Remote system type is UNIX. Using binary mode to transfer files. ftp> cd pub/sendmail ftp> get sendmail.8.11.3.tar.gz local: sendmail.8.11.3.tar.gz remote: sendmail.8.11.3.tar.gz 200 PORT command successful. 150 Opening BINARY mode data connection for sendmail.8.11.3.tar.gz (1347756 bytes). 226 Transfer complete. 1347756 bytes received in 18.68 Seconds (72.42 Kbytes/sec) ftp> quit 221-You have transferred 1347756 bytes in 1 files. 221-Thank you for using the FTP service on pub2.pa.vix.com. 221 Goodbye. $ cd /usr/local/src $ tar -zxvf /home/craig/sendmail.8.11.3.tar.gz Next, change to the sendmail-8.11.3 directory created by the tar file, and use the Build script to compile the new sendmail program, as shown below: $ cd sendmail-8.11.3 $ ./Build aking all in: /usr/local/src/sendmail-8.11.3/libsmutil Configuration: pfx=, os=Linux, rel=2.2.10, rbase=2, rroot=2.2, arch=i586, sfx=, variant=optimized Using M4=/usr/bin/m4 Creating ../obj.Linux.2.2.10.i586/libsmutil using ../devtools/OS/Linux aking dependencies in ../obj.Linux.2.2.10.i586/libsmutil make[1]: Entering directory `/usr/local/src/sendmail-8.11.3/obj.Linux.2.2.10.i586/libsmutil' cc -M -I. -I../../sendmail -I../../include -DNEWDB -DNOT_SENDMAIL debug.c errstring.c lockfile.c safefile.c snprintf.c strl.c >> Makefile make[1]: Leaving directory `/usr/local/src/sendmail-8.11.3/obj.Linux.2.2.10.i586/libsmutil' aking in ../obj.Linux.2.2.10.i586/libsmutil make[1]: Entering directory `/usr/local/src/sendmail-8.11.3/obj.Linux.2.2.10.i586/libsmutil' cc -O -I. -I../../sendmail -I../../include -DNEWDB -DNOT_SENDMAIL -c debug.c -o debug.o cc -O -I. -I../../sendmail -I../../include -DNEWDB -DNOT_SENDMAIL -c errstring.c -o errstring.o ... Many, many, many lines deleted... cc -O -I. -I../../sendmail -I../../include -DNEWDB -DNOT_SENDMAIL -c vacation.c -o vacation.o cc -o vacation vacation.o ../libsmdb/libsmdb.a ../libsmutil/libsmutil.a -ldb -lresolv -lcrypt -lnsl -ldl groff -Tascii -man vacation.1 > vacation.0 || cp vacation.0.dist vacation.0 make[1]: Leaving directory `/usr/local/src/sendmail-8.11.3/obj.Linux.2.2.10.i586/vacation' Build detects the architecture of the system and builds the correct Makefile for your system. It then compiles sendmail using the newly created Makefile. According to the documentation, running Build is all you need to do on most systems to compile sendmail. It works on Red Hat Linux and Solaris 8 systems. However, there are no guarantees. Your system may use nonstandard directories or lack certain libraries. You may need to provide compiler flags that are customized for your system. If you have experience with compiling sendmail, you may be tempted to look for the compiler options in the Makefile in the sendmail distribution's source code directory. You may even remember setting compiler options in the Makefile at some time in the past, but that has changed. Now, compiler options are set in the files located in the devtools directory of the sendmail source code distribution. The default compiler options are normally set in an operating system-specific file in the devtools/OS directory and changed in files you create specially for your server in the devtools/Site directory. The files in the devtools/OS directory are identified by operating system name; for example, the configuration file for Solaris 8 is named SunOS5.8. If your Solaris 8 system varies from the norm, create your own file in devtools/Site named site.SunOS5.8.m4 that contains the corrected setting. Additionally, you can create a file named site.config.m4 in the devtools/Site directory if the compiler options you wish to set relate more to the peculiarities of your site than they do to corrections of operating system settings. Build looks for and uses files with either of these names. As the .m4 file extension in these filenames implies, the commands that are used to define compiler options are m4 macros, not simple compiler options. Table E-1 lists the m4 commands that are used with sendmail 8.11.3 to control the compile process. Table E-1. m4 compiler options
Once sendmail compiles, it is installed by using the Build command with the install option, as shown here: # ./Build install aking all in: /usr/local/src/sendmail-8.11.3/libsmutil Configuration: pfx=, os=Linux, rel=2.2.10, rbase=2, rroot=2.2, arch=i586, sfx=, variant=optimized aking in ../obj.Linux.2.2.10.i586/libsmutil make[1]: Entering directory `/usr/local/src/sendmail-8.11.3/obj.Linux.2.2.10.i586/libsmutil' ... Many, many, many lines deleted... aking in ../obj.Linux.2.2.10.i586/vacation make[1]: Entering directory `/usr/local/src/sendmail-8.11.3/obj.Linux.2.2.10.i586/vacation' install -c -o bin -g bin -m 555 vacation /usr/bin install -c -o bin -g bin -m 444 vacation.0 /usr/man/man1/vacation.1 make[1]: Leaving directory `/usr/local/src/sendmail-8.11.3/obj.Linux.2.2.10.i586/vacation' The Build command installs the manpages, the executables, the help file, and the status file in the correct directories for your system. sendmail is now ready to run. The next section describes the syntax of the sendmail command. Copyright © 2002 O'Reilly & Associates. All rights reserved. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|