1# Copyright (c) 1983 Eric P. Allman 2# Copyright (c) 1988 The Regents of the University of California. 3# All rights reserved. 4# 5# %sccs.include.redist.sh% 6# 7# @(#)READ_ME 8.25 (Berkeley) 09/22/93 8# 9 10This directory contains the source files for sendmail. 11 12For detailed instructions, please read the document ../doc/op.me: 13 14 eqn ../doc/op.me | pic | ditroff -me 15 16The Makefile is for the new (4.4BSD) Berkeley make, available from 17ftp.uu.net in the directory /systems/unix/bsd-sources/usr.bin/make. 18(Paul Southworth <pauls@umich.edu> published a description of porting 19this make in comp.unix.bsd.) This Makefile has assumptions about the 204.4 file system layout built in. 21 22There is also a Makefile.dist which is much less clever, but works on 23the old traditional make. You can use this using: 24 25 make -f Makefile.dist 26 27There are a bunch of other Makefiles for other systems -- these are 28the ones that I use, they have "Berkeley quirks" in them, and I don't 29guarantee that they will work unmodified in your environment. However, 30they are all designed for the old make and can be used to help you get 31started. They have names like "Makefile.HPUX". Many of them include 32-I/usr/sww/include/db and -L/usr/sww/lib -- this is Berkeley's 33location for the new database libraries, described below. 34 35There is also a shell script (makesendmail) that tries to be clever 36about using object subdirectories. It's pretty straightforward, and 37may help if you share a source tree among different architectures. 38 39 40+----------------------+ 41| DATABASE DEFINITIONS | 42+----------------------+ 43 44There are several database formats that can be used for the alias files 45and for general maps. When used for alias files they interact in an 46attempt to be back compatible. 47 48The three options are NEWDB (the new Berkeley DB package), NDBM (the 49older DBM implementation -- the very old V7 implementation is no 50longer supported), and NIS (Network Information Services). Used alone 51these just include the support they indicate. [If you are using NEWDB, 52get the latest version from FTP.CS.Berkeley.EDU in /ucb/4bsd. DO NOT 53use the version from the Net2 distribution!] 54 55If NEWDB and NDBM are defined (but not NIS), then sendmail will read 56NDBM format alias files, but the next time a newaliases is run the 57format will be converted to NEWDB; that format will be used forever 58more. This is intended as a transition feature. [Note however that 59the NEWDB library also catches and maps NDBM calls; you will have to 60back out this feature to get this to work. See ``Quirks'' section 61below for details.] 62 63If all three are defined, sendmail operates as described above, and also 64looks for the file /var/yp/Makefile. If it exists, newaliases will 65build BOTH the NEWDB and NDBM format alias files. However, it will 66only use the NEWDB file; the NDBM format file is used only by the 67NIS subsystem. 68 69If NDBM and NIS are defined (regardless of the definition of NEWDB 70or the existance of /var/yp/Makefile), sendmail adds the special 71tokens "YP_LAST_MODIFIED" and "YP_MASTER_NAME", both of which are 72required if the NDBM file is to be used as an NIS map. 73 74All of -DNEWDB, -DNDBM, and -DNIS are normally defined in the DBMDEF 75line in the Makefile. 76 77 78+---------------+ 79| COMPILE FLAGS | 80+---------------+ 81 82Whereever possible, I try to make sendmail pull in the correct 83compilation options needed to compile on various environments based on 84automatically defined symbols. Some machines don't seem to have useful 85symbols availble, requiring the following compilation flags in the 86Makefile: 87 88SOLARIS Define this if you are running Solaris 2.0 or higher. 89NeXT Define this if you are on a NeXT box. (This one may 90 be pre-defined for you.) There are other hacks you 91 have to make -- see below. 92_AIX3 Define this if you are IBM AIX 3.x. 93RISCOS Define this if you are running RISC/os from MIPS. 94_SCO_unix_ Define this if you are on SCO UNIX. 95 96If you are a system that sendmail has already been ported to, you 97probably won't have to touch these. But if you are porting, you may 98have to tweak the following compilation flags in conf.h in order to 99get it to compile and link properly: 100 101SYSTEM5 Adjust for System V. 102SYS5SIGNALS Use System V signal semantics -- the signal handler 103 is automatically dropped when the signal is caught. 104 If this is not set, use POSIX/BSD semantics, where the 105 signal handler stays in force until an exec or an 106 explicit delete. Implied by SYSTEM5. 107HASFLOCK Set this if you prefer to use the flock(2) system call 108 rather than using fcntl-based locking. Fcntl locking 109 has some semantic gotchas, but many vendor systems 110 also interface it to lockd(8) to do NFS-style locking. 111 For this reason, this should not be set unless you 112 don't have an alternative. 113HASUNAME Set if you have the "uname" system call. Implied by 114 SYSTEM5. 115HASUNSETENV Define this if your system library has the "unsetenv" 116 subroutine. 117HASSTATFS Define this if you have the statfs(2) system call. It's 118 not a disaster to get this wrong -- but you do lose the 119 queue free space code. 120HASUSTAT Define this if you have the ustat(2) system call. It's 121 not a disaster to get this wrong -- but you do lose the 122 queue free space code. 123HASSETSID Define this if you have the setsid(2) system call. This 124 is implied if your system appears to be POSIX compliant. 125HASINITGROUPS Define this if you have the initgroups(3) routine. 126HASSETVBUF Define this if you have the setvbuf(3) library call. 127 If you don't, setlinebuf will be used instead. This 128 defaults on if your compiler defines __STDC__. 129HASSETREUID Define this if you have setreuid(2) ***AND*** root can 130 use setreuid to change to an arbitrary user. This second 131 condition is not satisfied on AIX 3.x. You may find that 132 your system has setresuid(2), (for example, on HP-UX) in 133 which case you will also have to #define setreuid(r, e) 134 to be the appropriate call. Some systems (such as Solaris) 135 have a compatibility routine that doesn't work properly. 136 The important thing is that you have a call that will set 137 the effective uid independently of the real or saved uid. 138 Setting this improves the security somewhat, since 139 sendmail doesn't have to read .forward and :include: files 140 as root. 141GIDSET_T The type of entries in a gidset passed as the second 142 argument to getgroups(2). Historically this has been an 143 int, so this is the default, but some systems (such as 144 IRIX) pass it as a gid_t, which is an unsigned short. 145 This will make a difference, so it is important to get 146 this right! However, it is only an issue if you have 147 group sets. 148SLEEP_T The type returned by the system sleep() function. 149 Defaults to "unsigned int". Don't worry about this 150 if you don't have compilation problems. 151ARBPTR_T The type of an arbitrary pointer -- defaults to "void *". 152 If you are an very old compiler you may need to define 153 this to be "char *". 154LA_TYPE The type of load average your kernel supports. These 155 can be LA_SUBR (4) if you have the getloadavg(3) routine, 156 LA_MACH (5) to use MACH-style load averages (calls 157 processor_set_info()), LA_FLOAT (3) if you read kmem and 158 interpret the value as a floating point number, LA_INT (2) 159 to interpret as a long integer, or LA_SHORT (6) to 160 interpret as a short integer. These last three have 161 several other parameters that they try to divine: the 162 name of your kernel, the name of the variable in the 163 kernel to examine, the number of bits of precision in 164 a fixed point load average, and so forth. In desparation, 165 use LA_ZERO (1) -- it always returns the load average as 166 "zero" (and does so on all architectures). The actual 167 code is in conf.c -- it can be tweaked if you are brave. 168ERRLIST_PREDEFINED 169 If set, assumes that some header file defines sys_errlist. 170 This may be needed if you get type conflicts on this 171 variable -- otherwise don't worry about it. 172WAITUNION The wait(2) routine takes a "union wait" argument instead 173 of an integer argument. This is for compatibility with 174 old versions of BSD. 175 176 177+-----------------------+ 178| COMPILE-TIME FEATURES | 179+-----------------------+ 180 181There are a bunch of features that you can decide to compile in, such 182as selecting various database packages and special protocol support. 183Several are assumed based on other compilation flags -- if you want to 184"un-assume" something, you probably need to edit conf.h. Compilation 185flags that add support for special features include: 186 187NDBM Include support for "new" DBM library for aliases and maps. 188 Normally defined in the Makefile. 189NEWDB Include support for Berkeley "db" package (hash & btree) 190 for aliases and maps. Normally defined in the Makefile. 191NIS Define this to get NIS (YP) support for aliases and maps. 192 Normally defined in the Makefile. 193USERDB Include support for the User Information Database. Implied 194 by NEWDB in conf.h. 195IDENTPROTO Define this to get IDENT (RFC 1413) protocol support. 196 This is assumed unless you are running on Ultrix or 197 HP-UX, both of which have a problem in the UDP 198 implementation. 199MIME Include support for MIME-encapsulated error messages. 200LOG Set this to get syslog(3) support. Defined by default 201 in conf.h. You want this if at all possible. 202NETINET Set this to get TCP/IP support. Defined by default 203 in conf.h. You probably want this. 204NETISO Define this to get ISO networking support. 205SMTP Define this to get the SMTP code. Implied by NETINET 206 or NETISO. 207NAMED_BIND Define this to get DNS (name daemon) support, including 208 MX support. The specs you must use this if you run 209 SMTP. Defined by default in conf.h. 210QUEUE Define this to get queueing code. Implied by NETINET 211 or NETISO; required by SMTP. This gives you other good 212 stuff -- it should be on. 213DAEMON Define this to get general network support. Implied by 214 NETINET or NETISO. Defined by default in conf.h. You 215 almost certainly want it on. 216MATCHGECOS Permit fuzzy matching of user names against the full 217 name (GECOS) field in the /etc/passwd file. This should 218 probably be on, since you can disable it from the config 219 file if you want to. Defined by default in conf.h. 220SETPROCTITLE Try to set the string printed by "ps" to something 221 informative about what sendmail is doing. Defined by 222 default in conf.h. 223 224 225+-------------------------------------+ 226| OPERATING SYSTEM AND COMPILE QUIRKS | 227+-------------------------------------+ 228 229SunOS 4.x (Solaris 1.x) 230 You may have to use -lresolv on SunOS. However, beware that 231 this links in a new version of gethostbyname that does not 232 understand NIS, so you must have all of your hosts in DNS. 233 234 There is substantial disagreement about whether you can make 235 this work with resolv+, which allows you to specify a search-path 236 of services. Some people report that it works fine, others 237 claim it doesn't work at all (including causing sendmail to 238 drop core when it tries to do multiple resolv+ lookups for a 239 single job). I haven't tried resolv+, as we use DNS exclusively. 240 241 Should you want to try resolv+, it is on ftp.uu.net in 242 /networking/ip/dns. 243 244Solaris 2.x (SunOS 5.x) 245 To compile for Solaris, be sure you use -DSOLARIS. 246 247 From a correspondent: 248 249 For solaris 2.2, I have 250 251 hosts: files dns 252 253 in /etc/nsswitch.conf and /etc/hosts has to have the fully 254 qualified host name. I think "files" has to be before "dns" 255 in /etc/nsswitch.conf during bootup. 256 257 To the best of my knowledge, Solaris does not have the 258 gethostbyname problem described above. 259 260 The Solaris "syslog" function is apparently limited to something 261 about 90 characters because of a kernel limitation. If you have 262 source code, you can probably up this number. Bill Wisner 263 <wisner@well.sf.ca.us> was able to get an unofficial, unsupported 264 patch. 265 266OSF/1 267 If you are compiling on OSF/1 (DEC Alpha), you must use -lmld. 268 269NeXT 270 If you are compiling on NeXT, you will have to create an empty 271 file "unistd.h" and create a file "dirent.h" containing: 272 273 #include <sys/dir.h> 274 #define dirent direct 275 276 (The Makefile.NeXT should try to do both of these for you.) 277 278 Apparently, there is a bug in getservbyname on Nextstep 3.0 279 that causes it to fail under some circumstances with the 280 message "SYSERR: service "smtp" unknown" logged. You should 281 be able to work around this by including the line: 282 283 OPort=25 284 285 in your .cf file. 286 287 You may have to use -DNeXT. 288 289BSDI (BSD/386) 290 I have reports that the "m4" from BSDI won't handle the config 291 files properly. I haven't had a chance to test this myself. 292 2934.3BSD 294 If you are running a "virgin" version of 4.3BSD, you'll have 295 a very old resolver and be missing some header files. The 296 header files are simple -- create empty versions and everything 297 will work fine. For the resolver you should really port a new 298 version (4.8.3 or later) of the resolver; 4.9 is available on 299 gatekeeper.DEC.COM in pub/BSD/bind/4.9. If you are really 300 determined to continue to use your old, buggy version (or as 301 a shortcut to get sendmail working -- I'm sure you have the 302 best intentions to port a modern version of BIND), you can 303 copy ../contrib/oldbind.compat.c into src and add 304 oldbind.compat.o to OBJADD in the Makefile. 305 306Linux 307 From: Karl London <karl@borg.demon.co.uk> 308 Subject: Little bit to add to a readme for Linux for 8.6 309 Date: Fri, 10 Sep 1993 20:16:05 +0100 (BST) 310 311 Below is a copy of a section of the /usr/include/unistd.h from 312 linux libc-4.4.1 which needs changing because of a bug in the 313 header files. Should be fixed for future releases.. 314 315 Karl 316 317 The #if 0 and #endif are new!! 318 319 ------- 320 321 If OPTS begins with `--', then non-option arguments 322 are treated as arguments to the option '\0'. 323 This behavior is specific to the GNU `getopt'. */ 324 #if 0 325 extern int getopt __P ((int __argc, char *__const * __argv, 326 __const char *__opts)); 327 #endif 328 extern int opterr; 329 extern int optind; 330 331Both NEWDB and NDBM 332 If you use both -DNDBM and -DNEWDB, you must delete the module 333 ndbm.o from libdb.a and delete the file "ndbm.h" from the files 334 that get installed (that is, use the OLD ndbm.h, not the new 335 ndbm.h). This compatibility module maps ndbm calls into DB 336 calls, and breaks things rather badly. 337 338GNU getopt 339 I'm told that GNU getopt has a problem in that it gets confused 340 by the double call. Use the version in conf.c instead. 341 342 343+-----------------------------+ 344| DESCRIPTION OF SOURCE FILES | 345+-----------------------------+ 346 347The following list describes the files in this directory: 348 349Makefile The makefile used here; this version only works with 350 the new Berkeley make. 351Makefile.dist A trimmed down version of the makefile that works with 352 the old make. 353READ_ME This file. 354TRACEFLAGS My own personal list of the trace flags -- not guaranteed 355 to be particularly up to date. 356alias.c Does name aliasing in all forms. 357arpadate.c A subroutine which creates ARPANET standard dates. 358clock.c Routines to implement real-time oriented functions 359 in sendmail -- e.g., timeouts. 360collect.c The routine that actually reads the mail into a temp 361 file. It also does a certain amount of parsing of 362 the header, etc. 363conf.c The configuration file. This contains information 364 that is presumed to be quite static and non- 365 controversial, or code compiled in for efficiency 366 reasons. Most of the configuration is in sendmail.cf. 367conf.h Configuration that must be known everywhere. 368convtime.c A routine to sanely process times. 369daemon.c Routines to implement daemon mode. This version is 370 specifically for Berkeley 4.1 IPC. 371deliver.c Routines to deliver mail. 372domain.c Routines that interface with DNS (the Domain Name 373 System). 374err.c Routines to print error messages. 375envelope.c Routines to manipulate the envelope structure. 376headers.c Routines to process message headers. 377macro.c The macro expander. This is used internally to 378 insert information from the configuration file. 379main.c The main routine to sendmail. This file also 380 contains some miscellaneous routines. 381map.c Support for database maps. 382mci.c Routines that handle mail connection information caching. 383parseaddr.c The routines which do address parsing. 384queue.c Routines to implement message queueing. 385readcf.c The routine that reads the configuration file and 386 translates it to internal form. 387recipient.c Routines that manipulate the recipient list. 388savemail.c Routines which save the letter on processing errors. 389sendmail.h Main header file for sendmail. 390srvrsmtp.c Routines to implement server SMTP. 391stab.c Routines to manage the symbol table. 392stats.c Routines to collect and post the statistics. 393sysexits.c List of error messages associated with error codes 394 in sysexits.h. 395trace.c The trace package. These routines allow setting and 396 testing of trace flags with a high granularity. 397udb.c The user database interface module. 398usersmtp.c Routines to implement user SMTP. 399util.c Some general purpose routines used by sendmail. 400version.c The version number and information about this 401 version of sendmail. Theoretically, this gets 402 modified on every change. 403 404Eric Allman 405 406(Version 8.25, last update 09/22/93 10:32:22) 407