135062Sbostic# Copyright (c) 1983 Eric P. Allman 248582Sbostic# Copyright (c) 1988 The Regents of the University of California. 333728Sbostic# All rights reserved. 433728Sbostic# 548582Sbostic# %sccs.include.redist.sh% 633728Sbostic# 7*64755Seric# @(#)READ_ME 8.30 (Berkeley) 10/24/93 833728Sbostic# 948582Sbostic 109881SericThis directory contains the source files for sendmail. 115369Seric 1260565SericFor detailed instructions, please read the document ../doc/op.me: 135369Seric 1460565Seric eqn ../doc/op.me | pic | ditroff -me 155369Seric 1664262SericThe Makefile is for the new (4.4BSD) Berkeley make, available from 1764262Sericftp.uu.net in the directory /systems/unix/bsd-sources/usr.bin/make. 1864501Seric(Paul Southworth <pauls@umich.edu> published a description of porting 1964501Sericthis make in comp.unix.bsd.) This Makefile has assumptions about the 2064501Seric4.4 file system layout built in. 2157418Seric 2264501SericThere is also a Makefile.dist which is much less clever, but works on 2364501Sericthe old traditional make. You can use this using: 2464501Seric 2557418Seric make -f Makefile.dist 2657418Seric 2764262SericThere are a bunch of other Makefiles for other systems -- these are 2860584Sericthe ones that I use, they have "Berkeley quirks" in them, and I don't 2964262Sericguarantee that they will work unmodified in your environment. However, 3064262Sericthey are all designed for the old make and can be used to help you get 3164262Sericstarted. They have names like "Makefile.HPUX". Many of them include 3264262Seric-I/usr/sww/include/db and -L/usr/sww/lib -- this is Berkeley's 3364262Sericlocation for the new database libraries, described below. 3457943Seric 3564272SericThere is also a shell script (makesendmail) that tries to be clever 3664272Sericabout using object subdirectories. It's pretty straightforward, and 3764272Sericmay help if you share a source tree among different architectures. 3864035Seric 3964701SericIMPORTANT: DO NOT USE OPTIMIZATION (``-O'') IF YOU ARE RUNNING GCC 4064701Seric2.4.x. THERE IS A BUG IN THE GCC OPTIMIZER THAT CAUSES SENDMAIL TO 4164701SericFAIL MISERABLY. 4264272Seric 4364718SericIMPORTANT: Read the appropriate paragraphs in the section on 4464718Seric``Operating System and Compile Quirks''. 4564701Seric 4664718Seric 4764250Seric+----------------------+ 4864250Seric| DATABASE DEFINITIONS | 4964250Seric+----------------------+ 5064250Seric 5164250SericThere are several database formats that can be used for the alias files 5264250Sericand for general maps. When used for alias files they interact in an 5364250Sericattempt to be back compatible. 5464250Seric 5564250SericThe three options are NEWDB (the new Berkeley DB package), NDBM (the 5664250Sericolder DBM implementation -- the very old V7 implementation is no 5764250Sericlonger supported), and NIS (Network Information Services). Used alone 5864376Sericthese just include the support they indicate. [If you are using NEWDB, 5964376Sericget the latest version from FTP.CS.Berkeley.EDU in /ucb/4bsd. DO NOT 6064376Sericuse the version from the Net2 distribution!] 6164250Seric 6264250SericIf NEWDB and NDBM are defined (but not NIS), then sendmail will read 6364250SericNDBM format alias files, but the next time a newaliases is run the 6464250Sericformat will be converted to NEWDB; that format will be used forever 6564250Sericmore. This is intended as a transition feature. [Note however that 6664250Sericthe NEWDB library also catches and maps NDBM calls; you will have to 6764250Sericback out this feature to get this to work. See ``Quirks'' section 6864250Sericbelow for details.] 6964250Seric 7064250SericIf all three are defined, sendmail operates as described above, and also 7164250Sericlooks for the file /var/yp/Makefile. If it exists, newaliases will 7264250Sericbuild BOTH the NEWDB and NDBM format alias files. However, it will 7364250Sericonly use the NEWDB file; the NDBM format file is used only by the 7464250SericNIS subsystem. 7564250Seric 7664250SericIf NDBM and NIS are defined (regardless of the definition of NEWDB 7764250Sericor the existance of /var/yp/Makefile), sendmail adds the special 7864250Serictokens "YP_LAST_MODIFIED" and "YP_MASTER_NAME", both of which are 7964250Sericrequired if the NDBM file is to be used as an NIS map. 8064250Seric 8164250SericAll of -DNEWDB, -DNDBM, and -DNIS are normally defined in the DBMDEF 8264250Sericline in the Makefile. 8364250Seric 8464250Seric 8564035Seric+---------------+ 8664035Seric| COMPILE FLAGS | 8764035Seric+---------------+ 8864035Seric 8960565SericWhereever possible, I try to make sendmail pull in the correct 9060584Sericcompilation options needed to compile on various environments based on 9160584Sericautomatically defined symbols. Some machines don't seem to have useful 9260584Sericsymbols availble, requiring the following compilation flags in the 9360584SericMakefile: 9460565Seric 9560565SericSOLARIS Define this if you are running Solaris 2.0 or higher. 9664077SericNeXT Define this if you are on a NeXT box. (This one may 9764072Seric be pre-defined for you.) There are other hacks you 9864072Seric have to make -- see below. 9960565Seric_AIX3 Define this if you are IBM AIX 3.x. 10063965SericRISCOS Define this if you are running RISC/os from MIPS. 10164501Seric_SCO_unix_ Define this if you are on SCO UNIX. 10260565Seric 10360584SericIf you are a system that sendmail has already been ported to, you 10460584Sericprobably won't have to touch these. But if you are porting, you may 10563962Serichave to tweak the following compilation flags in conf.h in order to 10663962Sericget it to compile and link properly: 10760565Seric 10860565SericSYSTEM5 Adjust for System V. 10964035SericSYS5SIGNALS Use System V signal semantics -- the signal handler 11064035Seric is automatically dropped when the signal is caught. 11164035Seric If this is not set, use POSIX/BSD semantics, where the 11264035Seric signal handler stays in force until an exec or an 11364035Seric explicit delete. Implied by SYSTEM5. 11464706SericSYS5SETPGRP Use System V setpgrp() semantics. Implied by SYSTEM5. 11564035SericHASFLOCK Set this if you prefer to use the flock(2) system call 11664035Seric rather than using fcntl-based locking. Fcntl locking 11764035Seric has some semantic gotchas, but many vendor systems 11864035Seric also interface it to lockd(8) to do NFS-style locking. 11964035Seric For this reason, this should not be set unless you 12064035Seric don't have an alternative. 12160565SericHASUNAME Set if you have the "uname" system call. Implied by 12260565Seric SYSTEM5. 12363962SericHASUNSETENV Define this if your system library has the "unsetenv" 12463962Seric subroutine. 12560584SericHASSTATFS Define this if you have the statfs(2) system call. It's 12660584Seric not a disaster to get this wrong -- but you do lose the 12760584Seric queue free space code. 12860584SericHASUSTAT Define this if you have the ustat(2) system call. It's 12960584Seric not a disaster to get this wrong -- but you do lose the 13060584Seric queue free space code. 13160565SericHASSETSID Define this if you have the setsid(2) system call. This 13260565Seric is implied if your system appears to be POSIX compliant. 13360565SericHASINITGROUPS Define this if you have the initgroups(3) routine. 13463753SericHASSETVBUF Define this if you have the setvbuf(3) library call. 13563753Seric If you don't, setlinebuf will be used instead. This 13663753Seric defaults on if your compiler defines __STDC__. 13763902SericHASSETREUID Define this if you have setreuid(2) ***AND*** root can 13863902Seric use setreuid to change to an arbitrary user. This second 13963902Seric condition is not satisfied on AIX 3.x. You may find that 14063902Seric your system has setresuid(2), (for example, on HP-UX) in 14163902Seric which case you will also have to #define setreuid(r, e) 14263902Seric to be the appropriate call. Some systems (such as Solaris) 14363902Seric have a compatibility routine that doesn't work properly. 14463902Seric The important thing is that you have a call that will set 14563902Seric the effective uid independently of the real or saved uid. 14663902Seric Setting this improves the security somewhat, since 14763902Seric sendmail doesn't have to read .forward and :include: files 14863902Seric as root. 14963937SericGIDSET_T The type of entries in a gidset passed as the second 15063937Seric argument to getgroups(2). Historically this has been an 15163937Seric int, so this is the default, but some systems (such as 15263937Seric IRIX) pass it as a gid_t, which is an unsigned short. 15363937Seric This will make a difference, so it is important to get 15463937Seric this right! However, it is only an issue if you have 15563937Seric group sets. 15663968SericSLEEP_T The type returned by the system sleep() function. 15763968Seric Defaults to "unsigned int". Don't worry about this 15863968Seric if you don't have compilation problems. 15963974SericARBPTR_T The type of an arbitrary pointer -- defaults to "void *". 16063974Seric If you are an very old compiler you may need to define 16163974Seric this to be "char *". 16260584SericLA_TYPE The type of load average your kernel supports. These 16360584Seric can be LA_SUBR (4) if you have the getloadavg(3) routine, 16464376Seric LA_MACH (5) to use MACH-style load averages (calls 16564376Seric processor_set_info()), LA_FLOAT (3) if you read kmem and 16664376Seric interpret the value as a floating point number, LA_INT (2) 16764376Seric to interpret as a long integer, or LA_SHORT (6) to 16864376Seric interpret as a short integer. These last three have 16964376Seric several other parameters that they try to divine: the 17064376Seric name of your kernel, the name of the variable in the 17164376Seric kernel to examine, the number of bits of precision in 17264376Seric a fixed point load average, and so forth. In desparation, 17364376Seric use LA_ZERO (1) -- it always returns the load average as 17464376Seric "zero" (and does so on all architectures). The actual 17564376Seric code is in conf.c -- it can be tweaked if you are brave. 17663962SericERRLIST_PREDEFINED 17763962Seric If set, assumes that some header file defines sys_errlist. 17863962Seric This may be needed if you get type conflicts on this 17963962Seric variable -- otherwise don't worry about it. 18064562SericWAITUNION The wait(2) routine takes a "union wait" argument instead 18164562Seric of an integer argument. This is for compatibility with 18264562Seric old versions of BSD. 18360565Seric 18464035Seric 18564035Seric+-----------------------+ 18664035Seric| COMPILE-TIME FEATURES | 18764035Seric+-----------------------+ 18864035Seric 18960584SericThere are a bunch of features that you can decide to compile in, such 19060584Sericas selecting various database packages and special protocol support. 19160584SericSeveral are assumed based on other compilation flags -- if you want to 19260584Seric"un-assume" something, you probably need to edit conf.h. Compilation 19360584Sericflags that add support for special features include: 19460565Seric 19560565SericNDBM Include support for "new" DBM library for aliases and maps. 19664250Seric Normally defined in the Makefile. 19760565SericNEWDB Include support for Berkeley "db" package (hash & btree) 19864250Seric for aliases and maps. Normally defined in the Makefile. 19960565SericNIS Define this to get NIS (YP) support for aliases and maps. 20064250Seric Normally defined in the Makefile. 20160565SericUSERDB Include support for the User Information Database. Implied 20264250Seric by NEWDB in conf.h. 20360565SericIDENTPROTO Define this to get IDENT (RFC 1413) protocol support. 20460565Seric This is assumed unless you are running on Ultrix or 20560565Seric HP-UX, both of which have a problem in the UDP 20660565Seric implementation. 20760565SericMIME Include support for MIME-encapsulated error messages. 20860565SericLOG Set this to get syslog(3) support. Defined by default 20960584Seric in conf.h. You want this if at all possible. 21060565SericNETINET Set this to get TCP/IP support. Defined by default 21160584Seric in conf.h. You probably want this. 21260565SericNETISO Define this to get ISO networking support. 21360565SericSMTP Define this to get the SMTP code. Implied by NETINET 21460565Seric or NETISO. 21560565SericNAMED_BIND Define this to get DNS (name daemon) support, including 21660565Seric MX support. The specs you must use this if you run 21760565Seric SMTP. Defined by default in conf.h. 21860565SericQUEUE Define this to get queueing code. Implied by NETINET 21960584Seric or NETISO; required by SMTP. This gives you other good 22060584Seric stuff -- it should be on. 22160565SericDAEMON Define this to get general network support. Implied by 22260584Seric NETINET or NETISO. Defined by default in conf.h. You 22360584Seric almost certainly want it on. 22460565SericMATCHGECOS Permit fuzzy matching of user names against the full 22560565Seric name (GECOS) field in the /etc/passwd file. This should 22660565Seric probably be on, since you can disable it from the config 22760584Seric file if you want to. Defined by default in conf.h. 22860565SericSETPROCTITLE Try to set the string printed by "ps" to something 22960584Seric informative about what sendmail is doing. Defined by 23060584Seric default in conf.h. 23160565Seric 23264035Seric 23364035Seric+-------------------------------------+ 23464035Seric| OPERATING SYSTEM AND COMPILE QUIRKS | 23564035Seric+-------------------------------------+ 23664035Seric 23764376SericSunOS 4.x (Solaris 1.x) 23864376Seric You may have to use -lresolv on SunOS. However, beware that 23964376Seric this links in a new version of gethostbyname that does not 24064376Seric understand NIS, so you must have all of your hosts in DNS. 24164035Seric 24264400Seric There is substantial disagreement about whether you can make 24364400Seric this work with resolv+, which allows you to specify a search-path 24464400Seric of services. Some people report that it works fine, others 24564400Seric claim it doesn't work at all (including causing sendmail to 24664400Seric drop core when it tries to do multiple resolv+ lookups for a 24764400Seric single job). I haven't tried resolv+, as we use DNS exclusively. 24864400Seric 24964400Seric Should you want to try resolv+, it is on ftp.uu.net in 25064400Seric /networking/ip/dns. 25164400Seric 25264376SericSolaris 2.x (SunOS 5.x) 25364376Seric To compile for Solaris, be sure you use -DSOLARIS. 25464376Seric 25564364Seric From a correspondent: 25664364Seric 25764364Seric For solaris 2.2, I have 25864364Seric 25964364Seric hosts: files dns 26064364Seric 26164364Seric in /etc/nsswitch.conf and /etc/hosts has to have the fully 26264364Seric qualified host name. I think "files" has to be before "dns" 26364364Seric in /etc/nsswitch.conf during bootup. 26464364Seric 26564376Seric To the best of my knowledge, Solaris does not have the 26664376Seric gethostbyname problem described above. 26764376Seric 26864385Seric The Solaris "syslog" function is apparently limited to something 26964385Seric about 90 characters because of a kernel limitation. If you have 27064385Seric source code, you can probably up this number. Bill Wisner 27164385Seric <wisner@well.sf.ca.us> was able to get an unofficial, unsupported 27264385Seric patch. 27364385Seric 27464250SericOSF/1 275*64755Seric If you are compiling on OSF/1 (DEC Alpha), you must use -lmld 276*64755Seric and -non_shared (otherwise it core dumps on startup). Also, 277*64755Seric the enclosed makefile removed /usr/sbin/smtpd; if you need it, 278*64755Seric just create the link to the sendmail binary. 27957977Seric 28064250SericNeXT 28164250Seric If you are compiling on NeXT, you will have to create an empty 28264250Seric file "unistd.h" and create a file "dirent.h" containing: 28363753Seric 28464250Seric #include <sys/dir.h> 28564250Seric #define dirent direct 28664035Seric 28764250Seric (The Makefile.NeXT should try to do both of these for you.) 28864077Seric 28964364Seric Apparently, there is a bug in getservbyname on Nextstep 3.0 29064364Seric that causes it to fail under some circumstances with the 29164364Seric message "SYSERR: service "smtp" unknown" logged. You should 29264364Seric be able to work around this by including the line: 29364364Seric 29464670Seric OOPort=25 29564364Seric 29664364Seric in your .cf file. 29764364Seric 29864376Seric You may have to use -DNeXT. 29964376Seric 30064250SericBSDI (BSD/386) 30164250Seric I have reports that the "m4" from BSDI won't handle the config 30264250Seric files properly. I haven't had a chance to test this myself. 30357943Seric 30464364Seric4.3BSD 30564364Seric If you are running a "virgin" version of 4.3BSD, you'll have 30664364Seric a very old resolver and be missing some header files. The 30764364Seric header files are simple -- create empty versions and everything 30864364Seric will work fine. For the resolver you should really port a new 30964364Seric version (4.8.3 or later) of the resolver; 4.9 is available on 31064364Seric gatekeeper.DEC.COM in pub/BSD/bind/4.9. If you are really 31164364Seric determined to continue to use your old, buggy version (or as 31264364Seric a shortcut to get sendmail working -- I'm sure you have the 31364364Seric best intentions to port a modern version of BIND), you can 31464364Seric copy ../contrib/oldbind.compat.c into src and add 31564364Seric oldbind.compat.o to OBJADD in the Makefile. 31664364Seric 31764501SericLinux 31864501Seric From: Karl London <karl@borg.demon.co.uk> 31964501Seric Subject: Little bit to add to a readme for Linux for 8.6 32064501Seric Date: Fri, 10 Sep 1993 20:16:05 +0100 (BST) 32164501Seric 32264501Seric Below is a copy of a section of the /usr/include/unistd.h from 32364501Seric linux libc-4.4.1 which needs changing because of a bug in the 32464501Seric header files. Should be fixed for future releases.. 32564501Seric 32664501Seric Karl 32764501Seric 32864501Seric The #if 0 and #endif are new!! 32964501Seric 33064501Seric ------- 33164501Seric 33264501Seric If OPTS begins with `--', then non-option arguments 33364501Seric are treated as arguments to the option '\0'. 33464501Seric This behavior is specific to the GNU `getopt'. */ 33564501Seric #if 0 33664501Seric extern int getopt __P ((int __argc, char *__const * __argv, 33764501Seric __const char *__opts)); 33864501Seric #endif 33964501Seric extern int opterr; 34064501Seric extern int optind; 34164501Seric 34264718SericA/UX 34364718Seric Date: Tue, 12 Oct 1993 18:28:28 -0400 (EDT) 34464718Seric From: "Eric C. Hagberg" <hagberg@med.cornell.edu> 34564718Seric Subject: Fix for A/UX ndbm 34664718Seric 34764718Seric I guess this isn't really a sendmail bug, however, it is something 34864718Seric that A/UX users should be aware of when compiling sendmail 8.6. 34964718Seric 35064718Seric Apparently, the calls that sendmail is using to the ndbm routines 35164718Seric in A/UX 3.0.x contain calls to "broken" routines, in that the 35264718Seric aliases database will break when it gets "just a little big" 35364718Seric (sorry I don't have exact numbers here, but it broke somewhere 35464718Seric around 20-25 aliases for me.), making all aliases non-functional 35564718Seric after exceeding this point. 35664718Seric 35764718Seric What I did was to get the gnu-dbm-1.6 package, compile it, and 35864718Seric then re-compile sendmail with "-lgdbm", "-DNDBM", and using the 35964718Seric ndbm.h header file that comes with the gnu-package. This makes 36064718Seric things behave properly. 36164718Seric 36264718Seric I suppose porting the New Berkeley db package is another route, 36364718Seric however, I made a quick attempt at it, and found it difficult 36464718Seric (not easy at least); the gnu-dbm package "configured" and 36564718Seric compiled easily. 36664718Seric 36764718SericDG/UX 36864718Seric Apparently, /bin/mail doesn't work properly for delivery on 36964718Seric DG/UX -- the person who has this working, Douglas Anderson 37064718Seric <dlander@afterlife.ncsc.mil>, used procmail instead. 37164718Seric 37264718SericNon-DNS based sites 37364718Seric This version of sendmail always tries to connect to the Domain 37464718Seric Name System (DNS) to resolve names, regardless of the setting 37564718Seric of the `I' option. On most systems that are not running DNS, 37664718Seric this will fail quickly and sendmail will continue, but on some 37764718Seric systems it has a long timeout. If you have this problem, you 37864718Seric will have to recompile without NAMED_BIND. Some people have 37964718Seric claimed that they have successfully used "OI+USEVC" to force 38064718Seric sendmail to use a virtual circuit -- this will always time out 38164718Seric quickly, but also tells sendmail that a failed connection 38264718Seric should requeue the message (probably not what you intended). 38364718Seric A future release of sendmail will correct this problem. 38464718Seric 38564250SericBoth NEWDB and NDBM 38664250Seric If you use both -DNDBM and -DNEWDB, you must delete the module 38764250Seric ndbm.o from libdb.a and delete the file "ndbm.h" from the files 38864250Seric that get installed (that is, use the OLD ndbm.h, not the new 38964250Seric ndbm.h). This compatibility module maps ndbm calls into DB 39064250Seric calls, and breaks things rather badly. 39158709Seric 39264559SericGNU getopt 39364559Seric I'm told that GNU getopt has a problem in that it gets confused 39464559Seric by the double call. Use the version in conf.c instead. 39564250Seric 39664559Seric 39764035Seric+-----------------------------+ 39864035Seric| DESCRIPTION OF SOURCE FILES | 39964035Seric+-----------------------------+ 40064035Seric 4019881SericThe following list describes the files in this directory: 4025369Seric 40357418SericMakefile The makefile used here; this version only works with 40457418Seric the new Berkeley make. 40557418SericMakefile.dist A trimmed down version of the makefile that works with 40657418Seric the old make. 4075369SericREAD_ME This file. 40860565SericTRACEFLAGS My own personal list of the trace flags -- not guaranteed 40960565Seric to be particularly up to date. 4105369Sericalias.c Does name aliasing in all forms. 4119881Sericarpadate.c A subroutine which creates ARPANET standard dates. 4129881Sericclock.c Routines to implement real-time oriented functions 4139881Seric in sendmail -- e.g., timeouts. 4145369Sericcollect.c The routine that actually reads the mail into a temp 4155369Seric file. It also does a certain amount of parsing of 4165369Seric the header, etc. 4175369Sericconf.c The configuration file. This contains information 4185369Seric that is presumed to be quite static and non- 4195369Seric controversial, or code compiled in for efficiency 4205369Seric reasons. Most of the configuration is in sendmail.cf. 4219881Sericconf.h Configuration that must be known everywhere. 4225369Sericconvtime.c A routine to sanely process times. 4239881Sericdaemon.c Routines to implement daemon mode. This version is 4249881Seric specifically for Berkeley 4.1 IPC. 4255369Sericdeliver.c Routines to deliver mail. 42660565Sericdomain.c Routines that interface with DNS (the Domain Name 42760565Seric System). 4285369Sericerr.c Routines to print error messages. 4299881Sericenvelope.c Routines to manipulate the envelope structure. 4305369Sericheaders.c Routines to process message headers. 4315369Sericmacro.c The macro expander. This is used internally to 4325369Seric insert information from the configuration file. 4335369Sericmain.c The main routine to sendmail. This file also 4345369Seric contains some miscellaneous routines. 43560565Sericmap.c Support for database maps. 43660565Sericmci.c Routines that handle mail connection information caching. 4379881Sericparseaddr.c The routines which do address parsing. 4385369Sericqueue.c Routines to implement message queueing. 4395369Sericreadcf.c The routine that reads the configuration file and 4405369Seric translates it to internal form. 4419881Sericrecipient.c Routines that manipulate the recipient list. 4425369Sericsavemail.c Routines which save the letter on processing errors. 4435369Sericsendmail.h Main header file for sendmail. 4445369Sericsrvrsmtp.c Routines to implement server SMTP. 4455369Sericstab.c Routines to manage the symbol table. 4465369Sericstats.c Routines to collect and post the statistics. 4475369Sericsysexits.c List of error messages associated with error codes 4485369Seric in sysexits.h. 4499881Serictrace.c The trace package. These routines allow setting and 4509881Seric testing of trace flags with a high granularity. 45160565Sericudb.c The user database interface module. 4525369Sericusersmtp.c Routines to implement user SMTP. 4535369Sericutil.c Some general purpose routines used by sendmail. 45460565Sericversion.c The version number and information about this 45560565Seric version of sendmail. Theoretically, this gets 45660565Seric modified on every change. 4575369Seric 4585369SericEric Allman 4595369Seric 460*64755Seric(Version 8.30, last update 10/24/93 10:39:19) 461