1This directory contains the files for sendmail. On some 2installations it may also contain the source files for 3auxiliary mailers. 4 5INSTALLING SENDMAIL 6 7This is a non-trivial task -- please plan to take time to think 8about this process carefully. 9 10Creating a Makefile 11 12You may have to create a new makefile. There are only two 13basic types: for a v6 system & for a v7 system. All pathnames & 14system dependent stuff should be in conf.c. The makefile distributed 15is for our ARPAVAX site, and should work for you. You may want to 16change some of the compile flags as listed in the makefile; these 17control things like logging, hashed alias tables, and debugging 18info. We distribute makefile.m4 which can be turned into a makefile; 19it may be easier in the long run to modify this file. 20 21Creating a Configuration Table 22 23The configuration table describes the mail world to sendmail. This 24table is quite complex, but in general the table from Berkeley can 25be modified to work. We use an m4 file to specify configuration for 26multiple machines; the file whoami.m4 can probably be modified to 27set the correct parameters for cf.m4 to generate a sendmail.cf. 28 29Whoami.m4 defines or may define the following macros: 30 31WHOAMI From /usr/include/whoami, this drives the entire 32 configuration. 33BNHOST If defined, the name of this host on BerkNet. 34UNHOST If defined, the name of this host on UUCPnet. 35ANHOST If defined, the name of this host on ArpaNet. 36ENHOST If defined, the name of this host on EtherNet. 37m4_SCCS If defined, we have the SCCS files here. 38m4_VAX If defined, this is a VAX. 39m4_VFORK If defined, we should use the VFORK syscall. 40m4_DBMLIB If defined, we have the DBM version of the alias 41 file. 42 43You should really read sendmail.doc before trying anything with 44sendmail. You can run this off using: 45 nroff -me sendmail.doc 46Among other things, this describes how to build a configuration file. 47 48Creating Pseudo-Users. 49 50Sometimes (particularly in Arpa-land) mail comes from a person who 51doesn't really exist. Some mail will be returned to them from a 52pseudo-user named MAILER-DAEMON, which will of course be returned. 53But MAILER-DAEMON does not exist, so it is returned.... and you have 54a loop. To break this, every site should have the entry: 55 MAILER-DAEMON:root 56in their aliases file. 57 58Actual Installation 59 60You will have to do the following things as root: 61 62Put the new sysexits.h in /usr/include. This defines some other 63exit codes used by sendmail. This is not dangerous unless you 64have extended sysexits yourself. 65 66Create the following files: 67-rw-rw-rw- 1 root 5161 Jan 10 17:47 /usr/lib/aliases 68-rw-rw-rw- 1 root 4096 Jan 10 17:47 /usr/lib/aliases.dir 69-rw-rw-rw- 1 root 37888 Jan 10 17:47 /usr/lib/aliases.pag 70drwxr-xr-x 2 eric 64 Nov 8 12:56 /usr/lib/mailers 71-rwxr-xr-x 1 eric 63162 Jan 5 10:01 /usr/lib/sendmail 72-rw-r--r-- 1 eric 3484 Jan 1 18:42 /usr/lib/sendmail.cf 73-rw-r--r-- 1 eric 708 Nov 7 15:34 /usr/lib/sendmail.hf 74-rw-rw-rw- 1 eric 168 Jan 10 19:11 /usr/lib/sendmail.st 75drwxrwxrwx 2 eric 176 Jan 10 19:11 /usr/spool/mqueue 76 77/usr/spool/mqueue may be some less permissive mode if sendmail 78runs setuid to the owner (root is recommended, as sendmail will 79then do certain file ownerships correctly). Likewise, the 80alias files need not be mode 666 unless you want users to be 81able to update the alias file directly. /usr/lib/sendmail.st 82stores statistics and may be safely removed. 83 84DESCRIPTION OF FILES 85 86AUX A directory of "other stuff" (which may or may 87 not be interesting). This stuff is UNSUPPORTED 88 and given only for examples sake. Many of these 89 programs have not run in some time and may not 90 even have reasonable sendmail calling conventions. 91AUX/arpa.c An old (v6 NCP) queueing program, formerly called 92 by sendmail on an ARPANET gateway. 93AUX/mail-dm.c An old (v6 NCP) incoming FTP mail server module, 94 which called sendmail one time long ago. 95FILES A list of "interesting" files. 96READ_ME This file. 97TODO New features to be put in (maybe) at some time. 98Version.c The version number and information about this 99 version of sendmail. Theoretically, this gets 100 modified on every change. 101alias.c Does name aliasing in all forms. 102aliases.5 Documentation for the alias file used by sendmail. 103arpadate.c A subroutine used by sendmail & AUX/arpa.c which 104 creates ARPANET standard dates. 105asm.sed A script to post-process the assembly language 106 output from the C compiler; this implements some 107 efficiency hacks. 108bmove.c A core-to-core move. This is in a separate file 109 because it can easily be replaced by a blindingly 110 efficient version on Vaxes. 111cf.m4 The m4 version of sendmail.cf. This may be somewhat 112 inscrutable. 113collect.c The routine that actually reads the mail into a temp 114 file. It also does a certain amount of parsing of 115 the header, etc. 116conf.c The configuration file. This contains information 117 that is presumed to be quite static and non- 118 controversial, or code compiled in for efficiency 119 reasons. Most of the configuration is in sendmail.cf. 120convtime.c A routine to sanely process times. 121daemon.c Routines to implement daemon mode. 122deliver.c Routines to deliver mail. 123err.c Routines to print error messages. 124headers.c Routines to process message headers. 125macro.c The macro expander. This is used internally to 126 insert information from the configuration file. 127macros.m4 Macros used by M4 when doing .cf configuration at 128 Berkeley. 129mailstats.c A program to print out the mail statistics. 130main.c The main routine to sendmail. This file also 131 contains some miscellaneous routines. 132makefile The makefile used here; this is created from 133 makefile.m4. 134makefile.m4 A makefile template. 135matchhdr.c A routine used by arpa.c to perform a match on 136 ARPANET format header items. 137parse.c The routines which do address parsing. 138praliases.c A debugging routine to print out the DBM version of 139 the alias file. 140queue.c Routines to implement message queueing. 141readcf.c The routine that reads the configuration file and 142 translates it to internal form. 143rmail.c A program to replace /bin/rmail that reads those 144 ugly UUCP header lines and replaces them by a real 145 From line with a real address. 146savemail.c Routines which save the letter on processing errors. 147sendmail.8 Documentation for sendmail. 148sendmail.cf A sample configuration file. 149sendmail.doc A large paper on sendmail. 150sendmail.h Main header file for sendmail. 151sendmail.hf The help file. This is used by the SMTP HELP command. 152sendto.c Routines to do address queueing. 153spell.good A list of words that spell chokes on for sendmail.doc 154 but which are still ok. 155srvrsmtp.c Routines to implement server SMTP. 156stab.c Routines to manage the symbol table. 157stats.c Routines to collect and post the statistics. 158sysexits.c List of error messages associated with error codes 159 in sysexits.h. 160sysexits.h List of exit statuses that could someday become a 161 standard. In any case, they are what sendmail & 162 a handful of other programs use. 163useful.h A header file containing a few things that appear to 164 be useful for even the most various programs. 165userdbm.h A header file for the -ldbm stuff. This should be 166 in /usr/include. 167usersmtp.c Routines to implement user SMTP. 168util.c Some general purpose routines used by sendmail. 169vacation.1 Documentation for the vacation program. 170vacation.c A program that lets you automatically send a message 171 to people saying "I am on vacation." 172version.c A master file for Version.c -- it may not exist in 173 your distribution. 174whoami.m4 An m4 file describing who we are. This is driven by 175 the file /usr/include/whoami, which should contain a 176 single word giving your system name. 177 178CHANGES TO OTHER PROGRAMS 179 180You will have to change your equivalent of /bin/mail to take a 181"-d" flag. If this flag is not asserted, /bin/mail should just 182turn itself into /usr/lib/sendmail (this is probably in a routine 183called "bulkmail" or "sendmail"). The code looks like something 184like: 185 186# ifdef SENDMAIL 187 {search argv for a -d flag} 188 if (!dflag) 189 { 190 argv[0] = "-sendmail"; 191 argv[argc] = 0; 192 execv(SENDMAIL, argv); 193 perror(SENDMAIL); 194 } 195 {ignore -d flag in further processing} 196# endif 197 198This is actually somewhat oversimplified. See the example mailers 199for something more realistic. Besides the mailers in this directory, 200see ../berknet/v6mail.c. 201 202Argv[0] should begin with a "-" to indicate that it is being called 203from /bin/mail. [This is currently unused, but I have tentative 204plans... isn't it easier to do it now?] 205 206If you are running server FTP on arpanet, you will have to change 207the incoming mail routine to accept mail for any address (rather than 208checking to see that the user exists). Instead of writing the 209mail in some non-standard mailbox, pipe the mail to /usr/lib/sendmail 210instead (include the -a flag). Sendmail will give the "350 Enter 211Mail" message, etc. Our "mail-dm.c" is given as an example. 212 213MISCELLANEOUS 214 215This version of sendmail can really truly run as root if you want 216it to. It does some neat stuff if you do, but it is not necessary. 217 218 219Eric Allman 220 221(Version 3.2, last update 06/17/82 10:43:01) 222