diff options
37 files changed, 526 insertions, 291 deletions
diff --git a/contrib/sendmail/KNOWNBUGS b/contrib/sendmail/KNOWNBUGS index 0a83bb0..85409a0 100644 --- a/contrib/sendmail/KNOWNBUGS +++ b/contrib/sendmail/KNOWNBUGS @@ -149,5 +149,37 @@ This list is not guaranteed to be complete. long for ruleset parsing. This can have an adverse effect on the relay_based_on_MX feature. - -(Version 8.34, last updated 12/17/1998) +* Saving to ~sender/dead.letter fails if su'ed to root + + If ErrorMode is set to print and an error in sending mail occurs, + the normal action is to print a message to the screen and append + the message to a dead.letter file in the sender's home directory. + In the case where the sender is using su to act as root, the file + safety checks prevent sendmail from saving the dead.letter file + because the sender's uid and the current real uid do not match. + +* Berkeley DB 2.X race condition with fcntl() locking + + There is a race condition for Berkeley DB 2.X databases on + operating systems which use fcntl() style locking, such as + Solaris. Sendmail locks the map before calling db_open() to + prevent others from modifying the map while it is being opened. + Unfortunately, Berkeley DB opens the map, closes it, and then + reopens it. fcntl() locking drops the lock when any file + descriptor pointing to the file is closed, even if it is a + different file descriptor than the one used to initially lock + the file. As a result there is a possibility that entries in a + map might not be found during a map rebuild. As a workaround, + you can use makemap to build a map with a new name and then + "mv" the new db file to replace the old one. + +* File open timeouts not available on hard mounted NFS file systems + + Since SIGALRM does not interrupt an RPC call for hard mounted + NFS file systems, it is impossible to implement a timeout on a file + open operation. Therefore, while the NFS server is not responding, + attempts to open a file on that server will hang. Systems with + local mail delivery and NFS hard mounted home directories should be + avoided, as attempts to open the forward files could hang. + +(Version 8.36, last updated 2/4/1999) diff --git a/contrib/sendmail/README b/contrib/sendmail/README index eff3fb2..c7ff734 100644 --- a/contrib/sendmail/README +++ b/contrib/sendmail/README @@ -1,5 +1,5 @@ /*- - * @(#)README 8.50 (Berkeley) 12/17/1998 + * @(#)README 8.51 (Berkeley) 1/25/1999 */ SENDMAIL RELEASE 8 @@ -343,6 +343,17 @@ one of those sites. Versions are available for several different systems, including Apollo, BSD, NeXT, AIX, TOPS20, and VMS. ++-------------------------+ +| INTEROPERATION PROBLEMS | ++-------------------------+ + +Microsoft Exchange Server 5.0 + We have had a report that ``about 7% of messages from Sendmail + to Exchange were not being delivered with status messages of + "connection reset" and "I/O error".'' Upgrading Exchange from + Version 5.0 to Version 5.5 Service Pack 2 solved this problem. + + +---------------------+ | DIRECTORY STRUCTURE | +---------------------+ diff --git a/contrib/sendmail/RELEASE_NOTES b/contrib/sendmail/RELEASE_NOTES index a8d299a..e50c3b5 100644 --- a/contrib/sendmail/RELEASE_NOTES +++ b/contrib/sendmail/RELEASE_NOTES @@ -1,11 +1,97 @@ SENDMAIL RELEASE NOTES - @(#)RELEASE_NOTES 8.9.2.4 (Berkeley) 12/29/1998 + @(#)RELEASE_NOTES 8.9.3.1 (Berkeley) 2/4/1999 This listing shows the version of the sendmail binary, the version of the sendmail configuration files, the date of release, and a summary of the changes in that release. +8.9.3/8.9.3 99/02/04 + SECURITY: Limit message headers to a maximum of 32K bytes (total + of all headers in a single message) to prevent a denial of + service attack. This limit will be configurable in 8.10. + Problem noted by Michal Zalewski of the "Internet for + Schools" project (IdS). + Prevent segmentation fault on an LDAP lookup if the LDAP map + was closed due to an earlier failure. Problem noted by + Jeff Wasilko of smoe.org. Fix from Booker Bense of + Stanford University and Per Hedeland of Ericsson. + Preserve the order of the MIME headers in multipart messages + when performing the MIME header length check. This + will allow PGP signatures to function properly. Problem + noted by Lars Hecking of University College, Cork, Ireland. + If ruleset 5 rewrote the local address to an :include: directive, + the delivery would fail with an "aliasing/forwarding loop + broken" error. Problem noted by Eric C Hagberg of Morgan + Stanley. Fix from Per Hedeland of Ericsson. + Allow -T to work for bestmx maps. Fix from Aaron Schrab of + ExecPC Internet Systems. + During the transfer of a message in an SMTP transaction, if a + TCP timeout occurs, the message would be properly queued + for later retry but the failure would be logged as + "Illegal Seek" instead of a timeout. Problem noted by + Piotr Kucharski of the Warsaw School of Economics (SGH) + and Carles Xavier Munyoz Baldo of CTV Internet. + Prevent multiple deliveries on a self-referencing alias if the + F=w mailer flag is not set. Problem noted by Murray S. + Kucherawy of Concentric Network Corporation and Per + Hedeland of Ericsson. + Do not strip empty headers but if there is no value and a + default is defined in sendmail.cf, use the default. + Problem noted by Philip Guenther of Gustavus Adolphus + College and Christopher McCrory of Netus, Inc. + Don't inherit information about the sender (notably the full name) + in SMTP (-bs) mode, since this might be called from inetd. + Accept any 3xx reply code in response to DATA command instead of + requiring 354. This change will match the wording to be + published in the updated SMTP specification from the DRUMS + group of the IETF. + Portability: + AIX 4.2.0.2 ships with a /usr/lib/libbind.a which should + not be used. It conflicts with the resolver + built into libc.a. "bind" has been removed + from the confLIBSEARCH BuildTools variable. + Users who have installed BIND 8.X will have + to add it back in their site.config.m4 file. + Problem noted by Ole Holm Nielsen of the + Technical University of Denmark. + CRAY TS 10.0.x from Sven Nielsen of San Diego + Supercomputer Center. + Improved LDAP version 3 integration based on input + from Kurt D. Zeilenga of the OpenLDAP Foundation, + John Beck of Sun Microsystems, and Booker Bense + of Stanford University. + Linux doesn't have a standard way to get the timezone + between different releases. Back out the + change in 8.9.2 and don't attempt to derive + a timezone. Problem reported by Igor S. Livshits + of the University of Illinois at Urbana-Champaign + and Michael Dickens of Tetranet Communications. + Reliant UNIX, the new name for SINIX, from Gert-Jan Looy + of Siemens/SNI. + SunOS 5.8 from John Beck of Sun Microsystems. + CONFIG: SCO UnixWare 2.1 and 7.0 need TZ to get the proper + timezone. Problem noted by Petr Lampa of Technical + University of Brno. + CONFIG: Handle <@bestmx-host:user@otherhost> addressing properly + when using FEATURE(bestmx_is_local). Patch from Neil W. + Rickert of Northern Illinois University. + CONFIG: Properly handle source routed and %-hack addresses on + hosts which the mailertable remaps to local:. Patch from + Neil W. Rickert of Northern Illinois University. + CONFIG: Internal fixup of mailertable local: map value. Patch from + Larry Parmelee of Cornell University. + CONFIG: Only add back +detail from host portion of mailer triplet + on local mailer triplets if it was originally +detail. + Patch from Neil W. Rickert of Northern Illinois University. + CONFIG: The bestmx_is_local checking done in check_rcpt would + cause later checks to fail. Patch from Paul J Murphy of + MIDS Europe. + New files: + BuildTools/OS/CRAYTS.10.0.x + BuildTools/OS/ReliantUNIX + BuildTools/OS/SunOS.5.8 + 8.9.2/8.9.2 98/12/30 SECURITY: Remove five second sleep on accepting daemon connections due to an accept() failure. This sleep could be used @@ -19,7 +105,7 @@ summary of the changes in that release. Problem noted by Andreas Schott of the Max Planck Society. Missing columns in a text map could cause a segmentation fault. Fix from David Lee of the University of Durham. - Note that for 8.9.X, PrivacyFlags=goaway also includes the + Note that for 8.9.X, PrivacyOptions=goaway also includes the noetrn flag. This is scheduled to change in a future version of sendmail. Problem noted by Theo Van Dinter of Chrysalis Symbolic Designa and Alan Brown of Manawatu @@ -80,14 +166,14 @@ summary of the changes in that release. Avoid bogus reporting of "LMTP tobuf overflow" when the buffer has enough space for the additional address. Problem noted by Steve Cliffe of the University of Wollongong. - Fix DontBlameSendmail=FileDeliveryToSymlinks behavior. Problem + Fix DontBlameSendmail=FileDeliveryToSymlink behavior. Problem noted by Alex Vorobiev of Swarthmore College. If the check_compat ruleset resolves to the $#discard mailer, discard the current recipient. Unlike check_relay, check_mail, and check_rcpt, the entire envelope is not discarded. Problem noted by RZ D. Rahlfs. Fix from Claus Assmann of Christian-Albrechts-University of Kiel. - Avoid segmentation fault when reading ServiceSwitch files with + Avoid segmentation fault when reading ServiceSwitchFile files with bogus formatting. Patch from Kari Hurtta of the Finnish Meteorological Institute. Support Berkeley DB 2.6.4 API change. @@ -122,7 +208,7 @@ summary of the changes in that release. Tom J. Moore of NCR. NeXT 4.x correction to man page path. From J. P. McCann of E I A. - System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs) + System V Rel 5.x (a.k.a UnixWare7 w/o BSD-Compatibility Libs) from Paul Gampe of the Asia Pacific Network Information Center. ULTRIX now requires an optimization limit of 970 from @@ -210,7 +296,7 @@ summary of the changes in that release. and then back. Problem noted by Michael Miller of the University of Natal, Pietermaritzburg. Do not advertise ETRN support in ESTMP EHLO reply if noetrn is - set in the PrivacyFlags option. Fix from Ted Rule of + set in the PrivacyOptions option. Fix from Ted Rule of Flextech TV. Log invalid persistent host status file lines instead of bouncing the message. Problem noted by David Lindes of @@ -972,7 +1058,7 @@ summary of the changes in that release. If the AllowBogusHELO option were set and an EHLO with a bad or missing parameter were issued, the EHLO behaved like a HELO. Load limiting never kicked in for incoming SMTP transactions if the - DeliverMode=background and any recipient was an alias or + DeliveryMode=background and any recipient was an alias or had a .forward file. From Nik Conwell of Boston University. On some non-Posix systems, the decision of whether chown(2) permits file giveaway was undefined. From Tetsu Ushijima of the @@ -1463,7 +1549,7 @@ summary of the changes in that release. first" error message. Problem pointed out by Chris Thomas of UCLA; patch from John Beck of SunSoft. Handle "sendmail -bp -qSfoobar" properly if restrictqrun is set - in PrivacyFlags. The -q shouldn't turn this command off. + in PrivacyOptions. The -q shouldn't turn this command off. Problem noted by Murray Kucherawy of Pacific Bell Internet; based on a patch from Gregory Neil Shapiro of WPI. Don't consider SMTP reply codes 452 or 552 (exceeded storage allocation) @@ -2113,7 +2199,7 @@ summary of the changes in that release. on a suggestion by Motonori Nakamura. Add new value "time" for QueueSortOrder option; this causes the queue to be sorted strictly by the time of submission. Note that - this can cause very bad behaviour over slow lines (because + this can cause very bad behavior over slow lines (because large jobs will tend to delay small jobs) and on nodes with heavy traffic (because old things in the queue for hosts that are down delay processing of new jobs). Also, this does not @@ -2236,7 +2322,7 @@ summary of the changes in that release. The Timeout.* options are not safe -- they can be used to create a denial-of-service attack. Problem noted by Christophe Wolfhugel. - Don't send PostMasterCopy messages in the event of a "delayed" + Don't send PostmasterCopy messages in the event of a "delayed" notification. Suggested by Barry Bouwsma. Don't advertise "VERB" ESMTP extension if the "noexpn" privacy option is set, since this disables VERB mode. Suggested @@ -2244,7 +2330,7 @@ summary of the changes in that release. Complain if the QueueDirectory (Q) option is not set. Problem noted by Motonori Nakamura of Kyoto University. Only queue messages on transient .forward open failures if there - were no successful opens. The previous behaviour caused it + were no successful opens. The previous behavior caused it to queue even if a "fall back" .forward was found. Problem noted by Ann-Kian Yeo of the Dept. of Information Systems and Computer Science (DISCS), NUS, Singapore. @@ -2497,7 +2583,7 @@ summary of the changes in that release. valid recipient headers (To:, Cc: or Apparently-To:, the last being a historic botch, of course). If Bcc: is the only recipient header in the message, its value is tossed, - but the header name is kept. The old behaviour (always keep + but the header name is kept. The old behavior (always keep the header name and toss the value) allowed primary recipients to see that a Bcc: went to _someone_. Include queue id on ``Authentication-Warning: <host>: <user> set @@ -2518,7 +2604,7 @@ summary of the changes in that release. John Hawkinson of Panix. An SMTP RCPT command referencing a host that gave a nameserver timeout would return a 451 command (8.6 accepted it and - queued it locally). Revert to the 8.6 behaviour in order + queued it locally). Revert to the 8.6 behavior in order to simplify queue management for clustered systems. Suggested by Gregory Neil Shapiro of WPI. The same problem could break MH, which assumes that the SMTP session will succeed (tsk, tsk @@ -2531,7 +2617,7 @@ summary of the changes in that release. Hawkinson and Sam Hartman of MIT. ``452 Out of disk space for temp file'' messages weren't being printed. Fix from David Perlin of Nanosoft. - Don't advertise the ESMTP DSN extension if the SendMIMEErrors option + Don't advertise the ESMTP DSN extension if the SendMimeErrors option is not set, since this is required to get the actual DSNs created. Problem pointed out by John Gardiner Myers of CMU. Log permission problems that cause .forward and :include: files to @@ -2872,7 +2958,7 @@ summary of the changes in that release. t TimeZoneSpec u DefaultUser U UserDatabaseSpec - V FallbackMXhost + V FallbackMXHost v Verbose w TryNullMXList x QueueLA @@ -3037,7 +3123,7 @@ summary of the changes in that release. or the sequence "\t" or "\n" for tab or newline. These are for use by NIS+ and similar access methods. Change maps to always strip quotes before lookups; the -q flag - turns off this behaviour. Suggested by Motonori Nakamura. + turns off this behavior. Suggested by Motonori Nakamura. Add "nisplus" map class. Takes -k and -v flags to choose the key and value field names respectively. Code donated by Sun Microsystems. @@ -3581,9 +3667,9 @@ summary of the changes in that release. deals with 32 bit or 16 bit fields, such as IP addresses or nameserver fields.'' DG/UX 5.4.3 from Mark T. Robinson <mtr@ornl.gov>. To - get the old behaviour, use -DDGUX_5_4_2. + get the old behavior, use -DDGUX_5_4_2. DG/UX hack: add _FORCE_MAIL_LOCAL_=yes environment - variable to fix bogus /bin/mail behaviour. + variable to fix bogus /bin/mail behavior. Tandem NonStop-UX from Rick McCarty <mccarty@mpd.tandem.com>. This also cleans up some System V Release 4 compile problems. @@ -3727,7 +3813,7 @@ summary of the changes in that release. Received: header inserted into all messages. Suggested by Gary Mills of the University of Manitoba. CONFIG: Make "notsticky" the default; use FEATURE(stickyhost) - to get the old behaviour. I did this upon observing + to get the old behavior. I did this upon observing that almost everyone needed this feature, and that the concept I was trying to make happen didn't work with some user agents anyway. FEATURE(notsticky) still works, @@ -3801,7 +3887,7 @@ summary of the changes in that release. would only work when locally addressed. Fix from Edvard Tuinder of Cistron Internet Services. CONFIG: use ${opMode} to avoid error on .REDIRECT addresses if option - "n" (CheckAlaises) is set when rebuilding alias database. + "n" (CheckAliases) is set when rebuilding alias database. Based on code contributed by Claude Marinier. CONFIG: Allow mailertable to have values of the form ``error:code message''. The ``code'' is a status code @@ -4108,7 +4194,7 @@ summary of the changes in that release. this could in turn cause the sendmail.pid file to be incorrect. A better approach might be to accept the connection and give a 421 code, but that could break - other mailers in mysterious ways and have paging behaviour + other mailers in mysterious ways and have paging behavior implications. Fix a glitch in TCP-level debugging that caused flag 16.101 to set debugging on the wrong socket. From Eric Wassenaar. @@ -4413,7 +4499,7 @@ summary of the changes in that release. this by putting "*" in /etc/shells. It also won't permit world-writable :include: files to reference programs or files (there's no way to disable this). - These behaviours are only one level deep -- for + These behaviors are only one level deep -- for example, it is legal for a world-writable :include: file to reference an alias that writes a file, on the assumption that the alias file is well controlled. @@ -4756,7 +4842,7 @@ summary of the changes in that release. Non-root use of -C flag, dangerous -f flags, and use of -oQ by non-root users were not put into X-Authentication-Warning:s as intended because the - config file hadn't set the PrivacyFlags yet. Fix + config file hadn't set the PrivacyOptions yet. Fix from Sven-Ove Westberg of the University of Lulea. Under very odd circumstances, the alias file rebuild code could get confused as to whether a database was @@ -4834,7 +4920,7 @@ summary of the changes in that release. term bug. Fix a nasty bug causing core dumps when returning the "warning: cannot deliver for N hours -- will keep trying" message; - it only occurred if you had PostMasterCopy set and + it only occurred if you had PostmasterCopy set and only on some architectures. Although sendmail would keep trying, it would send error messages on each queue interval. This is an important fix. @@ -4923,7 +5009,7 @@ summary of the changes in that release. Fix a bug that can cause qf files to be left around even after an SMTP RSET command. Problem and fix from Michael Corrigan. - Don't send a PostMasterCopy to errors when the Precedence: is + Don't send a PostmasterCopy to errors when the Precedence: is negative. Error reports still go to the envelope sender address. Add LA_SHORT for load averages. @@ -5146,7 +5232,7 @@ summary of the changes in that release. Support -M as equivalent to -oM on Ultrix -- apparently DECnet calls sendmail with -MrDECnet -Ms<HOST> -bs instead of using standard flags. Oh joy. This - behaviour reported by Jon Giltner of University + behavior reported by Jon Giltner of University of Colorado. SGI IRIX -- this includes several changes that should help other strict ANSI compilers. @@ -5692,7 +5778,7 @@ summary of the changes in that release. Fix compilation problem in getauthinfo() if IDENTPROTO is off. Turn off DEFNAMES and DNSRCH when getting the hostsignature (i.e., MX records) in level 1 configuration files; this - matches the old behaviour. From Motonori Nakamura of + matches the old behavior. From Motonori Nakamura of Kyoto University. Improve error message printing -- if sent through an alias, error messages include the name of the alias in the @@ -5736,7 +5822,7 @@ summary of the changes in that release. IDENT port (113). Thus, no email can be received from such hosts. There is some evidence that versions of Ultrix before 4.3 do not have this problem. Thanks to Tom Ivar Helbekkmo - for pointing out this behaviour to me and to Michael Corrigan + for pointing out this behavior to me and to Michael Corrigan of U.C. San Diego for informing me about the HPUX problem. Allow IPC mailers to return a colon-separated list of hosts in the $@ clause; these are searched in order as though they were @@ -6293,7 +6379,7 @@ summary of the changes in that release. Add the "c" mailer flag -- this suppresses all comment parts of addresses (requested by John Curran of NEARnet). Have -v print prompts in -bt mode even if stdin is not a terminal - (default behaviour is to be silent if not reading from + (default behavior is to be silent if not reading from a terminal). Suggested by Bryan Costales, ICSI. Move the metacharacters from C0 space (\001-\037) into C1 space (\201-\237). This also fixes a bunch of potential bugs @@ -6322,7 +6408,7 @@ summary of the changes in that release. was suggested by Eric Wassenaar. Use initgroups() in hpux, even though it's System-V based. The HASINITGROUPS compile flag can set this on other systems. - This HPUX behaviour was pointed out by Eric Wassenaar. + This HPUX behavior was pointed out by Eric Wassenaar. 6.23/6.6 93/02/16 Clean up handling of LogLevel to make it easier to figure out @@ -6343,7 +6429,7 @@ summary of the changes in that release. definition lines. Note that rulesets 1 and 2 are still used for both addresses as before. Bruce Lilly gave a convincing argument that RFC976 insists on - this behaviour. + this behavior. Added some time zones to arpatounix -- they may not be in the standards, but they are in use. However, I may delete arpatounix entirely -- there appears to be no reason @@ -6464,7 +6550,7 @@ summary of the changes in that release. 6.9/6.1 93/01/13 Environment handling simplification/bug fix -- child processes get a minimal, fixed environment. This avoids different - behaviour in queue runs. + behavior in queue runs. Handle commas inside comments properly. Properly limit large messages submitted in -obq mode. diff --git a/contrib/sendmail/cf/README b/contrib/sendmail/cf/README index 46a9475..392c36d 100644 --- a/contrib/sendmail/cf/README +++ b/contrib/sendmail/cf/README @@ -4,7 +4,7 @@ Eric Allman <eric@Sendmail.ORG> - @(#)README 8.184 (Berkeley) 12/29/1998 + @(#)README 8.186 (Berkeley) 2/3/1999 This document describes the sendmail configuration files being used @@ -293,14 +293,15 @@ POP_MAILER_FLAGS [Penu] Flags added to POP mailer. Flags "lsDFM" are always added. POP_MAILER_ARGS [pop $u] The arguments passed to the POP mailer. PROCMAIL_MAILER_PATH [/usr/local/bin/procmail] The path to the procmail - program. This is also used by FEATURE(local_procmail). + program. This is also used by + FEATURE(`local_procmail'). PROCMAIL_MAILER_FLAGS [SPhnu9] Flags added to Procmail mailer. Flags ``DFM'' are always set. This is NOT used by - FEATURE(local_procmail); tweak LOCAL_MAILER_FLAGS + FEATURE(`local_procmail'); tweak LOCAL_MAILER_FLAGS instead. PROCMAIL_MAILER_ARGS [procmail -Y -m $h $f $u] The arguments passed to the Procmail mailer. This is NOT used by - FEATURE(local_procmail); tweak LOCAL_MAILER_ARGS + FEATURE(`local_procmail'); tweak LOCAL_MAILER_ARGS instead. PROCMAIL_MAILER_MAX [undefined] If set, the maximum size message that will be accepted by the procmail mailer. @@ -327,8 +328,8 @@ CYRUS_BB_MAILER_FLAGS [undefined] The flags used by the cyrusbb CYRUS_BB_MAILER_ARGS [deliver -e -m $u] The arguments passed to deliver cyrusbb mail. confEBINDIR [/usr/libexec] The directory for executables. - Currently used for FEATURE(local_lmtp) and - FEATURE(smrsh). + Currently used for FEATURE(`local_lmtp') and + FEATURE(`smrsh'). @@ -454,7 +455,7 @@ procmail An interface to procmail (does not come with sendmail). This would arrange for (anything)@host.com to be sent to person@other.host. Within the procmail script, $1 is the name of the sender and $2 is the name of the recipient. - If you use this with FEATURE(local_procmail), the FEATURE + If you use this with FEATURE(`local_procmail'), the FEATURE should be listed first. mail11 The DECnet mail11 mailer, useful only if you have the mail11 @@ -478,10 +479,10 @@ cyrus The cyrus and cyrusbb mailers. The cyrus mailer delivers to The local mailer accepts addresses of the form "user+detail", where the "+detail" is not used for mailbox matching but is available -to certain local mail programs (in particular, see FEATURE(local_procmail)). -For example, "eric", "eric+sendmail", and "eric+sww" all indicate -the same user, but additional arguments <null>, "sendmail", and "sww" -may be provided for use in sorting mail. +to certain local mail programs (in particular, see +FEATURE(`local_procmail')). For example, "eric", "eric+sendmail", and +"eric+sww" all indicate the same user, but additional arguments <null>, +"sendmail", and "sww" may be provided for use in sorting mail. +----------+ @@ -491,13 +492,13 @@ may be provided for use in sorting mail. Special features can be requested using the "FEATURE" macro. For example, the .mc line: - FEATURE(use_cw_file) + FEATURE(`use_cw_file') tells sendmail that you want to have it read an /etc/sendmail.cw file to get values for class $=w. The FEATURE may contain a single optional parameter -- for example: - FEATURE(mailertable, dbm /usr/lib/mailertable) + FEATURE(`mailertable', `dbm /usr/lib/mailertable') The default database map type for the table features can be set with @@ -554,7 +555,9 @@ mailertable Include a "mailer table" which can be used to override routing for particular domains. The argument of the FEATURE may be the key definition. If none is specified, the definition used is: + hash -o /etc/mailertable + Keys in this database are fully qualified domain names or partial domains preceded by a dot -- for example, "vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU". @@ -580,7 +583,9 @@ domaintable Include a "domain table" which can be used to provide oldname.com to newname.com). The argument of the FEATURE may be the key definition. If none is specified, the definition used is: + hash -o /etc/domaintable + The key in this table is the domain name; the value is the new (fully qualified) domain. Anything in the domaintable is reflected into headers; that is, this @@ -591,13 +596,17 @@ bitdomain Look up bitnet hosts in a table to try to turn them into bitdomain program contributed by John Gardiner Myers. The argument of the FEATURE may be the key definition; if none is specified, the definition used is: + hash -o /etc/bitdomain.db + Keys are the bitnet hostname; values are the corresponding internet hostname. uucpdomain Similar feature for UUCP hosts. The default map definition is: + hash -o /etc/uudomain.db + At the moment there is no automagic tool to build this database. @@ -659,7 +668,7 @@ genericstable This feature will cause certain addresses originating locally (analogously to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, see below). - The argument of FEATURE(genericstable) may be the map + The argument of FEATURE(`genericstable') may be the map definition; the default map definition is: hash -o /etc/genericstable @@ -670,8 +679,8 @@ genericstable This feature will cause certain addresses originating locally not include a domain, it will be qualified in the standard manner, i.e. using $j or the masquerade name. Note that the address being looked up must be fully qualified. For local - mail, it is necessary to use FEATURE(always_add_domain) for - the addresses to be qualified. + mail, it is necessary to use FEATURE(`always_add_domain') + for the addresses to be qualified. virtusertable A domain-specific form of aliasing, allowing multiple virtual domains to be hosted on one machine. For example, @@ -699,7 +708,7 @@ virtusertable A domain-specific form of aliasing, allowing multiple A new definition can be specified as the second argument of the FEATURE macro, such as - FEATURE(virtusertable, dbm -o /etc/mail/virtusers) + FEATURE(`virtusertable', `dbm -o /etc/mail/virtusers') nodns We aren't running DNS at our site (for example, we are UUCP-only connected). It's hard to consider @@ -793,11 +802,11 @@ relay_based_on_MX feature. Also, see the KNOWNBUGS entry regarding bestmx map lookups. - FEATURE(relay_based_on_MX) does not necessarily allow + FEATURE(`relay_based_on_MX') does not necessarily allow routing of these messages which you expect to be allowed, if route address syntax (or %-hack syntax) is used. If this is a problem, add entries to the access-table or use - FEATURE(loose_relay_check). + FEATURE(`loose_relay_check'). relay_local_from Allows relaying if the domain portion of the mail sender @@ -828,9 +837,11 @@ accept_unresolvable_domains access_db Turns on the access database feature. The access db gives you the ability to allow or refuse to accept mail from specified domains for administrative reasons. By default, - the access database specification is - ``hash -o /etc/mail/access''. The format of the - database is described below. + the access database specification is: + + hash -o /etc/mail/access + + The format of the database is described below. blacklist_recipients Turns on the ability to block incoming mail for certain @@ -888,7 +899,7 @@ the $=w class. This is a list of names by which you are known, and anything sent to an address using a host name in this list will be treated as local mail. You can do this in two ways: either create the file /etc/sendmail.cw containing a list of your aliases (one per -line), and use ``FEATURE(use_cw_file)'' in the .mc file, or add the +line), and use ``FEATURE(`use_cw_file')'' in the .mc file, or add the line: Cw alias.host.name @@ -1114,7 +1125,7 @@ to read the list of names from the indicated file. Normally only header addresses are masqueraded. If you want to masquerade the envelope as well, use - FEATURE(masquerade_envelope) + FEATURE(`masquerade_envelope') There are always users that need to be "exposed" -- that is, their internal site name should be displayed instead of the masquerade name. @@ -1131,7 +1142,7 @@ without @host) to a relay host. For example, if you have a central email server, you might relay to that host so that users don't have to have .forward files or aliases. You can do this using - define(`LOCAL_RELAY', mailer:hostname) + define(`LOCAL_RELAY', `mailer:hostname') The ``mailer:'' can be omitted, in which case the mailer defaults to "relay". There are some user names that you don't want relayed, perhaps @@ -1147,16 +1158,16 @@ This adds users to class L; you could also use something like If you want all incoming mail sent to a centralized hub, as for a shared /var/spool/mail scheme, use - define(`MAIL_HUB', mailer:hostname) + define(`MAIL_HUB', `mailer:hostname') Again, ``mailer:'' defaults to "relay". If you define both LOCAL_RELAY -and MAIL_HUB _AND_ you have FEATURE(stickyhost), unqualified names will +and MAIL_HUB _AND_ you have FEATURE(`stickyhost'), unqualified names will be sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB. Names in $=L will be delivered locally, so you MUST have aliases or .forward files for them. For example, if you are on machine mastodon.CS.Berkeley.EDU and you have -FEATURE(stickyhost), the following combinations of settings will have the +FEATURE(`stickyhost'), the following combinations of settings will have the indicated effects: email sent to.... eric eric@mastodon.CS.Berkeley.EDU @@ -1170,7 +1181,7 @@ mammoth.CS.Berkeley.EDU (aliasing done) (aliasing done) Both LOCAL_RELAY and mail.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU MAIL_HUB set as above (no local aliasing) (aliasing done) -If you do not have FEATURE(stickyhost) set, then LOCAL_RELAY and +If you do not have FEATURE(`stickyhost') set, then LOCAL_RELAY and MAIL_HUB act identically, with MAIL_HUB taking precedence. If you want all outgoing mail to go to a central relay site, define @@ -1209,14 +1220,14 @@ Relaying (transmission of messages from a site outside your domain to another site outside your domain) is denied by default. Note that this changed in sendmail 8.9; previous versions allowed relaying by default. If you want to revert to the old behaviour, you will need -to use FEATURE(promiscuous_relay). You can allow certain domains to +to use FEATURE(`promiscuous_relay'). You can allow certain domains to relay through your server by adding their domain name or IP address to class 'R' ($=R) using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the access database (described below). If you use - FEATURE(relay_entire_domain) + FEATURE(`relay_entire_domain') then any host in any of your local domains (that is, the $=m class) will be relayed (that is, you will accept mail either to or from any @@ -1225,7 +1236,7 @@ host in your domain). You can also allow relaying based on the MX records of the host portion of an incoming recipient address by using - FEATURE(relay_based_on_MX) + FEATURE(`relay_based_on_MX') For example, if your server receives a recipient of user@domain.com and domain.com lists your server in its MX records, the mail will be @@ -1235,7 +1246,7 @@ using your server as a relay for their site (that is, they set up an MX record pointing to your mail server, and you will relay mail addressed to them without any prior arrangement). Along the same lines, - FEATURE(relay_local_from) + FEATURE(`relay_local_from') will allow relaying if the sender specifies a return path (i.e. MAIL FROM: <user@domain>) domain which is a local domain. This a @@ -1246,11 +1257,11 @@ It should not be used unless absolutely necessary. If source routing is used in the recipient address (i.e. RCPT TO: <user%site.com@othersite.com>), sendmail will check user@site.com for relaying if othersite.com is an allowed relay host -in either class 'R', class 'm' if FEATURE(relay_entire_domain) is used, -or the access database if FEATURE(access_db) is used. To prevent +in either class 'R', class 'm' if FEATURE(`relay_entire_domain') is used, +or the access database if FEATURE(`access_db') is used. To prevent the address from being stripped down, use: - FEATURE(loose_relay_check) + FEATURE(`loose_relay_check') If you think you need to use this feature, you probably do not. This should only be used for sites which have no control over the addresses @@ -1265,30 +1276,30 @@ firewall that has only a limited view of the Internet host name space (note that you will not be able to return mail to them unless you have some "smart host" forwarder), use - FEATURE(accept_unresolvable_domains) + FEATURE(`accept_unresolvable_domains') sendmail will also refuse mail if the MAIL FROM: parameter is not fully qualified (i.e., contains a domain as well as a user). If you want to continue to accept such senders, use - FEATURE(accept_unqualified_senders) + FEATURE(`accept_unqualified_senders') An ``access'' database can be created to accept or reject mail from selected domains. For example, you may choose to reject all mail originating from known spammers. To enable such a database, use - FEATURE(access_db) + FEATURE(`access_db') The FEATURE macro can accept a second parameter giving the key file definition for the database; for example - FEATURE(access_db, hash -o /etc/mail/access) + FEATURE(`access_db', `hash -o /etc/mail/access') Remember, since /etc/mail/access is a database, after creating the text file as described below, you must use makemap to create the database map. For example: -makemap hash /etc/mail/access < /etc/mail/access + makemap hash /etc/mail/access < /etc/mail/access The table itself uses e-mail addresses, domain names, and network numbers as keys. For example, @@ -1335,7 +1346,7 @@ and allow relaying for the 128.32.*.* network. Note, UUCP users may need to add hostname.UUCP to the access database or class 'R' ($=R). If you also use: - FEATURE(relay_hosts_only) + FEATURE(`relay_hosts_only') then the above example will allow relaying for sendmail.org, but not hosts within the sendmail.org domain. Note that this will also require @@ -1352,7 +1363,7 @@ sender address. If you use: - FEATURE(blacklist_recipients) + FEATURE(`blacklist_recipients') then you can add entries to the map for local users, hosts in your domains, or addresses in your domain which should not receive mail: @@ -1377,7 +1388,7 @@ There is also a ``Realtime Blackhole List'' run by the MAPS project at http://maps.vix.com/. This is a database maintained in DNS of spammers. To use this database, use - FEATURE(rbl) + FEATURE(`rbl') This will cause sendmail to reject mail from any site in the Realtime Blackhole List database. You can specify an alternative @@ -1420,8 +1431,8 @@ a Message-ID: header: R< $+ @ $+ > $@ OK R$* $#error $: 553 Header Error -Users of FEATURE(nullclient) who desire to use the anti-spam and -anti-relaying capabilities should replace FEATURE(nullclient, mailhub) +Users of FEATURE(`nullclient') who desire to use the anti-spam and +anti-relaying capabilities should replace FEATURE(`nullclient', `mailhub') with: undefine(`ALIAS_FILE') @@ -1430,6 +1441,14 @@ with: define(`confFORWARD_PATH', `') where mailhub is the fully qualified hostname for their mail server. +The above rules will provide the relaying to the mailhub without local +alias and forward file expansion. To match the other behavior of +FEATURE(`nullclient'), you should also add these lines along with those +listed above: + + MASQUERADE_AS(`mailhub') + FEATURE(`allmasquerade') + FEATURE(`masquerade_envelope') +--------------------------------+ @@ -1462,7 +1481,7 @@ hook to handle some special cases. You can define a ``smart host'' that understands a richer address syntax using: - define(`SMART_HOST', mailer:hostname) + define(`SMART_HOST', `mailer:hostname') In this case, the ``mailer:'' defaults to "relay". Any messages that can't be handled using the usual UUCP rules are passed to this host. @@ -1471,18 +1490,18 @@ If you are on a local SMTP-based net that connects to the outside world via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules. For example: - define(`SMART_HOST', suucp:uunet) + define(`SMART_HOST', `suucp:uunet') LOCAL_NET_CONFIG R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 This will cause all names that end in your domain name ($m) via SMTP; anything else will be sent via suucp (smart UUCP) to uunet. -If you have FEATURE(nocanonify), you may need to omit the dots after +If you have FEATURE(`nocanonify'), you may need to omit the dots after the $m. If you are running a local DNS inside your domain which is not otherwise connected to the outside world, you probably want to use: - define(`SMART_HOST', smtp:fire.wall.com) + define(`SMART_HOST', `smtp:fire.wall.com') LOCAL_NET_CONFIG R$* < @ $* . > $* $#smtp $@ $2. $: $1 < @ $2. > $3 @@ -1490,8 +1509,8 @@ That is, send directly only to things you found in your DNS lookup; anything else goes through SMART_HOST. You may need to turn off the anti-spam rules in order to accept -UUCP mail with FEATURE(promiscuous_relay) and -FEATURE(accept_unresolvable_domains). +UUCP mail with FEATURE(`promiscuous_relay') and +FEATURE(`accept_unresolvable_domains'). +-----------+ @@ -1516,7 +1535,7 @@ name. This is usually done using: | USING MAILERTABLES | +--------------------+ -To use FEATURE(mailertable), you will have to create an external +To use FEATURE(`mailertable'), you will have to create an external database containing the routing information for various domains. For example, a mailertable file in text format might be: @@ -1575,7 +1594,7 @@ is fairly easy.) The intent was to locate the default maildrop at a site, but allow you to override this by sending to a specific host. If you decide to set up the user database in this fashion, it is -imperative that you not use FEATURE(stickyhost) -- otherwise, +imperative that you not use FEATURE(`stickyhost') -- otherwise, e-mail sent to Full.Name@local.host.name will be rejected. To build the internal form of the user database, use: @@ -1715,7 +1734,7 @@ confCR_FILE FR class [/etc/mail/relay-domains] Name of confTRUSTED_USERS Ct class [no default] Names of users to add to the list of trusted users. This list always includes root, uucp, and daemon. - See also FEATURE(use_ct_file). + See also FEATURE(`use_ct_file'). confSMTP_MAILER - [esmtp] The mailer name used when SMTP connectivity is required. One of "smtp", "smtp8", or "esmtp". diff --git a/contrib/sendmail/cf/cf/knecht.mc b/contrib/sendmail/cf/cf/knecht.mc index 026c8fb..4ba1471 100644 --- a/contrib/sendmail/cf/cf/knecht.mc +++ b/contrib/sendmail/cf/cf/knecht.mc @@ -16,7 +16,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`@(#)knecht.mc 8.30 (Berkeley) 6/11/1998') +VERSIONID(`@(#)knecht.mc 8.31 (Berkeley) 1/30/1999') OSTYPE(bsd4.4)dnl DOMAIN(generic)dnl define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward+$h:$z/.forward')dnl @@ -27,10 +27,10 @@ define(`confCOPY_ERRORS_TO', `Postmaster')dnl define(`confTO_QUEUEWARN', `8h')dnl define(`confTRUSTED_USERS', `www')dnl define(`confPRIVACY_FLAGS', ``authwarnings,noexpn,novrfy'')dnl -FEATURE(virtusertable)dnl +FEATURE(virtusertable, `hash /etc/mail/virtusertable')dnl FEATURE(access_db)dnl FEATURE(local_lmtp)dnl -define(`LOCAL_MAILER_FLAGS', LOCAL_MAILER_FLAGS`'P)dnl +define(`LOCAL_MAILER_FLAGS', CONCAT(LOCAL_MAILER_FLAGS,P))dnl MAILER(local)dnl MAILER(smtp)dnl diff --git a/contrib/sendmail/cf/feature/bestmx_is_local.m4 b/contrib/sendmail/cf/feature/bestmx_is_local.m4 index 4064387..ec4c81c 100644 --- a/contrib/sendmail/cf/feature/bestmx_is_local.m4 +++ b/contrib/sendmail/cf/feature/bestmx_is_local.m4 @@ -12,7 +12,7 @@ divert(-1) # divert(0) -VERSIONID(`@(#)bestmx_is_local.m4 8.13 (Berkeley) 8/13/1998') +VERSIONID(`@(#)bestmx_is_local.m4 8.14 (Berkeley) 1/25/1999') divert(-1) define(_BESTMX_IS_LOCAL_, _ARG_) @@ -44,5 +44,6 @@ R$* < @ $* > $* $: $1 < @ $2 @@ $(bestmx $2 $) > $3', # limit bestmx to $=B R$* < @ $* $=B . > $* $: $1 < @ $2 $3 . @@ $(bestmx $2 $3 . $) > $4') R$* $=O $* < @ $* @@ $=w . > $* $@ $>97 $1 $2 $3 +R< @ $* @@ $=w . > : $* $@ $>97 $3 R$* < @ $* @@ $=w . > $* $#local $: $1 R$* < @ $* @@ $* > $* $: $1 < @ $2 > $4 diff --git a/contrib/sendmail/cf/m4/proto.m4 b/contrib/sendmail/cf/m4/proto.m4 index cce5e32..863b42c 100644 --- a/contrib/sendmail/cf/m4/proto.m4 +++ b/contrib/sendmail/cf/m4/proto.m4 @@ -12,7 +12,7 @@ divert(-1) # divert(0) -VERSIONID(`@(#)proto.m4 8.237 (Berkeley) 12/17/1998') +VERSIONID(`@(#)proto.m4 8.243 (Berkeley) 2/2/1999') MAILER(local)dnl @@ -478,9 +478,9 @@ ifdef(`confMAX_MIME_HEADER_LENGTH', `# Maximum MIME header length to protect MUAs O MaxMimeHeaderLength=confMAX_MIME_HEADER_LENGTH ') -ifdef(`confMAX_HEADER_LINES', -`# Maximum number of header lines and header line length limit -O MaxHeaderLines=confMAX_HEADER_LINES +ifdef(`confMAX_HEADERS_LENGTH', +`# Maximum length of the sum of all headers +O MaxHeadersLength=confMAX_HEADERS_LENGTH ') ########################### @@ -789,7 +789,7 @@ ifdef(`MAILER_TABLE', `dnl R$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name R< $+ . > $* $: < $1 > $2 strip trailing dot R< $+ > $* $: < $(mailertable $1 $) > $2 lookup -R< $~[ : $+ > $* $>95 < $1 : $2 > $3 check -- resolved? +R< $~[ : $* > $* $>95 < $1 : $2 > $3 check -- resolved? R< $+ > $* $: $>90 <$1> $2 try domain', `dnl') undivert(4)dnl @@ -877,7 +877,9 @@ R< > $+ $: < > < $1 $&h > nope, restore +detail R< > < $+ + $* > $* < > < $1 > + $2 $3 find the user part R< > < $+ > + $* $#_LOCAL_ $@ $2 $: @ $1 strip the extra + R< > < $+ > $@ $1 no +detail -R$+ $: $1 $&h add +detail back in +R$+ $: $1 <> $&h add +detail back in +R$+ <> + $* $: $1 + $2 check whether +detail +R$+ <> $* $: $1 else discard R< local : $* > $* $: $>95 < local : $1 > $2 no host extension R< error : $* > $* $: $>95 < error : $1 > $2 no host extension R< $- : $+ > $+ $: $>95 < $1 : $2 > $3 < @ $2 > @@ -890,10 +892,10 @@ ifdef(`MAILER_TABLE', `dnl S90 R$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4 -R$* <$~[ : $+ > $* $>95 < $2 : $3 > $4 check -- resolved? +R$* <$~[ : $* > $* $>95 < $2 : $3 > $4 check -- resolved? R$* < . $+ > $* $@ $>90 $1 . <$2> $3 no -- strip & try again R$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "." -R< $~[ : $+ > $* $>95 < $1 : $2 > $3 "." found? +R< $~[ : $* > $* $>95 < $1 : $2 > $3 "." found? R< $* > $* $@ $2 no mailertable match', `dnl') @@ -915,6 +917,10 @@ R< $+ > $* $#_RELAY_ $@ $1 $: $2 use unqualified mailer ################################################################### SCanonLocal +# strip local host from routed addresses +R< $* > < @ $+ > : $+ $@ $>97 $3 +R< $* > $+ $=O $+ < @ $+ > $@ $>97 $2 $3 $4 + # strip trailing dot from any host name that may appear R< $* > $* < @ $* . > $: < $1 > $2 < @ $3 > @@ -1212,7 +1218,7 @@ ifelse(_BESTMX_IS_LOCAL_, `', `dnl R$* < @ $* > $* $: $1 < @ $2 @@ $(bestmx $2 $) > $3', `dnl # limit bestmx to $=B -R$* < @ $* $=B > $* $: $1 < @ $2 $3 . @@ $(bestmx $2 $3 $) > $4') +R$* < @ $* $=B > $* $: $1 < @ $2 $3 @@ $(bestmx $2 $3 $) > $4') R$* $=O $* < @ $* @@ $=w . > $* $@ $>Basic_check_rcpt $1 $2 $3 R$* < @ $* @@ $=w . > $* $: $1 < @ $3 > $4 R$* < @ $* @@ $* > $* $: $1 < @ $2 > $4') diff --git a/contrib/sendmail/cf/m4/version.m4 b/contrib/sendmail/cf/m4/version.m4 index 6d03e37..416488c 100644 --- a/contrib/sendmail/cf/m4/version.m4 +++ b/contrib/sendmail/cf/m4/version.m4 @@ -10,8 +10,8 @@ divert(-1) # the sendmail distribution. # # -VERSIONID(`@(#)version.m4 8.9.2.1 (Berkeley) 12/29/1998') +VERSIONID(`@(#)version.m4 8.9.3.1 (Berkeley) 2/4/1999') # divert(0) # Configuration version number -DZ8.9.2`'ifdef(`confCF_VERSION', `/confCF_VERSION') +DZ8.9.3`'ifdef(`confCF_VERSION', `/confCF_VERSION') diff --git a/contrib/sendmail/cf/ostype/sco-uw-2.1.m4 b/contrib/sendmail/cf/ostype/sco-uw-2.1.m4 index 07da0ad..0de9bae 100644 --- a/contrib/sendmail/cf/ostype/sco-uw-2.1.m4 +++ b/contrib/sendmail/cf/ostype/sco-uw-2.1.m4 @@ -12,7 +12,7 @@ divert(-1) # Contributed by Christopher Durham <chrisdu@SCO.COM> of SCO. # divert(0) -VERSIONID(`@(#)sco-uw-2.1.m4 8.7 (Berkeley) 10/6/1998') +VERSIONID(`@(#)sco-uw-2.1.m4 8.8 (Berkeley) 1/25/1999') define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/lib/mail/aliases'))dnl ifdef(`HELP_FILE',,`define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/usr/ucblib/sendmail.hf'))')dnl @@ -23,3 +23,4 @@ define(`LOCAL_SHELL_FLAGS', `ehuP')dnl define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gmedium $h!rmail ($u)')dnl define(`LOCAL_MAILER_ARGS',`rmail $u')dnl define(`confEBINDIR', `/usr/lib')dnl +define(`confTIME_ZONE', `USE_TZ')dnl diff --git a/contrib/sendmail/cf/ostype/unixware7.m4 b/contrib/sendmail/cf/ostype/unixware7.m4 index af1bcc8..a787307 100644 --- a/contrib/sendmail/cf/ostype/unixware7.m4 +++ b/contrib/sendmail/cf/ostype/unixware7.m4 @@ -9,8 +9,9 @@ divert(-1) # divert(0) -VERSIONID(`@(#)unixware7.m4 8.1 (Berkeley) 10/13/1998') +VERSIONID(`@(#)unixware7.m4 8.2 (Berkeley) 1/25/1999') define(`ALIAS_FILE', `/etc/mail/aliases')dnl ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/etc/mailer/sendmail.st'))')dnl define(`confEBINDIR', `/usr/lib')dnl +define(`confTIME_ZONE', `USE_TZ')dnl diff --git a/contrib/sendmail/doc/op/op.me b/contrib/sendmail/doc/op/op.me index a2b0ef14..e9c2e5c 100644 --- a/contrib/sendmail/doc/op/op.me +++ b/contrib/sendmail/doc/op/op.me @@ -8,7 +8,7 @@ .\" the sendmail distribution. .\" .\" -.\" @(#)op.me 8.134 (Berkeley) 9/16/1998 +.\" @(#)op.me 8.135 (Berkeley) 1/16/1999 .\" .\" eqn op.me | pic | troff -me .eh 'SMM:08-%''Sendmail Installation and Operation Guide' @@ -46,7 +46,7 @@ Eric Allman Sendmail, Inc. eric@Sendmail.COM .sp -Version 8.134 +Version 8.135 .sp For Sendmail Version 8.9 .)l @@ -812,7 +812,7 @@ you should create the file .q /etc/sendmail.st : .(b cp /dev/null /etc/sendmail.st -chmod 666 /etc/sendmail.st +chmod 644 /etc/sendmail.st .)b This file does not grow. It is printed with the program @@ -2870,6 +2870,17 @@ forwardfileinunsafedirpathsafe flags with the DontBlameSendmail option to allow forward files in a world writable directory. +This might also be used as a +denial of service +attack (users could create forward files for other users); +a better approach might be to create +/var/forward +mode 755 +and create empty files for each user, +owned by that user, +mode 644. +If you do this, you don't have to set the DontBlameSendmail options +indicated above. .sh 2 "Free Space" .pp On systems that have one of the system calls in the @@ -8213,7 +8224,7 @@ replace it with a blank sheet for double-sided output. .\".sz 10 .\"Eric Allman .\".sp -.\"Version 8.134 +.\"Version 8.135 .\".ce 0 .bp 3 .ce diff --git a/contrib/sendmail/mailstats/mailstats.c b/contrib/sendmail/mailstats/mailstats.c index 5df3b95..56e9357 100644 --- a/contrib/sendmail/mailstats/mailstats.c +++ b/contrib/sendmail/mailstats/mailstats.c @@ -18,7 +18,7 @@ static char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)mailstats.c 8.28 (Berkeley) 9/14/1998"; +static char sccsid[] = "@(#)mailstats.c 8.29 (Berkeley) 1/25/1999"; #endif /* not lint */ #ifndef NOT_SENDMAIL @@ -283,7 +283,7 @@ main(argc, argv) frmsgs, frbytes, tomsgs, tobytes, rejmsgs, dismsgs); close(fd); fd = open(sfile, O_RDWR | O_TRUNC); - if (fd > 0) + if (fd >= 0) close(fd); } else diff --git a/contrib/sendmail/src/Makefile.m4 b/contrib/sendmail/src/Makefile.m4 index ad9e1c9..d88d35b 100644 --- a/contrib/sendmail/src/Makefile.m4 +++ b/contrib/sendmail/src/Makefile.m4 @@ -2,7 +2,7 @@ # This Makefile is designed to work on any reasonably current version of # "make" program. # -# @(#)Makefile.m4 8.25 (Berkeley) 10/5/1998 +# @(#)Makefile.m4 8.26 (Berkeley) 1/23/1999 # # C compiler @@ -103,16 +103,18 @@ MAN8= ${MANROOT}ifdef(`confMAN8', `confMAN8', `8') MAN8EXT=ifdef(`confMAN8EXT', `confMAN8EXT', `8') MAN8SRC=ifdef(`confMAN8SRC', `confMAN8SRC', `0') -ALL= sendmail aliases.${MAN5SRC} mailq.${MAN1SRC} newaliases.${MAN1SRC} sendmail.${MAN8SRC} +ALL= sendmail sendmail.st aliases.${MAN5SRC} mailq.${MAN1SRC} newaliases.${MAN1SRC} sendmail.${MAN8SRC} all: ${ALL} sendmail: ${BEFORE} ${OBJS} ${CC} -o sendmail ${LDOPTS} ${LIBDIRS} ${OBJS} ${LIBS} - cp /dev/null sendmail.st undivert(3) +sendmail.st: + cp /dev/null sendmail.st + aliases.${MAN5SRC}: aliases.5 ${NROFF} ${MANDOC} aliases.5 > aliases.${MAN5SRC} diff --git a/contrib/sendmail/src/README b/contrib/sendmail/src/README index 817b3a4..7106e8c 100644 --- a/contrib/sendmail/src/README +++ b/contrib/sendmail/src/README @@ -8,7 +8,7 @@ # the sendmail distribution. # # -# @(#)README 8.209 (Berkeley) 10/6/1998 +# @(#)README 8.211 (Berkeley) 2/2/1999 # This directory contains the source files for sendmail(TM). @@ -115,8 +115,8 @@ HESIOD Support for Hesiod (from the DEC/Athena distribution). You work. You may be able to get this to work with the MIT/Athena version of Hesiod, but that's likely to be a lot of work. LDAPMAP Lightweight Directory Lookup Protocol support. You will - have to install the UMich ldap and lber libraries to use - this flag. + have to install the UMich or OpenLDAP ldap and lber + libraries to use this flag. MAP_REGEX Regular Expression support. You will need to use an operating system which comes with the POSIX regex() routines or install a regexp library such as libregex from @@ -1078,6 +1078,12 @@ Linux to LIBS. Data structures may change and you'd be asking for a core dump. + A number of problems have been reported regarding the Linux 2.2.0 + kernel. So far, these problems have been tracked down to syslog() + and DNS resolution. We believe the problem is with the poll() + implementation in the Linux 2.2.0 kernel and poll()-aware versions + of glib (at least up to 2.0.111). + AIX 4.2 The AIX m4 implements a different mechanism for ifdef which is inconsistent with other versions of m4. Therefore, it will not @@ -1315,6 +1321,9 @@ LDAP The software has been in production on Solaris.2.5.1 at Stanford for over 2 years. + The LDAP map supports both the UMich LDAP 3.2 and 3.3 libraries as + well as the OpenLDAP (http://www.openldap.org/) libraries. + TCP Wrappers If you are using -DTCPWRAPPERS to get TCP Wrappers support you will also need to install libwrap.a and modify your site.config.m4 file @@ -1452,4 +1461,4 @@ version.c The version number and information about this Eric Allman -(Version 8.209, last update 10/6/1998 17:10:21) +(Version 8.211, last update 2/2/1999 15:28:18) diff --git a/contrib/sendmail/src/arpadate.c b/contrib/sendmail/src/arpadate.c index 1b539b6..c02decd 100644 --- a/contrib/sendmail/src/arpadate.c +++ b/contrib/sendmail/src/arpadate.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)arpadate.c 8.12 (Berkeley) 5/19/1998"; +static char sccsid[] = "@(#)arpadate.c 8.14 (Berkeley) 2/2/1999"; #endif /* not lint */ # include "sendmail.h" @@ -73,7 +73,7 @@ arpadate(ud) ** to resolve the timezone. */ - (void) time(&t); + t = curtime(); if (ud == NULL) ud = ctime(&t); @@ -156,7 +156,12 @@ arpadate(ud) { extern char *tzname[]; - tz = tzname[lt->tm_isdst]; + if (lt->tm_isdst > 0) + tz = tzname[1]; + else if (lt->tm_isdst == 0) + tz = tzname[0]; + else + tz = NULL; } #endif #if TZ_TYPE == TZ_TIMEZONE diff --git a/contrib/sendmail/src/clock.c b/contrib/sendmail/src/clock.c index aab301c..e6466e6 100644 --- a/contrib/sendmail/src/clock.c +++ b/contrib/sendmail/src/clock.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)clock.c 8.34 (Berkeley) 6/4/1998"; +static char sccsid[] = "@(#)clock.c 8.35 (Berkeley) 2/2/1999"; #endif /* not lint */ # include "sendmail.h" @@ -60,7 +60,7 @@ setevent(intvl, func, arg) } wasblocked = blocksignal(SIGALRM); - (void) time(&now); + now = curtime(); /* search event queue for correct position */ for (evp = &EventQueue; (ev = *evp) != NULL; evp = &ev->ev_link) diff --git a/contrib/sendmail/src/collect.c b/contrib/sendmail/src/collect.c index 7e68f40..a8916b1 100644 --- a/contrib/sendmail/src/collect.c +++ b/contrib/sendmail/src/collect.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)collect.c 8.91 (Berkeley) 8/19/1998"; +static char sccsid[] = "@(#)collect.c 8.93 (Berkeley) 1/26/1999"; #endif /* not lint */ # include <errno.h> @@ -78,8 +78,7 @@ collect(fp, smtpmode, hdrp, e) volatile int istate; volatile int mstate; u_char *volatile pbp; - int nhdrlines = 0; - int hdrlinelen = 0; + int hdrslen = 0; u_char peekbuf[8]; char dfname[MAXQFNAME]; char bufbuf[MAXLINE]; @@ -201,7 +200,6 @@ collect(fp, smtpmode, hdrp, e) switch (istate) { case IS_BOL: - hdrlinelen = 0; if (c == '.') { istate = IS_DOT; @@ -309,18 +307,18 @@ bufferchar: else if (c != '\0') { *bp++ = c; - if (MaxHeaderLineLength > 0 && - ++hdrlinelen > MaxHeaderLineLength) + if (MaxHeadersLength > 0 && + ++hdrslen > MaxHeadersLength) { sm_syslog(LOG_NOTICE, e->e_id, - "header line too long (%d max) from %s during message collect", - MaxHeaderLineLength, + "headers too large (%d max) from %s during message collect", + MaxHeadersLength, CurHostName != NULL ? CurHostName : "localhost"); errno = 0; e->e_flags |= EF_CLRQUEUE; e->e_status = "5.6.0"; - usrerr("552 Header line too long (%d max)", - MaxHeaderLineLength); + usrerr("552 Headers too large (%d max)", + MaxHeadersLength); mstate = MS_DISCARD; } } @@ -356,22 +354,6 @@ nextstate: goto nextstate; } - if (MaxHeaderLines > 0 && - ++nhdrlines > MaxHeaderLines) - { - sm_syslog(LOG_NOTICE, e->e_id, - "too many header lines (%d max) from %s during message collect", - MaxHeaderLines, - CurHostName != NULL ? CurHostName : "localhost"); - errno = 0; - e->e_flags |= EF_CLRQUEUE; - e->e_status = "5.6.0"; - usrerr("552 Too many header lines (%d max)", - MaxHeaderLines); - mstate = MS_DISCARD; - break; - } - /* check for possible continuation line */ do { diff --git a/contrib/sendmail/src/conf.c b/contrib/sendmail/src/conf.c index 2544de6..3cfa73b 100644 --- a/contrib/sendmail/src/conf.c +++ b/contrib/sendmail/src/conf.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)conf.c 8.450 (Berkeley) 12/17/1998"; +static char sccsid[] = "@(#)conf.c 8.452 (Berkeley) 1/26/1999"; #endif /* not lint */ # include "sendmail.h" @@ -284,8 +284,7 @@ setdefaults(e) ColonOkInAddr = TRUE; DontLockReadFiles = TRUE; DoubleBounceAddr = "postmaster"; - MaxHeaderLines = MAXHDRLINES; - MaxHeaderLineLength = MAXHDRLINELEN; + MaxHeadersLength = MAXHDRSLEN; snprintf(buf, sizeof buf, "%s%sdead.letter", _PATH_VARTMP, _PATH_VARTMP[sizeof _PATH_VARTMP - 2] == '/' ? "" : "/"); diff --git a/contrib/sendmail/src/conf.h b/contrib/sendmail/src/conf.h index 8e5a637..6097c27 100644 --- a/contrib/sendmail/src/conf.h +++ b/contrib/sendmail/src/conf.h @@ -9,7 +9,7 @@ * the sendmail distribution. * * - * @(#)conf.h 8.380 (Berkeley) 11/9/1998 + * @(#)conf.h 8.385 (Berkeley) 1/28/1999 */ /* @@ -69,11 +69,8 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */ # else # define MAXMACNAMELEN 20 /* max macro name length */ # endif -# ifndef MAXHDRLINES -# define MAXHDRLINES 1000 /* max lines in a message header */ -# endif -# ifndef MAXHDRLINELEN -# define MAXHDRLINELEN SMTPLINELIM /* max length of a header line */ +# ifndef MAXHDRSLEN +# define MAXHDRSLEN (32 * 1024) /* max size of message headers */ # endif /********************************************************************** @@ -1302,10 +1299,12 @@ extern void *malloc(); # endif # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() impl */ # define SPT_PADCHAR '\0' /* pad process title with nulls */ +# ifndef TZ_TYPE +# define TZ_TYPE TZ_NONE /* no standard for Linux */ +# endif # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/var/run/sendmail.pid" # endif -# define TZ_TYPE TZ_TZNAME # include <sys/sysmacros.h> # undef atol /* wounded in <stdlib.h> */ #endif diff --git a/contrib/sendmail/src/control.c b/contrib/sendmail/src/control.c index 157ca08..415818c 100644 --- a/contrib/sendmail/src/control.c +++ b/contrib/sendmail/src/control.c @@ -8,7 +8,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)control.c 8.17 (Berkeley) 12/1/1998"; +static char sccsid[] = "@(#)control.c 8.18 (Berkeley) 1/17/1999"; #endif /* not lint */ #include "sendmail.h" @@ -70,8 +70,7 @@ opencontrolsocket() { int save_errno = errno; - (void) close(ControlSocket); - ControlSocket = -1; + clrcontrol(); errno = save_errno; return -1; } @@ -88,6 +87,7 @@ opencontrolsocket() ControlSocketName, errstring(save_errno)); message("050 ownership change on %s failed: %s", ControlSocketName, errstring(save_errno)); + closecontrolsocket(TRUE); errno = save_errno; return -1; } diff --git a/contrib/sendmail/src/daemon.c b/contrib/sendmail/src/daemon.c index b74a7a7..ae6b004 100644 --- a/contrib/sendmail/src/daemon.c +++ b/contrib/sendmail/src/daemon.c @@ -15,9 +15,9 @@ #ifndef lint #ifdef DAEMON -static char sccsid[] = "@(#)daemon.c 8.234 (Berkeley) 12/17/1998 (with daemon mode)"; +static char sccsid[] = "@(#)daemon.c 8.236 (Berkeley) 1/25/1999 (with daemon mode)"; #else -static char sccsid[] = "@(#)daemon.c 8.234 (Berkeley) 12/17/1998 (without daemon mode)"; +static char sccsid[] = "@(#)daemon.c 8.236 (Berkeley) 1/25/1999 (without daemon mode)"; #endif #endif /* not lint */ @@ -178,8 +178,8 @@ getrequests(e) if (opencontrolsocket() < 0) sm_syslog(LOG_WARNING, NOQID, - "daemon could not open control socket: %s", - errstring(errno)); + "daemon could not open control socket %s: %s", + ControlSocketName, errstring(errno)); (void) setsignal(SIGCHLD, reapchild); @@ -503,7 +503,7 @@ getrequests(e) } /* parent -- keep track of children */ - snprintf(status, MAXLINE, "SMTP server child for %s", + snprintf(status, sizeof status, "SMTP server child for %s", anynet_ntoa(&RealHostAddr)); proc_list_add(pid, status); (void) releasesignal(SIGCHLD); diff --git a/contrib/sendmail/src/deliver.c b/contrib/sendmail/src/deliver.c index e70f17e..ed03328 100644 --- a/contrib/sendmail/src/deliver.c +++ b/contrib/sendmail/src/deliver.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)deliver.c 8.366 (Berkeley) 12/18/1998"; +static char sccsid[] = "@(#)deliver.c 8.367 (Berkeley) 1/18/1999"; #endif /* not lint */ #include "sendmail.h" @@ -2003,7 +2003,7 @@ do_transfer: mci->mci_contentlen = 0; putfromline(mci, e); - (*e->e_puthdr)(mci, e->e_header, e); + (*e->e_puthdr)(mci, e->e_header, e, M87F_OUTER); (*e->e_putbody)(mci, e, NULL); /* get the exit status */ @@ -3569,7 +3569,7 @@ mailfile(filename, mailer, ctladdr, sfflags, e) #endif putfromline(&mcibuf, e); - (*e->e_puthdr)(&mcibuf, e->e_header, e); + (*e->e_puthdr)(&mcibuf, e->e_header, e, M87F_OUTER); (*e->e_putbody)(&mcibuf, e, NULL); putline("\n", &mcibuf); if (fflush(f) < 0 || ferror(f)) diff --git a/contrib/sendmail/src/domain.c b/contrib/sendmail/src/domain.c index a279c0e..ec79be8 100644 --- a/contrib/sendmail/src/domain.c +++ b/contrib/sendmail/src/domain.c @@ -14,9 +14,9 @@ #ifndef lint #if NAMED_BIND -static char sccsid[] = "@(#)domain.c 8.80 (Berkeley) 12/17/1998 (with name server)"; +static char sccsid[] = "@(#)domain.c 8.81 (Berkeley) 1/21/1999 (with name server)"; #else -static char sccsid[] = "@(#)domain.c 8.80 (Berkeley) 12/17/1998 (without name server)"; +static char sccsid[] = "@(#)domain.c 8.81 (Berkeley) 1/21/1999 (without name server)"; #endif #endif /* not lint */ @@ -446,7 +446,6 @@ bestmx_map_lookup(map, name, av, statp) int *statp; { int nmx; - auto int rcode; int saveopts = _res.options; int i, len = 0; char *p; @@ -454,7 +453,7 @@ bestmx_map_lookup(map, name, av, statp) char buf[PSBUFSIZE / 2]; _res.options &= ~(RES_DNSRCH|RES_DEFNAMES); - nmx = getmxrr(name, mxhosts, FALSE, &rcode); + nmx = getmxrr(name, mxhosts, FALSE, statp); _res.options = saveopts; if (nmx <= 0) return NULL; diff --git a/contrib/sendmail/src/envelope.c b/contrib/sendmail/src/envelope.c index a17aa8c..2cc90d6 100644 --- a/contrib/sendmail/src/envelope.c +++ b/contrib/sendmail/src/envelope.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)envelope.c 8.121 (Berkeley) 12/18/1998"; +static char sccsid[] = "@(#)envelope.c 8.122 (Berkeley) 1/25/1999"; #endif /* not lint */ #include "sendmail.h" @@ -800,7 +800,7 @@ setsender(from, e, delimptr, delimchar, internal) if (FullName != NULL && !internal) define('x', FullName, e); } - else if (!internal && OpMode != MD_DAEMON) + else if (!internal && OpMode != MD_DAEMON && OpMode != MD_SMTP) { if (e->e_from.q_home == NULL) { diff --git a/contrib/sendmail/src/headers.c b/contrib/sendmail/src/headers.c index fcf1d9c..6c43dcb 100644 --- a/contrib/sendmail/src/headers.c +++ b/contrib/sendmail/src/headers.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)headers.c 8.134 (Berkeley) 11/29/1998"; +static char sccsid[] = "@(#)headers.c 8.136 (Berkeley) 1/26/1999"; #endif /* not lint */ # include <errno.h> @@ -77,6 +77,7 @@ chompheader(line, def, hdrp, e) bool headeronly; STAB *s; struct hdrinfo *hi; + bool nullheader = FALSE; BITMAP mopts; if (tTd(31, 6)) @@ -123,11 +124,17 @@ chompheader(line, def, hdrp, e) return 0; } *fvalue = '\0'; - fvalue = p; /* strip field value on front */ - if (*fvalue == ' ') - fvalue++; + if (*p == ' ') + p++; + fvalue = p; + + /* if the field is null, go ahead and use the default */ + while (isascii(*p) && isspace(*p)) + p++; + if (*p == '\0') + nullheader = TRUE; /* security scan: long field names are end-of-header */ if (strlen(fname) > 100) @@ -236,6 +243,11 @@ chompheader(line, def, hdrp, e) bitset(H_DEFAULT, h->h_flags) && !bitset(H_FORCE, h->h_flags)) { + if (nullheader) + { + /* user-supplied value was null */ + return 0; + } h->h_value = NULL; if (!cond) { @@ -1149,6 +1161,7 @@ crackaddr(addr) ** mci -- the connection information. ** h -- the header to put. ** e -- envelope to use. +** flags -- MIME conversion flags. ** ** Returns: ** none. @@ -1165,10 +1178,11 @@ crackaddr(addr) #endif void -putheader(mci, hdr, e) +putheader(mci, hdr, e, flags) register MCI *mci; HDR *hdr; register ENVELOPE *e; + int flags; { register HDR *h; char buf[MAX(MAXLINE,BUFSIZ)]; @@ -1251,9 +1265,16 @@ putheader(mci, hdr, e) } #endif - /* suppress Content-Transfer-Encoding: if we are MIMEing */ + /* + ** Suppress Content-Transfer-Encoding: if we are MIMEing + ** and we are potentially converting from 8 bit to 7 bit + ** MIME. If converting, add a new CTE header in + ** mime8to7(). + */ if (bitset(H_CTE, h->h_flags) && - bitset(MCIF_CVT8TO7|MCIF_CVT7TO8|MCIF_INMIME, mci->mci_flags)) + bitset(MCIF_CVT8TO7|MCIF_CVT7TO8|MCIF_INMIME, + mci->mci_flags) && + !bitset(M87F_NO8TO7, flags)) { if (tTd(34, 11)) printf(" (skipped (content-transfer-encoding))\n"); diff --git a/contrib/sendmail/src/ldap_map.h b/contrib/sendmail/src/ldap_map.h index 97eb29e..7d40329 100644 --- a/contrib/sendmail/src/ldap_map.h +++ b/contrib/sendmail/src/ldap_map.h @@ -14,7 +14,7 @@ ** Please go to him for support -- since I (Eric) don't run LDAP, I ** can't help you at all. ** -** @(#)ldap_map.h 8.10 (Berkeley) 9/14/1998 +** @(#)ldap_map.h 8.12 (Berkeley) 2/2/1999 */ #ifndef _LDAP_MAP_H @@ -68,4 +68,24 @@ typedef struct ldap_map_struct LDAP_MAP_STRUCT; # define DEFAULT_LDAP_MAP_LDAP_OPTIONS 0 #endif /* LDAP_REFERRALS */ +/* +** ldap_init(3) is broken in Umich 3.x and OpenLDAP 1.0/1.1. +** Use the lack of LDAP_OPT_SIZELIMIT to detect old API implementations +** and assume (falsely) that all old API implementations are broken. +** (OpenLDAP 1.2 and later have a working ldap_init(), add -DUSE_LDAP_INIT) +*/ + +#if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) +# define USE_LDAP_INIT 1 +#endif + +/* +** LDAP_OPT_SIZELIMIT is not defined under Umich 3.x nor OpenLDAP 1.x, +** hence ldap_set_option() must not exist. +*/ + +#if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) +# define USE_LDAP_SET_OPTION 1 +#endif + #endif /* _LDAP_MAP_H */ diff --git a/contrib/sendmail/src/map.c b/contrib/sendmail/src/map.c index 787ae07..8fc3387f 100644 --- a/contrib/sendmail/src/map.c +++ b/contrib/sendmail/src/map.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)map.c 8.256 (Berkeley) 11/15/1998"; +static char sccsid[] = "@(#)map.c 8.261 (Berkeley) 2/2/1999"; #endif /* not lint */ #include "sendmail.h" @@ -1877,9 +1877,11 @@ db_map_close(map) ** opened by another process will interfere ** with the shared memory and locks of the parent ** process leaving things in a bad state. - ** + */ + + /* ** If this map was not opened by the current - ** process, do not close it here but recover + ** process, do not close the map but recover ** the file descriptor. */ if (map->map_pid != getpid()) @@ -2670,7 +2672,7 @@ ldap_map_start(map) ev = setevent(lmap->timeout.tv_sec, ldaptimeout, 0); } -#ifdef LDAP_VERSION3 +#ifdef USE_LDAP_INIT ld = ldap_init(lmap->ldaphost,lmap->ldapport); #else ld = ldap_open(lmap->ldaphost,lmap->ldapport); @@ -2691,23 +2693,26 @@ ldap_map_start(map) return FALSE; } -#ifdef LDAP_VERSION3 +#ifdef USE_LDAP_SET_OPTION ldap_set_option(ld, LDAP_OPT_DEREF, &lmap->deref); ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &lmap->timelimit); ldap_set_option(ld, LDAP_OPT_SIZELIMIT, &lmap->sizelimit); - ldap_set_option(ld, LDAP_OPT_REFERRALS, &lmap->ldap_options); - - /* ld needs to be cast into the map struct */ - lmap->ld = ld; - return TRUE; + ldap_set_option(ld, LDAP_OPT_REFERRALS, + bitset(LDAP_OPT_REFERRALS, lmap->ldap_options) ? + LDAP_OPT_ON : LDAP_OPT_OFF); #else - /* From here on in we can use ldap internal timelimits */ ld->ld_deref = lmap->deref; ld->ld_timelimit = lmap->timelimit; ld->ld_sizelimit = lmap->sizelimit; ld->ld_options = lmap->ldap_options; +#endif +#ifdef USE_LDAP_INIT + /* ld needs to be cast into the map struct */ + lmap->ld = ld; + return TRUE; +#else if (ldap_bind_s(ld, lmap->binddn,lmap->passwd,lmap->method) != LDAP_SUCCESS) { if (!bitset(MF_OPTIONAL, map->map_mflags)) @@ -2729,19 +2734,33 @@ ldap_map_start(map) /* -** LDAP_MAP_CLOSE -- close ldap map +** LDAP_MAP_STOP -- close the ldap connection */ void -ldap_map_close(map) +ldap_map_stop(map) MAP *map; { - LDAP_MAP_STRUCT *lmap ; + LDAP_MAP_STRUCT *lmap; + lmap = (LDAP_MAP_STRUCT *) map->map_db1; if (lmap->ld != NULL) + { ldap_unbind(lmap->ld); + lmap->ld = NULL; + } } +/* +** LDAP_MAP_CLOSE -- close ldap map +*/ + +void +ldap_map_close(map) + MAP *map; +{ + ldap_map_stop(map); +} #ifdef SUNET_ID /* @@ -2855,8 +2874,8 @@ ldap_map_lookup(map, name, av, statp) lmap->attr, lmap->attrsonly, &(lmap->timeout), &(lmap->res)) != LDAP_SUCCESS) { - /* try close/opening map */ - ldap_map_close(map); + /* try stopping/starting map */ + ldap_map_stop(map); if (!ldap_map_start(map)) { result = NULL; @@ -2918,7 +2937,7 @@ ldap_map_lookup(map, name, av, statp) ldap_value_free(attr_values); if (lmap != NULL) ldap_msgfree(lmap->res); - ldap_map_close(map); + ldap_map_stop(map); return result ; } diff --git a/contrib/sendmail/src/mime.c b/contrib/sendmail/src/mime.c index a1429cb..7156891 100644 --- a/contrib/sendmail/src/mime.c +++ b/contrib/sendmail/src/mime.c @@ -14,7 +14,7 @@ # include <string.h> #ifndef lint -static char sccsid[] = "@(#)mime.c 8.70 (Berkeley) 11/10/1998"; +static char sccsid[] = "@(#)mime.c 8.71 (Berkeley) 1/18/1999"; #endif /* not lint */ /* @@ -308,7 +308,7 @@ mime8to7(mci, header, e, boundaries, flags) collect(e->e_dfp, FALSE, &hdr, e); if (tTd(43, 101)) putline("+++after collect", mci); - putheader(mci, hdr, e); + putheader(mci, hdr, e, flags); if (tTd(43, 101)) putline("+++after putheader", mci); bt = mime8to7(mci, hdr, e, boundaries, flags); @@ -360,7 +360,7 @@ mime8to7(mci, header, e, boundaries, flags) collect(e->e_dfp, FALSE, &hdr, e); if (tTd(43, 101)) putline("+++after collect", mci); - putheader(mci, hdr, e); + putheader(mci, hdr, e, flags); if (tTd(43, 101)) putline("+++after putheader", mci); if (hvalue("MIME-Version", hdr) == NULL) @@ -442,11 +442,16 @@ mime8to7(mci, header, e, boundaries, flags) if (sectionhighbits == 0) { /* no encoding necessary */ - if (cte != NULL && bitset(MCIF_INMIME, mci->mci_flags)) + if (cte != NULL && + bitset(MCIF_INMIME, mci->mci_flags) && + !bitset(M87F_NO8TO7, flags)) { /* - ** Skip _unless_ in MIME mode; see putheader() for the - ** counterpart where this is skipped _if_ in MIME mode. + ** Skip _unless_ in MIME mode and potentially + ** converting from 8 bit to 7 bit MIME. See + ** putheader() for the counterpart where the + ** CTE header is skipped in the opposite + ** situation. */ snprintf(buf, sizeof buf, diff --git a/contrib/sendmail/src/queue.c b/contrib/sendmail/src/queue.c index 65e777a..b02fc08 100644 --- a/contrib/sendmail/src/queue.c +++ b/contrib/sendmail/src/queue.c @@ -14,9 +14,9 @@ #ifndef lint #if QUEUE -static char sccsid[] = "@(#)queue.c 8.210 (Berkeley) 10/15/1998 (with queueing)"; +static char sccsid[] = "@(#)queue.c 8.211 (Berkeley) 1/25/1999 (with queueing)"; #else -static char sccsid[] = "@(#)queue.c 8.210 (Berkeley) 10/15/1998 (without queueing)"; +static char sccsid[] = "@(#)queue.c 8.211 (Berkeley) 1/25/1999 (without queueing)"; #endif #endif /* not lint */ @@ -348,8 +348,7 @@ queueup(e, announce) { extern bool bitzerop __P((BITMAP)); - /* don't output null headers */ - if (h->h_value == NULL || h->h_value[0] == '\0') + if (h->h_value == NULL) continue; /* don't output resent headers on non-resent messages */ diff --git a/contrib/sendmail/src/readcf.c b/contrib/sendmail/src/readcf.c index ab81027..df40097 100644 --- a/contrib/sendmail/src/readcf.c +++ b/contrib/sendmail/src/readcf.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)readcf.c 8.235 (Berkeley) 8/18/1998"; +static char sccsid[] = "@(#)readcf.c 8.238 (Berkeley) 1/28/1999"; #endif /* not lint */ # include "sendmail.h" @@ -1527,9 +1527,9 @@ struct optioninfo #define O_CONTROLSOCKET 0xa9 { "ControlSocketName", O_CONTROLSOCKET, FALSE }, #endif -#if _FFR_MAX_HEADER_LINES -#define O_MAXHDRLINES 0xaa - { "MaxHeaderLines", O_MAXHDRLINES, FALSE }, +#if _FFR_MAX_HEADERS_LENGTH +#define O_MAXHDRSLEN 0xaa + { "MaxHeadersLength", O_MAXHDRSLEN, FALSE }, #endif { NULL, '\0', FALSE } }; @@ -2470,22 +2470,13 @@ setoption(opt, val, safe, sticky, e) break; #endif -#if _FFR_MAX_HEADER_LINES - case O_MAXHDRLINES: - p = strchr(val, '/'); - if (p != NULL) - *p++ = '\0'; - MaxHeaderLines = atoi(val); - if (p != NULL && *p != '\0') - MaxHeaderLineLength = atoi(p); - - if (MaxHeaderLines > 0 && - MaxHeaderLines < 50) - printf("Warning: MaxHeaderLines: header line limit set lower than 50\n"); +#if _FFR_MAX_HEADERS_LENGTH + case O_MAXHDRSLEN: + MaxHeadersLength = atoi(val); - if (MaxHeaderLineLength > 0 && - MaxHeaderLineLength < MAXHDRLINELEN) - printf("Warning: MaxHeaderLines: header line length limit set lower than %d\n", MAXHDRLINELEN); + if (MaxHeadersLength > 0 && + MaxHeadersLength < (MAXHDRSLEN / 2)) + printf("Warning: MaxHeadersLength: headers length limit set lower than %d\n", MAXHDRSLEN); break; #endif diff --git a/contrib/sendmail/src/recipient.c b/contrib/sendmail/src/recipient.c index 59412a8..f7e221f 100644 --- a/contrib/sendmail/src/recipient.c +++ b/contrib/sendmail/src/recipient.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)recipient.c 8.161 (Berkeley) 12/18/1998"; +static char sccsid[] = "@(#)recipient.c 8.163 (Berkeley) 1/23/1999"; #endif /* not lint */ # include "sendmail.h" @@ -1195,6 +1195,7 @@ resetuid: { /* don't do any more now */ ctladdr->q_flags |= QVERIFIED; + ctladdr->q_flags &= ~QDONTSEND; e->e_nrcpts++; xfclose(fp, "include", fname); return rval; @@ -1409,6 +1410,8 @@ self_reference(a, e) c = a; while (c != NULL) { + if (tTd(27, 10)) + printf(" %s", c->q_user); if (bitnset(M_HASPWENT, c->q_mailer->m_flags)) { if (tTd(27, 2)) @@ -1427,6 +1430,22 @@ self_reference(a, e) if (tTd(27, 2)) printf("failed\n"); } + else + { + /* if local delivery, compare usernames */ + if (bitnset(M_LOCALMAILER, c->q_mailer->m_flags) && + b->q_mailer == c->q_mailer) + { + if (tTd(27, 2)) + printf("\t... local match (%s)\n", c->q_user); + if (sameaddr(b, c)) + return b; + else + return c; + } + } + if (tTd(27, 10)) + printf("\n"); c = c->q_alias; } diff --git a/contrib/sendmail/src/savemail.c b/contrib/sendmail/src/savemail.c index f15c8de..6a18ee6 100644 --- a/contrib/sendmail/src/savemail.c +++ b/contrib/sendmail/src/savemail.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)savemail.c 8.139 (Berkeley) 8/5/1998"; +static char sccsid[] = "@(#)savemail.c 8.140 (Berkeley) 1/18/1999"; #endif /* not lint */ # include "sendmail.h" @@ -395,7 +395,7 @@ savemail(e, sendbody) mcibuf.mci_contentlen = 0; putfromline(&mcibuf, e); - (*e->e_puthdr)(&mcibuf, e->e_header, e); + (*e->e_puthdr)(&mcibuf, e->e_header, e, M87F_OUTER); (*e->e_putbody)(&mcibuf, e, NULL); putline("\n", &mcibuf); (void) fflush(fp); @@ -1139,7 +1139,7 @@ errbody(mci, e, separator) } } putline("", mci); - putheader(mci, e->e_parent->e_header, e->e_parent); + putheader(mci, e->e_parent->e_header, e->e_parent, M87F_OUTER); if (sendbody) putbody(mci, e->e_parent, e->e_msgboundary); else if (e->e_msgboundary == NULL) diff --git a/contrib/sendmail/src/sendmail.h b/contrib/sendmail/src/sendmail.h index 3c73699..ff2697e 100644 --- a/contrib/sendmail/src/sendmail.h +++ b/contrib/sendmail/src/sendmail.h @@ -9,7 +9,7 @@ * the sendmail distribution. * * - * @(#)sendmail.h 8.292 (Berkeley) 11/21/1998 + * @(#)sendmail.h 8.295 (Berkeley) 1/26/1999 */ /* @@ -19,7 +19,7 @@ # ifdef _DEFINE # define EXTERN # ifndef lint -static char SmailSccsId[] = "@(#)sendmail.h 8.292 11/21/1998"; +static char SmailSccsId[] = "@(#)sendmail.h 8.295 1/26/1999"; # endif # else /* _DEFINE */ # define EXTERN extern @@ -464,7 +464,7 @@ struct envelope short e_sendmode; /* message send mode */ short e_errormode; /* error return mode */ short e_timeoutclass; /* message timeout class */ - void (*e_puthdr)__P((MCI *, HDR *, ENVELOPE *)); + void (*e_puthdr)__P((MCI *, HDR *, ENVELOPE *, int)); /* function to put header of message */ void (*e_putbody)__P((MCI *, ENVELOPE *, char *)); /* function to put body of message */ @@ -522,7 +522,7 @@ extern ENVELOPE *newenvelope __P((ENVELOPE *, ENVELOPE *)); extern void dropenvelope __P((ENVELOPE *, bool)); extern void clearenvelope __P((ENVELOPE *, bool)); -extern void putheader __P((MCI *, HDR *, ENVELOPE *)); +extern void putheader __P((MCI *, HDR *, ENVELOPE *, int)); extern void putbody __P((MCI *, ENVELOPE *, char *)); /* ** Message priority classes. @@ -1258,8 +1258,7 @@ EXTERN gid_t RunAsGid; /* GID to become for bulk of run */ EXTERN int MaxRcptPerMsg; /* max recipients per SMTP message */ EXTERN bool DoQueueRun; /* non-interrupt time queue run needed */ EXTERN u_long ConnectOnlyTo; /* override connection address (for testing) */ -EXTERN int MaxHeaderLines; /* max lines of headers per message */ -EXTERN int MaxHeaderLineLength; /* max length of a header line */ +EXTERN int MaxHeadersLength; /* max length of headers */ #if _FFR_DSN_RRT_OPTION EXTERN bool RrtImpliesDsn; /* turn Return-Receipt-To: into DSN */ #endif diff --git a/contrib/sendmail/src/udb.c b/contrib/sendmail/src/udb.c index a279aff..96c6513 100644 --- a/contrib/sendmail/src/udb.c +++ b/contrib/sendmail/src/udb.c @@ -14,9 +14,9 @@ #ifndef lint #if USERDB -static char sccsid [] = "@(#)udb.c 8.70 (Berkeley) 12/21/1998 (with USERDB)"; +static char sccsid [] = "@(#)udb.c 8.71 (Berkeley) 1/17/1999 (with USERDB)"; #else -static char sccsid [] = "@(#)udb.c 8.70 (Berkeley) 12/21/1998 (without USERDB)"; +static char sccsid [] = "@(#)udb.c 8.71 (Berkeley) 1/17/1999 (without USERDB)"; #endif #endif @@ -1164,11 +1164,7 @@ badspec: #endif if (tTd(28, 1)) { -#if DB_VERSION_MAJOR < 2 - printf("_udbx_init: db->close(%s)\n", -#else printf("_udbx_init: db->close(%s)\n", -#endif up->udb_dbname); } } @@ -1242,11 +1238,7 @@ _udbx_close() } if (tTd(28, 1)) { -#if DB_VERSION_MAJOR < 2 - printf("_udbx_init: db->close(%s)\n", -#else printf("_udbx_init: db->close(%s)\n", -#endif up->udb_dbname); } #endif diff --git a/contrib/sendmail/src/usersmtp.c b/contrib/sendmail/src/usersmtp.c index 99ea646..c82942b 100644 --- a/contrib/sendmail/src/usersmtp.c +++ b/contrib/sendmail/src/usersmtp.c @@ -14,9 +14,9 @@ #ifndef lint #if SMTP -static char sccsid[] = "@(#)usersmtp.c 8.108 (Berkeley) 10/6/1998 (with SMTP)"; +static char sccsid[] = "@(#)usersmtp.c 8.111 (Berkeley) 2/3/1999 (with SMTP)"; #else -static char sccsid[] = "@(#)usersmtp.c 8.108 (Berkeley) 10/6/1998 (without SMTP)"; +static char sccsid[] = "@(#)usersmtp.c 8.111 (Berkeley) 2/3/1999 (without SMTP)"; #endif #endif /* not lint */ @@ -327,7 +327,6 @@ smtpmailfrom(m, mci, e) ENVELOPE *e; { int r; - int l; char *bufp; char *bodytype; char buf[MAXNAME + 1]; @@ -337,11 +336,12 @@ smtpmailfrom(m, mci, e) printf("smtpmailfrom: CurHost=%s\n", CurHostName); /* set up appropriate options to include */ + bufp = optbuf; if (bitset(MCIF_SIZE, mci->mci_flags) && e->e_msgsize > 0) snprintf(optbuf, sizeof optbuf, " SIZE=%ld", e->e_msgsize); else strcpy(optbuf, ""); - l = sizeof optbuf - strlen(optbuf) - 1; + bufp = &optbuf[strlen(optbuf)]; bodytype = e->e_bodytype; if (bitset(MCIF_8BITMIME, mci->mci_flags)) @@ -352,11 +352,12 @@ smtpmailfrom(m, mci, e) !bitset(EF_DONT_MIME, e->e_flags) && !bitnset(M_8BITS, m->m_flags)) bodytype = "8BITMIME"; - if (bodytype != NULL && strlen(bodytype) + 7 < l) + if (bodytype != NULL && + SPACELEFT(optbuf, bufp) > strlen(bodytype) + 7) { - strcat(optbuf, " BODY="); - strcat(optbuf, bodytype); - l -= strlen(optbuf); + snprintf(bufp, SPACELEFT(optbuf, bufp), + " BODY=%s", bodytype); + bufp += strlen(bufp); } } else if (bitnset(M_8BITS, m->m_flags) || @@ -387,22 +388,23 @@ smtpmailfrom(m, mci, e) if (bitset(MCIF_DSN, mci->mci_flags)) { - if (e->e_envid != NULL && strlen(e->e_envid) < (SIZE_T) (l - 7)) + if (e->e_envid != NULL && + SPACELEFT(optbuf, bufp) > strlen(e->e_envid) + 7) { - strcat(optbuf, " ENVID="); - strcat(optbuf, e->e_envid); - l -= strlen(optbuf); + snprintf(bufp, SPACELEFT(optbuf, bufp), + " ENVID=%s", e->e_envid); + bufp += strlen(bufp); } /* RET= parameter */ - if (bitset(EF_RET_PARAM, e->e_flags) && l >= 9) + if (bitset(EF_RET_PARAM, e->e_flags) && + SPACELEFT(optbuf, bufp) > 9) { - strcat(optbuf, " RET="); - if (bitset(EF_NO_BODY_RETN, e->e_flags)) - strcat(optbuf, "HDRS"); - else - strcat(optbuf, "FULL"); - l -= 9; + snprintf(bufp, SPACELEFT(optbuf, bufp), + " RET=%s", + bitset(EF_NO_BODY_RETN, e->e_flags) ? + "HDRS" : "FULL"); + bufp += strlen(bufp); } } @@ -529,11 +531,11 @@ smtprcpt(to, m, mci, e) ENVELOPE *e; { register int r; - int l; + char *bufp; char optbuf[MAXLINE]; strcpy(optbuf, ""); - l = sizeof optbuf - 1; + bufp = &optbuf[strlen(optbuf)]; if (bitset(MCIF_DSN, mci->mci_flags)) { /* NOTIFY= parameter */ @@ -543,37 +545,38 @@ smtprcpt(to, m, mci, e) { bool firstone = TRUE; - strcat(optbuf, " NOTIFY="); + strcat(bufp, " NOTIFY="); if (bitset(QPINGONSUCCESS, to->q_flags)) { - strcat(optbuf, "SUCCESS"); + strcat(bufp, "SUCCESS"); firstone = FALSE; } if (bitset(QPINGONFAILURE, to->q_flags)) { if (!firstone) - strcat(optbuf, ","); - strcat(optbuf, "FAILURE"); + strcat(bufp, ","); + strcat(bufp, "FAILURE"); firstone = FALSE; } if (bitset(QPINGONDELAY, to->q_flags)) { if (!firstone) - strcat(optbuf, ","); - strcat(optbuf, "DELAY"); + strcat(bufp, ","); + strcat(bufp, "DELAY"); firstone = FALSE; } if (firstone) - strcat(optbuf, "NEVER"); - l -= strlen(optbuf); + strcat(bufp, "NEVER"); + bufp += strlen(bufp); } /* ORCPT= parameter */ - if (to->q_orcpt != NULL && strlen(to->q_orcpt) + 7 < l) + if (to->q_orcpt != NULL && + SPACELEFT(optbuf, bufp) > strlen(to->q_orcpt) + 7) { - strcat(optbuf, " ORCPT="); - strcat(optbuf, to->q_orcpt); - l -= strlen(optbuf); + snprintf(bufp, SPACELEFT(optbuf, bufp), + " ORCPT=%s", to->q_orcpt); + bufp += strlen(bufp); } } @@ -673,7 +676,7 @@ smtpdata(m, mci, e) smtprset(m, mci, e); return EX_UNAVAILABLE; } - else if (r != 354) + else if (REPLYTYPE(r) != 3) { if (LogLevel > 1) { @@ -713,7 +716,7 @@ smtpdata(m, mci, e) ** Output the actual message. */ - (*e->e_puthdr)(mci, e->e_header, e); + (*e->e_puthdr)(mci, e->e_header, e, M87F_OUTER); (*e->e_putbody)(mci, e, NULL); /* diff --git a/contrib/sendmail/src/util.c b/contrib/sendmail/src/util.c index 785d362..0cb8992 100644 --- a/contrib/sendmail/src/util.c +++ b/contrib/sendmail/src/util.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)util.c 8.167 (Berkeley) 12/1/1998"; +static char sccsid[] = "@(#)util.c 8.168 (Berkeley) 1/21/1999"; #endif /* not lint */ # include "sendmail.h" @@ -1026,6 +1026,7 @@ sfgets(buf, siz, fp, timeout, during) { register EVENT *ev = NULL; register char *p; + int save_errno; if (fp == NULL) { @@ -1043,7 +1044,6 @@ sfgets(buf, siz, fp, timeout, during) "timeout waiting for input from %.100s during %s", CurHostName ? CurHostName : "local", during); - errno = 0; buf[0] = '\0'; #if XDEBUG checkfd012(during); @@ -1051,6 +1051,7 @@ sfgets(buf, siz, fp, timeout, during) if (TrafficLogFile != NULL) fprintf(TrafficLogFile, "%05d <<< [TIMEOUT]\n", (int) getpid()); + errno = 0; return (NULL); } ev = setevent(timeout, readtimeout, 0); @@ -1058,6 +1059,7 @@ sfgets(buf, siz, fp, timeout, during) /* try to read */ p = NULL; + errno = 0; while (!feof(fp) && !ferror(fp)) { errno = 0; @@ -1066,6 +1068,7 @@ sfgets(buf, siz, fp, timeout, during) break; clearerr(fp); } + save_errno = errno; /* clear the event if it has not sprung */ clrevent(ev); @@ -1077,6 +1080,7 @@ sfgets(buf, siz, fp, timeout, during) buf[0] = '\0'; if (TrafficLogFile != NULL) fprintf(TrafficLogFile, "%05d <<< [EOF]\n", (int) getpid()); + errno = save_errno; return (NULL); } if (TrafficLogFile != NULL) diff --git a/contrib/sendmail/src/version.c b/contrib/sendmail/src/version.c index 8e8707b..6f9d05e 100644 --- a/contrib/sendmail/src/version.c +++ b/contrib/sendmail/src/version.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)version.c 8.9.2.1 (Berkeley) 12/29/1998"; +static char sccsid[] = "@(#)version.c 8.9.3.1 (Berkeley) 2/4/1999"; #endif /* not lint */ -char Version[] = "8.9.2"; +char Version[] = "8.9.3"; |