aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sendmail
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1996-10-24 04:51:14 +0000
committerPeter Wemm <peter@FreeBSD.org>1996-10-24 04:51:14 +0000
commit3b50ea913d769957ab9b7033645004280e6ba4bb (patch)
treeefb7adf2e82400d24328b6391407afe19db7f244 /usr.sbin/sendmail
parent70cd2f632d3327a2ce3dbaca1da559601d7b7fc1 (diff)
parent606a9934698724ead709ea8f66eeb8831ae541bf (diff)
downloadsrc-3b50ea913d769957ab9b7033645004280e6ba4bb.tar.gz
src-3b50ea913d769957ab9b7033645004280e6ba4bb.zip
This commit was generated by cvs2svn to compensate for changes in r19146,
which included commits to RCS files with non-trunk default branches.
Notes
Notes: svn path=/head/; revision=19147
Diffstat (limited to 'usr.sbin/sendmail')
-rw-r--r--usr.sbin/sendmail/FAQ734
-rw-r--r--usr.sbin/sendmail/KNOWNBUGS18
-rw-r--r--usr.sbin/sendmail/READ_ME18
-rw-r--r--usr.sbin/sendmail/RELEASE_NOTES726
-rw-r--r--usr.sbin/sendmail/cf/README225
-rw-r--r--usr.sbin/sendmail/cf/cf/chez.cs.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/clientproto.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/cs-hpux10.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/cs-hpux9.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/cs-osf1.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/cs-solaris2.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/cs-sunos4.1.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/cs-ultrix4.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/cyrusproto.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-bsd4.4.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-hpux10.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-hpux9.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-nextstep3.3.mc48
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-osf1.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-solaris2.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-sunos4.1.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-ultrix4.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/huginn.cs.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/mail.cs.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/mail.eecs.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/mailspool.cs.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/python.cs.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/s2k-osf1.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/s2k-ultrix4.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/tcpproto.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/ucbarpa.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/ucbvax.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/uucpproto.mc3
-rw-r--r--usr.sbin/sendmail/cf/cf/vangogh.cs.mc3
-rw-r--r--usr.sbin/sendmail/cf/domain/generic.m43
-rw-r--r--usr.sbin/sendmail/cf/feature/bestmx_is_local.m412
-rw-r--r--usr.sbin/sendmail/cf/feature/genericstable.m440
-rw-r--r--usr.sbin/sendmail/cf/feature/limited_masquerade.m440
-rw-r--r--usr.sbin/sendmail/cf/feature/local_procmail.m411
-rw-r--r--usr.sbin/sendmail/cf/feature/masquerade_entire_domain.m440
-rw-r--r--usr.sbin/sendmail/cf/feature/nullclient.m45
-rw-r--r--usr.sbin/sendmail/cf/feature/redirect.m44
-rw-r--r--usr.sbin/sendmail/cf/feature/virtusertable.m440
-rw-r--r--usr.sbin/sendmail/cf/m4/cfhead.m412
-rw-r--r--usr.sbin/sendmail/cf/m4/nullrelay.m415
-rw-r--r--usr.sbin/sendmail/cf/m4/proto.m4151
-rw-r--r--usr.sbin/sendmail/cf/m4/version.m44
-rw-r--r--usr.sbin/sendmail/cf/mailer/cyrus.m413
-rw-r--r--usr.sbin/sendmail/cf/mailer/fax.m46
-rw-r--r--usr.sbin/sendmail/cf/mailer/local.m410
-rw-r--r--usr.sbin/sendmail/cf/mailer/pop.m44
-rw-r--r--usr.sbin/sendmail/cf/mailer/procmail.m410
-rw-r--r--usr.sbin/sendmail/cf/ostype/aix2.m441
-rw-r--r--usr.sbin/sendmail/cf/ostype/aix3.m44
-rw-r--r--usr.sbin/sendmail/cf/ostype/altos.m449
-rw-r--r--usr.sbin/sendmail/cf/ostype/amdahl-uts.m46
-rw-r--r--usr.sbin/sendmail/cf/ostype/aux.m46
-rw-r--r--usr.sbin/sendmail/cf/ostype/dgux.m46
-rw-r--r--usr.sbin/sendmail/cf/ostype/domainos.m44
-rw-r--r--usr.sbin/sendmail/cf/ostype/dynix3.2.m44
-rw-r--r--usr.sbin/sendmail/cf/ostype/hpux10.m46
-rw-r--r--usr.sbin/sendmail/cf/ostype/hpux9.m46
-rw-r--r--usr.sbin/sendmail/cf/ostype/irix4.m46
-rw-r--r--usr.sbin/sendmail/cf/ostype/irix5.m46
-rw-r--r--usr.sbin/sendmail/cf/ostype/isc4.1.m46
-rw-r--r--usr.sbin/sendmail/cf/ostype/maxion.m450
-rw-r--r--usr.sbin/sendmail/cf/ostype/nextstep.m46
-rw-r--r--usr.sbin/sendmail/cf/ostype/osf1.m44
-rw-r--r--usr.sbin/sendmail/cf/ostype/ptx2.m49
-rw-r--r--usr.sbin/sendmail/cf/ostype/riscos4.5.m44
-rw-r--r--usr.sbin/sendmail/cf/ostype/sco3.2.m46
-rw-r--r--usr.sbin/sendmail/cf/ostype/solaris2.m47
-rw-r--r--usr.sbin/sendmail/cf/ostype/solaris2.ml.m451
-rw-r--r--usr.sbin/sendmail/cf/ostype/svr4.m46
-rw-r--r--usr.sbin/sendmail/cf/ostype/uxpds.m449
-rw-r--r--usr.sbin/sendmail/contrib/re-mqueue.pl203
-rw-r--r--usr.sbin/sendmail/doc/op/op.me836
-rw-r--r--usr.sbin/sendmail/mail.local/mail.local.c68
-rw-r--r--usr.sbin/sendmail/praliases/Makefile4
-rw-r--r--usr.sbin/sendmail/praliases/praliases.841
-rw-r--r--usr.sbin/sendmail/praliases/praliases.c3
-rw-r--r--usr.sbin/sendmail/src/READ_ME240
-rw-r--r--usr.sbin/sendmail/src/TRACEFLAGS4
-rw-r--r--usr.sbin/sendmail/src/alias.c47
-rw-r--r--usr.sbin/sendmail/src/arpadate.c4
-rw-r--r--usr.sbin/sendmail/src/clock.c4
-rw-r--r--usr.sbin/sendmail/src/convtime.c4
-rw-r--r--usr.sbin/sendmail/src/envelope.c152
-rw-r--r--usr.sbin/sendmail/src/err.c57
-rw-r--r--usr.sbin/sendmail/src/ldap_map.h60
-rw-r--r--usr.sbin/sendmail/src/macro.c30
-rw-r--r--usr.sbin/sendmail/src/makesendmail51
-rw-r--r--usr.sbin/sendmail/src/map.c771
-rw-r--r--usr.sbin/sendmail/src/mci.c841
-rw-r--r--usr.sbin/sendmail/src/mime.c358
-rw-r--r--usr.sbin/sendmail/src/queue.c155
-rw-r--r--usr.sbin/sendmail/src/sendmail.hf49
-rw-r--r--usr.sbin/sendmail/src/stab.c71
-rw-r--r--usr.sbin/sendmail/src/stats.c4
-rw-r--r--usr.sbin/sendmail/src/sysexits.c4
-rw-r--r--usr.sbin/sendmail/src/trace.c4
-rw-r--r--usr.sbin/sendmail/src/useful.h4
-rw-r--r--usr.sbin/sendmail/src/version.c4
-rw-r--r--usr.sbin/sendmail/test/Results22
-rw-r--r--usr.sbin/sendmail/test/t_seteuid.c1
-rw-r--r--usr.sbin/sendmail/test/t_setreuid.c1
106 files changed, 5337 insertions, 1375 deletions
diff --git a/usr.sbin/sendmail/FAQ b/usr.sbin/sendmail/FAQ
index cc27e50805fd..3ed325746f13 100644
--- a/usr.sbin/sendmail/FAQ
+++ b/usr.sbin/sendmail/FAQ
@@ -1,731 +1,9 @@
-Newsgroups: comp.mail.sendmail,comp.mail.misc,comp.mail.smail,comp.answers,news.answers
-Subject: comp.mail.sendmail Frequently Asked Questions (FAQ)
-From: brad@birch.ims.disa.mil (Brad Knowles)
-Followup-to: comp.mail.sendmail
-Summary: This posting contains a list of Frequently Asked Questions
- (and their answers) about the program "sendmail", distributed
- with many versions of Unix (and available for some other
- operating systems). This FAQ is shared between
- comp.mail.sendmail and the Sendmail V8 distribution. It should
- be read by anyone who wishes to post to comp.mail.sendmail, or
- anyone having questions about the newsgroup itself.
-
-Archive-name: mail/sendmail-faq
-Posting-Frequency: monthly (first Monday)
-
-
-[The most recent copy of this document can be obtained via anonymous
-FTP from rtfm.mit.edu in /pub/usenet/news.answers/mail/sendmail-faq.
+The FAQ is no longer maintained with the sendmail release. It is
+posted regularly to comp.mail.sendmail, comp.mail.misc, comp.mail.smail,
+comp.answers, and news.answers, and can be obtained via anonymous FTP
+from ftp://rtfm.mit.edu/pub/usenet/news.answers/mail/sendmail-faq.
If you do not have access to anonymous FTP, you can retrieve it by
sending email to mail-server@rtfm.mit.edu with the command "send
-usenet/news.answers/mail/sendmail-faq" in the message.]
-
-
-
- Sendmail Version 8
- Frequently Asked Questions
- Last updated 9/17/95
-
-
-This FAQ is specific to Version 8.6.10 of sendmail. Other questions,
-particularly regarding compilation and configuration, are answered in
-src/READ_ME and cf/README (found in the V8 sendmail distribution).
-
-This is also the official FAQ for the Usenet newsgroup
-comp.mail.sendmail.
-
-======================================================================
-BEFORE YOU GO ANY FURTHER
-======================================================================
-
- * What do you wish everyone would do before sending you mail or
- posting to comp.mail.sendmail?
-
- Read this FAQ completely. Read src/READ_ME and cf/README
- completely. Read the books written to help with common
- problems such as compilation and installation, configuration,
- security issues, etc.... Ask themselves if their question
- hasn't already been answered.
-----------------------------------------------------------------------
- * How can I be sure if this is the right place to look for answers
- to my questions?
-
- 1. Do you know, for a fact, that the question is related to
- sendmail V8?
-
- 2. Do you know, for a fact, that the question is related to an
- older version of sendmail?
-
- 3. Is the question about a sendmail-like program (e.g., Smail,
- Zmailer, MMDF, etc...)?
-
- 4. Is the question about an SMTP Gateway product for a LAN
- mail package (e.g., cc:Mail, MS-Mail, WordPerfect
- Office/GroupWise, etc...)?
-
- If you answered "yes" to the question #1, then this is the
- right place.
-
- If you answered "yes" to questions #2 or #3, then you should
- seriously consider upgrading to the most recent version of
- sendmail V8.
-
- For question #2, If you're going to continue using an older
- version of sendmail, you may not find much help and will
- probably get some responses that amount to "Get V8".
- Otherwise, this is probably the best place to look for
- answers.
-
- If you answered "yes" to question #3 and are not going to
- upgrade to sendmail V8, then this is probably not the right
- place to look.
-
- If you answered "yes" to question #4, then this is almost
- certainly not the right place to look.
-
- For questions #3 and #4, try looking around elsewhere in the
- "comp.mail.*" hierarchy for a more appropriate newsgroup.
- For example, you might want to try posting to comp.mail.misc
- or comp.mail.smail.
-
- If you couldn't answer "yes" to any of the above questions,
- then you're DEFINITELY in the wrong place. For the sake of
- your sanity and ego, not to mention avoiding the waste of
- your time and ours, try asking your System or E-Mail
- Administrator(s) before you post any questions publicly.
-----------------------------------------------------------------------
- * Where can I find the latest version of this FAQ?
-
- It is included in the most recent Version 8 distribution of
- sendmail (described below), as well as via anonymous FTP from
- rtfm.mit.edu in /pub/usenet/news.answers/mail/sendmail-faq.
- If you do not have access to anonymous FTP, you can retrieve
- it by sending email to mail-server@rtfm.mit.edu with the
- command "send usenet/news.answers/mail/sendmail-faq" in the
- message.
-----------------------------------------------------------------------
- * I don't have access to Usenet news. Can I still get access to
- comp.mail.sendmail?
-
- Yes. Send email to mxt@dl.ac.uk with the command "sub
- comp-news.comp.mail.sendmail <full-US-ordered-email-address>"
- in the message.
-
- E-mail you want posted on comp.mail.sendmail should be sent
- to comp-mail-sendmail@dl.ac.uk
-----------------------------------------------------------------------
- * I have sendmail-related DNS questions. Where should I ask them?
-
- Depending on how deeply they get into the DNS, they can be
- asked here. However, you'll probably be told that you should
- send them to the Info-BIND mailing list (if the question is
- specific to that program) or to the Usenet newsgroup
- comp.protocols.tcp-ip.domains (DNS in general).
-----------------------------------------------------------------------
- * How do I subscribe to either of these?
-
- For comp.protocols.tcp-ip.domains, you have to be on Usenet.
- They don't have a news-to-mail gateway yet.
-
- For the Info-BIND mailing list, send email to
- bind-request@uunet.uu.net with the command "subscribe" in the
- message. Submissions should be sent to bind@uunet.uu.net
-
-======================================================================
-GENERAL QUESTIONS
-======================================================================
-
- * Where can I get Version 8?
-
- Via anonymous FTP from FTP.CS.Berkeley.EDU in /ucb/sendmail.
-----------------------------------------------------------------------
- * What are the differences between Version 8 and other versions?
-
- See doc/changes/changes.me in the sendmail distribution.
-----------------------------------------------------------------------
- * What happened to sendmail 6.x and 7.x?
-
- When a new (Alpha/Beta) version of sendmail was released, it
- was changed to Release 6. Development continued in that tree
- until 4.4BSD was released, when everything on the 4.4 tape
- was set to be version 8.1. Version 7.x never existed.
-----------------------------------------------------------------------
- * What books are available describing sendmail?
-
- There is one book available devoted to sendmail:
-
- Costales, Allman, and Rickert, _Sendmail_. O'Reilly &
- Associates.
-
- Several books have sendmail chapters, for example:
-
- Nemeth, Snyder, and Seebass, _Unix System Administration
- Handbook_. Prentice-Hall.
- Carl-Mitchell and Quarterman, _Practical Internetworking with
- TCP/IP and UNIX_. Addison-Wesley.
- Hunt, _TCP/IP Network Administration_. O'Reilly & Associates.
-
- Another book about sendmail is due out "soon":
-
- Avolio & Vixie, _Sendmail Theory and Practice_. Digital
- Press (release date unknown).
-
- For details on sendmail-related DNS issues, consult:
-
- Liu and Albitz, _DNS and BIND_. O'Reilly & Associates.
-
- For details on UUCP, see:
-
- O'Reilly and Todino, _Managing UUCP and Usenet_.
- O'Reilly & Associates.
-
-======================================================================
-COMPILING AND INSTALLING SENDMAIL 8
-======================================================================
-
- * Version 8 requires a new version of "make". Where can I get this?
-
- Actually, Version 8 does not require a new version of "make".
- It includes a collection of Makefiles for different architectures,
- only one or two of which require the new "make". For a supported
- architecture, use ``sh makesendmail''. If you are porting to a
- new architecture, start with Makefile.dist.
-
- If you really do want the new make, it is available on any of
- the BSD Net2 or 4.4-Lite distribution sites. These include:
-
- ftp.uu.net /systems/unix/bsd-sources
- gatekeeper.dec.com /.0/BSD/net2
- ucquais.cba.uc.edu /pub/net2
- ftp.luth.se /pub/unix/4.3bsd/net2
-
- Diffs and instructions for building this version of make
- under SunOS 4.1.x are available on ftp.css.itd.umich.edu in
- /pub/systems/sun/Net2-make.sun4.diff.Z. A patchkit for
- Ultrix is on ftp.vix.com in /pub/patches/pmake-for-ultrix.Z.
- Patches for AIX 3.2.4 are available on ftp.uni-stuttgart.de
- in /sw/src/patches/bsd-make-rus-patches.
-
- There is also a Linux version available on the main Linux
- distribution sites as pmake; this version is included as
- standard with the current Slackware distributions.
-----------------------------------------------------------------------
- * What macro package do I use to format the V8 man pages?
-
- The BSD group switched over the the ``mandoc'' macros for the
- 4.4 release. These include more hooks designed for hypertext
- handling. However, new man pages won't format under the old
- man macros. Fortunately, old man pages will format under the
- new mandoc macros.
-
- Get the new macros with the BSD Net2 or 4.4-Lite release (see
- above for locations; for example, on FTP.UU.NET the files
- /system/unix/bsd-sources/share/tmac/me/strip/sed and
- /system/unix/bsd-sources/share/tmac/* are what you need).
-
- This macro set is also included with newer versions of groff.
-----------------------------------------------------------------------
- * What modes should be used when installing sendmail?
-
- The sendmail binary should be owned by root, mode 4755.
- The queue directory should be owned by root, with a mode
- between 700 and 755. Under no circumstances should
- it be group or other writable!
- The sendmail config file should be owned by root, mode 644.
- The aliases file should generally be owned by one trusted
- user and writable only by that user, although it is
- not unreasonable to have it group writable by a
- "sysadmin" group. It should not be world writable.
- The aliases database files (aliases.db or aliases.{pag,dir}
- depending on what database format you compile with)
- should be owned by root, mode 644.
-
-======================================================================
-CONFIGURATION QUESTIONS
-======================================================================
-
- * How do I make all my addresses appear to be from a single host?
-
- Using the V8 configuration macros, use:
-
- MASQUERADE_AS(my.dom.ain)
-
- This will cause all addresses to be sent out as being from
- the indicated domain.
-----------------------------------------------------------------------
- * How do I rewrite my From: lines to read ``First_Last@My.Domain''?
-
- There are a couple of ways of doing this. This describes
- using the "user database" code. This is still experimental,
- and was intended for a different purpose -- however, it does
- work with a bit of care. It does require that you have the
- Berkeley "db" package installed (it won't work with DBM).
-
- First, create your input file. This should have lines like:
-
- loginname:mailname First_Last
- First_Last:maildrop loginname
-
- Install it in (say) /etc/userdb. Create the database:
-
- makemap btree /etc/userdb.db < /etc/userdb
-
- You can then create a config file that uses this. You will
- have to include the following in your .mc file:
-
- define(confUSERDB_SPEC, /etc/userdb.db)
- FEATURE(notsticky)
-----------------------------------------------------------------------
- * So what was the user database feature intended for?
-
- The intent was to have all information for a given user
- (where the user is the unique login name, not an inherently
- non-unique full name) in one place. This would include phone
- numbers, addresses, and so forth. The "maildrop" feature is
- because Berkeley does not use a centralized mail server
- (there are a number of reasons for this that are mostly
- historic), and so we need to know where each user gets his or
- her mail delivered -- i.e., the mail drop.
-
- We are in the process of setting up our environment so that
- mail sent to an unqualified "name" goes to that person's
- preferred maildrop; mail sent to "name@host" goes to that
- host. The purpose of "FEATURE(notsticky)" is to cause
- "name@host" to be looked up in the user database for delivery
- to the maildrop.
-----------------------------------------------------------------------
- * Why are you so hostile to using full names for e-mail addresses?
-
- Because full names are not unique. For example, the computer
- community has two Andy Tannenbaums and two Peter Deutsches.
- At one time, Bell Labs had two Stephen R. Bournes with
- offices a few doors apart. You can create alternative
- addresses (e.g., Stephen_R_Bourne_2), but that's even worse
- -- which one of them has to have their name desecrated in
- this way? And you can bet that one of them will get most of
- the other person's e-mail.
-
- So called "full names" are just an attempt to create longer
- versions of unique names. Rather that lulling people into a
- sense of security, I'd rather that it be clear that these
- handles are arbitrary. People should use good user agents
- that have alias mappings so that they can attach arbitrary
- names for their personal use to those with whom they
- correspond (such as the MH alias file).
-
- Even worse is fuzzy matching in e-mail -- this can make good
- addresses turn bad. For example, Eric Allman is currently
- (to the best of our knowledge) the only ``Allman'' at
- Berkeley, so mail sent to "Allman@Berkeley.EDU" should get to
- him. But if another Allman ever appears, this address could
- suddenly become ambiguous. He's been the only Allman at
- Berkeley for over fifteen years -- to suddenly have this
- "good address" bounce mail because it is ambiguous would be a
- heinous wrong.
-
- Finger services should be as fuzzy as possible (within
- reason, of course). Mail services should be unique.
-----------------------------------------------------------------------
- * Should I use a wildcard MX for my domain?
-
- If at all possible, no.
-
- Wildcard MX records have lots of semantic "gotcha"s. For
- example, they will match a host "unknown.your.domain" -- if
- you don't explicitly test for unknown hosts in your domain,
- you will get "config error: mail loops back to myself"
- errors.
-
- See RFCs 1535-1537 for more detail and other related (or
- common) problems.
-----------------------------------------------------------------------
- * How can I get sendmail to process messages sent to an account and
- send the results back to the originator?
-
- This is a local mailer issue, not a sendmail issue.
- Depending on what you're doing, look at procmail (mentioned
- again below), ftpmail, or Majordomo.
-
- Check your local archie server to see what machine(s) nearest
- you have the most recent versions of these programs.
-----------------------------------------------------------------------
- * How can I get sendmail to deliver local mail to $HOME/.mail
- instead of into /usr/spool/mail (or /usr/mail)?
-
- Again, this is a local mailer issue, not a sendmail issue.
- Either modify your local mailer (source code will be
- required) or change the program called in the "local" mailer
- configuration description to be a new program that does this
- local delivery. One program that is capable of doing this is
- "procmail", although there are probably many others as well.
-
- You might be interested in reading the paper ``HLFSD:
- Delivering Email to your $HOME'' available in the Proceedings
- of the USENIX System Administration (LISA VII) Conference
- (November 1993). This is also available via public FTP from
- ftp.cs.columbia.edu in /pub/hlfsd/{README.hlfsd,hlfsd.ps}.
-----------------------------------------------------------------------
- * I'm trying to to get my mail to go into queue only mode, and it
- delivers the mail interactively anyway. (Or, I'm trying to use
- the "don't deliver to expensive mailer" flag, and it delivers the
- mail interactively anyway.) I can see it does it: here's the
- output of "sendmail -v foo@somehost" (or Mail -v or equivalent).
-
- The -v flag to sendmail (which is implied by the -v flag to
- Mail and other programs in that family) tells sendmail to
- watch the transaction. Since you have explicitly asked to
- see what's going on, it assumes that you do not want to to
- auto-queue, and turns that feature off. Remove the -v flag
- and use a "tail -f" of the log instead to see what's going
- on.
-
- If you are trying to use the "don't deliver to expensive
- mailer" flag (mailer flag "e"), be sure you also turn on
- global option "c" -- otherwise it ignores the mailer flag.
-----------------------------------------------------------------------
- * There are four UUCP mailers listed in the configuration files.
- Which one should I use?
-
- The choice is partly a matter of local preferences and what
- is running at the other end of your UUCP connection. Unlike
- good protocols that define what will go over the wire, UUCP
- uses the policy that you should do what is right for the
- other end; if they change, you have to change. This makes it
- hard to do the right thing, and discourages people from
- updating their software. In general, if you can avoid UUCP,
- please do.
-
- If you can't avoid it, you'll have to find the version that
- is closest to what the other end accepts. Following is a
- summary of the UUCP mailers available.
-
- uucp-old (obsolete name: "uucp")
- This is the oldest, the worst (but the closest to UUCP) way
- of sending messages across UUCP connections. It does
- bangify everything and prepends $U (your UUCP name) to the
- sender's address (which can already be a bang path
- itself). It can only send to one address at a time, so it
- spends a lot of time copying duplicates of messages. Avoid
- this if at all possible.
-
- uucp-new (obsolete name: "suucp")
- The same as above, except that it assumes that in one rmail
- command you can specify several recipients. It still has a
- lot of other problems.
-
- uucp-dom
- This UUCP mailer keeps everything as domain addresses.
- Basically, it uses the SMTP mailer rewriting rules.
-
- Unfortunately, a lot of UUCP mailer transport agents
- require bangified addresses in the envelope, although you
- can use domain-based addresses in the message header. (The
- envelope shows up as the From_ line on UNIX mail.) So....
-
- uucp-uudom
- This is a cross between uucp-new (for the envelope
- addresses) and uucp-dom (for the header addresses). It
- bangifies the envelope sender (From_ line in messages)
- without adding the local hostname, unless there is no host
- name on the address at all (e.g., "wolf") or the host
- component is a UUCP host name instead of a domain name
- ("somehost!wolf" instead of "some.dom.ain!wolf").
-
- Examples:
-
- We are on host grasp.insa-lyon.fr (UUCP host name "grasp").
- The following summarizes the sender rewriting for various
- mailers.
-
- Mailer sender rewriting in the envelope
- ------ ------ -------------------------
- uucp-{old,new} wolf grasp!wolf
- uucp-dom wolf wolf@grasp.insa-lyon.fr
- uucp-uudom wolf grasp.insa-lyon.fr!wolf
-
- uucp-{old,new} wolf@fr.net grasp!fr.net!wolf
- uucp-dom wolf@fr.net wolf@fr.net
- uucp-uudom wolf@fr.net fr.net!wolf
-
- uucp-{old,new} somehost!wolf grasp!somehost!wolf
- uucp-dom somehost!wolf somehost!wolf@grasp.insa-lyon.fr
- uucp-uudom somehost!wolf grasp.insa-lyon.fr!somehost!wolf
-
-======================================================================
-RESOLVING PROBLEMS
-======================================================================
-
- * When I compile, I get "undefined symbol inet_aton" messages.
-
- You've probably replaced your resolver with the version from
- BIND 4.9.3. You need to compile with -l44bsd in order to get
- the additional routines.
-----------------------------------------------------------------------
- * I'm getting "Local configuration error" messages, such as:
-
- 553 relay.domain.net config error: mail loops back to myself
- 554 <user@domain.net>... Local configuration error
-
- How can I solve this problem?
-
- You have asked mail to the domain (e.g., domain.net) to be
- forwarded to a specific host (in this case, relay.domain.net)
- by using an MX record, but the relay machine doesn't
- recognize itself as domain.net. Add domain.net to
- /etc/sendmail.cw (if you are using FEATURE(use_cw_file)) or
- add "Cw domain.net" to your configuration file.
-
- IMPORTANT: Be sure you kill and restart the sendmail daemon
- after you change the configuration file (for ANY change in
- the configuration, not just this one):
-
- kill `head -1 /etc/sendmail.pid`
- sh -c "`tail -1 /etc/sendmail.pid`"
-
- NOTA BENE: kill -1 does not work!
-----------------------------------------------------------------------
- * When I use sendmail V8 with a Sun config file I get lines like:
-
- /etc/sendmail.cf: line 273: replacement $3 out of bounds
-
- the line in question reads:
-
- R$*<@$%y>$* $1<@$2.LOCAL>$3 user@ether
-
- what does this mean? How do I fix it?
-
- V8 doesn't recognize the Sun "$%y" syntax, so as far as it is
- concerned, there is only a $1 and a $2 (but no $3) in this
- line. Read Rick McCarty's paper on "Converting Standard Sun
- Config Files to Sendmail Version 8", in the contrib directory
- (file "converting.sun.configs") on the sendmail distribution
- for a full discussion of how to do this.
-----------------------------------------------------------------------
- * When I use sendmail V8 on a Sun, I sometimes get lines like:
-
- /etc/sendmail.cf: line 445: bad ruleset 96 (50 max)
-
- what does this mean? How do I fix it?
-
- You're somehow trying to start up the old Sun sendmail (or
- sendmail.mx) with a sendmail V8 config file, which Sun's
- sendmail doesn't like. Check your /etc/rc.local, any
- procedures that have been created to stop and re-start the
- sendmail processes, etc.... Make sure that you've switched
- everything over to using the new sendmail. To keep this
- problem from ever happening again, try the following:
-
- mv /usr/lib/sendmail /usr/lib/sendmail.old
- ln -s /usr/local/lib/sendmail.v8 /usr/lib/sendmail
- mv /usr/lib/sendmail.mx /usr/lib/sendmail.mx.old
- ln -s /usr/local/lib/sendmail.v8 /usr/lib/sendmail.mx
- chmod 0000 /usr/lib/sendmail.old
- chmod 0000 /usr/lib/sendmail.mx.old
-
- Assuming you have installed sendmail V8 in /usr/local/lib.
-----------------------------------------------------------------------
- * When I use sendmail V8 on an IBM RS/6000 running AIX, the system
- resource controller always reports sendmail as "inoperative" even
- though it is running. What's wrong?
-
- IBM's system resource controller is one of their "value
- added" features to AIX -- it's not a Unix standard. You'll
- need to either redefine the subsystem to use signals (see
- chssys(1)) or dump the entire subsystem and invoke sendmail
- in /etc/rc.tcpip or some other boot script.
-----------------------------------------------------------------------
- * When I use sendmail V8 on an Intel x86 machine running Linux, I
- have some problems. Specifically, I have....
-
- The current versions of Linux are generally considered to be
- great for hobbyists and anyone else who wants to learn Unix
- inside and out, or wants to always have something to do, or
- wants a machine for light-duty mostly personal use and not
- high-volume multi-user purposes.
-
- However, for those who want a system that will just sit in
- the background and work without a fuss handling thousands of
- mail messages a day for lots of different users, it's not
- (yet) stable enough to fit the bill.
-
- Unfortunately, there are no known shareware/freeware
- implementations of any operating system that provides the
- level of stability necessary to handle that kind of load
- (i.e., there are no free lunches).
-
- If you're wedded to the Intel x86 platform and want to run
- sendmail, we suggest you look at commercial implementations
- of Unix such as Interactive, UnixWare, Solaris, or BSD/386
- (just a sample of the dozens of different versions of Unix
- for Intel x86).
-
- Of all known vendor supported versions of Unix for Intel x86,
- BSDI's BSD/386 is least expensive and the only one known to
- currently ship with sendmail V8 pre-installed. Since sendmail
- V8 is continuing to be developed at UC Berkeley, and BSD/386
- is a full BSD 4.4 implementation, this is obviously be the most
- "native" sendmail V8 environment.
-----------------------------------------------------------------------
- * When I use sendmail on an Intel x86 machine running OS/2, I have
- some problems. Specifically, I have....
-
- The OS/2 port of sendmail is known to have left out huge
- chunks of the code and functionality of even much older
- versions of sendmail, in large part because the underlying OS
- just doesn't have the necessary hooks to make it happen.
- This port is so broken that we make no attempt to provide any
- kind of support for it. Try BSDI's BSD/386 instead.
-----------------------------------------------------------------------
- * I'm connected to the network via a SLIP/PPP link. Sometimes my
- sendmail process hangs (although it looks like part of the
- message has been transfered). Everything else works. What's
- wrong?
-
- Most likely, the problem isn't sendmail at all, but the low
- level network connection. It's important that the MTU
- (Maximum Transfer Unit) for the SLIP connection be set
- properly at both ends. If they disagree, large packets will
- be trashed and the connection will hang.
-----------------------------------------------------------------------
- * I just upgraded to 8.x and suddenly I'm getting messages in my
- syslog of the form "collect: I/O error on connection". What is
- going wrong?
-
- Nothing. This is just a diagnosis of a condition that had
- not been diagnosed before. If you are getting a lot of these
- from a single host, there is probably some incompatibility
- between 8.x and that host. If you get a lot of them in
- general, you may have network problems that are causing
- connections to get reset.
-----------------------------------------------------------------------
- * I just upgraded to 8.x and now when my users try to forward their
- mail to a program they get an "illegal shell" message and their
- mail is not delivered. What's wrong?
-
- In order for people to be able to run a program from their
- .forward file, 8.x insists that their shell (that is, the
- shell listed for that user in the passwd entry) be a "valid"
- shell, meaning a shell listed in /etc/shells. If /etc/shells
- does not exist, a default list is used, typically consisting
- of /bin/sh and /bin/csh.
-
- This is to support environments that may have NFS-shared
- directories mounted on machines on which users do not have
- login permission. For example, many people make their
- file server inaccessible for performance or security
- reasons; although users have directories, their shell on
- the server is /usr/local/etc/nologin or some such. If you
- allowed them to run programs anyway you might as well let
- them log in.
-
- If you are willing to let users run programs from their
- .forward file even though they cannot telnet or rsh in (as
- might be reasonable if you run smrsh to control the list of
- programs they can run) then add the line
-
- /SENDMAIL/ANY/SHELL/
-
- to /etc/shells. This must be typed exactly as indicated,
- in caps, with the trailing slash. NOTA BENE: DO NOT
- list /usr/local/etc/nologin in /etc/shells -- this will
- open up other security problems.
-----------------------------------------------------------------------
- * I just upgraded to 8.x and suddenly connections to the SMTP port
- take a long time. What is going wrong?
-
- It's probably something weird in your TCP implementation that
- makes the IDENT code act oddly. On most systems V8 tries to
- do a ``callback'' to the connecting host to get a validated
- user name (see RFC 1413 for detail). If the connecting host
- does not support such a service it will normally fail quickly
- with "Connection refused", but certain kinds of packet
- filters and certain TCP implementations just time out.
-
- To test this, set the IDENT timeout to zero using
- ``OrIdent=0'' in the configuration file. This will
- completely disable all use of the IDENT protocol.
-
- Another possible problem is that you have your name server
- and/or resolver configured improperly. Make sure that all
- "nameserver" entries in /etc/resolv.conf point to functional
- servers. If you are running your own server make certain
- that all the servers listed in your root cache (usually
- called something like "/var/namedb/root.cache"; see your
- /etc/named.boot file to get your value) are up to date.
- Either of these can cause long delays.
-----------------------------------------------------------------------
- * I just upgraded to 8.x and suddenly I get errors such as ``unknown
- mailer error 5 -- mail: options MUST PRECEDE recipients.'' What is
- going wrong?
-
- You need OSTYPE(systype) in your .mc file -- otherwise the
- configurations use a default that probably disagrees with
- your local mail system. See cf/README for details.
-----------------------------------------------------------------------
- * Under V8, the "From " header gets mysteriously munged when I send
- to an alias.
-
- ``It's not a bug, it's a feature.'' This happens when you
- have a "owner-list" alias and you send to "list". V8
- propagates the owner information into the envelope sender
- field (which appears as the "From " header on UNIX mail or as
- the Return-Path: header) so that downstream errors are
- properly returned to the mailing list owner instead of to the
- sender. In order to make this appear as sensible as possible
- to end users, I recommend making the owner point to a
- "request" address -- for example:
-
- list: :include:/path/name/list.list
- owner-list: list-request
- list-request: eric
-
- This will make message sent to "list" come out as being "From
- list-request" instead of "From eric".
-----------------------------------------------------------------------
- * I am trying to use MASQUERADE_AS (or the user database) to
- rewrite from addresses, and although it works in the From: header
- line, it doesn't work in the envelope (e.g., the "From " line).
-
- Believe it or not, this is intentional. The interpretation
- of the standards by the V8 development group was that this
- was an inappropriate rewriting, and that if the rewriting
- were incorrect at least the envelope would contain a valid
- return address. Other people have since described scenarios
- where the envelope cannot be correct without this rewriting,
- so 8.7 will have an option to rewrite both header and
- envelope.
-----------------------------------------------------------------------
- * I want to run Sendmail version 8 on my DEC system, but you don't
- have MAIL11V3 support in sendmail. How do I handle this?
-
- Get Paul Vixie's reimplementation of the mail11 protocol from
- gatekeeper.dec.com in /pub/DEC/gwtools.
-
- Rumour has it that he will be fully integrating into sendmail
- V8 what little is left of IDA sendmail that is not handled
- (or handled as well) by V8. No additional information on
- this project is currently available.
-----------------------------------------------------------------------
- * Messages seem to disappear from my queue unsent. When I look in
- the queue directory I see that they have been renamed from qf* to
- Qf*, and sendmail doesn't see these.
-
- If you look closely you should find that the Qf files are
- owned by users other than root. Since sendmail runs as root
- it refuses to believe information in non-root-owned qf files,
- and it renames them to Qf to get them out of the way and make
- it easy for you to find. The usual cause of this is
- twofold: first, you have the queue directory world writable
- (which is probably a mistake -- this opens up other security
- problems) and someone is calling sendmail with an "unsafe"
- flag, usually a -o flag that sets an option that could
- compromise security. When sendmail sees this it gives up
- setuid root permissions.
+usenet/news.answers/mail/sendmail-faq" in the message.
- The usual solution is to not use the problematic flags. If
- you must use them, you have to write a special queue
- directory and have them processed by the same uid that
- submitted the job in the first place.
-----------------------------------------------------------------------
-@(#)FAQ 8.16 (Berkeley) 9/17/95
-Send updates to sendmail@sendmail.ORG.
+ --Eric Allman 8/17/96
diff --git a/usr.sbin/sendmail/KNOWNBUGS b/usr.sbin/sendmail/KNOWNBUGS
index f9020e7fb75e..b948ca2d03ed 100644
--- a/usr.sbin/sendmail/KNOWNBUGS
+++ b/usr.sbin/sendmail/KNOWNBUGS
@@ -1,7 +1,7 @@
K N O W N B U G S I N S E N D M A I L
- (for 8.7)
+ (for 8.8)
The following are bugs or deficiencies in sendmail that I am aware of
@@ -74,18 +74,8 @@ This list is not guaranteed to be complete.
not in the sendmail source code, so I assume it is also a bug
in the sockets emulation. (Errno 22 is EINVAL "Invalid Argument"
on all the systems I have available, including Solaris 2.x.)
-
-* Sending user deletion not done properly in :include: lists.
-
- If you don't have the "m" (me too) option set, then a person
- sending to a list that contains themselves should not get a copy
- of the message. However, if that list points to a :include: file
- that has one address per line, this will break, and the sender
- will always get a copy of their own message, just as though the
- "m" option were set.
-
- You can eliminate this by adding commas at the end of each line
- of the :include: file.
+ Apparently, this problem is due to linking -lc before -lsocket;
+ if you are having this problem, check your Makefile.
* Excessive mailing list nesting can run out of file descriptors.
@@ -116,4 +106,4 @@ This list is not guaranteed to be complete.
allow for 8->7 bit MIME conversions either.
-(Version 8.21, last updated 8/27/95)
+(Version 8.23, last updated 10/15/96)
diff --git a/usr.sbin/sendmail/READ_ME b/usr.sbin/sendmail/READ_ME
index 2e50d085ecad..159ac81d9ef1 100644
--- a/usr.sbin/sendmail/READ_ME
+++ b/usr.sbin/sendmail/READ_ME
@@ -1,5 +1,5 @@
/*-
- * @(#)READ_ME 8.25 (Berkeley) 11/19/95
+ * @(#)READ_ME 8.29 (Berkeley) 9/24/96
*/
SENDMAIL RELEASE 8
@@ -9,6 +9,9 @@ doc/changes/changes.me for a summary of changes since 5.67.
Report any bugs to sendmail-bugs@sendmail.ORG
+There is a web site at http://WWW.Sendmail.ORG -- see that site for
+the latest updates.
+
******************************************************************
** DO NOT USE MAKE to compile sendmail. Instead, cd src and **
** use the "makesendmail" shell script. On many environments **
@@ -128,13 +131,20 @@ Important RFCs for electronic mail are:
RFC976 UUCP mail format
RFC1123 Host requirements (modifies 821, 822, and 974)
RFC1413 Identification server
- RFC1425 SMTP Service Extensions (ESMTP spec)
- RFC1426 SMTP Service Extension for 8bit-MIMEtransport
- RFC1427 SMTP Service Extension for Message Size Declaration
+ RFC1869 SMTP Service Extensions (ESMTP spec)
+ RFC1652 SMTP Service Extension for 8bit-MIMEtransport
+ RFC1870 SMTP Service Extension for Message Size Declaration
RFC1521 MIME: Multipurpose Internet Mail Extensions
RFC1344 Implications of MIME for Internet Mail Gateways
RFC1428 Transition of Internet Mail from Just-Send-8 to
8-bit SMTP/MIME
+ RFC1891 SMTP Service Extension for Delivery Status Notifications
+ RFC1892 Multipart/Report Content Type for the Reporting of
+ Mail System Administrative Messages
+ RFC1893 Enhanced Mail System Status Codes
+ RFC1894 An Extensible Message Format for Delivery Status
+ Notifications
+ RFC1985 SMTP Service Extension for Remote Message Queue Starting
Other standards that may be of interest (but which are less directly
relevant to sendmail) are:
diff --git a/usr.sbin/sendmail/RELEASE_NOTES b/usr.sbin/sendmail/RELEASE_NOTES
index a4daceaf3133..0eb9e61f75b0 100644
--- a/usr.sbin/sendmail/RELEASE_NOTES
+++ b/usr.sbin/sendmail/RELEASE_NOTES
@@ -1,11 +1,718 @@
SENDMAIL RELEASE NOTES
- @(#)RELEASE_NOTES 8.7.6.4 (Berkeley) 9/16/96
+ @(#)RELEASE_NOTES 8.8.2.1 (Berkeley) 10/18/96
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.8.2/8.8.2 96/11/18
+ SECURITY: fix a botch in the 7-bit MIME patch; the previous patch
+ changed the code but didn't fix the problem.
+ PORTABILITY FIXES:
+ Solaris: Don't use the system getusershell(3); it can
+ apparently corrupt the heap in some circumstances.
+ Problem found by Ken Pizzini of Spry, Inc.
+ OP.ME: document several mailer flags that were accidently omitted
+ from this document. These flags were F=d, F=j, F=R, and F=9.
+ CONFIG: no changes.
+
+8.8.1/8.8.1 96/10/17
+ SECURITY: unset all environment variables that the resolver will
+ examine during queue runs and daemon mode. Problem noted
+ by Dan Bernstein of the University of Illinois at Chicago.
+ SECURITY: in some cases an illegal 7-bit MIME-encoded text/plain
+ message could overflow a buffer if it was converted back
+ to 8 bits. This caused core dumps and has the potential
+ for a remote attack. Problem first noted by Gregory Shapiro
+ of WPI.
+ Avoid duplicate deliveries of error messages on systems that don't
+ have flock(2) support. Patch from Motonori Nakamura of
+ Kyoto University.
+ Ignore null FallBackMX (V) options. If this option is null (as
+ opposed to undefined) it can cause "null signature" syserrs
+ on illegal host names.
+ If a Base64 encoded text/plain message has no trailing newline in
+ the encoded text, conversion back to 8 bits will drop the
+ final line. Problem noted by Pierre David.
+ If running with a RunAsUser, sendmail would give bogus "cannot
+ setuid" (or seteuid, or setreuid) messages on some systems.
+ Problem pointed out by Jordan Mendelson of Web Services, Inc.
+ Always print error messages in -bv mode -- previously, -bv would
+ be absolutely silent on errors if the error mode was sent
+ to (say) mail-back. Problem noted by Kyle Jones of UUNET.
+ If -qI/R/S is set (or the ETRN command is used), ignore all long
+ term host status. This is necessary because it is common
+ to do this when you know a host has just come back up.
+ Disallow duplicate HELO/EHLO commands as required by RFC 1651 section
+ 4.2. Excessive permissiveness noted by Lee Flight of the
+ University of Leicester.
+ If a service (such as NIS) is specified as the last entry in the
+ service switch, but that service is not compiled in, sendmail
+ would return a temporary failure when an entry was not found
+ in the map. This caused the message to be queued instead of
+ bouncing immediately. Problem noted by Harry Edmon of the
+ University of Washington.
+ PORTABILITY FIXES:
+ Solaris 2.3 had compilation problems in conf.c. Several
+ people pointed this out.
+ NetBSD from Charles Hannum of MIT.
+ AIX4 improvements based on info from Steve Bauer of South
+ Dakota School of Mines & Technology.
+ CONFIG: ``error:code message'' syntax was broken in virtusertable.
+ Patch from Gil Kloepfer Jr.
+ CONFIG: if FEATURE(nocanonify) was specified, hosts in $=M (set
+ using MASQUERADE_DOMAIN) were not masqueraded unless they
+ were also in $=w. Problem noted by Zoltan Basti of
+ Softec.
+ MAIL.LOCAL: patches to compile and link cleanly on AIX. Based
+ on a patch from Eric Hagberg of Morgan Stanley.
+ MAIL.LOCAL: patches to compile on NEXTSTEP. From Patrick Nolan
+ of Stanford via Robert La Ferla.
+
+8.8.0/8.8.0 96/09/26
+ Under some circumstances, Bcc: headers would not be properly
+ deleted. Pointed out by Jonathan Kamens of OpenVision.
+ Log a warning if the sendmail daemon is invoked without a full
+ pathname, which prevents "kill -1" from working. I was
+ urged to put this in by Andrey A. Chernov of DEMOS (Russia).
+ Fix small buffer overflow. Since the data in this buffer was not
+ read externally, there was no security problem (and in fact
+ probably wouldn't really overflow on most compilers). Pointed
+ out by KIZU takashi of Osaka University.
+ Fix problem causing domain literals such as [1.2.3.4] to be ignored
+ if a FallbackMXHost was specified in the configuration file
+ -- all mail would be sent to the fallback even if the original
+ host was accessible. Pointed out by Munenari Hirayama of
+ NSC (Japan).
+ A message that didn't terminate with a newline would (sometimes) not
+ have the trailing "." added properly in the SMTP dialogue,
+ causing SMTP to hang. Patch from Per Hedeland of Ericsson.
+ The DaemonPortOptions suboption to bind to a particular address was
+ incorrect and nonfunctional due to a misunderstanding of the
+ semantics of binding on a passive socket. Patch from
+ NIIBE Yutaka of Mitsubishi Research Institute.
+ Increase the number of MX hosts for a single name to 100 to better
+ handle the truly huge service providers such as AOL, which
+ has 13 at the moment (and climbing). In order to avoid
+ trashing memory, the buffer for all names has only been
+ slightly increased in size, to 12.8K from 10.2K -- this means
+ that if a single name had 100 MX records, the average size
+ of those records could not exceed 128 bytes. Requested by
+ Brad Knowles of America On Line.
+ Restore use of IDENT returns where the OSTYPE field equals "OTHER".
+ Urged by Dan Bernstein of U.C. Berkeley.
+ Print q_statdate and q_specificity in address structure debugging
+ printout.
+ Expand MCI structure flag bits for debugging output.
+ Support IPv6-style domain literals, which can have colons between
+ square braces.
+ Log open file descriptors for the "cannot dup" messages in deliver();
+ this is an attempt to track down a bug that one person seems
+ to be having (it may be a Solaris bug!).
+ DSN NOTIFY parameters were not properly propogated across queue runs;
+ this caused the NOTIFY info to sometimes be lost. Problem
+ pointed out by Claus Assmann of the
+ Christian-Albrechts-University of Kiel.
+ The statistics gathered in the sendmail.st file were too high; in
+ some cases failures (e.g., user unknown or temporary failure)
+ would count as a delivery as far as the statistics were
+ concerned. Problem noted by Tom Moore of AT&T GIS.
+ Systems that don't have flock() would not send split envelopes in
+ the initial run. Problem pointed out by Leonard Zubkoff of
+ Dandelion Digital.
+ Move buffer overflow checking -- these primarily involve distrusting
+ results that may come from NIS and DNS.
+ 4.4-BSD-derived systems, including FreeBSD, NetBSD, and BSD/OS didn't
+ include <paths.h> and hence had the wrong pathnames for a few
+ things like /var/tmp. Reported by Matthew Green.
+ Conditions were reversed for the Priority: header, resulting in all
+ values being interpreted as non-urgent except for non-urgent,
+ which was interpreted as normal. Patch from Bryan Costales.
+ The -o (optional) flag was being ignored on hash and btree maps
+ since 8.7.2. Fix from Bryan Costales.
+ Content-Types listed in class "q" will always be encoded as
+ Quoted-Printable (or more accurately, will never be encoded
+ as base64). The class can have primary types (e.g., "text")
+ or full types (e.g., "text/plain"). Based on a suggestion by
+ Marius Olafsson of the University of Iceland.
+ Define ${envid} to be the original envelope id (from the ESMTP DSN
+ dialogue) so it can be passed to programs in mailers.
+ Define ${bodytype} to be the body type (from the -B flag or the
+ BODY= ESMTP parameter) so it can be passed to programs in
+ mailers.
+ Cause the VRFY command to return 252 instead of 250 unless the F=q
+ flag is set in the mailer descriptor. Suggested by John
+ Myers of CMU.
+ Implement ESMTP ETRN command to flush the queue for a specific host.
+ The command takes a host name; data for that host is
+ immediately (and asynchronously) flushed. Because this shares
+ the -qR implementation, other hosts may be attempted, but
+ there should be no security implications. Implementation
+ from John Beck of InReference, Inc. See RFC 1985 for details.
+ Add three new command line flags to pass in DSN parameters: -V envid
+ (equivalent to ENVID=envid on the MAIL command), -R ret
+ (equivalent to RET=ret on the MAIL command), and -Nnotify
+ (equivalent to NOTIFY=notify on the RCPT command). Note
+ that the -N flag applies to all recipients; there is no way
+ to specify per-address notifications on the command line,
+ nor is there an equivalent for the ORCPT= per-address
+ parameter.
+ Restore LogLevel option to be safe (it can only be increased);
+ apparently I went into paranoid mode between 8.6 and 8.7
+ and made it unsafe. Pointed out by Dabe Murphy of the
+ University of Maryland.
+ New logging on log level 15: all SMTP traffic. Patches from
+ Andrew Gross of San Diego Supercomputer Center.
+ NetInfo property value searching code wasn't stopping when it found
+ a match. This was causing the wrong values to be found (and
+ had a memory leak). Found by Bastian Schleuter of TU-Berlin.
+ Add new F=0 (zero) mailer flag to turn off MX lookups. It was pointed
+ out by Bill Wisner of Electronics for Imaging that you can't
+ use the bracket address form for the MAIL_HUB macro, since
+ that causes the brackets to remain in the envelope recipient
+ address used for delivery. The simple fix (stripping off the
+ brackets in the config file) breaks the use of IP literal
+ addresses. This flag will solve that problem.
+ Add MustQuoteChars option. This is a list of characters that must
+ be quoted if they are found in the phrase part of an address
+ (that is, the full name part). The characters @,;:\()[] are
+ always in this list and cannot be removed. The default is
+ this list plus . and ' to match RFC 822.
+ Add AllowBogusHELO option; if set, sendmail will allow HELO commands
+ that do not include a host name for back compatibility with
+ some stupid SMTP clients. Setting this violates RFC 1123
+ section 5.2.5.
+ Add MaxDaemonChildren option; if this is set, sendmail will start
+ rejecting connections if it has more than this many
+ outstanding children accepting mail. Note that you may
+ see more processes than this because of outgoing mail; this
+ is for incoming connections only.
+ Add ConnectionRateThrottle option. If set to a positive value, the
+ number of incoming SMTP connections that will be permitted
+ in a single second is limited to this number. Connections are
+ not refused during this time, just deferred. The intent is to
+ flatten out demand so that load average limiting can kick in.
+ It is less radical than MaxDaemonChildren, which will stop
+ accepting connections even if all the connections are idle
+ (e.g., due to connection caching).
+ Add Timeout.hoststatus option. This interval (defaulting to 30m)
+ specifies how long cached information about the state of a
+ host will be kept before they are considered stale and the
+ host is retried. If you are using persistent host status
+ (i.e., the HostStatusDirectory option is set) this will apply
+ between runs; otherwise, it applies only within a single queue
+ run and hence is useful only for hosts that have large queues
+ that take a very long time to run.
+ Add SingleLineFromHeader option. If set, From: headers are coerced
+ into being a single line even if they had newlines in them
+ when read. This is to get around a botch in Lotus Notes.
+ Text class maps were totally broken -- if you ever retrieved the last
+ item in a table it would be truncated. Problem noted by
+ Gregory Neil Shapiro of WPI.
+ Extend the lines printed by the mailq command (== the -bp flag) when
+ -v is given to 120 characters; this allows more information
+ to be displayed. Suggested by Gregory Neil Shapiro of WPI.
+ Allow macro definitions (`D' lines) with unquoted commas; previously
+ this was treated as end-of-input. Problem noted by Bryan
+ Costales.
+ The RET= envelope parameter (used for DSNs) wasn't properly written
+ to the queue file. Fix from John Hughes of Atlantic
+ Technologies, Inc.
+ Close /var/tmp/dead.letter after a successful write -- otherwise
+ if this happens in a queue run it can cause nasty delays.
+ Problem noted by Mark Horton of AT&T.
+ If userdb entries pointed to userdb entries, and there were multiple
+ values for a given key, the database cursor would get
+ trashed by the recursive call. Problem noted by Roy Mongiovi
+ of Georgia Tech. Fixed by reading all the values and creating
+ a comma-separated list; thus, the -v output will be somewhat
+ different for this case.
+ Fix buffer allocation problem with Hesiod-based userdb maps when
+ HES_GETMAILHOST is defined. Based on a patch by Betty Lee
+ of Stanford University.
+ When envelopes were split due to aliases with owner- aliases, and
+ there was some error on one of the lists, more than one of
+ the owners would get the message. Problem pointed out by
+ Roy Mongiovi of Georgia Tech.
+ Detect excessive recursion in macro expansions, e.g., $X defined
+ in terms of $Y which is defined in terms of $X. Problem
+ noted by Bryan Costales; patch from Eric Wassenaar.
+ When using F=U to get "ugly UUCP" From_ lines, a buffer could in
+ some cases get trashed causing bogus From_ lines. Fix from
+ Kyle Jones of UUNET.
+ When doing load average initialization, if the nlist call for avenrun
+ failed, the second and subsequent lookups wouldn't notice
+ that fact causing bogus load averages to be returned. Noted
+ by Casper Dik of Sun Holland.
+ Fix problem with incompatibility with some versions of inet_aton that
+ have changed the return value to unsigned, so a check for an
+ error return of -1 doesn't work. Use INADDR_NONE instead.
+ This could cause mail to addresses such as [foo.com] to bounce
+ or get dropped. Problem noted by Christophe Wolfhugel of the
+ Pasteur Institute.
+ DSNs were inconsistent if a failure occured during the DATA phase
+ rather than the RCPT phase: the Action: would be correct, but
+ the detailed status information would be wrong. Problem noted
+ by Bob Snyder of General Electric Company.
+ Add -U command line flag and the XUSR ESMTP extension, both indicating
+ that this is the initial MUA->MTA submission. The flag current
+ does nothing, but in future releases (when MUAs start using
+ these flags) it will probably turn on things like DNS
+ canonification.
+ Default end-of-line string (E= specification on mailer [M] lines)
+ to \r\n on SMTP mailers. Default remains \n on non-SMTP
+ mailers.
+ Change the internal definition for the *file* and *include* mailers
+ to have $u in the argument vectors so that they aren't
+ misinterpreted as SMTP mailers and thus use \r\n line
+ termination. This will affect anyone who has redefined
+ either of these in their configuration file.
+ Don't assume that IDENT servers close the connection after a query;
+ responses can be newline terminated. From Terry Kennedy of
+ St. Peter's College.
+ Avoid core dumps on erroneous configuration files that have
+ $#mailer with nothing following. From Bryan Costales.
+ Avoid null pointer dereference with high debug values in unlockqueue.
+ Fix from Randy Martin of Clemson University.
+ Fix possible buffer overrun when expanding very large macros. Fix
+ from Kyle Jones of UUNET.
+ After 25 EXPN or VRFY commands, start pausing for a second before
+ processing each one. This avoids a certain form of denial
+ of service attack. Potential attack pointed out by Bryan
+ Costales.
+ Allow new named (not numbered!) config file rules to do validity
+ checking on SMTP arguments: check_mail for MAIL commands and
+ check_rcpt for RCPT commands. These rulesets can do anything
+ they want; their result is ignored unless they resolve to the
+ $#error mailer, in which case the indicated message is printed
+ and the command is rejected. Similarly, the check_compat
+ ruleset is called before delivery with "from_addr $| to_addr"
+ (the $| is a meta-symbol used to separate the two addresses);
+ it can give a "this sender can't send to this recipient"
+ notification. Note that this patch allows $| to stand alone
+ in rulesets.
+ Define new macros ${client_name}, ${client_addr}, and ${client_port}
+ that have the name, IP address, and port number (respectively)
+ of the SMTP client (that is, the entity at the other end of
+ the connection. These can be used in (e.g.) check_rcpt to
+ verify that someone isn't trying to relay mail through your
+ host inappropriately. Be sure to use the deferred evaluation
+ form, for example $&{client_name}, to avoid having these bound
+ when sendmail reads the configuration file.
+ Add new config file rule check_relay to check the incoming connection
+ information. Like check_compat, it is passed the host name
+ and host address separated by $| and can reject connections
+ on that basis.
+ Allow IDA-style recursive function calls. Code contributed by Mark
+ Lovell and Paul Vixie.
+ Eliminate the "No ! in UUCP From address!" message" -- instead, create
+ a virtual UUCP address using either a domain address or the $k
+ macro. Based on code contributed by Mark Lovell and Paul
+ Vixie.
+ Add Stanford LDAP map. Requires special libraries that are not
+ included with sendmail. Contributed by Booker C. Bense
+ <bbense@networking.stanford.edu>; contact him for support.
+ See also the src/READ_ME file.
+ Allow -dANSI to turn on ANSI escape sequences in debug output; this
+ puts metasymbols (e.g., $+) in reverse video. Really useful
+ only for debugging deep bits of code where it is important to
+ distinguish between the single-character metasymbol $+ and the
+ two characters $, +.
+ Changed ruleset 89 (executed in dumpstate()) to a named ruleset,
+ debug_dumpstate.
+ Add new UnsafeGroupWrites option; if set, .forward and :include:
+ files that are group writable are considered "unsafe" -- that
+ is, programs and files referenced from such files are not
+ valid recipients.
+ Delete bogosity test for FallBackMX host; this prevented it to be a
+ name that was not in DNS or was a domain-literal. Problem
+ noted by Tom May.
+ Change the introduction to error messages to more clearly delineate
+ permanent from temporary failures; if both existed in a
+ single message it could be confusing. Suggested by John
+ Beck of InReference, Inc.
+ The IngoreDot (i) option didn't work for lines that were terminated
+ with CRLF. Problem noted by Ted Stockwell of Secure
+ Computing Corporation.
+ Add a heuristic to improve the handling of unbalanced `<' signs in
+ message headers. Problem reported by Matt Dillon of Best
+ Internet Communications.
+ Check for bogus characters in the 0200-0237 range; since these are
+ used internally, very strange errors can occur if those
+ characters appear in headers. Problem noted by Anders Gertz
+ of Lysator.
+ Implement 7 -> 8 bit MIME conversions. This only takes place if the
+ recipient mailer has the F=9 flag set, and only works on
+ text/plain body types. Code contributed by Marius Olafsson
+ of the University of Iceland.
+ Special case "postmaster" name so that it is always treated as lower
+ case in alias files regardless of configuration settings;
+ this prevents some potential problems where "Postmaster" or
+ "POSTMASTER" might not match "postmaster". In most cases
+ this change is a no-op.
+ The -o map flag was ignored for text maps. Problem noted by Bryan
+ Costales.
+ The -a map flag was ignored for dequote maps. Problem noted by
+ Bryan Costales.
+ Fix core dump when a lookup of a class "prog" map returns no
+ response. Patch from Bryan Costales.
+ Log instances where sendmail is deferring or rejecting connections
+ on LogLevel 14. Suggested by Kyle Jones of UUNET.
+ Include port number in process title for network daemons. Suggested
+ by Kyle Jones of UUNET.
+ Send ``double bounces'' (errors that occur when sending an error
+ message) to the address indicated in the DoubleBounceAddress
+ option (default: postmaster). Previously they were always
+ sent to postmaster. Suggested by Kyle Jones of UUNET.
+ Add new mode, -bD, that acts like -bd in all respects except that
+ it runs in foreground. This is useful for using with a
+ wrapper that "watches" system services. Suggested by Kyle
+ Jones of UUNET.
+ Fix botch in spacing around (parenthesized) comments in addresses
+ when the comment comes before the address. Patch from
+ Motonori Nakamura of Kyoto University.
+ Use the prefix "Postmaster notify" on the Subject: lines of messages
+ that are being bounced to postmaster, rather than "Returned
+ mail". This permits the person who is postmaster more
+ easily determine what messages are to their role as
+ postmaster versus bounces to mail they actually sent. Based
+ 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
+ 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
+ guarantee that jobs will be delivered in submission order
+ unless you also set DeliveryMode=queue. In general, it should
+ probably only be used on the command line, and only in
+ conjunction with -qRhost.domain. In fact, there are very few
+ cases where it should be used at all. Based on an
+ implementation by Motonori Nakamura.
+ If a map lookup in ruleset 5 returns tempfail, queue the message in
+ the same manner as other rulesets. Previously a temporary
+ failure in ruleset 5 was ignored. Patch from Booker Bense
+ of Stanford University.
+ Don't proceed to the next MX host if an SMTP MAIL command returns a
+ 5yz (permanent failure) code. The next MX host will still be
+ tried if the connection cannot be opened in the first place
+ or if the MAIL command returns a 4yz (temporary failure) code.
+ (It's hard to know what to do here, since neither RFC 974 nor
+ RFC 1123 specify when to proceed to the next MX host.)
+ Suggested by Jonathan Kamens of OpenVision, Inc.
+ Add new "-t" flag for map definitions (the "K" line in the .cf file).
+ This causes map lookups that get a temporary failure (e.g.,
+ name server failure) to _not_ defer the delivery of the
+ message. This should only be used if your configuration file
+ is prepared to do something sensible in this case. Based on
+ an idea by Gregory Shapiro of WPI.
+ Fix problem finding network interface addresses. Patch from
+ Motonori Nakamura.
+ Don't reject qf entries that are not owned by your effective uid if
+ you are not running setuid; this makes management of certain
+ kinds of firewall setups difficult. Patch suggested by
+ Eamonn Coleman of Qualcomm.
+ Add persistent host status. This keeps the information normally
+ maintained within a single queue run in disk files that are
+ shared between sendmail instances. The HostStatusDirectory
+ is the directory in which the information is maintained. If
+ not set, persistent host status is turned off. If not a full
+ pathname, it is relative to the queue directory. A common
+ value is ".hoststat".
+ There are also two new operation modes:
+ * -bh prints the status of hosts that have had recent
+ connections.
+ * -bH purges the host statuses. No attempt is made to save
+ recent status information.
+ This feature was originally written by Paul Vixie of Vixie
+ Enterprises for KJS and adapted for V8 by Mark Lovell of
+ Bigrock Consulting. Paul's funding of Mark and Mark's patience
+ with my insistence that things fit cleanly into the V8
+ framework is gratefully appreciated.
+ New SingleThreadDelivery option (requires HostStatusDirectory to
+ operate). Avoids letting two sendmails on the local machine
+ open connections to the same remote host at the same time.
+ This reduces load on the other machine, but can cause mail to
+ be delayed (for example, if one sendmail is delivering a huge
+ message, other sendmails won't be able to send even small
+ messages). Also, it requires another file descriptor (for the
+ lock file) per connection, so you may have to reduce
+ ConnectionCacheSize to avoid running out of per-process
+ file descriptors. Based on the persistent host status code
+ contributed by Paul Vixie and Mark Lovell.
+ Allow sending to non-simple files (e.g., /dev/null) even if the
+ SafeFileEnvironment option is set. Problem noted by Bryan
+ Costales.
+ The -qR flag mistakenly matched flags in the "R" line of the queue
+ file. Problem noted by Bryan Costales.
+ If a job was aborted using the interrupt signal (e.g., control-C from
+ the keyboard), on some occasions an empty df file would be
+ left around; these would collect in the queue directory.
+ Problem noted by Bryan Costales.
+ Change the makesendmail script to enhance the search for Makefiles
+ based on release number. For example, on SunOS 5.5.1, it will
+ search for Makefile.SunOS.5.5.1, Makefile.SunOS.5.5, and then
+ Makefile.SunOS.5.x (in addition to the other rules, e.g.,
+ adding $arch). Problem noted by Jason Mastaler of Atlanta
+ Webmasters.
+ When creating maps using "newaliases", always map the keys to lower
+ case when creating the map unless the -f flag is specified on
+ the map itself. Previously this was done based on the F=u
+ flag in the local mailer, which meant you could create aliases
+ that you could never access. Problem noted by Bob Wu of DEC.
+ When a job was read from the queue, the bits causing notification on
+ failure or delay were always set. This caused those
+ notifications to be sent even if NOTIFY=NEVER had been
+ specified. Problem noted by Steve Hubert of the University
+ of Washington, Seattle.
+ Add new configurable routine validate_connection (in conf.c). This
+ lets you decide if you are willing to accept traffic from
+ this host. If it returns FALSE, all SMTP commands will return
+ "550 Access denied". -DTCPWRAPPERS will include support for
+ TCP wrappers; you will need to add -lwrap to the link line.
+ (See src/READ_ME for details.)
+ Don't include the "THIS IS A WARNING MESSAGE ONLY" banner on postmaster
+ bounces. Some people seemed to think that this could be
+ confusing (even though it is true). Suggested by Motonori
+ Nakamura.
+ Add new RunAsUser option; this causes sendmail to do a setuid to that
+ user early in processing to avoid potential security problems.
+ However, this means that all .forward and :include: files must
+ be readable by that user, and on systems that don't support the
+ saved uid bit properly, all files to be written must be
+ writable by that user and all programs will be executed by that
+ user. It is also incompatible with the SafeFileEnvironment
+ option. In other words, it may not actually add much to
+ security. However, it should be useful on firewalls and other
+ places where users don't have accounts and the aliases file is
+ well constrained.
+ Add Timeout.iconnect. This is like Timeout.connect except it is used
+ only on the first attempt to delivery to an address. It could
+ be set to be lower than Timeout.connect on the principle that
+ the mail should go through quickly to responsive hosts; less
+ responsive hosts get to wait for the next queue run.
+ Fix a problem on Solaris that occassionally causes programs
+ (such as vacation) to hang with their standard input connected
+ to a UDP port. It also created some signal handling problems.
+ The problems turned out to be an interaction between vfork(2)
+ and some of the libraries, particularly NIS/NIS+. I am
+ indebted to Tor Egge <tegge@idt.ntnu.no> for this fix.
+ Change user class map to do the same matching that actual delivery
+ will do instead of just a /etc/passwd lookup. This adds
+ fuzzy matching to the user map. Patch from Dan Oscarsson.
+ 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"
+ notification. Suggested by Barry Bouwsma.
+ Don't advertise "VERB" ESMTP extension if the "noexpn" privacy
+ option is set, since this disables VERB mode. Suggested
+ by John Hawkinson of MIT.
+ 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
+ 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.
+ Don't do 8->7 bit conversions when bouncing a MIME message that
+ is bouncing because of a MIME error during 8->7 bit conversion;
+ the encapsulated message will bounce again, causing a loop.
+ Problem noted by Steve Hubert of the University of Washington.
+ Create xf (transcript) files using the TempFileMode option value
+ instead of 0644. Suggested by Ann-Kian Yeo of the
+ National University of Singapore.
+ Print errors if setgid/setuid/etc. fail during delivery. This helps
+ detect cases where DefaultUid is set to something that the
+ system can't cope with.
+ PORTABILITY FIXES:
+ Support for AIX/RS 2.2.1 from Mark Whetzel of Western
+ Atlas International.
+ Patches for Intel Paragon OSF/1 1.3 from Leo Bicknell
+ <bicknell@ufp.org>.
+ On DEC OSF/1 3.2 and earlier, the MatchGECOS code would only
+ work on the first recipient of a message due to a
+ bug in the getpwent family. If this is something you
+ use, you can define DEC_OSF_BROKEN_GETPWENT=1 for a
+ workaround. From Maximum Entropy of Sanford C.
+ Bernstein and Associates.
+ FreeBSD 1.1.5.1 uname -r returns a string containing
+ parentheses, which breaks makesendmail. Reported
+ by Piero Serini <piero@strider.ibenet.it>.
+ Sequent DYNIX/ptx 4.0.2 patches from Jack Woolley of
+ Systems and Computer Technology Corporation.
+ Solaris 2.x: omit the UUCP grade parameter (-g flag) because
+ it is system-dependent. Problem noted by J.J. Bailey
+ of Bailey Computer Consulting.
+ Pyramid NILE running DC/OSx support from Earle F. Ake of
+ Hassler Communication Systems Technology, Inc.
+ HP-UX 10.x compile glitches, reported by Anne Brink of the
+ U.S. Army and James Byrne of Harte & Lyne Limited.
+ NetBSD from Matthew Green of the NetBSD crew.
+ SCO 5.x from Keith Reynolds of SCO.
+ IRIX 6.2 from Robert Tarrall of the University of
+ Colorado and Kari Hurtta of the Finnish Meteorological
+ Institute.
+ UXP/DS (Fujitsu/ICL DS/90 series) support from Diego R.
+ Lopez, CICA (Seville).
+ NCR SVR4 MP-RAS 3.x support from Tom Moore of NCR.
+ PTX 3.2.0 from Kenneth Stailey of the US Department of Labor
+ Employment Standards Administration.
+ Altos System V (5.3.1) from Tim Rice of Multitalents.
+ Concurrent Systems Corporation Maxion from Donald R. Laster
+ Jr.
+ NetInfo maps (improved debugging and multi-valued aliases)
+ from Adrian Steinmann of Steinmann Consulting.
+ ConvexOS 11.5 (including SecureWare C2 and the Share Scheduler)
+ from Eric Schnoebelen of Convex.
+ Linux 2.0 mail.local patches from Horst von Brand.
+ NEXTSTEP 3.x compilation from Robert La Ferla.
+ NEXTSTEP 3.x code changes from Allan J. Nathanson of NeXT.
+ Solaris 2.5 configuration fixes for mail.local by Jim Davis
+ of the University of Arizona.
+ Solaris 2.5 has a working setreuid. Noted by David Linn of
+ Vanderbilt University.
+ Solaris changes for praliases, makemap, mailstats, and smrsh.
+ Previously you had to add -DSOLARIS in Makefile.dist;
+ this auto-detects. Based on a patch from Randall
+ Winchester of the University of Maryland.
+ CONFIG: add generic-nextstep3.3.mc file. Contributed by
+ Robert La Ferla of Hot Software.
+ CONFIG: allow mailertables to resolve to ``error:code message''
+ (where "code" is an exit status) on domains (previously
+ worked only on hosts). Patch from Cor Bosman of Xs4all
+ Foundation.
+ CONFIG: hooks for IPv6-style domain literals.
+ CONFIG: predefine ALIAS_FILE and change the prototype file so that
+ if it is undefined the AliasFile option is never set; this
+ should be transparent for most everyone. Suggested by John
+ Myers of CMU.
+ CONFIG: add FEATURE(limited_masquerade). Without this feature, any
+ domain listed in $=w is masqueraded. With it, only those
+ domains listed in a MASQUERADE_DOMAIN macro are masqueraded.
+ CONFIG: add FEATURE(masquerade_entire_domain). This causes
+ masquerading specified by MASQUERADE_DOMAIN to apply to all
+ hosts under those domains as well as the domain headers
+ themselves. For example, if a configuration had
+ MASQUERADE_DOMAIN(foo.com), then without this feature only
+ foo.com would be masqueraded; with it, *.foo.com would be
+ masqueraded as well. Based on an implementation by Richard
+ (Pug) Bainter of U. Texas.
+ CONFIG: add FEATURE(genericstable) to do a more general rewriting of
+ outgoing addresses. Defaults to ``hash -o /etc/genericstable''.
+ Keys are user names; values are outgoing mail addresses. Yes,
+ this does overlap with the user database, and figuring out
+ just when to use which one may be tricky. Based on code
+ contributed by Richard (Pug) Bainter of U. Texas with updates
+ from Per Hedeland of Ericsson.
+ CONFIG: add FEATURE(virtusertable) to do generalized rewriting of
+ incoming addresses. Defaults to ``hash -o /etc/virtusertable''.
+ Keys are either fully qualified addresses or just the host
+ part (with the @ sign). For example, a table containing:
+ info@foo.com foo-info
+ info@bar.com bar-info
+ @baz.org jane@elsewhere.net
+ would send all mail destined for info@foo.com to foo-info
+ (which is presumably an alias), mail addressed to info@bar.com
+ to bar-info, and anything addressed to anyone at baz.org will
+ be sent to jane@elsewhere.net. The names foo.com, bar.com,
+ and baz.org must all be in $=w. Based on discussions with
+ a great many people.
+ CONFIG: add nullclient configurations to define SMTP_MAILER_FLAGS.
+ Suggested by Richard Bainter.
+ CONFIG: add FAX_MAILER_ARGS to tweak the arguments passed to the
+ "fax" mailer.
+ CONFIG: allow mailertable entries to resolve to local:user; this
+ passes the original user@host in to procmail-style local
+ mailers as the "detail" information to allow them to do
+ additional clever processing. From Joe Pruett of
+ Teleport Corporation. Delivery to the original user can
+ be done by specifying "local:" (with nothing after the colon).
+ CONFIG: allow any context that takes "mailer:domain" to also take
+ "mailer:user@domain" to force mailing to the given user;
+ "local:user" can also be used to do local delivery. This
+ applies on *_RELAY and in the mailertable entries. Based
+ on a suggestion by Ribert Kiessling of Easynet.
+ CONFIG: Allow FEATURE(bestmx_is_local) to take an argument that
+ limits the possible domains; this reduces the number of DNS
+ lookups required to support this feature. For example,
+ FEATURE(bestmx_is_local, my.site.com) limits the lookups
+ to domains under my.site.com. Code contributed by Anthony
+ Thyssen <anthony@cit.gu.edu.au>.
+ CONFIG: LOCAL_RULESETS introduces any locally defined rulesets,
+ such as the check_rcpt ruleset. Suggested by Gregory Shapiro
+ of WPI.
+ CONFIG: MAILER_DEFINITIONS introduces any mailer definitions, in the
+ event you have to define local mailers. Suggested by
+ Gregory Shapiro of WPI.
+ CONFIG: fix cases where a three- (or more-) stage route-addr could
+ be misinterpreted as a list:...; syntax. Based on a patch by
+ Vlado Potisk <Vlado_Potisk@tempest.sk>.
+ CONFIG: Fix masquerading of UUCP addresses when the UUCP relay is
+ remotely connected. The address host!user was being
+ converted to host!user@thishost instead of host!user@uurelay.
+ Problem noted by William Gianopoulos of Raytheon Company.
+ CONFIG: add confTO_ICONNECT to set Timeout.iconnect.
+ CONFIG: change FEATURE(redirect) message from "User not local" to
+ "User has moved"; the former wording was confusing if the
+ new address is still on the local host. Based on a suggestion
+ by Andreas Luik.
+ CONFIG: add support in FEATURE(nullclient) for $=E (exposed users).
+ However, the class is not pre-initialized to contain root.
+ Suggested by Gregory Neil Shapiro.
+ CONTRIB: Remove XLA code at the request of the author, Christophe
+ Wolfhugel.
+ CONTRIB: Add re-mqueue.pl, contributed by Paul Pomes of Qualcomm.
+ MAIL.LOCAL: make it possible to compile mail.local on Solaris. Note
+ well: this produces a slightly different mailbox format (no
+ Content-Length: headers), file ownerships and modes are
+ different (not owned by group mail; mode 600 instead of 660),
+ and the local mailer flags will have to be tweaked (make them
+ match bsd4.4) in order to use this mailer. Patches from Paul
+ Hammann of the Missouri Research and Education Network.
+ MAIL.LOCAL: in some cases it could return EX_OK even though there
+ was a delivery error, such as if the ownership on the file
+ was wrong or the mode changed between the initial stat and
+ the open. Problem reported by William Colburn of the New
+ Mexico Institute of Mining and Technology.
+ MAILSTATS: handle zero length files more reliably. Patch from Bryan
+ Costales.
+ MAILSTATS: add man page contributed by Keith Bostic of BSDI.
+ MAKEMAP: The -d flag (to allow duplicate keys) to a btree map wasn't
+ honored. Fix from Michael Scott Shappe.
+ PRALIASES: add man page contributed by Keith Bostic of BSDI.
+ NEW FILES:
+ src/Makefiles/Makefile.AIX.2
+ src/Makefiles/Makefile.IRIX.6.2
+ src/Makefiles/Makefile.maxion
+ src/Makefiles/Makefile.NCR.MP-RAS.3.x
+ src/Makefiles/Makefile.SCO.5.x
+ src/Makefiles/Makefile.UXPDSV20
+ mailstats/mailstats.8
+ praliases/praliases.8
+ cf/cf/generic-nextstep3.3.mc
+ cf/feature/genericstable.m4
+ cf/feature/limited_masquerade.m4
+ cf/feature/masquerade_entire_domain.m4
+ cf/feature/virtusertable.m4
+ cf/ostype/aix2.m4
+ cf/ostype/altos.m4
+ cf/ostype/maxion.m4
+ cf/ostype/solaris2.ml.m4
+ cf/ostype/uxpds.m4
+ contrib/re-mqueue.pl
+ DELETED FILES:
+ src/Makefiles/Makefile.Solaris
+ contrib/xla/README
+ contrib/xla/xla.c
+ RENAMED FILES:
+ src/Makefiles/Makefile.NCR3000 => Makefile.NCR.MP-RAS.2.x
+ src/Makefiles/Makefile.SCO.3.2v4.2 => Makefile.SCO.4.2
+ src/Makefiles/Makefile.UXPDS => Makefile.UXPDSV10
+ src/Makefiles/Makefile.NeXT => Makefile.NeXT.2.x
+ src/Makefiles/Makefile.NEXTSTEP => Makefile.NeXT.3.x
+
8.7.6/8.7.3 96/09/17
SECURITY: It is possible to force getpwuid to fail when writing the
queue file, causing sendmail to fall back to running programs
@@ -18,8 +725,11 @@ summary of the changes in that release.
8.7.5/8.7.3 96/03/04
Fix glitch in 8.7.4 when putting certain internal lines; this can
- in some case cause connections to hang. Patch from Eric
- Wassenaar.
+ in some case cause connections to hang or messages to have
+ extra spaces in odd places. Patch from Eric Wassenaar;
+ reports from Eric Hall of Chiron Corporation, Stephen
+ Hansen of Stanford University, Dean Gaudet of HotWired,
+ and others.
8.7.4/8.7.3 96/02/18
SECURITY: In some cases it was still possible for an attacker to
@@ -80,7 +790,7 @@ summary of the changes in that release.
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
- -- mail gets lost!); this was pointe dout by Stuart Pook of
+ -- mail gets lost!); this was pointed out by Stuart Pook of
Infobiogen.
Fix possible buffer overflow in munchstring(). This was not a security
problem because you couldn't specify any argument to this
@@ -720,7 +1430,8 @@ summary of the changes in that release.
"dns" is in the service list for "hosts".
Add preliminary support for the ESMTP "DSN" extension (Delivery
Status Notifications). DSN notifications override
- Return-Receipt-To: headers, which are bogus anyhow.
+ Return-Receipt-To: headers, which are bogus anyhow --
+ support for them has been removed.
Add T=mts-name-type/address-type/diagnostic-type keyletter to mailer
definitions to define the types used in DSN returns for
MTA names, addresses, and diagnostics respectively.
@@ -1484,7 +2195,7 @@ summary of the changes in that release.
contrib/rcpt-streaming
src/Makefiles/Makefile.SunOS.5.x
-8.6.13/8.6.12 95/01/25
+8.6.13/8.6.12 96/01/25
SECURITY: In some cases it was still possible for an attacker to
insert newlines into a queue file, thus allowing access to
any user (except root).
@@ -2516,7 +3227,8 @@ summary of the changes in that release.
is set. Problem noted by P{r (Pell) Emanuelsson.
Fix a problem causing the "c" option (don't connect to expensive
mailers) to be ignored in SMTP. Problem noted and the
- solution suggested by Robert Elz of Munnari University.
+ solution suggested by Robert Elz of The University of
+ Melbourne.
Improve connection caching algorithm by passing "[host]" to
hostsignature, which strips the square brackets and
returns the real name. This allows mailertable entries
diff --git a/usr.sbin/sendmail/cf/README b/usr.sbin/sendmail/cf/README
index 6027b86f40e2..de57253066f0 100644
--- a/usr.sbin/sendmail/cf/README
+++ b/usr.sbin/sendmail/cf/README
@@ -4,7 +4,7 @@
Eric Allman <eric@CS.Berkeley.EDU>
- @(#)README 8.81 (Berkeley) 12/3/95
+ @(#)README 8.106 (Berkeley) 10/12/96
This document describes the sendmail configuration files being used
@@ -13,7 +13,7 @@ not work on other versions.
These configuration files are probably not as general as previous
versions, and don't handle as many of the weird cases automagically.
-I was able to simplify by them for two reasons. First, the network
+I was able to simplify them for two reasons. First, the network
has become more consistent -- for example, at this point, everyone
on the internet is supposed to be running a name server, so hacks to
handle NIC-registered hosts can go away. Second, I assumed that a
@@ -158,9 +158,38 @@ definition appropriate for your environment.
MAILER(smtp)
These describe the mailers used at the default CS site site. The
-local mailer is always included automatically. Beware MAILER
-declarations should always be last in the configuration file, and
-MAILER(smtp) should always precede MAILER(uucp).
+local mailer is always included automatically. Beware: MAILER
+declarations should always be at the end of the configuration file,
+and MAILER(smtp) should always precede MAILER(uucp). The general
+rules are that the order should be:
+
+ VERSIONID
+ OSTYPE
+ DOMAIN
+ FEATURE
+ local macro definitions
+ MAILER
+ LOCAL_RULESET_*
+
+
++----------------------------+
+| A BRIEF INTRODUCTION TO M4 |
++----------------------------+
+
+Sendmail uses the M4 macro processor to ``compile'' the configuration
+files. The most important thing to know is that M4 is stream-based,
+that is, it doesn't understand about lines. For this reason, in some
+places you may see the word ``dnl'', which standards for ``delete
+through newline''; essentially, it deletes all characters starting
+at the ``dnl'' up to and including the next newline character. In
+most cases sendmail uses this only to avoid lots of unnecessary
+blank lines in the output.
+
+Other important directives are define(A, B) which defines the macro
+``A'' to have value ``B''. Macros are expanded as they are read, so
+one normally quotes both values to prevent expansion. For example,
+
+ define(`SMART_HOST', `smart.foo.com')
One word of warning: M4 macros are expanded even in lines that appear
to be comments. For example, if you have
@@ -251,6 +280,7 @@ SMTP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data
that ARRIVE from an address that resolves to one of
the SMTP mailers and which are converted to MIME will
be labelled with this character set.
+UUCP_MAILER_PATH [/usr/bin/uux] The program used to send UUCP mail.
UUCP_MAILER_FLAGS [undefined] Flags added to UUCP mailer. Default
flags are `DFMhuU' (and `m' for uucp-new mailer,
minus `U' for uucp-dom mailer).
@@ -264,12 +294,16 @@ UUCP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data
be labelled with this character set.
FAX_MAILER_PATH [/usr/local/lib/fax/mailfax] The program used to
submit FAX messages.
+FAX_MAILER_ARGS [mailfax $u $h $f] The arguments passed to the FAX
+ mailer.
FAX_MAILER_MAX [100000] The maximum size message accepted for
transmission by FAX.
POP_MAILER_PATH [/usr/lib/mh/spop] The pathname of the POP mailer.
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).
PROCMAIL_MAILER_FLAGS [Shu] Flags added to Procmail mailer. Flags
``DFMmn'' are always set.
PROCMAIL_MAILER_ARGS [procmail -m $h $f $u] The arguments passed to
@@ -290,6 +324,10 @@ CYRUS_MAILER_PATH [/usr/cyrus/bin/deliver] The progam used to deliver
cyrus mail.
CYRUS_MAILER_ARGS [deliver -e -m $h -- $u] The arguments passed
to deliver cyrus mail.
+CYRUS_MAILER_MAX [undefined] If set, the maximum size message that
+ will be accepted by the cyrus mailer.
+CYRUS_MAILER_USER [cyrus:mail] The user and group to become when
+ running the cyrus mailer.
CYRUS_BB_MAILER_FLAGS [undefined] The flags used by the cyrusbb
mailer. The flags lsDFMnP are always included.
CYRUS_BB_MAILER_ARGS [deliver -e -m $u] The arguments passed
@@ -565,6 +603,73 @@ allmasquerade If masquerading is enabled (using MASQUERADE_AS), this
namespace on your masquerade host supersets all the
local entries.
+limited_masquerade
+ Normally, any hosts listed in $=w are masqueraded. If this
+ feature is given, only the hosts listed in $=M are masqueraded.
+ This is useful if you have several domains with disjoint
+ namespaces hosted on the same machine.
+
+masquerade_entire_domain
+ If masquerading is enabled (using MASQUERADE_AS) and
+ MASQUERADE_DOMAIN (see below) is set, this feature will
+ cause addresses to be rewritten such that the masquerading
+ domains are actually entire domains to be hidden. All
+ hosts within the masquerading domains will be rewritten
+ to the masquerade name (used in MASQUERADE_AS). For example,
+ if you have:
+
+ MASQUERADE_AS(masq.com)
+ MASQUERADE_DOMAIN(foo.org)
+ MASQUERADE_DOMAIN(bar.com)
+
+ then *foo.org and *bar.com are converted to masq.com. Without
+ this feature, only foo.org and bar.com are masqueraded.
+
+ NOTE: only domains within your jurisdiction and
+ current hierarchy should be masqueraded using this.
+
+genericstable This feature will cause certain addresses originating in the
+ local domain or a domain listed in $=G to be looked up in a
+ map and turned into another ("generic") form, which can change
+ both the domain name and the user name. This is similar to
+ the userdb functionality. The same types of addresses as for
+ masquerading are looked up, i.e. only header sender addresses
+ unless the allmasquerade and/or masquerade_envelope features
+ are given. The addresses must be in the list of names given
+ by the macros GENERICS_DOMAIN or GENERICS_DOMAIN_FILE
+ (analogously to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE,
+ see below).
+
+ The argument of FEATURE(genericstable) may be the map
+ defintion; the default map definition is:
+
+ hash -o /etc/genericstable
+
+ The key for this table is either the full address or the
+ unqualified username (the former is tried first); the
+ value is the new user address. If the new user address does
+ not include a domain, $j is used.
+
+virtusertable A domain-specific form of aliasing, allowing multiple
+ virtual domains to be hosted on one machine. For example,
+ if the virtuser table contained:
+
+ info@foo.com foo-info
+ info@bar.com bar-info
+ @baz.org jane@elsewhere.net
+
+ then mail addressed to info@foo.com will be sent to the
+ address foo-info, mail addressed to info@bar.com will be
+ delivered to bar-info, and mail addressed to anyone at
+ baz.org will be sent to jane@elsewhere.net. All the host
+ names on the left hand side (foo.com, bar.com, and baz.org)
+ must be in $=w. The default map definition is:
+
+ hash -o /etc/virtusertable
+
+ A new definition can be specified as the second argument of
+ the FEATURE macro.
+
nodns We aren't running DNS at our site (for example,
we are UUCP-only connected). It's hard to consider
this a "feature", but hey, it had to go somewhere.
@@ -587,7 +692,7 @@ local_procmail Use procmail as the local mailer. This mailer can
normally the +indicator is just tossed, but by default
it is passed as the -a argument to procmail. The
argument to this feature is the pathname of procmail,
- which defaults to /usr/local/bin/procmail.
+ which defaults to PROCMAIL_MAILER_PATH.
bestmx_is_local Accept mail as though locally addressed for any host that
lists us as the best possible MX record. This generates
@@ -834,14 +939,17 @@ You can have your host masquerade as another using
MASQUERADE_AS(host.domain)
-This causes outgoing SMTP mail to be labeled as coming from the
+This causes mail being sent to be labeled as coming from the
indicated domain, rather than $j. One normally masquerades as one
of one's own subdomains (for example, it's unlikely that I would
-choose to masquerade as an MIT site).
+choose to masquerade as an MIT site). This behaviour is modified by
+a plethora of FEATUREs; in particular, see masquerade_envelope,
+allmasquerade, limited_masquerade, and masquerade_entire_domain.
The masquerade name is not normally canonified, so it is important
that it be your One True Name, that is, fully qualified and not a
-CNAME.
+CNAME. However, if you use a CNAME, the receiving side may canonify
+it for you, so don't think you can cheat CNAME mapping this way.
Normally the only addresses that are masqueraded are those that come
from this host (that is, are either unqualified or in $=w, the list
@@ -883,7 +991,7 @@ to have .forward files or aliases. You can do this using
define(`LOCAL_RELAY', mailer:hostname)
The ``mailer:'' can be omitted, in which case the mailer defaults to
-"smtp". There are some user names that you don't want relayed, perhaps
+"relay". There are some user names that you don't want relayed, perhaps
because of local aliases. A common example is root, which may be
locally aliased. You can add entries to this list using
@@ -898,13 +1006,13 @@ shared /var/spool/mail scheme, use
define(`MAIL_HUB', mailer:hostname)
-Again, ``mailer:'' defaults to "smtp". If you define both LOCAL_RELAY
+Again, ``mailer:'' defaults to "relay". If you define both LOCAL_RELAY
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 are on machine mastodon.CS.Berkeley.EDU and you have
+For example, if you are on machine mastodon.CS.Berkeley.EDU and you have
FEATURE(stickyhost), the following combinations of settings will have the
indicated effects:
@@ -936,6 +1044,12 @@ really want absolutely everything to go to a single central site you will
need to unset all the other relays -- or better yet, find or build a
minimal config file that does this.
+For duplicate suppression to work properly, the host name is best
+specified with a terminal dot:
+
+ define(`MAIL_HUB', `host.domain.')
+ note the trailing dot ---^
+
+-------------------------------+
| NON-SMTP BASED CONFIGURATIONS |
@@ -1118,7 +1232,7 @@ for. In particular:
version.
* Make sure that other files that sendmail reads, such as the
- mailertable, is only writable by trusted system personnel.
+ mailertable, are only writable by trusted system personnel.
* The queue directory should not be world writable PARTICULARLY
if your system allows "file giveaways" (that is, if a non-root
@@ -1319,7 +1433,7 @@ 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).
-confSMTP_MAILER - [smtp] The mailer name used when
+confSMTP_MAILER - [esmtp] The mailer name used when
SMTP connectivity is required.
One of "smtp", "smtp8", or "esmtp".
confUUCP_MAILER - [uucp-old] The mailer to be used by
@@ -1351,7 +1465,7 @@ confMIN_FREE_BLOCKS MinFreeBlocks [100] Minimum number of free blocks on
for the second value now.)
confMAX_MESSAGE_SIZE MaxMessageSize [infinite] The maximum size of messages
that will be accepted (in bytes).
-confBLANK_SUB BlankSub [ ] Blank (space) substitution
+confBLANK_SUB BlankSub [.] Blank (space) substitution
character.
confCON_EXPENSIVE HoldExpensive [False] Avoid connecting immediately
to mailers marked expensive?
@@ -1383,6 +1497,17 @@ confMCI_CACHE_SIZE ConnectionCacheSize
[2] Size of open connection cache.
confMCI_CACHE_TIMEOUT ConnectionCacheTimeout
[5m] Open connection cache timeout.
+confHOST_STATUS_DIRECTORY HostStatusDirectory
+ [undefined] If set, host status is kept
+ on disk between sendmail runs in the
+ named directory tree. This need not be
+ a full pathname, in which case it is
+ interpreted relative to the queue
+ directory. This option also
+ single-threads connections to each
+ host, i.e., prevents multiple
+ connections to a single server from
+ this client.
confUSE_ERRORS_TO* UserErrorsTo [False] Use the Errors-To: header to
deliver error messages. This should
not be necessary because of general
@@ -1411,6 +1536,18 @@ confSAFE_QUEUE* SuperSafe [True] Commit all messages to disk
before forking.
confTO_INITIAL Timeout.initial [5m] The timeout waiting for a response
on the initial connect.
+confTO_CONNECT Timeout.connect [0] The timeout waiting for an initial
+ connect() to complete. This can only
+ shorten connection timeouts; the kernel
+ silently enforces an absolute maximum
+ (which varies depending on the system).
+confTO_ICONNECT Timeout.iconnect
+ [undefined] Like Timeout.connect, but
+ applies only to the very first attempt
+ to connect to a host in a message.
+ This allows a single very fast pass
+ followed by more careful delivery
+ attempts in the future.
confTO_HELO Timeout.helo [5m] The timeout waiting for a response
to a HELO or EHLO command.
confTO_MAIL Timeout.mail [10m] The timeout waiting for a
@@ -1469,6 +1606,13 @@ confTO_QUEUEWARN_NONURGENT
Timeout.queuewarn.non-urgent
[undefined] As above, for non-urgent
(low) priority messages.
+confTO_HOSTSTATUS Timeout.hoststatus
+ [30m] How long information about host
+ statuses will be maintained before it
+ is considered stale and the host should
+ be retried. This applies both within
+ a single queue run and to persistent
+ information (see below).
confTIME_ZONE TimeZoneSpec [USE_SYSTEM] Time zone info -- can be
USE_SYSTEM to use the system's idea,
USE_TZ to use the user's TZ envariable,
@@ -1486,6 +1630,19 @@ confQUEUE_LA QueueLA [8] Load average at which queue-only
function kicks in.
confREFUSE_LA RefuseLA [12] Load average at which incoming
SMTP connections are refused.
+confMAX_DAEMON_CHILDREN MaxDaemonChildren
+ [undefined] The maximum number of
+ children the daemon will permit. After
+ this number, connections will be
+ rejected. If not set or <= 0, there is
+ no limit.
+confCONNECTION_RATE_THROTTLE ConnectionRateThrottle
+ [undefined] The maximum number of
+ connections permitted per second.
+ After this many connections are
+ accepted, further connections will be
+ delayed. If not set or <= 0, there is
+ no limit.
confWORK_RECIPIENT_FACTOR
RecipientFactor [30000] Cost of each recipient.
confSEPARATE_PROC ForkEachJob [False] Run all deliveries in a separate
@@ -1585,6 +1742,39 @@ confDONT_INIT_GROUPS DontInitGroups [False] If set, the initgroups(3)
this, agents run on behalf of users
will only have their primary
(/etc/passwd) group permissions.
+confUNSAFE_GROUP_WRITES UnsafeGroupWrites
+ [False] If set, group-writable
+ :include: and .forward files are
+ considered "unsafe", that is, programs
+ and files cannot be directly referenced
+ from such files. World-writable files
+ are always considered unsafe.
+confDOUBLE_BOUNCE_ADDRESS DoubleBounceAddress
+ [postmaster] If an error occurs when
+ sending an error message, send that
+ "double bounce" error message to this
+ address.
+confRUN_AS_USER RunAsUser [undefined] If set, become this user
+ when reading and delivering mail.
+ Causes all file reads (e.g., .forward
+ and :include: files) to be done as
+ this user. Also, all programs will
+ be run as this user, and all output
+ files will be written as this user.
+ Intended for use only on firewalls
+ where users do not have accounts.
+confSINGLE_THREAD_DELIVERY SingleThreadDelivery
+ [False] If this option and the
+ HostStatusDirectory option are both
+ set, single thread deliveries to other
+ hosts. That is, don't allow any two
+ sendmails on this host to connect
+ simultaneously to any other single
+ host. This can slow down delivery in
+ some cases, in particular since a
+ cached but otherwise idle connection
+ to a host will prevent other sendmails
+ from connecting to the other host.
See also the description of OSTYPE for some parameters that can be
tweaked (generally pathnames to mailers).
@@ -1710,12 +1900,12 @@ MACROS
CLASSES
A
- B
+ B domains that are candidates for bestmx lookup
C
D
E addresses that should not seem to come from $M
F hosts we forward for
- G
+ G domains that should be looked up in genericstable
H
I
J
@@ -1736,6 +1926,7 @@ CLASSES
Y locally connected smart UUCP hosts
Z locally connected domain-ized UUCP hosts
. the class containing only a dot
+ [ the class containing only a left bracket
M4 DIVERSIONS
diff --git a/usr.sbin/sendmail/cf/cf/chez.cs.mc b/usr.sbin/sendmail/cf/cf/chez.cs.mc
index b30fe9ce22da..85f7e5c2c1ba 100644
--- a/usr.sbin/sendmail/cf/cf/chez.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/chez.cs.mc
@@ -44,7 +44,8 @@ divert(-1)
# will be forwarded to that machine.
#
-VERSIONID(`@(#)chez.cs.mc 8.5 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)chez.cs.mc 8.6 (Berkeley) 3/23/96')
OSTYPE(bsd4.4)dnl
DOMAIN(CS.Berkeley.EDU)dnl
define(`LOCAL_RELAY', vangogh.CS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/clientproto.mc b/usr.sbin/sendmail/cf/cf/clientproto.mc
index a59ac037e192..7cbb352c8fb6 100644
--- a/usr.sbin/sendmail/cf/cf/clientproto.mc
+++ b/usr.sbin/sendmail/cf/cf/clientproto.mc
@@ -48,7 +48,8 @@ divert(-1)
# Other than these, it should never contain any other lines.
#
-VERSIONID(`@(#)clientproto.mc 8.6 (Berkeley) 8/16/95')
+divert(0)dnl
+VERSIONID(`@(#)clientproto.mc 8.7 (Berkeley) 3/23/96')
OSTYPE(unknown)
FEATURE(nullclient, mailhost.$m)
diff --git a/usr.sbin/sendmail/cf/cf/cs-hpux10.mc b/usr.sbin/sendmail/cf/cf/cs-hpux10.mc
index 1d39ccfa413a..61155d303cfd 100644
--- a/usr.sbin/sendmail/cf/cf/cs-hpux10.mc
+++ b/usr.sbin/sendmail/cf/cf/cs-hpux10.mc
@@ -43,7 +43,8 @@ divert(-1)
# to a name of your own choosing.
#
-VERSIONID(`@(#)cs-hpux10.mc 8.3 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)cs-hpux10.mc 8.4 (Berkeley) 3/23/96')
OSTYPE(hpux10)dnl
DOMAIN(CS.Berkeley.EDU)dnl
define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/cs-hpux9.mc b/usr.sbin/sendmail/cf/cf/cs-hpux9.mc
index a27febeaedac..e9e0af8830c8 100644
--- a/usr.sbin/sendmail/cf/cf/cs-hpux9.mc
+++ b/usr.sbin/sendmail/cf/cf/cs-hpux9.mc
@@ -43,7 +43,8 @@ divert(-1)
# to a name of your own choosing.
#
-VERSIONID(`@(#)cs-hpux9.mc 8.4 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)cs-hpux9.mc 8.5 (Berkeley) 3/23/96')
OSTYPE(hpux9)dnl
DOMAIN(CS.Berkeley.EDU)dnl
define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/cs-osf1.mc b/usr.sbin/sendmail/cf/cf/cs-osf1.mc
index b5beca80c0f2..f61b65655d59 100644
--- a/usr.sbin/sendmail/cf/cf/cs-osf1.mc
+++ b/usr.sbin/sendmail/cf/cf/cs-osf1.mc
@@ -43,7 +43,8 @@ divert(-1)
# to a name of your own choosing.
#
-VERSIONID(`@(#)cs-osf1.mc 8.3 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)cs-osf1.mc 8.4 (Berkeley) 3/23/96')
OSTYPE(osf1)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/cs-solaris2.mc b/usr.sbin/sendmail/cf/cf/cs-solaris2.mc
index aad526b6a51c..ae8f420b13e3 100644
--- a/usr.sbin/sendmail/cf/cf/cs-solaris2.mc
+++ b/usr.sbin/sendmail/cf/cf/cs-solaris2.mc
@@ -43,7 +43,8 @@ divert(-1)
# to a name of your own choosing.
#
-VERSIONID(`@(#)cs-solaris2.mc 8.2 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)cs-solaris2.mc 8.3 (Berkeley) 3/23/96')
OSTYPE(solaris2)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/cs-sunos4.1.mc b/usr.sbin/sendmail/cf/cf/cs-sunos4.1.mc
index 024fc375d743..754de46010c1 100644
--- a/usr.sbin/sendmail/cf/cf/cs-sunos4.1.mc
+++ b/usr.sbin/sendmail/cf/cf/cs-sunos4.1.mc
@@ -43,7 +43,8 @@ divert(-1)
# to a name of your own choosing.
#
-VERSIONID(`@(#)cs-sunos4.1.mc 8.3 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)cs-sunos4.1.mc 8.4 (Berkeley) 3/23/96')
OSTYPE(sunos4.1)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/cs-ultrix4.mc b/usr.sbin/sendmail/cf/cf/cs-ultrix4.mc
index 1f90d00e0151..72735fc58919 100644
--- a/usr.sbin/sendmail/cf/cf/cs-ultrix4.mc
+++ b/usr.sbin/sendmail/cf/cf/cs-ultrix4.mc
@@ -43,7 +43,8 @@ divert(-1)
# to a name of your own choosing.
#
-VERSIONID(`@(#)cs-ultrix4.mc 8.3 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)cs-ultrix4.mc 8.4 (Berkeley) 3/23/96')
OSTYPE(ultrix4)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/cyrusproto.mc b/usr.sbin/sendmail/cf/cf/cyrusproto.mc
index 125b931704c0..c660898b738f 100644
--- a/usr.sbin/sendmail/cf/cf/cyrusproto.mc
+++ b/usr.sbin/sendmail/cf/cf/cyrusproto.mc
@@ -26,7 +26,8 @@ divert(-1)
# exclusively for local mail.
#
-VERSIONID(`@(#)cyrusproto.mc 8.2 (Carnegie Mellon) @(#)cyrusproto.mc 8.2')
+divert(0)dnl
+VERSIONID(`@(#)cyrusproto.mc 8.3 (Carnegie Mellon) @(#)cyrusproto.mc 8.3')
define(`confBIND_OPTS',`-DNSRCH -DEFNAMES')
FEATURE(nouucp)
FEATURE(nocanonify)
diff --git a/usr.sbin/sendmail/cf/cf/generic-bsd4.4.mc b/usr.sbin/sendmail/cf/cf/generic-bsd4.4.mc
index 482f671d0a5f..25783a324d70 100644
--- a/usr.sbin/sendmail/cf/cf/generic-bsd4.4.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-bsd4.4.mc
@@ -41,7 +41,8 @@ divert(-1)
# and do the modifications there.
#
-VERSIONID(`@(#)generic-bsd4.4.mc 8.1 (Berkeley) 9/12/95')
+divert(0)dnl
+VERSIONID(`@(#)generic-bsd4.4.mc 8.2 (Berkeley) 3/23/96')
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-hpux10.mc b/usr.sbin/sendmail/cf/cf/generic-hpux10.mc
index 9c59c64bed69..48828eb02467 100644
--- a/usr.sbin/sendmail/cf/cf/generic-hpux10.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-hpux10.mc
@@ -40,7 +40,8 @@ divert(-1)
# and do the modifications there.
#
-VERSIONID(`@(#)generic-hpux10.mc 8.2 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)generic-hpux10.mc 8.3 (Berkeley) 3/23/96')
OSTYPE(hpux10)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-hpux9.mc b/usr.sbin/sendmail/cf/cf/generic-hpux9.mc
index d56e05ec9ec6..3c89e4330000 100644
--- a/usr.sbin/sendmail/cf/cf/generic-hpux9.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-hpux9.mc
@@ -40,7 +40,8 @@ divert(-1)
# and do the modifications there.
#
-VERSIONID(`@(#)generic-hpux9.mc 8.2 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)generic-hpux9.mc 8.3 (Berkeley) 3/23/96')
OSTYPE(hpux9)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-nextstep3.3.mc b/usr.sbin/sendmail/cf/cf/generic-nextstep3.3.mc
new file mode 100644
index 000000000000..7383c0ba0bcf
--- /dev/null
+++ b/usr.sbin/sendmail/cf/cf/generic-nextstep3.3.mc
@@ -0,0 +1,48 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+#
+# This is a generic configuration file for NEXTSTEP 3.3 systems.
+# It has support for local and SMTP mail only. If you want to
+# customize it, copy it to a name appropriate for your environment
+# and do the modifications there.
+#
+
+divert(0)dnl
+VERSIONID(`@(#)generic-nextstep3.3.mc 8.2 (Berkeley) 3/23/96')
+OSTYPE(nextstep)dnl
+DOMAIN(generic)dnl
+MAILER(local)dnl
+MAILER(smtp)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-osf1.mc b/usr.sbin/sendmail/cf/cf/generic-osf1.mc
index 3134f6138f5e..bb74d18ab270 100644
--- a/usr.sbin/sendmail/cf/cf/generic-osf1.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-osf1.mc
@@ -40,7 +40,8 @@ divert(-1)
# and do the modifications there.
#
-VERSIONID(`@(#)generic-osf1.mc 8.2 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)generic-osf1.mc 8.3 (Berkeley) 3/23/96')
OSTYPE(osf1)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-solaris2.mc b/usr.sbin/sendmail/cf/cf/generic-solaris2.mc
index 7e6b84ec9046..21fab9fba6ba 100644
--- a/usr.sbin/sendmail/cf/cf/generic-solaris2.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-solaris2.mc
@@ -40,7 +40,8 @@ divert(-1)
# and do the modifications there.
#
-VERSIONID(`@(#)generic-solaris2.mc 8.2 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)generic-solaris2.mc 8.3 (Berkeley) 3/23/96')
OSTYPE(solaris2)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-sunos4.1.mc b/usr.sbin/sendmail/cf/cf/generic-sunos4.1.mc
index 1e3b3c83bfb2..eeff027a6ab8 100644
--- a/usr.sbin/sendmail/cf/cf/generic-sunos4.1.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-sunos4.1.mc
@@ -40,7 +40,8 @@ divert(-1)
# and do the modifications there.
#
-VERSIONID(`@(#)generic-sunos4.1.mc 8.2 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)generic-sunos4.1.mc 8.3 (Berkeley) 3/23/96')
OSTYPE(sunos4.1)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-ultrix4.mc b/usr.sbin/sendmail/cf/cf/generic-ultrix4.mc
index a12b3d107ffe..dd30936d10ba 100644
--- a/usr.sbin/sendmail/cf/cf/generic-ultrix4.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-ultrix4.mc
@@ -40,7 +40,8 @@ divert(-1)
# and do the modifications there.
#
-VERSIONID(`@(#)generic-ultrix4.mc 8.2 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)generic-ultrix4.mc 8.3 (Berkeley) 3/23/96')
OSTYPE(ultrix4)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/huginn.cs.mc b/usr.sbin/sendmail/cf/cf/huginn.cs.mc
index 4914f32e3137..aad442b4d840 100644
--- a/usr.sbin/sendmail/cf/cf/huginn.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/huginn.cs.mc
@@ -42,7 +42,8 @@ divert(-1)
# This file is for the backup CS Division mail server.
#
-VERSIONID(`@(#)huginn.cs.mc 8.6 (Berkeley) 8/25/95')
+divert(0)dnl
+VERSIONID(`@(#)huginn.cs.mc 8.7 (Berkeley) 3/23/96')
OSTYPE(hpux9)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MASQUERADE_AS(CS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/mail.cs.mc b/usr.sbin/sendmail/cf/cf/mail.cs.mc
index 50daad7e68c0..02a3acf7321f 100644
--- a/usr.sbin/sendmail/cf/cf/mail.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/mail.cs.mc
@@ -42,7 +42,8 @@ divert(-1)
# This file is for the primary CS Division mail server.
#
-VERSIONID(`@(#)mail.cs.mc 8.9 (Berkeley) 8/25/95')
+divert(0)dnl
+VERSIONID(`@(#)mail.cs.mc 8.10 (Berkeley) 3/23/96')
OSTYPE(ultrix4)dnl
DOMAIN(Berkeley.EDU)dnl
MASQUERADE_AS(CS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/mail.eecs.mc b/usr.sbin/sendmail/cf/cf/mail.eecs.mc
index f6d2bdcde106..756f5ddefd5d 100644
--- a/usr.sbin/sendmail/cf/cf/mail.eecs.mc
+++ b/usr.sbin/sendmail/cf/cf/mail.eecs.mc
@@ -42,7 +42,8 @@ divert(-1)
# This file is for the primary EECS mail server.
#
-VERSIONID(`@(#)mail.eecs.mc 8.9 (Berkeley) 8/25/95')
+divert(0)dnl
+VERSIONID(`@(#)mail.eecs.mc 8.10 (Berkeley) 3/23/96')
OSTYPE(ultrix4)dnl
DOMAIN(EECS.Berkeley.EDU)dnl
MASQUERADE_AS(EECS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/mailspool.cs.mc b/usr.sbin/sendmail/cf/cf/mailspool.cs.mc
index 0493b2dffcf0..de0a7d7d1ad3 100644
--- a/usr.sbin/sendmail/cf/cf/mailspool.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/mailspool.cs.mc
@@ -44,7 +44,8 @@ divert(-1)
# for back compatibility.
#
-VERSIONID(`@(#)mailspool.cs.mc 8.3 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)mailspool.cs.mc 8.4 (Berkeley) 3/23/96')
OSTYPE(sunos4.1)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/python.cs.mc b/usr.sbin/sendmail/cf/cf/python.cs.mc
index 3dff97d15300..e049d66185a6 100644
--- a/usr.sbin/sendmail/cf/cf/python.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/python.cs.mc
@@ -44,7 +44,8 @@ divert(-1)
# will be forwarded to that machine.
#
-VERSIONID(`@(#)python.cs.mc 8.3 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)python.cs.mc 8.4 (Berkeley) 3/23/96')
OSTYPE(bsd4.4)dnl
DOMAIN(CS.Berkeley.EDU)dnl
define(`LOCAL_RELAY', vangogh.CS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/s2k-osf1.mc b/usr.sbin/sendmail/cf/cf/s2k-osf1.mc
index db324ae51561..eb195ccf155c 100644
--- a/usr.sbin/sendmail/cf/cf/s2k-osf1.mc
+++ b/usr.sbin/sendmail/cf/cf/s2k-osf1.mc
@@ -43,7 +43,8 @@ divert(-1)
# to a name of your own choosing.
#
-VERSIONID(`@(#)s2k-osf1.mc 8.3 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)s2k-osf1.mc 8.4 (Berkeley) 3/23/96')
OSTYPE(osf1)dnl
DOMAIN(S2K.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/s2k-ultrix4.mc b/usr.sbin/sendmail/cf/cf/s2k-ultrix4.mc
index 1404b86393b9..37df422edb12 100644
--- a/usr.sbin/sendmail/cf/cf/s2k-ultrix4.mc
+++ b/usr.sbin/sendmail/cf/cf/s2k-ultrix4.mc
@@ -43,7 +43,8 @@ divert(-1)
# to a name of your own choosing.
#
-VERSIONID(`@(#)s2k-ultrix4.mc 8.3 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)s2k-ultrix4.mc 8.4 (Berkeley) 3/23/96')
OSTYPE(ultrix4)dnl
DOMAIN(S2K.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/tcpproto.mc b/usr.sbin/sendmail/cf/cf/tcpproto.mc
index 7f43558ca97d..d023185ccbd8 100644
--- a/usr.sbin/sendmail/cf/cf/tcpproto.mc
+++ b/usr.sbin/sendmail/cf/cf/tcpproto.mc
@@ -46,7 +46,8 @@ divert(-1)
# will not trash your changes.
#
-VERSIONID(`@(#)tcpproto.mc 8.4 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)tcpproto.mc 8.5 (Berkeley) 3/23/96')
OSTYPE(unknown)
FEATURE(nouucp)
MAILER(local)
diff --git a/usr.sbin/sendmail/cf/cf/ucbarpa.mc b/usr.sbin/sendmail/cf/cf/ucbarpa.mc
index 39d73908cad6..5fe99d00476d 100644
--- a/usr.sbin/sendmail/cf/cf/ucbarpa.mc
+++ b/usr.sbin/sendmail/cf/cf/ucbarpa.mc
@@ -41,7 +41,8 @@ divert(-1)
# `SITECONFIG'. See also ucbvax.mc.
#
-VERSIONID(`@(#)ucbarpa.mc 8.3 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)ucbarpa.mc 8.4 (Berkeley) 3/23/96')
DOMAIN(CS.Berkeley.EDU)dnl
OSTYPE(bsd4.4)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/ucbvax.mc b/usr.sbin/sendmail/cf/cf/ucbvax.mc
index cc8cd2ce66de..89a0f1014cd6 100644
--- a/usr.sbin/sendmail/cf/cf/ucbvax.mc
+++ b/usr.sbin/sendmail/cf/cf/ucbvax.mc
@@ -42,7 +42,8 @@ divert(-1)
# `SITECONFIG' for routing of UUCP within your domain.
#
-VERSIONID(`@(#)ucbvax.mc 8.5 (Berkeley) 8/25/95')
+divert(0)dnl
+VERSIONID(`@(#)ucbvax.mc 8.6 (Berkeley) 3/23/96')
OSTYPE(bsd4.3)
DOMAIN(CS.Berkeley.EDU)
MASQUERADE_AS(CS.Berkeley.EDU)
diff --git a/usr.sbin/sendmail/cf/cf/uucpproto.mc b/usr.sbin/sendmail/cf/cf/uucpproto.mc
index 49c4a0de6562..6a21156ed52a 100644
--- a/usr.sbin/sendmail/cf/cf/uucpproto.mc
+++ b/usr.sbin/sendmail/cf/cf/uucpproto.mc
@@ -46,7 +46,8 @@ divert(-1)
# will not trash your changes.
#
-VERSIONID(`@(#)uucpproto.mc 8.5 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)uucpproto.mc 8.6 (Berkeley) 3/23/96')
OSTYPE(unknown)
FEATURE(nodns)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/vangogh.cs.mc b/usr.sbin/sendmail/cf/cf/vangogh.cs.mc
index 2be3179ea9bf..95a15e922ed9 100644
--- a/usr.sbin/sendmail/cf/cf/vangogh.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/vangogh.cs.mc
@@ -43,7 +43,8 @@ divert(-1)
# set up (to stress sendmail) and accepts mail for some other machines.
#
-VERSIONID(`@(#)vangogh.cs.mc 8.4 (Berkeley) 8/6/95')
+divert(0)dnl
+VERSIONID(`@(#)vangogh.cs.mc 8.5 (Berkeley) 3/23/96')
DOMAIN(CS.Berkeley.EDU)dnl
OSTYPE(bsd4.4)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/domain/generic.m4 b/usr.sbin/sendmail/cf/domain/generic.m4
index 6799ff895227..ca91f50f112e 100644
--- a/usr.sbin/sendmail/cf/domain/generic.m4
+++ b/usr.sbin/sendmail/cf/domain/generic.m4
@@ -41,8 +41,7 @@ divert(-1)
# files.
#
divert(0)
-VERSIONID(`@(#)generic.m4 8.2 (Berkeley) 4/21/95')
+VERSIONID(`@(#)generic.m4 8.3 (Berkeley) 3/24/96')
define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')dnl
-define(`confCW_FILE', `-o /etc/sendmail.cw')dnl
FEATURE(redirect)dnl
FEATURE(use_cw_file)dnl
diff --git a/usr.sbin/sendmail/cf/feature/bestmx_is_local.m4 b/usr.sbin/sendmail/cf/feature/bestmx_is_local.m4
index 23dff8c93eef..80c0ebb82cb1 100644
--- a/usr.sbin/sendmail/cf/feature/bestmx_is_local.m4
+++ b/usr.sbin/sendmail/cf/feature/bestmx_is_local.m4
@@ -34,12 +34,16 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)bestmx_is_local.m4 8.2 (Berkeley) 10/29/95')
+VERSIONID(`@(#)bestmx_is_local.m4 8.3 (Berkeley) 5/11/96')
divert(-1)
LOCAL_CONFIG
+# turn on bestMX lookup table
Kbestmx bestmx
+# limit bestmx to these domains
+CB`'_ARG_
+
LOCAL_NET_CONFIG
# If we are the best MX for a site, then we want to accept
@@ -50,9 +54,13 @@ LOCAL_NET_CONFIG
# Warning: this may generate a lot of extra DNS traffic -- a
# lower cost method is to list all the expected best MX hosts
# in $=w. This should be fine (and easier to administer) for
-# low to medium traffic hosts.
+# low to medium traffic hosts. If you use the limited bestmx
+# by passing in a set of possible domains it will improve things.
+ifelse(_ARG_, `', `', `#')dnl unlimited bestmx
R$* < @ $* > $* $: $1 < @ $2 @@ $(bestmx $2 $) > $3
+ifelse(_ARG_, `', `#', `')dnl limit bestmx to $=B
+R$* < @ $* $=B > $* $: $1 < @ $2 @@ $(bestmx $2 $3 $) > $4
R$* $=O $* < @ $* @@ $=w . > $* $@ $>97 $1 $2 $3
R$* < @ $* @@ $=w . > $* $#local $: $1
R$* < @ $* @@ $* > $* $: $1 < @ $2 > $4
diff --git a/usr.sbin/sendmail/cf/feature/genericstable.m4 b/usr.sbin/sendmail/cf/feature/genericstable.m4
new file mode 100644
index 000000000000..50fbbd0f25fb
--- /dev/null
+++ b/usr.sbin/sendmail/cf/feature/genericstable.m4
@@ -0,0 +1,40 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)genericstable.m4 8.1 (Berkeley) 2/11/96')
+divert(-1)
+
+define(`GENERICS_TABLE', ifelse(_ARG_, `', `hash -o /etc/genericstable', `_ARG_'))dnl
diff --git a/usr.sbin/sendmail/cf/feature/limited_masquerade.m4 b/usr.sbin/sendmail/cf/feature/limited_masquerade.m4
new file mode 100644
index 000000000000..fc4f5eaf3fc8
--- /dev/null
+++ b/usr.sbin/sendmail/cf/feature/limited_masquerade.m4
@@ -0,0 +1,40 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)limited_masquerade.m4 8.1 (Berkeley) 2/11/96')
+divert(-1)
+
+define(`_LIMITED_MASQUERADE_', 1)
diff --git a/usr.sbin/sendmail/cf/feature/local_procmail.m4 b/usr.sbin/sendmail/cf/feature/local_procmail.m4
index 9087a690d082..ba194bd22b04 100644
--- a/usr.sbin/sendmail/cf/feature/local_procmail.m4
+++ b/usr.sbin/sendmail/cf/feature/local_procmail.m4
@@ -34,11 +34,14 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)local_procmail.m4 8.3 (Berkeley) 10/29/95')
+VERSIONID(`@(#)local_procmail.m4 8.5 (Berkeley) 2/12/96')
divert(-1)
-define(`PROCMAIL_PATH',
- ifelse(_ARG_, `', `/usr/local/bin/procmail', `_ARG_'))
+define(`LOCAL_MAILER_PATH',
+ ifelse(_ARG_, `',
+ ifdef(`PROCMAIL_MAILER_PATH',
+ PROCMAIL_MAILER_PATH,
+ `/usr/local/bin/procmail'),
+ _ARG_))
define(`LOCAL_MAILER_FLAGS', `SPfhn')
-define(`LOCAL_MAILER_PATH', PROCMAIL_PATH)
define(`LOCAL_MAILER_ARGS', `procmail -Y -a $h -d $u')
diff --git a/usr.sbin/sendmail/cf/feature/masquerade_entire_domain.m4 b/usr.sbin/sendmail/cf/feature/masquerade_entire_domain.m4
new file mode 100644
index 000000000000..d94c007783b2
--- /dev/null
+++ b/usr.sbin/sendmail/cf/feature/masquerade_entire_domain.m4
@@ -0,0 +1,40 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)masquerade_entire_domain.m4 8.1 (Berkeley) 2/11/96')
+divert(-1)
+
+define(`_MASQUERADE_ENTIRE_DOMAIN_', 1)
diff --git a/usr.sbin/sendmail/cf/feature/nullclient.m4 b/usr.sbin/sendmail/cf/feature/nullclient.m4
index 7543070f77f7..6eaa8c1aeca8 100644
--- a/usr.sbin/sendmail/cf/feature/nullclient.m4
+++ b/usr.sbin/sendmail/cf/feature/nullclient.m4
@@ -45,7 +45,7 @@ POPDIVERT
# sendmail.
#
-VERSIONID(`@(#)nullclient.m4 8.6 (Berkeley) 6/29/95')
+VERSIONID(`@(#)nullclient.m4 8.7 (Berkeley) 2/11/96')
PUSHDIVERT(6)
# hub host (to which all mail is sent)
@@ -65,7 +65,8 @@ ifdef(`confRELAY_MAILER',,
`define(`confRELAY_MAILER', `nullclient')')dnl
ifdef(`confFROM_HEADER',,
`define(`confFROM_HEADER', <$g>)')dnl
+ifdef(`SMTP_MAILER_ARGS',, `define(`SMTP_MAILER_ARGS', `IPC $h')')dnl
Mnullclient, P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS),ifdef(`SMTP_MAILER_MAX', ` M=SMTP_MAILER_MAX,')
- A=IPC $h
+ A=SMTP_MAILER_ARGS
POPDIVERT
diff --git a/usr.sbin/sendmail/cf/feature/redirect.m4 b/usr.sbin/sendmail/cf/feature/redirect.m4
index 081db113ae01..27f235765359 100644
--- a/usr.sbin/sendmail/cf/feature/redirect.m4
+++ b/usr.sbin/sendmail/cf/feature/redirect.m4
@@ -34,7 +34,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)redirect.m4 8.4 (Berkeley) 6/25/95')
+VERSIONID(`@(#)redirect.m4 8.5 (Berkeley) 8/17/96')
divert(-1)
@@ -42,7 +42,7 @@ PUSHDIVERT(3)
# addresses sent to foo@host.REDIRECT will give a 551 error code
R$* < @ $+ .REDIRECT. > $: $1 < @ $2 . REDIRECT . > < ${opMode} >
R$* < @ $+ .REDIRECT. > <i> $: $1 < @ $2 . REDIRECT. >
-R$* < @ $+ .REDIRECT. > < $- > $# error $@ 5.1.1 $: "551 User not local; please try " <$1@$2>
+R$* < @ $+ .REDIRECT. > < $- > $# error $@ 5.1.1 $: "551 User has moved; please try " <$1@$2>
POPDIVERT
PUSHDIVERT(6)
diff --git a/usr.sbin/sendmail/cf/feature/virtusertable.m4 b/usr.sbin/sendmail/cf/feature/virtusertable.m4
new file mode 100644
index 000000000000..91db88c25627
--- /dev/null
+++ b/usr.sbin/sendmail/cf/feature/virtusertable.m4
@@ -0,0 +1,40 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)virtusertable.m4 8.1 (Berkeley) 2/11/96')
+divert(-1)
+
+define(`VIRTUSER_TABLE', ifelse(_ARG_, `', `hash -o /etc/virtusertable', `_ARG_'))dnl
diff --git a/usr.sbin/sendmail/cf/m4/cfhead.m4 b/usr.sbin/sendmail/cf/m4/cfhead.m4
index 46605e7e34c0..f15257245d91 100644
--- a/usr.sbin/sendmail/cf/m4/cfhead.m4
+++ b/usr.sbin/sendmail/cf/m4/cfhead.m4
@@ -86,8 +86,13 @@ define(`LOCAL_RULE_2',
S2
')
+define(`LOCAL_RULESETS',
+`divert(9)
+
+')
define(`LOCAL_RULE_3', `divert(2)')
define(`LOCAL_CONFIG', `divert(6)')
+define(`MAILER_DEFINITIONS', `divert(7)')
define(`LOCAL_NET_CONFIG', `define(`_LOCAL_RULES_', 1)divert(1)')
define(`UUCPSMTP', `R DOL(*) < @ $1 .UUCP > DOL(*) DOL(1) < @ $2 > DOL(2)')
define(`CONCAT', `$1$2$3$4$5$6$7')
@@ -109,11 +114,16 @@ define(`MASQUERADE_DOMAIN', `PUSHDIVERT(5)CM$1
POPDIVERT`'dnl')
define(`MASQUERADE_DOMAIN_FILE', `PUSHDIVERT(5)FM$1
POPDIVERT`'dnl')
+define(`GENERICS_DOMAIN', `PUSHDIVERT(5)CG$1
+POPDIVERT`'dnl')
+define(`GENERICS_DOMAIN_FILE', `PUSHDIVERT(5)FG$1
+POPDIVERT`'dnl')
define(`_OPTINS', `ifdef(`$1', `$2$1$3')')
m4wrap(`include(_CF_DIR_`m4/proto.m4')')
# set up default values for options
+define(`ALIAS_FILE', `/etc/aliases')
define(`confMAILER_NAME', ``MAILER-DAEMON'')
define(`confFROM_LINE', `From $g $d')
define(`confOPERATORS', `.:%@!^/[]+')
@@ -144,4 +154,4 @@ define(`confMIME_FORMAT_ERRORS', `True')
define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')
divert(0)dnl
-VERSIONID(`@(#)cfhead.m4 8.3 (Berkeley) 9/15/95')
+VERSIONID(`@(#)cfhead.m4 8.6 (Berkeley) 6/19/96')
diff --git a/usr.sbin/sendmail/cf/m4/nullrelay.m4 b/usr.sbin/sendmail/cf/m4/nullrelay.m4
index 799f3ab79198..86c0356e2c5f 100644
--- a/usr.sbin/sendmail/cf/m4/nullrelay.m4
+++ b/usr.sbin/sendmail/cf/m4/nullrelay.m4
@@ -34,7 +34,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)nullrelay.m4 8.10 (Berkeley) 9/29/95')
+VERSIONID(`@(#)nullrelay.m4 8.12 (Berkeley) 10/12/96')
#
# This configuration applies only to relay-only hosts. They send
@@ -74,25 +74,30 @@ R$* ; $: $1 strip trailing semi
R$@ $@ :; <@>
# basic textual canonicalization -- note RFC733 heuristic here
-R$*<$*>$*<$*>$* $2$3<$4>$5 strip multiple <> <>
-R$*<$*<$+>$*>$* <$3>$5 2-level <> nesting
-R$*<>$* $@ <@> MAIL FROM:<> case
-R$*<$+>$* $2 basic RFC821/822 parsing
+R$* $: < $1 > housekeeping <>
+R$+ < $* > < $2 > strip excess on left
+R< $* > $+ < $1 > strip excess on right
+R<> $@ < @ > MAIL FROM:<> case
+R< $+ > $: $1 remove housekeeping <>
ifdef(`_NO_CANONIFY_', `dnl',
`# eliminate local host if present
R@ $=w $=: $+ $@ @ $M $2 $3 @thishost ...
R@ $+ $@ @ $1 @somewhere ...
+R$=E @ $=w $@ $1 @ $2 leave exposed
R$+ @ $=w $@ $1 @ $M ...@thishost
R$+ @ $+ $@ $1 @ $2 ...@somewhere
+R$=w ! $=E $@ $2 @ $1 leave exposed
R$=w ! $+ $@ $2 @ $M thishost!...
R$+ ! $+ $@ $1 ! $2 @ $M somewhere ! ...
+R$=E % $=w $@ $1 @ $2 leave exposed
R$+ % $=w $@ $1 @ $M ...%thishost
R$+ % $+ $@ $1 @ $2 ...%somewhere
+R$=E $@ $1 @ $j leave exposed
R$+ $@ $1 @ $M unadorned user')
diff --git a/usr.sbin/sendmail/cf/m4/proto.m4 b/usr.sbin/sendmail/cf/m4/proto.m4
index 89b3215e5ce3..1dc457ce9aaf 100644
--- a/usr.sbin/sendmail/cf/m4/proto.m4
+++ b/usr.sbin/sendmail/cf/m4/proto.m4
@@ -34,12 +34,12 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)proto.m4 8.100 (Berkeley) 12/3/95')
+VERSIONID(`@(#)proto.m4 8.134 (Berkeley) 10/13/96')
MAILER(local)dnl
-# level 6 config file format
-V6/Berkeley
+# level 7 config file format
+V7/Berkeley
divert(-1)
# do some sanity checking
@@ -47,7 +47,7 @@ ifdef(`__OSTYPE__',,
`errprint(`*** ERROR: No system type defined (use OSTYPE macro)')')
# pick our default mailers
-ifdef(`confSMTP_MAILER',, `define(`confSMTP_MAILER', `smtp')')
+ifdef(`confSMTP_MAILER',, `define(`confSMTP_MAILER', `esmtp')')
ifdef(`confLOCAL_MAILER',, `define(`confLOCAL_MAILER', `local')')
ifdef(`confRELAY_MAILER',,
`define(`confRELAY_MAILER',
@@ -94,7 +94,7 @@ Fw`'confCW_FILE',
`dnl')
# my official domain name
-# ... define this only if sendmail cannot automatically determine your domain
+# ... `define' this only if sendmail cannot automatically determine your domain
ifdef(`confDOMAIN_NAME', `Dj`'confDOMAIN_NAME', `#Dj$w.Foo.COM')
ifdef(`_NULL_CLIENT_ONLY_', `divert(-1)')dnl
@@ -142,6 +142,9 @@ CO @ % ifdef(`_NO_UUCP_', `', `!')
# a class with just dot (for identifying canonical names)
C..
+# a class with just a left bracket (for identifying domain literals)
+C[[
+
# Mailer table (overriding domains)
ifdef(`MAILER_TABLE',
`Kmailertable MAILER_TABLE',
@@ -152,6 +155,16 @@ ifdef(`DOMAIN_TABLE',
`Kdomaintable DOMAIN_TABLE',
`#Kdomaintable dbm /etc/domaintable')
+# Generics table (mapping outgoing addresses)
+ifdef(`GENERICS_TABLE',
+ `Kgenerics GENERICS_TABLE',
+ `#Kgenerics dbm /etc/genericstable')
+
+# Virtual user table (maps incoming users)
+ifdef(`VIRTUSER_TABLE',
+ `Kvirtuser VIRTUSER_TABLE',
+ `#Kvirtuser dbm /etc/virtusertable')
+
# who I send unqualified names to (null means deliver locally)
DR`'ifdef(`LOCAL_RELAY', LOCAL_RELAY)
@@ -193,7 +206,7 @@ ifdef(`_NULL_CLIENT_ONLY_', `dnl', `
_OPTION(AliasWait, `confALIAS_WAIT', 5m)
# location of alias file
-O AliasFile=ifdef(`ALIAS_FILE', `ALIAS_FILE', /etc/aliases)
+_OPTION(AliasFile, `ALIAS_FILE', /etc/aliases)
')
# minimum number of free blocks on filesystem
_OPTION(MinFreeBlocks, `confMIN_FREE_BLOCKS', 100)
@@ -255,6 +268,12 @@ _OPTION(ConnectionCacheSize, `confMCI_CACHE_SIZE', 2)
# open connection cache timeout
_OPTION(ConnectionCacheTimeout, `confMCI_CACHE_TIMEOUT', 5m)
+# persistent host status directory
+_OPTION(HostStatusDirectory, `confHOST_STATUS_DIRECTORY', .hoststat)
+
+# single thread deliveries (requires HostStatusDirectory)?
+_OPTION(SingleThreadDelivery, `confSINGLE_THREAD_DELIVERY')
+
# use Errors-To: header?
_OPTION(UseErrorsTo, `confUSE_ERRORS_TO')
@@ -287,6 +306,8 @@ O QueueDirectory=ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue)
# timeouts (many of these)
_OPTION(Timeout.initial, `confTO_INITIAL', 5m)
+_OPTION(Timeout.connect, `confTO_CONNECT', 5m)
+_OPTION(Timeout.iconnect, `confTO_ICONNECT', 5m)
_OPTION(Timeout.helo, `confTO_HELO', 5m)
_OPTION(Timeout.mail, `confTO_MAIL', 10m)
_OPTION(Timeout.rcpt, `confTO_RCPT', 1h)
@@ -307,6 +328,7 @@ _OPTION(Timeout.queuewarn, `confTO_QUEUEWARN', 4h)
_OPTION(Timeout.queuewarn.normal, `confTO_QUEUEWARN_NORMAL', 4h)
_OPTION(Timeout.queuewarn.urgent, `confTO_QUEUEWARN_URGENT', 1h)
_OPTION(Timeout.queuewarn.non-urgent, `confTO_QUEUEWARN_NONURGENT', 12h)
+_OPTION(Timeout.hoststatus, `confTO_HOSTSTATUS', 30m)
# should we not prune routes in route-addr syntax addresses?
_OPTION(DontPruneRoutes, `confDONT_PRUNE_ROUTES')
@@ -343,6 +365,12 @@ _OPTION(QueueLA, `confQUEUE_LA', 8)
# load average at which we refuse connections
_OPTION(RefuseLA, `confREFUSE_LA', 12)
+# maximum number of children we allow at one time
+_OPTION(MaxDaemonChildren, `confMAX_DAEMON_CHILDREN', 12)
+
+# maximum number of new connections per second
+_OPTION(ConnectionRateThrottle, `confCONNECTION_RATE_THROTTLE', 3)
+
# work recipient factor
_OPTION(RecipientFactor, `confWORK_RECIPIENT_FACTOR', 30000)
@@ -400,6 +428,15 @@ _OPTION(OperatorChars, `confOPERATORS')
# shall I avoid calling initgroups(3) because of high NIS costs?
_OPTION(DontInitGroups, `confDONT_INIT_GROUPS')
+# are group-writable :include: and .forward files (un)trustworthy?
+_OPTION(UnsafeGroupWrites, `confUNSAFE_GROUP_WRITES')
+
+# where do errors that occur when sending errors get sent?
+_OPTION(DoubleBounceAddress, `confDOUBLE_BOUNCE_ADDRESS')
+
+# what user id do we assume for the majority of the processing?
+_OPTION(RunAsUser, `confRUN_AS_USER', sendmail)
+
###########################
# Message precedences #
###########################
@@ -418,7 +455,7 @@ Pjunk=-100
ifdef(`_USE_CT_FILE_', `', `#')Ft`'ifdef(`confCT_FILE', confCT_FILE, `/etc/sendmail.ct')
Troot
Tdaemon
-Tuucp
+ifdef(`_NO_UUCP_', `dnl', `Tuucp')
ifdef(`confTRUSTED_USERS', `T`'confTRUSTED_USERS', `dnl')
#########################
@@ -426,14 +463,13 @@ ifdef(`confTRUSTED_USERS', `T`'confTRUSTED_USERS', `dnl')
#########################
ifdef(`confFROM_HEADER',, `define(`confFROM_HEADER', `$?x$x <$g>$|$g$.')')dnl
-H?P?Return-Path: $g
+H?P?Return-Path: <$g>
HReceived: confRECEIVED_HEADER
H?D?Resent-Date: $a
H?D?Date: $a
H?F?Resent-From: confFROM_HEADER
H?F?From: confFROM_HEADER
H?x?Full-Name: $x
-HSubject:
# HPosted-Date: $a
# H?l?Received-Date: $b
H?M?Resent-Message-Id: <$t.$i@$j>
@@ -450,11 +486,9 @@ ifdef(`_NULL_CLIENT_ONLY_',
######################################################################
######################################################################
-undivert(9)dnl
-
-###########################################
-### Rulset 3 -- Name Canonicalization ###
-###########################################
+############################################
+### Ruleset 3 -- Name Canonicalization ###
+############################################
S3
# handle null input (translate to <@> special case)
@@ -463,8 +497,11 @@ R$@ $@ <@>
# strip group: syntax (not inside angle brackets!) and trailing semicolon
R$* $: $1 <@> mark addresses
R$* < $* > $* <@> $: $1 < $2 > $3 unmark <addr>
+R@ $* <@> $: @ $1 unmark @host:...
R$* :: $* <@> $: $1 :: $2 unmark node::addr
R:`include': $* <@> $: :`include': $1 unmark :`include':...
+R$* [ $* : $* ] <@> $: $1 [ $2 : $3 ] unmark IPv6 addrs
+R$* : $* [ $* ] $: $1 : $2 [ $3 ] <@> remark if leading colon
R$* : $* <@> $: $2 strip colon if marked
R$* <@> $: $1 unmark
R$* ; $: $1 strip trailing semi
@@ -559,18 +596,17 @@ ifdef(`_CLASS_Y_',
R$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3
R$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3')
')
-ifdef(`_NO_CANONIFY_', `dnl',
-`# pass to name server to make hostname canonical
-R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4')
+# pass to name server to make hostname canonical
+ifdef(`_NO_CANONIFY_', `#')dnl
+R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4
# local host aliases and pseudo-domains are always canonical
R$* < @ $=w > $* $: $1 < @ $2 . > $3
+R$* < @ $j > $* $: $1 < @ $j . > $2
+R$* < @ $* $=M > $* $: $1 < @ $2 $3 . > $4
R$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4
R$* < @ $* . . > $* $1 < @ $2 . > $3
-# if this is the local hostname, make sure we treat is as canonical
-R$* < @ $j > $* $: $1 < @ $j . > $2
-
##################################################
### Ruleset 4 -- Final Output Post-rewriting ###
@@ -622,7 +658,10 @@ S0
R<@> $#_LOCAL_ $: <@> special case error msgs
R$* : $* ; <@> $#error $@ 5.1.3 $: "list:; syntax illegal for recipient addresses"
R<@ $+> $#error $@ 5.1.1 $: "user address required"
-R$* <$* : $* > $* $#error $@ 5.1.1 $: "colon illegal in host name part"
+R$* $: <> $1
+R<> $* < @ [ $+ ] > $* $1 < @ [ $2 ] > $3
+R<> $* <$* : $* > $* $#error $@ 5.1.1 $: "colon illegal in host name part"
+R<> $* $1
R$* < @ . > $* $#error $@ 5.1.2 $: "invalid host name"
ifdef(`_MAILER_smtp_',
@@ -635,15 +674,24 @@ R$* < @ [ $+ ] > $* $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3 still numeric: send',
R$* < @ > $* $@ $>97 $1 user@ => user
R< @ $=w . > : $* $@ $>97 $2 @here:... -> ...
R$- < @ $=w . > $: $(dequote $1 $) < @ $2 . > dequote "foo"@here
+R< @ $+ > $#error $@ 5.1.1 $: "user address required"
R$* $=O $* < @ $=w . > $@ $>97 $1 $2 $3 ...@here -> ...
# handle local hacks
R$* $: $>98 $1
+# handle virtual users
+define(`X', ifdef(`VIRTUSER_TABLE', `', `#'))dnl
+X`'R$+ < @ $=w . > $: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
+X`'R< @ > $+ < @ $+ . > $: < $(virtuser @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
+X`'R< @ > $+ $: $1
+X`'R< error : $- $+ > $* $#error $@ $1 $: $2
+X`'R< $+ > $+ < @ $+ > $: $>97 $1
+undefine(`X')dnl
+
# short circuit local delivery so forwarded email works
-ifdef(`_MAILER_usenet_',
-`R$+ . USENET < @ $=w . > $#usenet $: $1 handle usenet specially',
- `dnl')
+ifdef(`_MAILER_usenet_', `', `#')dnl
+R$+ . USENET < @ $=w . > $#usenet $: $1 handle usenet specially
ifdef(`_STICKY_LOCAL_DOMAIN_',
`R$+ < @ $=w . > $: < $H > $1 < @ $2 . > first try hub
R< $+ > $+ < $+ > $>95 < $1 > $2 < $3 > yep ....
@@ -657,8 +705,7 @@ define(`X', ifdef(`MAILER_TABLE', `', `#'))dnl
X`'R$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name
X`'R< $+ . > $* $: < $1 > $2 strip trailing dot
X`'R< $+ > $* $: < $(mailertable $1 $) > $2 lookup
-X`'R< error : $- $+ > $* $#error $@ $1 $: $2 check -- error?
-X`'R< $- : $+ > $* $# $1 $@ $2 $: $3 check -- resolved?
+X`'R< $~[ : $+ > $* $>95 < $1 : $2 > $3 check -- resolved?
X`'R< $+ > $* $: $>90 <$1> $2 try domain
undefine(`X')dnl
undivert(4)dnl
@@ -759,40 +806,63 @@ R< $+ > $+ $@ $>95 < $1 > $2 < @ $1 >
###################################################################
define(`X', ifdef(`MAILER_TABLE', `', `#'))dnl
-X`'S90
+S90
X`'R$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4
-X`'R$* <$- : $+ > $* $# $2 $@ $3 $: $4 check -- resolved?
-X`'R$* < . $+ > $* $@ $>90 $1 . <$2> $3 no -- strip & try again
+X`'R$* <$~[ : $+ > $* $>95 < $2 : $3 > $4 check -- resolved?
+X`'R$* < . $+ > $* $@ $>90 $1 . <$2> $3 no -- strip & try again
X`'R$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "."
-X`'R<$- : $+ > $* $# $1 $@ $2 $: $3 "." found?
-X`'R< $* > $* $@ $2 no mailertable match
+X`'R< $~[ : $+ > $* $>95 < $1 : $2 > $3 "." found?
+X`'R< $* > $* $@ $2 no mailertable match
undefine(`X')dnl
###################################################################
-### Ruleset 95 -- canonify mailer:host syntax to triple ###
+### Ruleset 95 -- canonify mailer:[user@]host syntax to triple ###
###################################################################
S95
-R< > $* $@ $1 strip off null relay
-R< $- : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer
-R< $=w > $* $@ $2 delete local host
-R< $+ > $* $#_RELAY_ $@ $1 $: $2 use unqualified mailer
+R< > $* $@ $1 strip off null relay
+R< error : $- $+ > $* $#error $@ $1 $: $2 special case errors
+R< local : > $* < @ $* > $#local $@ $1@$2 $: $1 no host: use old user
+R< local : $+ > $* <@ $* . > $* $#local $@ $2@$3 $: $1 special case local
+R< $- : $+ @ $+ > $*<$*>$* $# $1 $@ $3 $: $2<@$3> use literal user
+R< $- : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer
+R< $=w > $* $@ $2 delete local host
+R< $+ > $* $#_RELAY_ $@ $1 $: $2 use unqualified mailer
###################################################################
### Ruleset 93 -- convert header names to masqueraded form ###
###################################################################
S93
+
+# handle generics database
+define(`X', ifdef(`GENERICS_TABLE', `', `#'))dnl
+X`'R$+ < @ $=G . > $: < $1@$2 > $1 < @ $2 . > @ mark
+X`'R$+ < @ *LOCAL* > $: < $1@$j > $1 < @ *LOCAL* > @ mark
+X`'R< $+ > $+ < $* > @ $: < $(generics $1 $: $) > $2 < $3 >
+X`'R< > $+ < @ $+ > $: < $(generics $1 $: $) > $1 < @ $2 >
+X`'R< $* @ $* > $* < $* > $@ $>3 $1 @ $2 found qualified
+X`'R< $+ > $* < $* > $: $>3 $1 @ *LOCAL* found unqualified
+X`'R< > $* $: $1 not found
+undefine(`X')dnl
+
+# special case the users that should be exposed
R$=E < @ *LOCAL* > $@ $1 < @ $j . > leave exposed
-R$=E < @ $=M . > $@ $1 < @ $2 . >
+ifdef(`_MASQUERADE_ENTIRE_DOMAIN_',
+`R$=E < @ $* $=M . > $@ $1 < @ $2 $3 . >',
+`R$=E < @ $=M . > $@ $1 < @ $2 . >')
ifdef(`_LIMITED_MASQUERADE_', `#')dnl
R$=E < @ $=w . > $@ $1 < @ $2 . >
-R$* < @ $=M . > $* $: $1 < @ $2 . @ $M > $3 convert masqueraded doms
+
+# handle domain-specific masquerading
+ifdef(`_MASQUERADE_ENTIRE_DOMAIN_',
+`R$* < @ $* $=M . > $* $: $1 < @ $2 $3 . @ $M > $4 convert masqueraded doms',
+`R$* < @ $=M . > $* $: $1 < @ $2 . @ $M > $3 convert masqueraded doms')
ifdef(`_LIMITED_MASQUERADE_', `#')dnl
R$* < @ $=w . > $* $: $1 < @ $2 . @ $M > $3
R$* < @ *LOCAL* > $* $: $1 < @ $j . @ $M > $2
-R$* < @ $+ @ > $* $@ $1 < @ $2 > $3 $M is null
-R$* < @ $+ @ $+ > $* $@ $1 < @ $3 . > $4 $M is not null
+R$* < @ $+ @ > $* $: $1 < @ $2 > $3 $M is null
+R$* < @ $+ @ $+ > $* $: $1 < @ $3 . > $4 $M is not null
###################################################################
### Ruleset 94 -- convert envelope names to masqueraded form ###
@@ -810,6 +880,7 @@ R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
S98
undivert(3)dnl
+undivert(9)dnl
#
######################################################################
######################################################################
diff --git a/usr.sbin/sendmail/cf/m4/version.m4 b/usr.sbin/sendmail/cf/m4/version.m4
index fb8e96e144f3..db8f365f5022 100644
--- a/usr.sbin/sendmail/cf/m4/version.m4
+++ b/usr.sbin/sendmail/cf/m4/version.m4
@@ -32,8 +32,8 @@ divert(-1)
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-VERSIONID(`@(#)version.m4 8.7.3.1 (Berkeley) 12/3/95')
+VERSIONID(`@(#)version.m4 8.8.2.1 (Berkeley) 10/18/96')
#
divert(0)
# Configuration version number
-DZ8.7.3`'ifdef(`confCF_VERSION', `/confCF_VERSION')
+DZ8.8.2`'ifdef(`confCF_VERSION', `/confCF_VERSION')
diff --git a/usr.sbin/sendmail/cf/mailer/cyrus.m4 b/usr.sbin/sendmail/cf/mailer/cyrus.m4
index f5311371b536..47a4a5afd6a8 100644
--- a/usr.sbin/sendmail/cf/mailer/cyrus.m4
+++ b/usr.sbin/sendmail/cf/mailer/cyrus.m4
@@ -26,6 +26,7 @@ PUSHDIVERT(-1)
ifdef(`CYRUS_MAILER_FLAGS',, `define(`CYRUS_MAILER_FLAGS', `A5@')')
ifdef(`CYRUS_MAILER_PATH',, `define(`CYRUS_MAILER_PATH', /usr/cyrus/bin/deliver)')
ifdef(`CYRUS_MAILER_ARGS',, `define(`CYRUS_MAILER_ARGS', `deliver -e -m $h -- $u')')
+ifdef(`CYRUS_MAILER_USER',, `define(`CYRUS_MAILER_USER', `cyrus:mail')')
ifdef(`CYRUS_BB_MAILER_FLAGS',, `define(`CYRUS_BB_MAILER_FLAGS', `')')
ifdef(`CYRUS_BB_MAILER_ARGS',, `define(`CYRUS_BB_MAILER_ARGS', `deliver -e -m $u')')
@@ -35,10 +36,12 @@ POPDIVERT
### Cyrus Mailer specification ###
##################################################
-VERSIONID(`@(#)cyrus.m4 8.2 (Carnegie Mellon) 9/12/95')
+VERSIONID(`@(#)cyrus.m4 8.4 (Carnegie Mellon) 9/2/96')
-Mcyrus, P=CYRUS_MAILER_PATH, F=CONCAT(`lsDFMnP', CYRUS_MAILER_FLAGS), S=10, R=20/40, T=X-Unix,
- ifdef(`CYRUS_MAILER_MAX', `M=CYRUS_MAILER_MAX, ')A=CYRUS_MAILER_ARGS
+Mcyrus, P=CYRUS_MAILER_PATH, F=CONCAT(`lsDFMnPq', CYRUS_MAILER_FLAGS), S=10, R=20/40, T=X-Unix,
+ ifdef(`CYRUS_MAILER_MAX', `M=CYRUS_MAILER_MAX, ')U=CYRUS_MAILER_USER,
+ A=CYRUS_MAILER_ARGS
-Mcyrusbb, P=CYRUS_MAILER_PATH, F=CONCAT(`lsDFMnP', CYRUS_MAILER_FLAGS), S=10, R=20/40, T=X-Unix,
- ifdef(`CYRUS_MAILER_MAX', `M=CYRUS_MAILER_MAX, ')A=CYRUS_BB_MAILER_ARGS
+Mcyrusbb, P=CYRUS_MAILER_PATH, F=CONCAT(`lsDFMnP', CYRUS_BB_MAILER_FLAGS), S=10, R=20/40, T=X-Unix,
+ ifdef(`CYRUS_MAILER_MAX', `M=CYRUS_MAILER_MAX, ')U=CYRUS_MAILER_USER,
+ A=CYRUS_BB_MAILER_ARGS
diff --git a/usr.sbin/sendmail/cf/mailer/fax.m4 b/usr.sbin/sendmail/cf/mailer/fax.m4
index 777fe01cf36a..726c83a2dce0 100644
--- a/usr.sbin/sendmail/cf/mailer/fax.m4
+++ b/usr.sbin/sendmail/cf/mailer/fax.m4
@@ -35,6 +35,8 @@ PUSHDIVERT(-1)
# SUCH DAMAGE.
#
+ifdef(`FAX_MAILER_ARGS',,
+ `define(`FAX_MAILER_ARGS', mailfax $u $h $f)')
ifdef(`FAX_MAILER_PATH',,
`define(`FAX_MAILER_PATH', /usr/local/lib/fax/mailfax)')
ifdef(`FAX_MAILER_MAX',,
@@ -44,10 +46,10 @@ POPDIVERT
### FAX Mailer specification ###
####################################
-VERSIONID(`@(#)fax.m4 8.4 (Berkeley) 10/10/95')
+VERSIONID(`@(#)fax.m4 8.5 (Berkeley) 5/10/96')
Mfax, P=FAX_MAILER_PATH, F=DFMhu, S=14, R=24, M=FAX_MAILER_MAX, T=X-Phone/X-FAX/X-Unix,
- A=mailfax $u $h $f
+ A=FAX_MAILER_ARGS
LOCAL_CONFIG
CPFAX
diff --git a/usr.sbin/sendmail/cf/mailer/local.m4 b/usr.sbin/sendmail/cf/mailer/local.m4
index 124cbba75282..998778a0d0c4 100644
--- a/usr.sbin/sendmail/cf/mailer/local.m4
+++ b/usr.sbin/sendmail/cf/mailer/local.m4
@@ -32,10 +32,10 @@ PUSHDIVERT(-1)
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `rmn')')
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `rmn9')')
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/mail)')
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -d $u')')
-ifdef(`LOCAL_SHELL_FLAGS',, `define(`LOCAL_SHELL_FLAGS', `eu')')
+ifdef(`LOCAL_SHELL_FLAGS',, `define(`LOCAL_SHELL_FLAGS', `eu9')')
ifdef(`LOCAL_SHELL_PATH',, `define(`LOCAL_SHELL_PATH', /bin/sh)')
ifdef(`LOCAL_SHELL_ARGS',, `define(`LOCAL_SHELL_ARGS', `sh -c $u')')
ifdef(`LOCAL_SHELL_DIR',, `define(`LOCAL_SHELL_DIR', `$z:/')')
@@ -45,12 +45,12 @@ POPDIVERT
### Local and Program Mailer specification ###
##################################################
-VERSIONID(`@(#)local.m4 8.21 (Berkeley) 11/6/95')
+VERSIONID(`@(#)local.m4 8.23 (Berkeley) 5/31/96')
-Mlocal, P=LOCAL_MAILER_PATH, F=CONCAT(`lsDFMAw5:/|@', LOCAL_MAILER_FLAGS), S=10/30, R=20/40,
+Mlocal, P=LOCAL_MAILER_PATH, F=CONCAT(`lsDFMAw5:/|@q', LOCAL_MAILER_FLAGS), S=10/30, R=20/40,
_OPTINS(`LOCAL_MAILER_MAX', `M=', `, ')_OPTINS(`LOCAL_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/X-Unix,
A=LOCAL_MAILER_ARGS
-Mprog, P=LOCAL_SHELL_PATH, F=CONCAT(`lsDFMo', LOCAL_SHELL_FLAGS), S=10/30, R=20/40, D=LOCAL_SHELL_DIR,
+Mprog, P=LOCAL_SHELL_PATH, F=CONCAT(`lsDFMoq', LOCAL_SHELL_FLAGS), S=10/30, R=20/40, D=LOCAL_SHELL_DIR,
_OPTINS(`LOCAL_MAILER_MAX', `M=', `, ')T=X-Unix,
A=LOCAL_SHELL_ARGS
diff --git a/usr.sbin/sendmail/cf/mailer/pop.m4 b/usr.sbin/sendmail/cf/mailer/pop.m4
index 210a3c83a6fc..7e8ec0d22932 100644
--- a/usr.sbin/sendmail/cf/mailer/pop.m4
+++ b/usr.sbin/sendmail/cf/mailer/pop.m4
@@ -43,9 +43,9 @@ POPDIVERT
### POP Mailer specification ###
####################################
-VERSIONID(`@(#)pop.m4 8.5 (Berkeley) 4/23/95')
+VERSIONID(`@(#)pop.m4 8.6 (Berkeley) 2/12/96')
-Mpop, P=POP_MAILER_PATH, F=CONCAT(`lsDFM', POP_MAILER_FLAGS), S=10, R=20/40, T=DNS/RFC822/X-Unix,
+Mpop, P=POP_MAILER_PATH, F=CONCAT(`lsDFMq', POP_MAILER_FLAGS), S=10, R=20/40, T=DNS/RFC822/X-Unix,
A=POP_MAILER_ARGS
LOCAL_CONFIG
diff --git a/usr.sbin/sendmail/cf/mailer/procmail.m4 b/usr.sbin/sendmail/cf/mailer/procmail.m4
index d1293b9ceff6..a170e58a4714 100644
--- a/usr.sbin/sendmail/cf/mailer/procmail.m4
+++ b/usr.sbin/sendmail/cf/mailer/procmail.m4
@@ -33,8 +33,10 @@ PUSHDIVERT(-1)
# SUCH DAMAGE.
#
-ifdef(`PROCMAIL_PATH',,
- `define(`PROCMAIL_PATH', /usr/local/bin/procmail)')
+ifdef(`PROCMAIL_MAILER_PATH',,
+ `ifdef(`PROCMAIL_PATH',
+ `define(`PROCMAIL_MAILER_PATH', PROCMAIL_PATH)',
+ `define(`PROCMAIL_MAILER_PATH', /usr/local/bin/procmail)')')
ifdef(`PROCMAIL_MAILER_FLAGS',,
`define(`PROCMAIL_MAILER_FLAGS', `Shu')')
ifdef(`PROCMAIL_MAILER_ARGS',,
@@ -46,7 +48,7 @@ POPDIVERT
### PROCMAIL Mailer specification ###
##################*****##################
-VERSIONID(`@(#)procmail.m4 8.4 (Berkeley) 4/23/95')
+VERSIONID(`@(#)procmail.m4 8.5 (Berkeley) 12/28/95')
-Mprocmail, P=PROCMAIL_PATH, F=CONCAT(`DFMm', PROCMAIL_MAILER_FLAGS), S=11/31, R=21/31, T=DNS/RFC822/X-Unix,
+Mprocmail, P=PROCMAIL_MAILER_PATH, F=CONCAT(`DFMm', PROCMAIL_MAILER_FLAGS), S=11/31, R=21/31, T=DNS/RFC822/X-Unix,
ifdef(`PROCMAIL_MAILER_MAX', `M=PROCMAIL_MAILER_MAX, ')A=PROCMAIL_MAILER_ARGS
diff --git a/usr.sbin/sendmail/cf/ostype/aix2.m4 b/usr.sbin/sendmail/cf/ostype/aix2.m4
new file mode 100644
index 000000000000..423393b5f7bb
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/aix2.m4
@@ -0,0 +1,41 @@
+divert(-1)
+#
+# Copyright (c) 1995 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)aix2.m4 8.2 (Berkeley) 9/19/96')
+define(`LOCAL_MAILER_PATH', /bin/bellmail)dnl
+define(`LOCAL_MAILER_ARGS', mail $u)dnl
+define(`LOCAL_MAILER_FLAGS', `mn9')dnl
+define(`confTIME_ZONE', `USE_TZ')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/aix3.m4 b/usr.sbin/sendmail/cf/ostype/aix3.m4
index 19763422fe3c..153e1f6568c7 100644
--- a/usr.sbin/sendmail/cf/ostype/aix3.m4
+++ b/usr.sbin/sendmail/cf/ostype/aix3.m4
@@ -34,8 +34,8 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)aix3.m4 8.5 (Berkeley) 11/13/95')
+VERSIONID(`@(#)aix3.m4 8.6 (Berkeley) 9/19/96')
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/bellmail)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', mail $u)')dnl
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `mn')')dnl
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `mn9')')dnl
define(`confTIME_ZONE', `USE_TZ')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/altos.m4 b/usr.sbin/sendmail/cf/ostype/altos.m4
new file mode 100644
index 000000000000..10c4da91d925
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/altos.m4
@@ -0,0 +1,49 @@
+divert(-1)
+#
+# Copyright (c) 1996 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# Contributed by Tim Rice <tim@trr.metro.NET>.
+#
+
+divert(0)
+VERSIONID(`@(#)altos.m4 8.3 (Berkeley) 9/25/96')
+
+define(`ALIAS_FILE', /usr/lib/mail/aliases)dnl
+ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
+ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
+ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/bin/lmail)')dnl
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', mPuhCE9)')dnl
+ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `lmail $u')')dnl
+ifdef(`LOCAL_SHELL_FLAGS',, `define(`LOCAL_SHELL_FLAGS', Peu)')dnl
+ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/amdahl-uts.m4 b/usr.sbin/sendmail/cf/ostype/amdahl-uts.m4
index 34b352104145..3583746a9bc3 100644
--- a/usr.sbin/sendmail/cf/ostype/amdahl-uts.m4
+++ b/usr.sbin/sendmail/cf/ostype/amdahl-uts.m4
@@ -34,11 +34,11 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)amdahl-uts.m4 8.2 (Berkeley) 11/13/95')
+VERSIONID(`@(#)amdahl-uts.m4 8.4 (Berkeley) 9/25/96')
divert(-1)
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /etc/mail/aliases)')
+define(`ALIAS_FILE', /etc/mail/aliases)
ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/mail/sendmail.hf)')
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `fSn')')
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `fSn9')')
define(`confCW_FILE', /etc/mail/sendmail.cw)
diff --git a/usr.sbin/sendmail/cf/ostype/aux.m4 b/usr.sbin/sendmail/cf/ostype/aux.m4
index 3c60eb13a62a..0f515d150a86 100644
--- a/usr.sbin/sendmail/cf/ostype/aux.m4
+++ b/usr.sbin/sendmail/cf/ostype/aux.m4
@@ -34,10 +34,10 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)aux.m4 8.2 (Berkeley) 11/13/95')
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /usr/lib/aliases)')dnl
+VERSIONID(`@(#)aux.m4 8.4 (Berkeley) 9/25/96')
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', mn)')dnl
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', mn9)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -d -r $f $u')')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/dgux.m4 b/usr.sbin/sendmail/cf/ostype/dgux.m4
index e78ce3bca5aa..ec8f4b4ea277 100644
--- a/usr.sbin/sendmail/cf/ostype/dgux.m4
+++ b/usr.sbin/sendmail/cf/ostype/dgux.m4
@@ -34,6 +34,8 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)dgux.m4 8.2 (Berkeley) 11/13/95')
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', m)')dnl
+VERSIONID(`@(#)dgux.m4 8.4 (Berkeley) 9/19/96')
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', m9)')dnl
define(`confTIME_ZONE', `USE_TZ')dnl
+LOCAL_CONFIG
+E_FORCE_MAIL_LOCAL_=yes
diff --git a/usr.sbin/sendmail/cf/ostype/domainos.m4 b/usr.sbin/sendmail/cf/ostype/domainos.m4
index 65329f3e1728..4af9906459ed 100644
--- a/usr.sbin/sendmail/cf/ostype/domainos.m4
+++ b/usr.sbin/sendmail/cf/ostype/domainos.m4
@@ -34,9 +34,9 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)domainos.m4 8.2 (Berkeley) 11/13/95')
+VERSIONID(`@(#)domainos.m4 8.3 (Berkeley) 9/25/96')
divert(-1)
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /usr/lib/aliases)')
+define(`ALIAS_FILE', /usr/lib/aliases)
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')
diff --git a/usr.sbin/sendmail/cf/ostype/dynix3.2.m4 b/usr.sbin/sendmail/cf/ostype/dynix3.2.m4
index 149f6ad3a6fc..ffbe943e1912 100644
--- a/usr.sbin/sendmail/cf/ostype/dynix3.2.m4
+++ b/usr.sbin/sendmail/cf/ostype/dynix3.2.m4
@@ -34,6 +34,6 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)dynix3.2.m4 8.2 (Berkeley) 11/13/95')
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /usr/lib/aliases)')dnl
+VERSIONID(`@(#)dynix3.2.m4 8.3 (Berkeley) 9/25/96')
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/hpux10.m4 b/usr.sbin/sendmail/cf/ostype/hpux10.m4
index 7c8ba4090dce..c1d7e6946d3f 100644
--- a/usr.sbin/sendmail/cf/ostype/hpux10.m4
+++ b/usr.sbin/sendmail/cf/ostype/hpux10.m4
@@ -34,14 +34,14 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)hpux10.m4 8.6 (Berkeley) 11/13/95')
+VERSIONID(`@(#)hpux10.m4 8.8 (Berkeley) 9/25/96')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /var/spool/mqueue)')dnl
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /etc/mail/aliases)')dnl
+define(`ALIAS_FILE', /etc/mail/aliases)dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /etc/mail/sendmail.st)')dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/share/lib/sendmail.hf)')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/bin/rmail)')dnl
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `m')')dnl
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `m9')')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `rmail -d $u')')dnl
ifdef(`LOCAL_SHELL_PATH',, `define(`LOCAL_SHELL_PATH', /usr/bin/sh)')dnl
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gC $h!rmail ($u)')')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/hpux9.m4 b/usr.sbin/sendmail/cf/ostype/hpux9.m4
index 7a120052e424..82e4f75ab7bb 100644
--- a/usr.sbin/sendmail/cf/ostype/hpux9.m4
+++ b/usr.sbin/sendmail/cf/ostype/hpux9.m4
@@ -34,13 +34,13 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)hpux9.m4 8.10 (Berkeley) 11/13/95')
+VERSIONID(`@(#)hpux9.m4 8.12 (Berkeley) 9/25/96')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /usr/lib/aliases)')dnl
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', `/bin/rmail')')dnl
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `m')')dnl
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `m9')')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `rmail -d $u')')dnl
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gC $h!rmail ($u)')')dnl
define(`confTIME_ZONE', `USE_TZ')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/irix4.m4 b/usr.sbin/sendmail/cf/ostype/irix4.m4
index e24b008823e4..fb8eff720d4e 100644
--- a/usr.sbin/sendmail/cf/ostype/irix4.m4
+++ b/usr.sbin/sendmail/cf/ostype/irix4.m4
@@ -34,8 +34,8 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)irix4.m4 8.5 (Berkeley) 11/13/95')
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', Ehm)')dnl
+VERSIONID(`@(#)irix4.m4 8.7 (Berkeley) 9/25/96')
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', Ehm9)')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /usr/lib/aliases)')dnl
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/irix5.m4 b/usr.sbin/sendmail/cf/ostype/irix5.m4
index 79843da6dbeb..89a2975adffd 100644
--- a/usr.sbin/sendmail/cf/ostype/irix5.m4
+++ b/usr.sbin/sendmail/cf/ostype/irix5.m4
@@ -50,11 +50,11 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)irix5.m4 8.2 (Berkeley) 11/13/95')
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', Ehmu)')dnl
+VERSIONID(`@(#)irix5.m4 8.4 (Berkeley) 9/25/96')
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', Ehmu9)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -s -d $u')')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /var/spool/mqueue)')dnl
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /etc/aliases)')dnl
+define(`ALIAS_FILE', /etc/aliases)dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/sendmail.st)')dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/sendmail.hf)')dnl
define(`confDEF_USER_ID', `998:998')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/isc4.1.m4 b/usr.sbin/sendmail/cf/ostype/isc4.1.m4
index 258f5450bb93..902f49a24978 100644
--- a/usr.sbin/sendmail/cf/ostype/isc4.1.m4
+++ b/usr.sbin/sendmail/cf/ostype/isc4.1.m4
@@ -35,11 +35,11 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)isc4.1.m4 8.2 (Berkeley) 11/13/95')
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /usr/lib/aliases)')dnl
+VERSIONID(`@(#)isc4.1.m4 8.4 (Berkeley) 9/25/96')
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/lib/sendmail.hf)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `lmail -s $u')')dnl
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `humS')')dnl
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `humS9')')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/lmail)')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/maxion.m4 b/usr.sbin/sendmail/cf/ostype/maxion.m4
new file mode 100644
index 000000000000..63cc4961f60f
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/maxion.m4
@@ -0,0 +1,50 @@
+#
+# Copyright (c) 1996 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# Concurrent Computer Corporation Maxion system support contributed
+# by Donald R. Laster Jr. <Laster@access.digex.com>.
+#
+
+divert(0)
+VERSIONID(`@(#)maxion.m4 8.3 (Berkeley) 9/25/96')
+
+define(`ALIAS_FILE', `/etc/ucbmail/aliases')dnl
+define(`HELP_FILE', `/etc/ucbmail/sendmail.hf')dnl
+define(`QUEUE_DIR', `/var/spool/mqueue')dnl
+define(`STATUS_FILE', `/var/adm/log/sendmail.st')dnl
+define(`LOCAL_MAILER_PATH', `/usr/bin/mail')dnl
+define(`LOCAL_MAILER_FLAGS',`rmn9')dnl
+define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
+define(`LOCAL_MAILER_ARGS', `mail $u')dnl
+define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gmedium $h!rmail ($u)')dnl
+divert(-1)
diff --git a/usr.sbin/sendmail/cf/ostype/nextstep.m4 b/usr.sbin/sendmail/cf/ostype/nextstep.m4
index 515757aaf82b..dcdf47cb3abb 100644
--- a/usr.sbin/sendmail/cf/ostype/nextstep.m4
+++ b/usr.sbin/sendmail/cf/ostype/nextstep.m4
@@ -34,11 +34,11 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)nextstep.m4 8.5 (Berkeley) 11/13/95')
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /etc/sendmail/aliases)')dnl
+VERSIONID(`@(#)nextstep.m4 8.7 (Berkeley) 9/25/96')
+define(`ALIAS_FILE', /etc/sendmail/aliases)dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/lib/sendmail.hf)')dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /etc/sendmail/sendmail.st)')dnl
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `rmnP')')dnl
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `rmnP9')')dnl
ifdef(`LOCAL_SHELL_FLAGS',, `define(`LOCAL_SHELL_FLAGS', `euP')')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/osf1.m4 b/usr.sbin/sendmail/cf/ostype/osf1.m4
index 107cd7507171..ee73e4fef361 100644
--- a/usr.sbin/sendmail/cf/ostype/osf1.m4
+++ b/usr.sbin/sendmail/cf/ostype/osf1.m4
@@ -34,7 +34,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)osf1.m4 8.3 (Berkeley) 11/13/95')
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /usr/adm/sendmail/aliases)')dnl
+VERSIONID(`@(#)osf1.m4 8.4 (Berkeley) 9/25/96')
+define(`ALIAS_FILE', /usr/adm/sendmail/aliases)dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/adm/sendmail/sendmail.st)')dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/share/lib/sendmail.hf)')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/ptx2.m4 b/usr.sbin/sendmail/cf/ostype/ptx2.m4
index 365d21a1bbdd..cbe0f590a0a2 100644
--- a/usr.sbin/sendmail/cf/ostype/ptx2.m4
+++ b/usr.sbin/sendmail/cf/ostype/ptx2.m4
@@ -36,10 +36,11 @@ divert(-1)
# Support for DYNIX/ptx 2.x.
divert(0)
-VERSIONID(`@(#)ptx2.m4 8.1 (Berkeley) 12/4/94')
-ifdef(`ALIAS_FILE',,`define(`ALIAS_FILE', /usr/lib/aliases)')dnl
+VERSIONID(`@(#)ptx2.m4 8.5 (Berkeley) 9/25/96')
+ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`HELP_FILE',,`define(`HELP_FILE', /usr/lib/sendmail.hf)')dnl
ifdef(`STATUS_FILE',,`define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
define(`LOCAL_MAILER_PATH', `/bin/mail')dnl
-define(`LOCAL_MAILER_FLAGS', `rmn')dnl
-define(`LOCAL_SHELL_FLAGS', `e')dnl
+define(`LOCAL_MAILER_FLAGS', `fmn9')dnl
+define(`LOCAL_SHELL_FLAGS', `eu')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/riscos4.5.m4 b/usr.sbin/sendmail/cf/ostype/riscos4.5.m4
index 7e8f382d0e0e..96e3b16efee5 100644
--- a/usr.sbin/sendmail/cf/ostype/riscos4.5.m4
+++ b/usr.sbin/sendmail/cf/ostype/riscos4.5.m4
@@ -34,9 +34,9 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)riscos4.5.m4 8.3 (Berkeley) 11/13/95')
+VERSIONID(`@(#)riscos4.5.m4 8.4 (Berkeley) 9/25/96')
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `rmail -d $u')')dnl
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', `/usr/lib/aliases')')dnl
+define(`ALIAS_FILE', `/usr/lib/aliases')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', `/usr/spool/mqueue')')dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', `/usr/lib/sendmail.hf')')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/sco3.2.m4 b/usr.sbin/sendmail/cf/ostype/sco3.2.m4
index 06fc050197c3..b74eb6f4208f 100644
--- a/usr.sbin/sendmail/cf/ostype/sco3.2.m4
+++ b/usr.sbin/sendmail/cf/ostype/sco3.2.m4
@@ -34,12 +34,12 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)sco3.2.m4 8.2 (Berkeley) 11/13/95')
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /usr/lib/mail/aliases)')dnl
+VERSIONID(`@(#)sco3.2.m4 8.4 (Berkeley) 9/25/96')
+define(`ALIAS_FILE', /usr/lib/mail/aliases)dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/bin/lmail)')dnl
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', PuhCE)')dnl
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', PuhCE9)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `lmail $u')')dnl
ifdef(`LOCAL_SHELL_FLAGS',, `define(`LOCAL_SHELL_FLAGS', Peu)')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/solaris2.m4 b/usr.sbin/sendmail/cf/ostype/solaris2.m4
index 9a7b0703ecbb..e6553a8b664f 100644
--- a/usr.sbin/sendmail/cf/ostype/solaris2.m4
+++ b/usr.sbin/sendmail/cf/ostype/solaris2.m4
@@ -34,12 +34,13 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)solaris2.m4 8.6 (Berkeley) 11/13/95')
+VERSIONID(`@(#)solaris2.m4 8.9 (Berkeley) 9/25/96')
divert(-1)
-ifdef(`ALIAS_FILE',, `define(`ALIAS_FILE', /etc/mail/aliases)')
+define(`ALIAS_FILE', /etc/mail/aliases)
ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/mail/sendmail.hf)')
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /etc/mail/sendmail.st)')
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `SnE')')
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `SnE9')')
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -f $g -d $u')')
+ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')')
define(`confCW_FILE', /etc/mail/sendmail.cw)
diff --git a/usr.sbin/sendmail/cf/ostype/solaris2.ml.m4 b/usr.sbin/sendmail/cf/ostype/solaris2.ml.m4
new file mode 100644
index 000000000000..2ce5325158cc
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/solaris2.ml.m4
@@ -0,0 +1,51 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# This ostype file is suitable for use on Solaris 2.x systems that
+# have mail.local installed. It is my understanding that this is
+# standard as of Solaris 2.5.
+#
+
+divert(0)
+VERSIONID(`@(#)solaris2.ml.m4 8.2 (Berkeley) 9/25/96')
+divert(-1)
+
+define(`ALIAS_FILE', /etc/mail/aliases)
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/mail/sendmail.hf)')
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /etc/mail/sendmail.st)')
+ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', `/usr/lib/mail.local')')
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `fSmn9')')
+ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail.local -d $u')')
+ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')')
+define(`confCW_FILE', /etc/mail/sendmail.cw)
diff --git a/usr.sbin/sendmail/cf/ostype/svr4.m4 b/usr.sbin/sendmail/cf/ostype/svr4.m4
index ae18c1038b7e..3085db17fd32 100644
--- a/usr.sbin/sendmail/cf/ostype/svr4.m4
+++ b/usr.sbin/sendmail/cf/ostype/svr4.m4
@@ -34,12 +34,12 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)svr4.m4 8.2 (Berkeley) 5/26/95')
+VERSIONID(`@(#)svr4.m4 8.4 (Berkeley) 9/25/96')
-ifdef(`ALIAS_FILE',,`define(`ALIAS_FILE', /usr/ucblib/aliases)')dnl
+define(`ALIAS_FILE', /usr/ucblib/aliases)dnl
ifdef(`HELP_FILE',,`define(`HELP_FILE', /usr/ucblib/sendmail.hf)')dnl
ifdef(`STATUS_FILE',,`define(`STATUS_FILE', /usr/ucblib/sendmail.st)')dnl
define(`LOCAL_MAILER_PATH', `/usr/ucblib/binmail')dnl
-define(`LOCAL_MAILER_FLAGS', `rmn')dnl
+define(`LOCAL_MAILER_FLAGS', `rmn9')dnl
define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gmedium $h!rmail ($u)')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/uxpds.m4 b/usr.sbin/sendmail/cf/ostype/uxpds.m4
new file mode 100644
index 000000000000..88e455bc78b0
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/uxpds.m4
@@ -0,0 +1,49 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# Definitions for UXP/DS (Fujitsu/ICL DS/90 series)
+# Diego R. Lopez, CICA (Seville). 1995
+#
+
+divert(0)
+VERSIONID(`@(#)uxpds.m4 8.3 (Berkeley) 9/25/96')
+
+define(`confDEF_GROUP_ID', `6')
+define(`ALIAS_FILE', /usr/ucblib/aliases)dnl
+ifdef(`HELP_FILE',,`define(`HELP_FILE', /usr/ucblib/sendmail.hf)')dnl
+ifdef(`STATUS_FILE',,`define(`STATUS_FILE', /usr/ucblib/sendmail.st)')dnl
+define(`LOCAL_MAILER_PATH', `/usr/ucblib/binmail')dnl
+define(`LOCAL_MAILER_FLAGS', `rmn9')dnl
+define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
+define(`UUCP_MAILER_ARGS', `uux - -r -a$f -gmedium $h!rmail ($u)')dnl
diff --git a/usr.sbin/sendmail/contrib/re-mqueue.pl b/usr.sbin/sendmail/contrib/re-mqueue.pl
new file mode 100644
index 000000000000..61aef430e9b8
--- /dev/null
+++ b/usr.sbin/sendmail/contrib/re-mqueue.pl
@@ -0,0 +1,203 @@
+#!/usr/bin/perl
+#
+# re-mqueue -- requeue messages from queueA to queueB based on age.
+#
+# Contributed by Paul Pomes <ppomes@Qualcomm.COM>.
+# http://www.qualcomm.com/~ppomes/
+#
+# Usage: re-mqueue [-d] queueA queueB seconds
+#
+# -d enable debugging
+# queueA source directory
+# queueB destination directory
+# seconds select files older than this number of seconds
+#
+# Example: re-mqueue /var/spool/mqueue /var/spool/mqueue2 2700
+#
+# Moves the qf* and df* files for a message from /var/spool/mqueue to
+# /var/spool/mqueue2 if the df* file is over 2700 seconds old.
+#
+# The qf* file can't be used for age checking as it's partially re-written
+# with the results of the last queue run.
+#
+# Rationale: With a limited number of sendmail processes allowed to run,
+# messages that can't be delivered immediately slow down the ones that can.
+# This becomes especially important when messages are being queued instead
+# of delivered right away, or when the queue becomes excessively deep.
+# By putting messages that have already failed one or more delivery attempts
+# into another queue, the primary queue can be kept small and fast.
+#
+# On postoffice.cso.uiuc.edu, the primary sendmail daemon runs the queue
+# every thirty minutes. Messages over 45 minutues old are moved to
+# /var/spool/mqueue2 where sendmail runs every hour. Messages more than
+# 3.25 hours old are moved to /var/spool/mqueue3 where sendmail runs every
+# four hours. Messages more than a day old are moved to /var/spool/mqueue4
+# where sendmail runs three times a day. The idea is that a message is
+# tried at least twice in the first three queues before being moved to the
+# old-age ghetto.
+#
+# (Each must be re-formed into a single line before using in crontab)
+#
+# 08 * * * * /usr/local/libexec/re-mqueue /var/spool/mqueue ## /var/spool/mqueue2 2700
+# 11 * * * * /usr/lib/sendmail -oQ/var/spool/mqueue2 -q > ## > /var/log/mqueue2 2>&1
+# 38 * * * * /usr/local/libexec/re-mqueue /var/spool/mqueue2
+# /var/spool/mqueue3 11700
+# 41 1,5,9,13,17,21 * * * /usr/lib/sendmail -oQ/var/spool/mqueue3 -q ## > /var/log/mqueue3 2>&1
+# 48 * * * * /usr/local/libexec/re-mqueue /var/spool/mqueue3
+# /var/spool/mqueue4 100000
+#53 3,11,19 * * * /usr/lib/sendmail -oQ/var/spool/mqueue4 -q > ## > /var/log/mqueue4 2>&1
+#
+#
+# N.B., the moves are done with link(). This has two effects: 1) the mqueue*
+# directories must all be on the same filesystem, and 2) the file modification
+# times are not changed. All times must be cumulative from when the df*
+# file was created.
+#
+# Copyright (c) 1995 University of Illinois Board of Trustees and Paul Pomes
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# Illinois at Urbana and their contributors.
+# 4. Neither the name of the University nor the names of their contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE TRUSTEES AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE TRUSTEES OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# @(#)$Id: re-mqueue,v 1.3 1995/05/25 18:14:53 p-pomes Exp $
+
+require "syslog.pl";
+
+$LOCK_EX = 2;
+$LOCK_NB = 4;
+$LOCK_UN = 8;
+
+# Count arguments, exit if wrong in any way.
+die "Usage: $0 [-d] queueA queueB seconds\n" if ($#ARGV < 2);
+
+while ($_ = $ARGV[0], /^-/) {
+ shift;
+ last if /^--$/;
+ /^-d/ && $debug++;
+}
+
+$queueA = shift;
+$queueB = shift;
+$age = shift;
+
+die "$0: $queueA not a directory\n" if (! -d $queueA);
+die "$0: $queueB not a directory\n" if (! -d $queueB);
+die "$0: $age isn't a valid number of seconds for age\n" if ($age =~ /\D/);
+
+# chdir to $queueA and read the directory. When a df* file is found, stat it.
+# If it's older than $age, lock the corresponding qf* file. If the lock
+# fails, give up and move on. Once the lock is obtained, verify that files
+# of the same name *don't* already exist in $queueB and move on if they do.
+# Otherwise re-link the qf* and df* files into $queueB then release the lock.
+
+chdir "$queueA" || die "$0: can't cd to $queueA: $!\n";
+opendir (QA, ".") || die "$0: can't open directory $queueA for reading: $!\n";
+@dfiles = grep(/^df/, readdir(QA));
+$now = time();
+($program = $0) =~ s,.*/,,;
+&openlog($program, 'pid', 'mail');
+
+# Loop through the dfiles
+while ($dfile = pop(@dfiles)) {
+ print "Checking $dfile\n" if ($debug);
+ ($qfile = $dfile) =~ s/^d/q/;
+ ($mfile = $dfile) =~ s/^df//;
+ if (! -e $dfile || -z $dfile) {
+ print "$dfile is gone or zero bytes - skipping\n" if ($debug);
+ next;
+ }
+ if (! -e $qfile || -z $qfile) {
+ print "$qfile is gone or zero bytes - skipping\n" if ($debug);
+ next;
+ }
+
+ $mtime = $now;
+ ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+ $atime,$mtime,$ctime,$blksize,$blocks) = stat($dfile);
+
+ # Compare timestamps
+ if (($mtime + $age) > $now) {
+ printf ("%s is %d seconds old - skipping\n", $dfile, $now-$mtime) if ($debug);
+ next;
+ }
+
+ # See if files of the same name already exist in $queueB
+ if (-e "$queueB/$dfile") {
+ print "$queueb/$dfile already exists - skipping\n" if ($debug);
+ next;
+ }
+ if (-e "$queueB/$qfile") {
+ print "$queueb/$qfile already exists - skipping\n" if ($debug);
+ next;
+ }
+
+ # Try and lock qf* file
+ unless (open(QF, ">>$qfile")) {
+ print "$qfile: $!\n" if ($debug);
+ next;
+ }
+ $retval = flock(QF, $LOCK_EX|$LOCK_NB) || ($retval = -1);
+ if ($retval == -1) {
+ print "$qfile already flock()ed - skipping\n" if ($debug);
+ close(QF);
+ next;
+ }
+ print "$qfile now flock()ed\n" if ($debug);
+
+ # Show time! Do the link()s
+ if (link("$dfile", "$queueB/$dfile") == 0) {
+ &syslog('err', 'link(%s, %s/%s): %m', $dfile, $queueB, $dfile);
+ print STDERR "$0: link($dfile, $queueB/$dfile): $!\n";
+ exit (1);
+ }
+ if (link("$qfile", "$queueB/$qfile") == 0) {
+ &syslog('err', 'link(%s, %s/%s): %m', $qfile, $queueB, $qfile);
+ print STDERR "$0: link($qfile, $queueB/$qfile): $!\n";
+ unlink("$queueB/$dfile");
+ exit (1);
+ }
+
+ # Links created successfully. Unlink the original files, release the
+ # lock, and close the file.
+ print "links ok\n" if ($debug);
+ if (unlink($qfile) == 0) {
+ &syslog('err', 'unlink(%s): %m', $qfile);
+ print STDERR "$0: unlink($qfile): $!\n";
+ exit (1);
+ }
+ if (unlink($dfile) == 0) {
+ &syslog('err', 'unlink(%s): %m', $dfile);
+ print STDERR "$0: unlink($dfile): $!\n";
+ exit (1);
+ }
+ flock(QF, $LOCK_UN);
+ close(QF);
+ &syslog('info', '%s moved to %s', $mfile, $queueB);
+ print "Done with $dfile $qfile\n\n" if ($debug);
+}
+exit 0;
diff --git a/usr.sbin/sendmail/doc/op/op.me b/usr.sbin/sendmail/doc/op/op.me
index 6fd40ad866e3..1009ba17fec1 100644
--- a/usr.sbin/sendmail/doc/op/op.me
+++ b/usr.sbin/sendmail/doc/op/op.me
@@ -30,7 +30,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)op.me 8.70 (Berkeley) 11/3/95
+.\" @(#)op.me 8.97 (Berkeley) 10/17/96
.\"
.\" eqn op.me | pic | troff -me
.eh 'SMM:08-%''Sendmail Installation and Operation Guide'
@@ -65,12 +65,12 @@
.sp
.r
Eric Allman
-Pang\(aea Reference Systems
+InReference, Inc.
eric@Sendmail.ORG
.sp
-Version 8.70
+Version 8.97
.sp
-For Sendmail Version 8.7
+For Sendmail Version 8.8
.)l
.sp 2
.pp
@@ -105,17 +105,12 @@ RFC822 (Internet Mail Format Protocol),
RFC1123 (Internet Host Requirements),
RFC1521 (MIME),
RFC1651 (SMTP Service Extensions),
-and a series of as-yet-draft standards describing
-Delivery Status Notifications (DSNs),
-available from the internet drafts sites as
-draft-ietf-notary-mime-delivery-\fIXX\fP.txt,
-draft-ietf-notary-mime-report-\fIXX\fP.txt,
-draft-ietf-notary-smtp-drpt-\fIXX\fP.txt,
+RFC1891 (SMTP Delivery Status Notifications),
+RFC1892 (Multipart/Report),
+RFC1893 (Mail System Status Codes),
+RFC1894 (Delivery Status Notifications),
and
-draft-ietf-notary-status-\fIXX\fP.txt
-(replace
-.i XX
-by the latest draft number).
+RFC1985 (SMTP Service Extension for Remote Message Queue Starting).
However, since
.i sendmail
is designed to work in a wider world,
@@ -446,8 +441,7 @@ Shell files used by the
build process.
You shouldn't have to mess with these.
.ip siteconfig
-Local site configuration information,
-such as UUCP connectivity.
+Local UUCP connectivity information.
They normally contain lists of site information, for example:
.(b
SITE(contessa)
@@ -466,6 +460,9 @@ It can be U
(indicating locally connected hosts)
or one of W, X, or Y
for up to three remote UUCP hubs.
+This directory has been supplanted by the mailertable feature;
+any new configurations should use that feature to do UUCP
+(and other) routing.
.pp
If you are in a new domain
(e.g., a company),
@@ -586,6 +583,26 @@ ln \-s /usr/\*(SD/sendmail /usr/\*(SB/newaliases
.)b
This can be installed in whatever search path you prefer
for your system.
+.sh 3 "/usr/\*(SB/hoststat"
+.pp
+The
+.i hoststat
+command should just be a link to
+.i sendmail ,
+in a fashion similar to
+.i newaliases .
+This command lists the status of the last mail transaction
+with all remote hosts.
+It functions only when the
+.b HostStatusDirectory
+option is set.
+.sh 3 "/usr/\*(SB/purgestat"
+.pp
+This command is also a link to
+.i sendmail .
+It flushes all information that is stored in the
+.b HostStatusDirectory
+tree.
.sh 3 "/var/spool/mqueue"
.pp
The directory
@@ -600,6 +617,15 @@ is defined in the
option of the
.i sendmail.cf
file.
+.sh 3 "/var/spool/mqueue/.hoststat"
+.pp
+This is a typical value for the
+.b HostStatusDirectory
+option,
+containing one file per host
+that this sendmail has chatted with recently.
+It is normally a subdirectory of
+.i mqueue .
.sh 3 "/etc/aliases*"
.pp
The system aliases are held in
@@ -1022,6 +1048,80 @@ you can remove the directory:
.(b
rmdir /var/spool/omqueue
.)b
+.sh 2 "Disk Based Connection Information"
+.pp
+.i Sendmail
+stores a large amount of information about each remote system it
+has connected to in memory. It is now possible to preserve some
+of this information on disk as well, by using the
+.b HostStatusDirectory
+option, so that it may be shared between several invocations of
+.i sendmail .
+This allows mail to be queued immediately or skipped during a queue run if
+there has been a recent failure in connecting to a remote machine.
+.pp
+Additionally enabling
+.b SingleThreadDelivery
+has the added effect of single-threading mail delivery to a destination.
+This can be quite helpful
+if the remote machine is running an SMTP server that is easily overloaded
+or cannot accept more than a single connection at a time,
+but can cause some messages to be punted to a future queue run.
+It also applies to
+.i all
+hosts, so setting this because you have one machine on site
+that runs some software that is easily overrun
+can cause mail to other hosts to be slowed down.
+If this option is set,
+you probably want to set the
+.b MinQueueAge
+option as well and run the queue fairly frequently;
+this will cause hosts that are skipped because another
+.i sendmail
+instance is talking to it to be tried again soon.
+.pp
+The disk based host information is stored in a subdirectory of of the
+.b mqueue
+directory called
+.b \&.hoststat \**.
+.(f
+\**This is the usual value of the
+.b HostStatusDirectory
+option;
+it can, of course, go anywhere you like in your filesystem.
+.)f
+Removing this directory and its subdirectories has an effect similar to
+the
+.i purgestat
+command and is completely safe.
+The information in these directories can
+be perused with the
+.i hoststat
+command, which will indicate the host name, the last access, and the
+status of that access.
+An asterisk in the left most column indicates that a
+.i sendmail
+process currently has the host locked for mail delivery.
+.pp
+The disk based connection information is treated the same way as memory based
+connection information for the purpose of timeouts.
+By default, information about host failures is valid for 30 minutes.
+This can be adjusted with
+the
+.b Timeout.hoststatus
+option.
+.pp
+The connection information stored on disk may be purged at any time
+with the
+.i purgestat
+command or by invoking sendmail with the
+.b \-bH
+switch.
+The connection information may be viewed with the
+.i hoststat
+command or by invoking sendmail with the
+.b \-bh
+switch.
.sh 2 "The Service Switch"
.pp
The implementation of certain system services
@@ -1592,7 +1692,7 @@ sets the
for this run only;
the equivalent line using the long option name is
.(b
-/usr/\*(SD/sendmail -OQueueTimeout=2m
+/usr/\*(SD/sendmail -OTimeout.queuereturn=2m
.)b
.pp
Some options have security implications.
@@ -1748,6 +1848,28 @@ dumps the contents of the indicated ruleset.
.bu
\-d\|debug-spec
is equivalent to the command-line flag.
+.sh 2 "Persistent Host Status Information"
+.pp
+When
+.b HostStatusDirectory
+is enabled,
+information about the status of hosts is maintained on disk
+and can thus be shared between different instantiations of
+.i sendmail .
+The status of the last connection with each remote host
+may be viewed with the command:
+.(b
+sendmail \-bh
+.)b
+This information may be flushed with the command:
+.(b
+sendmail \-bH
+.)b
+Flushing the information prevents new
+.i sendmail
+processes from loading it,
+but does not prevent existing processes from using the status information
+that they already have.
.sh 1 "TUNING"
.pp
There are a number of configuration parameters
@@ -1836,6 +1958,16 @@ In no case can this option extend the timeout
longer than the kernel provides, but it can shorten it.
This is to get around kernels that provide an absurdly long connection timeout
(90 minutes in one case).
+.ip iconnect
+The same as
+.i connect,
+except it applies only to the initial attempt to connect to a host
+for a given message
+[0, unspecified].
+The concept is that this should be very short (a few seconds);
+hosts that are well connected and responsive will thus be serviced immediately.
+Hosts that are slow will not hold up other deliveries in the initial
+delivery attempt.
.ip initial
The wait for the initial 220 greeting message
[5m, 5m].
@@ -2211,6 +2343,8 @@ Messages being deferred
(due to a host being down, etc.).
.ip 10
Database expansion (alias, forward, and userdb lookups).
+.ip 12
+Log all incoming and outgoing SMTP commands.
.ip 20
Logs attempts to run locked queue files.
These are not errors,
@@ -2586,7 +2720,7 @@ and disables the EXPN command.
.pp
The flags are detailed in section
.\"XREF
-5.1.6.
+5.6.
.sh 2 "Send to Me Too"
.pp
Normally,
@@ -2667,7 +2801,7 @@ The syntax of these two commands are:
Sets the current ruleset being collected to
.i n .
If you begin a ruleset more than once
-it deletes the old definition.
+it appends to the old definition.
.(b F
.b R \c
.i lhs
@@ -2894,10 +3028,9 @@ is later rewritten by the mailer-specific envelope rewriting set
and assigned to the
.b $u
macro.
-As a special case, if the value to
-.b $#
-is
-.q local
+As a special case, if the mailer specified has the
+.b F=@
+flag specified
and the first character of the
.b $:
value is
@@ -3078,6 +3211,69 @@ Ruleset four is applied to all addresses
in the message.
It is typically used
to translate internal to external form.
+.pp
+In addition,
+ruleset 5 is applied to all local addresses
+(specifically, those that resolve to a mailer with the `F=5'
+flag set)
+that do not have aliases.
+This allows a last minute hook for local names.
+.sh 3 "Ruleset hooks"
+.pp
+A few extra rulesets are defined as
+.q hooks
+that can be defined to get special features.
+They are all named rulesets.
+The
+.q check_*
+forms all give accept/reject status;
+falling off the end or returning normally is an accept,
+and resolving to $#error
+is a reject.
+.sh 4 "check_relay"
+.pp
+The
+.i check_relay
+ruleset is called after a connection is accepted.
+It is passed
+.(b
+client.host.name $| client.host.address
+.)b
+where
+.b $|
+is a metacharacter separating the two parts.
+This ruleset can reject connections from various locations.
+.sh 4 "check_mail"
+.pp
+The
+.i check_mail
+ruleset is passed the user name parameter of the
+.sm "SMTP MAIL"
+command.
+It can accept or reject the address.
+.sh 4 "check_rcpt"
+.pp
+The
+.i check_rcpt
+ruleset is passed the user name parameter of the
+.sm "SMTP RCPT"
+command.
+It can accept or reject the address.
+.sh 4 "check_compat"
+.pp
+The
+.i check_compat
+ruleset is passed
+.(b
+sender-address $| recipient-address
+.)b
+where
+.b $|
+is a metacharacter separating the addresses.
+It can accept or reject mail transfer between these two addresses
+much like the
+.i checkcompat()
+function.
.sh 3 "IPC mailers"
.pp
Some special processing occurs
@@ -3560,6 +3756,20 @@ is set to a validated sender host name.
If the sender is running an RFC 1413 compliant IDENT server
and the receiver has the IDENT protocol turned on,
it will include the user name on that host.
+.pp
+The
+.b ${client_name}
+and
+.b ${client_addr}
+are set to the name and address of the SMTP client
+who is invoking
+.i sendmail
+as a server.
+These can be used in the
+.i check_*
+rulesets (using the
+.b $&
+deferred evaluation form, of course!).
.sh 2 "C and F \*- Define Classes"
.pp
Classes of phrases may be defined
@@ -3620,35 +3830,40 @@ The
only matches a single word;
multi-word entries in the class are ignored in this context.
.pp
-The class
-.b $=w
-is set to be the set of all names
-this host is known by.
-This can be used to match local hostnames.
-.pp
-The class
-.b $=k
-is set to be the same as
+Some classes have internal meaning to
+.i sendmail :
+.nr ii 0.5i
+.\".ip $=b
+.\"A set of Content-Types that will not have the newline character
+.\"translated to CR-LF before encoding into base64 MIME.
+.\"The class can have major times
+.\"(e.g.,
+.\".q image )
+.\"or full types
+.\"(such as
+.\".q application/octet-stream ).
+.\"The class is initialized with
+.\".q application/octet-stream ,
+.\".q image ,
+.\".q audio ,
+.\"and
+.\".q video .
+.ip $=e
+contains the Content-Transfer-Encodings that can be 8\(->7 bit encoded.
+It is predefined to contain
+.q 7bit ,
+.q 8bit ,
+and
+.q binary .
+.ip $=k
+set to be the same as
.b $k ,
that is, the UUCP node name.
-.pp
-The class
-.b $=m
-is set to the set of domains by which this host is known,
+.ip $=m
+set to the set of domains by which this host is known,
initially just
.b $m .
-.pp
-The class
-.b $=t
-is set to the set of trusted users by the
-.b T
-configuration line.
-If you want to read trusted users from a file use
-.b Ft \c
-.i /file/name .
-.pp
-The class
-.b $=n
+.ip $=n
can be set to the set of MIME body types
that can never be eight to seven bit encoded.
It defaults to
@@ -3662,16 +3877,19 @@ Multipart messages are always handled recursively.
The handling of message/* messages
are controlled by class
.b $=s .
-The class
-.b $=e
-contains the Content-Transfer-Encodings that can be 8\(->7 bit encoded.
-It is predefined to contain
-.q 7bit ,
-.q 8bit ,
-and
-.q binary .
-The class
-.b $=s
+.ip $=q
+A set of Content-Types that will never be encoded as base64
+(if they have to be encoded, they will be encoded as quoted-printable).
+It can have primary types
+(e.g.,
+.q text )
+or full types
+(such as
+.q text/plain ).
+The class is initialized to have
+.q text/plain
+only.
+.ip $=s
contains the set of subtypes of message that can be treated recursively.
By default it contains only
.q rfc822 .
@@ -3681,6 +3899,17 @@ types cannot be 8\(->7 bit encoded.
If a message containing eight bit data is sent to a seven bit host,
and that message cannot be encoded into seven bits,
it will be stripped to 7 bits.
+.ip $=t
+set to the set of trusted users by the
+.b T
+configuration line.
+If you want to read trusted users from a file use
+.b Ft \c
+.i /file/name .
+.ip $=w
+set to be the set of all names
+this host is known by.
+This can be used to match local hostnames.
.pp
.i Sendmail
can be compiled to allow a
@@ -3797,6 +4026,10 @@ To: userb@hostb, userc@hosta
.)b
automatically.
However, it doesn't really work reliably.
+.ip d
+Do not include angle brackets around route-address syntax addresses.
+This is useful on mailers that are going to pass addresses to a shell
+that might interpret angle brackets as I/O redirection.
.ip D\(dg
This mailer wants a
.q Date:
@@ -3853,6 +4086,8 @@ This option is not required
(i.e.,
if this option is omitted the transmission will still operate successfully,
although perhaps not as efficiently as possible).
+.ip j
+Do User Database rewriting on recipients as well as senders.
.ip k
Normally when
.i sendmail
@@ -3928,12 +4163,25 @@ Reverse-paths are officially discouraged by RFC 1123.
This mailer wants a
.q Return-Path:
line.
+.ip q
+When an address that resolves to this mailer is verified
+(SMTP VRFY command),
+generate 250 responses instead of 252 responses.
+This will imply that the address is local.
.ip r
Same as
.b f ,
but sends a
.b \-r
flag.
+.ip R
+Open SMTP connections from a
+.q secure
+port.
+Secure ports aren't
+(secure, that is)
+except on UNIX machines,
+so it is unclear that this adds anything.
.ip s
Strip quote characters (" and \e) off of the address
before calling the mailer.
@@ -3982,6 +4230,13 @@ will have an extra dot prepended
(to be stripped at the other end).
This insures that lines in the message containing a dot
will not terminate the message prematurely.
+.ip 0
+Don't look up MX records for hosts sent via SMTP.
+.ip 3
+Extend the list of characters converted to =XX notation
+when converting to Quoted-Printable
+to include those that don't map cleanly between ASCII and EBCDIC.
+Useful if you have IBM mainframes on site.
.ip 5
If no aliases are found for this address,
pass the address through ruleset 5 for possible alternate resolution.
@@ -4004,6 +4259,12 @@ that didn't have 8\(->7 bit MIME conversions performed.
If set,
it is acceptable to send eight bit data to this mailer;
the usual attempt to do 8\(->7 bit MIME conversions will be bypassed.
+.ip 9
+If set,
+do
+.i limited
+7\(->8 bit MIME conversions.
+These conversions are limited to text/plain data.
.ip :
Check addresses to see if they begin
.q :include: ;
@@ -4035,7 +4296,10 @@ The (optional) host field is an exit status to be returned,
and the user field is a message to be printed.
The exit status may be numeric or one of the values
USAGE, NOUSER, NOHOST, UNAVAILABLE, SOFTWARE, TEMPFAIL, PROTOCOL, or CONFIG
-to return the corresponding EX_ exit code.
+to return the corresponding EX_ exit code,
+or an enhanced error code as described in RFC 1893,
+.ul
+Enhanced Mail System Status Codes.
For example, the entry:
.(b
$#error $@ NOHOST $: Host unknown in this domain
@@ -4046,7 +4310,8 @@ and the
.q "Host unknown"
exit status to be returned
if the LHS matches.
-This mailer is only functional in rulesets zero or five.
+This mailer is only functional in rulesets 0, 5,
+or one of the check_* rulesets.
.pp
The mailer named
.q local
@@ -4140,8 +4405,7 @@ The Type= field
sets the type information
used in MIME error messages
as defined by
-RFC XXX
-(not yet published).
+RFC 1894.
It is actually three values separated by slashes:
the MTA-type (that is, the description of how hosts are named),
the address type (the description of e-mail addresses),
@@ -4293,6 +4557,12 @@ rebuild the database
.b AutoRebuildAliases
option is also set)
or issue a warning.
+.ip AllowBogusHELO
+[no short name]
+If set, allow HELO SMTP commands that don't include a host name.
+Setting this violates RFC 1123 section 5.2.5,
+but is necessary to interoperate with several SMTP clients.
+If there is a value, it is still checked for legitimacy.
.ip AutoRebuildAliases
[D]
If set,
@@ -4384,6 +4654,15 @@ The point of this option is to be a good network neighbor
and avoid using up excessive resources
on the other end.
The default is five minutes.
+.ip ConnectionRateThrottle=\fIN\fP
+[no short name]
+If set to a positive value,
+allow no more than
+.i N
+incoming daemon connections in a one second period.
+This is intended to flatten out peaks
+and allow the load average checking to cut in.
+Defaults to zero (no limits).
.ip DaemonPortOptions=\fIoptions\fP
[O]
Set server SMTP options.
@@ -4532,6 +4811,19 @@ option is set, this will be disabled,
and the mail will be sent to the first address in the route,
even if later addresses are known.
This may be useful if you are caught behind a firewall.
+.ip DoubleBounceAddress=\fIerror-address\fP
+[no short name]
+If an error occurs when sending an error message,
+send the error report
+(termed a
+.q "double bounce"
+because it is an error
+.q bounce
+that occurs when trying to send another error
+.q bounce )
+to the indicated address.
+If not set, defaults to
+.q postmaster .
.ip EightBitMode=\fIaction\fP
[8]
Set handling of eight-bit data.
@@ -4643,6 +4935,42 @@ don't connect immediately.
This requires that queueing be compiled in,
since it will depend on a queue run process to
actually send the mail.
+.ip HostsFile=\fIpath\fP
+[no short name]
+The path to the hosts database,
+normally
+.q /etc/hosts .
+This option is only consulted when sendmail
+is canonifying addresses,
+and then only when
+.q files
+is in the
+.q hosts
+service switch entry.
+In particular, this file is
+.i never
+used when looking up host addresses;
+that is under the control of the system
+.i gethostbyname (3)
+routine.
+.ip HostStatusDirectory=\fIpath\fP
+[no short name]
+The location of the long term host status information.
+When set,
+information about the status of hosts
+(e.g., host down or not accepting connections)
+will be shared between all
+.i sendmail
+processes;
+normally, this information is only held within a single queue run.
+This option requires a connection cache of at least 1 to function.
+If the option begins with a leading `/',
+it is an absolute pathname;
+otherwise,
+it is relative to the mail queue directory.
+A suggested value for sites desiring persistent host status is
+.q \&.hoststat
+(i.e., a subdirectory of the queue directory).
.ip IgnoreDots
[i]
Ignore dots in incoming messages.
@@ -4676,6 +5004,16 @@ for a matching entry in the GECOS field.
This also requires that MATCHGECOS
be turned on during compilation.
This option is not recommended.
+.ip MaxDaemonChildren=\fIN\fP
+[no short name]
+If set,
+.i sendmail
+will refuse connections when it has more than
+.i N
+children processing incoming mail.
+This does not limit the number of outgoing connections.
+If not set, there is no limit to the number of children --
+that is, the system load averaging controls this.
.ip MaxHopCount=\fIN\fP
[h]
The maximum hop count.
@@ -4690,6 +5028,11 @@ This option specifies how long host status information will be retained.
For example, if a host is found to be down,
connections to that host will not be retried for this interval.
The units default to minutes.
+.ip MaxMessageSize=\fIN\fP
+[no short name]
+Specify the maximum message size
+to be advertised in the ESMTP EHLO response.
+Messages larger than this will be rejected.
.ip MaxQueueRunSize=\fIN\fP
[no short name]
The maximum number of jobs that will be processed
@@ -4709,11 +5052,6 @@ jobs that happen to fall late in the queue directory.
[m]
Send to me too,
even if I am in an alias expansion.
-.ip MaxMessageSize=\fIN\fP
-[no short name]
-Specify the maximum message size
-to be advertised in the ESMTP EHLO response.
-Messages larger than this will be rejected.
.ip MinFreeBlocks=\fIN\fP
[b]
Insist on at least
@@ -4733,10 +5071,18 @@ This is intended to allow you to get responsiveness
by processing the queue fairly frequently
without thrashing your system by trying jobs too often.
The default units are minutes.
+.ip MustQuoteChars=\fIs\fP
+[no short name]
+Sets the list of characters that must be quoted if used in a full name
+that is in the phrase part of a ``phrase <address>'' syntax.
+The default is ``\'.''.
+The characters ``@,;:\e()[]'' are always added to this list.
.ip NoRecipientAction
[no short name]
The action to take when you receive a message that has no valid
-recipient headers (To:, Cc:, Bcc:).
+recipient headers (To:, Cc:, Bcc:, or Apparently-To: \(em
+the last included for back compatibility with old
+.i sendmail s).
It can be
.b None
to pass the message on unmodified,
@@ -4871,16 +5217,29 @@ used for sorting the queue.
Only the first character of the value is used.
Legal values are
.q host
-(to order by the name of the first host name of the first recipient)
+(to order by the name of the first host name of the first recipient),
+.q time
+(to order by the submission time),
and
.q priority
-(to order strictly by message priority).
+(to order by message priority).
Host ordering makes better use of the connection cache,
but may tend to process low priority messages
that go to a single host
over high priority messages that go to several hosts;
it probably shouldn't be used on slow network links.
+Time ordering is almost always a bad idea,
+since it allows large, bulk mail to go out
+before smaller, personal mail,
+but may have applicability on some hosts with very fast connections.
Priority ordering is the default.
+.ip QueueTimeout=\fItimeout\fP
+[T]
+A synonym for
+.q Timeout.queuereturn .
+Use that form instead of the
+.q QueueTimeout
+form.
.ip ResolverOptions=\fIoptions\fP
[I]
Set resolver options.
@@ -4921,61 +5280,49 @@ if the
method is listed in the service switch entry for the
.q hosts
service.
-.ip SmtpGreetingMessage=\fImessage\fP
-[$e macro]
-The message printed when the SMTP server starts up.
-Defaults to
-.q "$j Sendmail $v ready at $b".
-.ip Timeout.\fItype\fP=\|\fItimeout\fP
-[r; subsumes old T option as well]
-Set timeout values.
-The actual timeout is indicated by the
-.i type .
-The recognized timeouts and their default values, and their
-minimum values specified in RFC 1123 section 5.3.2 are:
-.(b
-.ta \w'datafinal'u+3n
-initial wait for initial greeting message [5m, 5m]
-helo reply to HELO or EHLO command [5m, none]
-mail reply to MAIL command [10m, 5m]
-rcpt reply to RCPT command [1h, 5m]
-datainit reply to DATA command [5m, 2m]
-datablock data block read [1h, 3m]
-datafinal reply to final ``.'' in data [1h, 10m]
-rset reply to RSET command [5m, none]
-quit reply to QUIT command [2m, none]
-misc reply to NOOP and VERB commands [2m, none]
-ident IDENT protocol timeout [30s, none]
-fileopen\(dg timeout on opening .forward and :include: files [60s, none]
-command\(dg command read [1h, 5m]
-queuereturn\(dg how long until a message is returned [5d, 5d]
-queuewarn\(dg how long until a warning is sent [none, none]
-.)b
-All but those marked with a dagger (\(dg)
-apply to client SMTP.
-If the message is submitted using the
-.sm NOTIFY
+.ip RunAsUser=\fIuser\fP
+[no short name]
+The
+.i user
+parameter may be a user name
+(looked up in
+.i /etc/passwd )
+or a numeric user id;
+either form can have
+.q ":group"
+attached
+(where group can be numeric or symbolic).
+If set to a non-zero (non-root) value,
+.i sendmail
+will change to this user id shortly after startup\**.
+.(f
+\**When running as a daemon,
+it changes to this user after accepting a connection
+but before reading any
.sm SMTP
-extension,
-warning messages will only be sent if
-.sm NOTIFY=DELAY
-is specified.
-The queuereturn and queuewarn timeouts
-can be further qualified with a tag based on the Precedence: field
-in the message;
-they must be one of
-.q urgent
-(indicating a positive non-zero precedence)
-.q normal
-(indicating a zero precedence), or
-.q non-urgent
-(indicating negative precedences).
-For example, setting
-.q Timeout.queuewarn.urgent=1h
-sets the warning timeout for urgent messages only
-to one hour.
-The default if no precedence is indicated
-is to set the timeout for all precedences.
+commands.
+.)f
+This avoids a certain class of security problems.
+However, this means that all
+.q \&.forward
+and
+.q :include:
+files must be readable by the indicated
+.i user ,
+and on systems that don't support the saved uid bit properly,
+all files to be written must be writable by
+.i user
+and all programs will be executed by
+.i user .
+It is also incompatible with the
+.b SafeFileEnvironment
+option.
+In other words, it may not actually add much to security on an average system,
+and may in fact detract from security
+(because other file permissions must be loosened).
+However, it should be useful on firewalls and other
+places where users don't have accounts and the aliases file is
+well constrained.
.ip RecipientFactor=\fIfact\fP
[y]
The indicated
@@ -5004,6 +5351,29 @@ its priority will be decreased by the indicated value.
In most environments this should be positive,
since hosts that are down are all too often down for a long time.
Defaults to 90000.
+.ip SafeFileEnvironment=\fIdir\fP
+[no short name]
+If this option is set,
+.i sendmail
+will do a
+.i chroot (2)
+call into the indicated
+.i dir ectory
+before doing any file writes.
+If the file name specified by the user begins with
+.i dir ,
+that partial path name will be stripped off before writing,
+so (for example)
+if the SafeFileEnvironment variable is set to
+.q /safe
+then aliases of
+.q /safe/logs/file
+and
+.q /logs/file
+actually indicate the same file.
+Additionally, if this option is set,
+.i sendmail
+refuses to deliver to symbolic links.
.ip SaveFromLine
[f]
Save
@@ -5016,6 +5386,11 @@ and discarded.
[j]
If set, send error messages in MIME format
(see RFC1521 and RFC1344 for details).
+If disabled,
+.i sendmail
+will not return the DSN keyword in response to an EHLO
+and will not do Delivery Status Notification processing as described in
+RFC1891.
.ip ServiceSwitchFile=\fIfilename\fP
[no short name]
If your host operating system has a service switch abstraction
@@ -5055,6 +5430,43 @@ The default file is
[7]
Strip input to seven bits for compatibility with old systems.
This shouldn't be necessary.
+.ip SingleLineFromHeader
+[no short name]
+If set, From: lines that have embedded newlines are unwrapped
+onto one line.
+This is to get around a botch in Lotus Notes
+that apparently cannot understand legally wrapped RFC822 headers.
+.ip SingleThreadDelivery
+[no short name]
+If set, a client machine will never try to open two SMTP connections
+to a single server machine at the same time,
+even in different processes.
+That is, if another
+.i sendmail
+is already talking to some host a new
+.i sendmail
+will not open another connection.
+This property is of mixed value;
+although this reduces the load on the other machine,
+it can cause mail to be delayed
+(for example, if one
+.i sendmail
+is delivering a huge message, other
+.i sendmail s
+won't be able to send even small messages).
+Also, it requires another file descriptor
+(for the lock file)
+per connection, so you may have to reduce the
+.b ConnectionCacheSize
+option to avoid running out of per-process file descriptors.
+Requires the
+.b HostStatusDirectory
+option.
+.ip SmtpGreetingMessage=\fImessage\fP
+[$e macro]
+The message printed when the SMTP server starts up.
+Defaults to
+.q "$j Sendmail $v ready at $b".
.ip StatusFile=\fIfile\fP
[S]
Log summary statistics in the named
@@ -5083,6 +5495,57 @@ be set.
The file mode for queue files.
It is interpreted in octal by default.
Defaults to 0600.
+.ip Timeout.\fItype\fP=\|\fItimeout\fP
+[r; subsumes old T option as well]
+Set timeout values.
+The actual timeout is indicated by the
+.i type .
+The recognized timeouts and their default values, and their
+minimum values specified in RFC 1123 section 5.3.2 are:
+.(b
+.ta \w'datafinal'u+3n
+initial wait for initial greeting message [5m, 5m]
+helo reply to HELO or EHLO command [5m, none]
+mail reply to MAIL command [10m, 5m]
+rcpt reply to RCPT command [1h, 5m]
+datainit reply to DATA command [5m, 2m]
+datablock data block read [1h, 3m]
+datafinal reply to final ``.'' in data [1h, 10m]
+rset reply to RSET command [5m, none]
+quit reply to QUIT command [2m, none]
+misc reply to NOOP and VERB commands [2m, none]
+ident IDENT protocol timeout [30s, none]
+fileopen\(dg timeout on opening .forward and :include: files [60s, none]
+command\(dg command read [1h, 5m]
+queuereturn\(dg how long until a message is returned [5d, 5d]
+queuewarn\(dg how long until a warning is sent [none, none]
+hoststatus\(dg how long until host status is ``stale'' [30m, none]
+.)b
+All but those marked with a dagger (\(dg)
+apply to client SMTP.
+If the message is submitted using the
+.sm NOTIFY
+.sm SMTP
+extension,
+warning messages will only be sent if
+.sm NOTIFY=DELAY
+is specified.
+The queuereturn and queuewarn timeouts
+can be further qualified with a tag based on the Precedence: field
+in the message;
+they must be one of
+.q urgent
+(indicating a positive non-zero precedence)
+.q normal
+(indicating a zero precedence), or
+.q non-urgent
+(indicating negative precedences).
+For example, setting
+.q Timeout.queuewarn.urgent=1h
+sets the warning timeout for urgent messages only
+to one hour.
+The default if no precedence is indicated
+is to set the timeout for all precedences.
.ip TimeZoneSpec=\fItzinfo\fP
[t]
Set the local time zone info to
@@ -5128,6 +5591,15 @@ Defaults to
.q "From $g $d" .
Don't change this unless your system uses a different UNIX mailbox format
(very unlikely).
+.ip UnsafeGroupWrites
+[no short name]
+If set,
+:include: and .forward files that are group writable are considered
+.q unsafe ,
+that is,
+they cannot reference programs or write directly to files.
+World writable :include: and .forward files
+are always unsafe..
.ip UseErrorsTo
[l]
If there is an
@@ -5141,6 +5613,16 @@ This option is disrecommended and deprecated.
.ip UserDatabaseSpec=\fIudbspec\fP
[U]
The user database specification.
+.ip UserSubmission
+[no short name]
+This is an initial submission directly from a Mail User Agent.
+This can be set in the configuration file if you have
+MUAs that don't pass the
+.b \-U
+flag or use the
+XUSR
+ESMTP extension,
+but some relayed mail may get inappropriately rewritten if you do.
.ip Verbose
[v]
Run in verbose mode.
@@ -5395,16 +5877,20 @@ is specified, the
replaces the input.
Otherwise, the input is unchanged.
.pp
-During replacement of either a map value or default
-the string
+The
+.i arguments
+are passed to the map for arbitrary use.
+Most map classes can interpolate these arguments
+into their values using the syntax
.q %\fIn\fP
(where
.i n
is a digit)
-is replaced by the corresponding
+to indicate the corresponding
.i argument .
-Argument zero
-is always the database key.
+Argument
+.q %0
+indicates the database key.
For example, the rule
.(b
.ta 1.5i
@@ -5419,6 +5905,9 @@ The database might contain records like:
decvax %1@%0.DEC.COM
research %1@%0.ATT.COM
.)b
+Note that
+.i default
+clauses never do this mapping.
.pp
The built in map with both name and class
.q host
@@ -5476,6 +5965,16 @@ Hesiod lookups.
must be compiled with
.b HESIOD
defined.
+.ip ldapx
+LDAP X500 directory lookups.
+.i Sendmail
+must be compiled with
+.b LDAPMAP
+defined.
+The map supports most of the standard arguments
+and most of the command line arguments of the
+.i ldapsearch
+program.
.ip netinfo
NeXT NetInfo lookups.
.i Sendmail
@@ -5648,9 +6147,15 @@ and the default is still taken if the match fails.
.ip "\-k\fIkeycol\fP"
The key column name (for NIS+) or number
(for text lookups).
+For LDAP maps this is a filter string
+passed to printf with a %s where the string to be
+.q "mapped"
+is inserted.
.ip "\-v\fIvalcol\fP"
The value column name (for NIS+) or number
(for text lookups).
+For LDAP maps this is the name of the
+attribute to be returned.
.ip "\-z\fIdelim\fP"
The column delimiter (for text lookups).
It can be a single character or one of the special strings
@@ -5660,6 +6165,28 @@ or
to indicate newline or tab respectively.
If omitted entirely,
the column separator is any sequence of whitespace.
+.ip "\-t"
+Normally, when a map attempts to do a lookup
+and the server fails
+(e.g.,
+.i sendmail
+couldn't contact any name server;
+this is
+.i not
+the same as an entry not being found in the map),
+the message being processed is queued for future processing.
+The
+.b \-t
+flag turns off this behaviour,
+letting the temporary failure (server down)
+act as though it were a permanent failure (entry not found).
+It is particularly useful for DNS lookups,
+where someone else's misconfigured name server can cause problems
+on your machine.
+However, care must be taken to ensure that you don't bounce mail
+that would be resolved correctly if you tried again.
+A common strategy is to forward such mail
+to another, possibly better connected, mail server.
.ip "\-s\fIspacesub\fP
For the dequote map only,
the character to use to replace space characters
@@ -5924,6 +6451,10 @@ program used on YP masters.
Compile in support for NIS+.
.ip NETINFO
Compile in support for NetInfo (NeXT stations).
+.ip LDAPMAP
+Compile in support for LDAP X500 queries.
+Requires libldap and liblber
+from the Umich LDAP 3.2 or 3.3 release.
.ip HESIOD
Compile in support for Hesiod.
.ip _PATH_SENDMAILCF
@@ -6003,7 +6534,7 @@ line in sendmail.cf).
.ip "MAXUSERENVIRON [100]"
The maximum number of items in the user environment
that will be passed to subordinate mailers.
-.ip "MAXMXHOSTS [20]"
+.ip "MAXMXHOSTS [100]"
The maximum number of MX records we will accept for any single host.
.ip "MAXALIASDB [12]"
The maximum number of alias databases that can be open at any time.
@@ -6815,7 +7346,7 @@ for debugging.
.pp
The
.b \-O
-flag simplies setting long-form options.
+flag implies setting long-form options.
.sh 2 "Enhanced Command Line Flags"
.pp
The
@@ -6856,7 +7387,7 @@ Several new options have been added,
many to support new features,
others to allow tuning that was previously available
only by recompiling.
-They are described in detail in Section 5.1.5.
+They are described in detail in Section 5.6.
Briefly,
.nr ii 0.5i
.ip b
@@ -7153,7 +7684,8 @@ Operation modes are:
m Deliver mail (default)
s Speak SMTP on input side
a\(dg ``Arpanet'' mode (get envelope sender information from header)
-d Run as a daemon
+d Run as a daemon in background
+D Run as a daemon in foreground
t Run in test mode
v Just verify addresses, don't collect or deliver
i Initialize the alias database
@@ -7195,6 +7727,21 @@ MAXHOP
throws away the message with an error.
.ip \-n
Don't do aliasing or forwarding.
+.ip "\-N \fInotifications\fP"
+Tag all addresses being sent as wanting the indicated
+.i notifications ,
+which consists of the word
+.q NEVER
+or a comma-separated list of
+.q SUCCESS ,
+.q FAILURE ,
+and
+.q DELAY
+for successful delivery,
+failure,
+and a message that is stuck in a queue somewhere.
+The default is
+.q FAILURE,DELAY .
.ip "\-r\ \fIaddr\fP"
An obsolete form of
.b \-f .
@@ -7255,6 +7802,16 @@ to limit based on sender.
A particular queued job is accepted if one of the corresponding addresses
contains the indicated
.i string .
+.ip "\-R ret"
+What information you want returned if the message bounces;
+.i ret
+can be
+.q HDRS
+for headers only or
+.q FULL
+for headers plus body.
+This is a request only;
+the other end is not required to honor the parameter.
.ip \-t
Read the header for
.q To: ,
@@ -7267,6 +7824,15 @@ The
line will be deleted before sending.
Any addresses in the argument vector will be deleted
from the send list.
+.ip "\-U"
+Indicate that this is an initial User Agent submission.
+In future releases, sendmail may complain about syntactically invalid messages
+rather than fixing them when this flag is not set.
+.ip "\-V envid"
+The indicated
+.i envid
+is passed with the envelope of the message
+and returned if the message bounces.
.ip "\-X \fIlogfile\fP"
Log all traffic in and out of
.i sendmail
@@ -7561,9 +8127,9 @@ A transcript of the current session.
.\".sp
.\".sz 10
.\"Eric Allman
-.\"Britton-Lee, Inc.
+.\"InReference, Inc.
.\".sp
-.\"Version 8.70
+.\"Version 8.97
.\".ce 0
.bp 2
.rs
diff --git a/usr.sbin/sendmail/mail.local/mail.local.c b/usr.sbin/sendmail/mail.local/mail.local.c
index 1ee4466c36b5..860486726477 100644
--- a/usr.sbin/sendmail/mail.local/mail.local.c
+++ b/usr.sbin/sendmail/mail.local/mail.local.c
@@ -38,7 +38,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)mail.local.c 8.22 (Berkeley) 6/21/95";
+static char sccsid[] = "@(#)mail.local.c 8.30 (Berkeley) 10/9/96";
#endif /* not lint */
/*
@@ -63,10 +63,13 @@ static char sccsid[] = "@(#)mail.local.c 8.22 (Berkeley) 6/21/95";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sysexits.h>
#include <syslog.h>
#include <time.h>
#include <unistd.h>
+#ifdef EX_OK
+# undef EX_OK /* unistd.h may have another use for this */
+#endif
+#include <sysexits.h>
#include <ctype.h>
#if __STDC__
@@ -75,6 +78,46 @@ static char sccsid[] = "@(#)mail.local.c 8.22 (Berkeley) 6/21/95";
#include <varargs.h>
#endif
+#if (defined(sun) && defined(__svr4__)) || defined(__SVR4)
+# define USE_LOCKF 1
+# define USE_SETEUID 1
+# define _PATH_MAILDIR "/var/mail"
+#endif
+
+#if defined(_AIX)
+# define USE_LOCKF 1
+# define USE_VSYSLOG 0
+#endif
+
+#if defined(ultrix)
+# define USE_VSYSLOG 0
+#endif
+
+#if defined(__osf__)
+# define USE_VSYSLOG 0
+#endif
+
+#if defined(NeXT)
+# include <libc.h>
+# define _PATH_MAILDIR "/usr/spool/mail"
+# define __dead /* empty */
+# define S_IRUSR S_IREAD
+# define S_IWUSR S_IWRITE
+#endif
+
+/*
+ * If you don't have flock, you could try using lockf instead.
+ */
+
+#ifdef USE_LOCKF
+# define flock(a, b) lockf(a, b, 0)
+# define LOCK_EX F_LOCK
+#endif
+
+#ifndef USE_VSYSLOG
+# define USE_VSYSLOG 1
+#endif
+
#ifndef LOCK_EX
# include <sys/file.h>
#endif
@@ -101,8 +144,12 @@ static char sccsid[] = "@(#)mail.local.c 8.22 (Berkeley) 6/21/95";
#ifndef BSD4_4
# define _BSD_VA_LIST_ va_list
+#endif
+
+#if !defined(BSD4_4) && !defined(linux)
extern char *strerror __P((int));
extern int snprintf __P((char *, int, const char *, ...));
+extern FILE *fdopen __P((int, const char *));
#endif
/*
@@ -135,6 +182,8 @@ int store __P((char *));
void usage __P((void));
void vwarn __P((const char *, _BSD_VA_LIST_));
void warn __P((const char *, ...));
+void lockmbox __P((char *));
+void unlockmbox __P((void));
int
main(argc, argv)
@@ -341,15 +390,16 @@ tryagain:
warn("%s: irregular file", path);
goto err0;
} else if (sb.st_uid != pw->pw_uid) {
+ eval = EX_CANTCREAT;
warn("%s: wrong ownership (%d)", path, sb.st_uid);
- unlockmbox();
- return;
+ goto err0;
} else {
mbfd = open(path, O_APPEND|O_WRONLY, 0);
if (mbfd != -1 &&
(fstat(mbfd, &fsb) || fsb.st_nlink != 1 ||
!S_ISREG(fsb.st_mode) || sb.st_dev != fsb.st_dev ||
sb.st_ino != fsb.st_ino || sb.st_uid != fsb.st_uid)) {
+ eval = EX_CANTCREAT;
warn("%s: file changed after open", path);
goto err1;
}
@@ -449,6 +499,7 @@ err0: unlockmbox();
char lockname[MAXPATHLEN];
int locked = 0;
+void
lockmbox(path)
char *path;
{
@@ -481,6 +532,7 @@ lockmbox(path)
}
}
+void
unlockmbox()
{
if (!locked)
@@ -587,7 +639,7 @@ vwarn(fmt, ap)
(void)vfprintf(stderr, fmt, ap);
(void)fprintf(stderr, "\n");
-#if !defined(ultrix) && !defined(__osf__)
+#if USE_VSYSLOG
/* Log the message to syslog. */
vsyslog(LOG_ERR, fmt, ap);
#else
@@ -693,9 +745,8 @@ e_to_sys(num)
}
}
-#ifndef BSD4_4
+#if !defined(BSD4_4) && !defined(__osf__)
-# ifndef __osf__
char *
strerror(eno)
int eno;
@@ -709,8 +760,11 @@ strerror(eno)
(void) sprintf(ebuf, "Error %d", eno);
return ebuf;
}
+
# endif
+#if !defined(BSD4_4) && !defined(linux)
+
# if __STDC__
snprintf(char *buf, int bufsiz, const char *fmt, ...)
# else
diff --git a/usr.sbin/sendmail/praliases/Makefile b/usr.sbin/sendmail/praliases/Makefile
index 498e1710bf87..4285a5b2c315 100644
--- a/usr.sbin/sendmail/praliases/Makefile
+++ b/usr.sbin/sendmail/praliases/Makefile
@@ -1,9 +1,9 @@
-# @(#)Makefile 8.1 (Berkeley) 6/7/93
+# @(#)Makefile 8.2 (Berkeley) 9/21/96
PROG= praliases
+MAN8= praliases.0
CFLAGS+=-I${.CURDIR}/../src
DPADD= ${LIBDBM}
-NOMAN= noman
.include "../../Makefile.inc"
.include <bsd.prog.mk>
diff --git a/usr.sbin/sendmail/praliases/praliases.8 b/usr.sbin/sendmail/praliases/praliases.8
new file mode 100644
index 000000000000..46082ba09e06
--- /dev/null
+++ b/usr.sbin/sendmail/praliases/praliases.8
@@ -0,0 +1,41 @@
+.\" @(#)praliases.8 8.1 (Berkeley) 9/21/96
+.Dd April 25, 1996
+.Dt PRALIASES 1
+.Os BSD 3
+.Sh NAME
+.Nm praliases
+.Nd display system mail aliases
+.Sh SYNOPSIS
+.Nm praliases
+.Op Fl f Ar file
+.Sh DESCRIPTION
+The
+.Nm praliases
+utility displays the current system aliases,
+one per line, in no particular order.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl f
+Read the specified file instead of the default
+.Nm sendmail
+system aliases file.
+.El
+.Pp
+The
+.Nm praliases
+utility exits 0 on success, and >0 if an error occurs.
+.Sh FILES
+.Bl -tag -width /var/log/sendmail.stXX -compact
+.It Pa /etc/aliases
+The default
+.Nm sendmail
+system aliases file.
+.It Pa /etc/aliases.db
+The database version of the
+.Pa /etc/aliases
+file.
+.El
+.Sh SEE ALSO
+.Xr mailq 1 ,
+.Xr sendmail 8
diff --git a/usr.sbin/sendmail/praliases/praliases.c b/usr.sbin/sendmail/praliases/praliases.c
index 2c22279205eb..2c1cc0a07dea 100644
--- a/usr.sbin/sendmail/praliases/praliases.c
+++ b/usr.sbin/sendmail/praliases/praliases.c
@@ -39,10 +39,11 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)praliases.c 8.3 (Berkeley) 3/6/94";
+static char sccsid[] = "@(#)praliases.c 8.4 (Berkeley) 9/25/96";
#endif /* not lint */
#include <ndbm.h>
+#define NOT_SENDMAIL
#include <sendmail.h>
#ifdef NEWDB
#include <db.h>
diff --git a/usr.sbin/sendmail/src/READ_ME b/usr.sbin/sendmail/src/READ_ME
index 264b2ebaac99..779f8281c615 100644
--- a/usr.sbin/sendmail/src/READ_ME
+++ b/usr.sbin/sendmail/src/READ_ME
@@ -1,4 +1,4 @@
-# Copyright (c) 1983, 1995 Eric P. Allman
+# Copyright (c) 1983, 1995, 1996 Eric P. Allman
# Copyright (c) 1988 The Regents of the University of California.
# All rights reserved.
#
@@ -30,7 +30,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# @(#)READ_ME 8.113 (Berkeley) 11/29/95
+# @(#)READ_ME 8.125 (Berkeley) 10/18/96
#
This directory contains the source files for sendmail.
@@ -144,46 +144,56 @@ There are several database formats that can be used for the alias files
and for general maps. When used for alias files they interact in an
attempt to be back compatible.
-The three options are NEWDB (the new Berkeley DB package), NDBM (the
-older DBM implementation -- the very old V7 implementation is no
-longer supported), and NIS (Network Information Services). Used alone
-these just include the support they indicate. [If you are using NEWDB,
-get the latest version from FTP.CS.Berkeley.EDU in /ucb/4bsd/db.tar.Z
-(or db.tar.gz). DO NOT use the version from the Net2 distribution!
-However, if you are on BSD/386 or 386BSD-based systems, use the one
-that already exists on your system. You may need to #define OLD_NEWDB
-1 to do this.]
-
-[NOTE WELL: it is CRITICAL that you remove ndbm.o from libdb.a and
-ndbm.h from the appropriate include directories if you want to get
-ndbm support. These files OVERRIDE calls to ndbm routines -- in
-particular, if you leave ndbm.h in, you can find yourself using
-the new db package even if you don't define NEWDB.]
+The options are:
+
+NEWDB The new Berkeley DB package. Some systems (e.g., BSD/OS and
+ Digital UNIX 4.0) have this package pre-installed. If your
+ system does not have NEWDB installed, get the latest version
+ from FTP.CS.Berkeley.EDU in /ucb/4bsd/db.tar.gz (or db.tar.Z).
+ DO NOT use the version from the Net2 distribution. If you are
+ still running BSD/386 1.x, you will also need to define
+ OLD_NEWDB.
+NDBM The older NDBM implementation -- the very old V7 DBM
+ implementation is no longer supported.
+NIS Network Information Services. To use this you must have
+ NIS support on your system.
+NISPLUS NIS+ (the revised NIS released with Solaris 2). You must
+ have NIS+ support on your system to use this flag.
+HESIOD Support for Hesiod (from the DEC/Athena distribution). You
+ must already have Hesiod support on your system for this to
+ 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.
+
+>>> NOTE WELL for NEWDB support: it is CRITICAL that you remove ndbm.o
+>>> from libdb.a and ndbm.h from the appropriate include directories if
+>>> you want to get ndbm support. If you don't delete these, there is
+>>> absolutely no point to including -DNDBM, since it will just get you
+>>> another (inferior) API to the same format database. These files
+>>> OVERRIDE calls to ndbm routines -- in particular, if you leave ndbm.h
+>>> in, you can find yourself using the new db package even if you don't
+>>> define NEWDB.
If NEWDB and NDBM are defined (but not NIS), then sendmail will read
NDBM format alias files, but the next time a newaliases is run the
format will be converted to NEWDB; that format will be used forever
-more. This is intended as a transition feature. [Note however that
-the NEWDB library also catches and maps NDBM calls; you will have to
-back out this feature to get this to work. See ``Quirks'' section
-below for details.]
+more. This is intended as a transition feature.
-If all three are defined and the name of the file includes the string
-"/yp/", sendmail will rebuild BOTH the NEWDB and NDBM format alias
-files. However, it will only read the NEWDB file; the NDBM format file
-is used only by the NIS subsystem.
+If NEWDB, NDBM, and NIS are all defined and the name of the file includes
+the string "/yp/", sendmail will rebuild BOTH the NEWDB and NDBM format
+alias files. However, it will only read the NEWDB file; the NDBM format
+file is used only by the NIS subsystem. This is needed because the NIS
+maps on an NIS server are built directly from the NDBM files.
If NDBM and NIS are defined (regardless of the definition of NEWDB),
and the filename includes the string "/yp/", sendmail adds the special
tokens "YP_LAST_MODIFIED" and "YP_MASTER_NAME", both of which are
required if the NDBM file is to be used as an NIS map.
-There is also preliminary support for NIS+ (-DNISPLUS), Hesiod
-(-DHESIOD), and NetInfo (-DNETINFO). These have not been well
-tested.
-
-All of -DNEWDB, -DNDBM, -DNIS, -DNISPLUS, -DHESIOD, and -DNETINFO are
-normally defined in the DBMDEF line in the Makefile.
+All of these flags are normally defined in the DBMDEF line in the
+Makefile.
If you define NEWDB or HESIOD you get the User Database (USERDB)
automatically. Generally you do want to have NEWDB for it to do
@@ -191,6 +201,11 @@ anything interesting. See above for getting the Berkeley "db"
package (i.e., NEWDB). There is no separate "user database"
package -- don't bother searching for it on the net.
+Hesiod and LDAP require libraries that may not be installed with your
+system. These are outside of my ability to provide support. See the
+"Quirks" section for more information.
+
+
+---------------+
| COMPILE FLAGS |
@@ -462,7 +477,7 @@ IP_SRCROUTE Define this to 1 to get IP source routing information
it won't compile properly (that is, no support for fetching
IP_OPTIONs), or it compiles but source-routed TCP connections
either refuse to open or open and hang for no apparent reason.
- Ultrix and AIX are known to fail this way.
+ Ultrix and AIX3 are known to fail this way.
LOG Set this to get syslog(3) support. Defined by default
in conf.h. You want this if at all possible.
NETINET Set this to get TCP/IP support. Defined by default
@@ -500,6 +515,19 @@ HES_GETMAILHOST Define this to 1 if you are using Hesiod with the
Hesiod distribution, but not with the DEC Hesiod distribution.
XDEBUG Do additional internal checking. These don't cost too
much; you might as well leave this on.
+TCPWRAPPERS Turns on support for the TCP wrappers library (-lwrap).
+ This library is available on ftp.win.tue.nl in /pub/security;
+ grab tcp_wrappers_<VER>.tar.gz (where <VER> is the highest
+ numbered version).
+SECUREWARE Enable calls to the SecureWare luid enabling/changing routines.
+ SecureWare is a C2 security package added to several UNIX's
+ (notably ConvexOS) to get a C2 Secure system. This
+ option causes mail delivery to be done with the luid of the
+ recipient.
+SHARE_V1 Support for the fair share scheduler, version 1. Setting to
+ 1 causes final delivery to be done using the recipients
+ resource limitations. So far as I know, this is only
+ supported on ConvexOS.
+---------------------+
@@ -515,7 +543,10 @@ dn_skipname.
Some people have had a problem with BIND 4.9; it uses some routines
that it expects to be externally defined such as strerror(). It may
-help to link with "-l44bsd" to solve this problem.
+help to link with "-l44bsd" to solve this problem. This has apparently
+been fixed in later versions of BIND, starting around 4.9.3. In other
+words, if you use 4.9.0 through 4.9.2, you need -l44bsd; for earlier or
+later versions, you do not.
!PLEASE! be sure to link with the same version of the resolver as
the header files you used -- some people have used the 4.9 headers
@@ -587,6 +618,13 @@ Configuration file location
vendor location rather than changing the location in the sendmail
binary.
+ld: fatal: library -l44bsd: not found
+ Most of the Makefiles include -l44bsd in the LIBS= definition;
+ this is because several versions of BIND (4.9.0, 4.9.1, 4.9.2)
+ require this library. If you are running one of these versions,
+ install this library. Otherwise, just delete "-l44bsd" from the
+ LIBS= line in the Makefile.
+
SunOS 4.x (Solaris 1.x)
You may have to use -lresolv on SunOS. However, beware that
this links in a new version of gethostbyname that does not
@@ -631,17 +669,18 @@ SunOS 4.0.2 (Sun 386i)
(and change the Makefile to use this library).
Note that the sendmail.cf and aliases files are found in /etc.
-SunOS 4.1.3_U1
- Sendmail causes crashes on SunOS 4.1.3_U1. According to Sun
- bug number 1077939:
+SunOS 4.1.3, 4.1.3_U1
+ Sendmail causes crashes on SunOS 4.1.3 and 4.1.3_U1. According
+ to Sun bug number 1077939:
If an application does a getsockopt() on a SOCK_STREAM (TCP) socket
after the other side of the connection has sent a TCP RESET for
the stream, the kernel gets a Bus Trap in the tcp_ctloutput() or
ip_ctloutput() routine.
- This is fixed in patch 101790-01 (SunOS 4.1.3_U1: TCP socket and
- reset problems).
+ For 4.1.3, this is fixed in patch 100584-08, available on the
+ Sunsolve 2.7.1 or later CDs. For 4.1.3_U1, this is fixed in patch
+ 101790-01 (SunOS 4.1.3_U1: TCP socket and reset problems).
Solaris 2.x (SunOS 5.x)
To compile for Solaris, be sure you use -DSOLARIS.
@@ -751,6 +790,10 @@ OSF/1
Also, the enclosed makefile removed /usr/sbin/smtpd; if you need
it, just create the link to the sendmail binary.
+ On DEC OSF/1 3.2 or earlier, the MatchGECOS option doesn't work
+ properly due to a bug in the getpw* routines. If you want to use
+ this, use -DDEC_OSF_BROKEN_GETPWENT=1. The problem is fixed in 3.2C.
+
IRIX
The header files on SGI IRIX are completely prototyped, and as
a result you can sometimes get some warning messages during
@@ -931,7 +974,22 @@ Linux
of libc between 4.4.4 and 4.7.0 (snprintf improves security, so
you want to use this if at all possible).
-AIX
+ NOTE ON LINUX & BIND: By default, the Makefiles for linux include
+ header files in /usr/local/include and libraries in /usr/local/lib.
+ If you've installed BIND on your system, the header files typically
+ end up in the search path and you need to add "-lresolv" to the
+ LIBS line in your Makefile. Really old versions may need to include
+ "-l44bsd" as well (particularly if the link phase complains about
+ missing strcasecmp, strncasecmp or strpbrk). Complaints about an
+ undefined reference to `__dn_skipname' in domain.o are a sure sign
+ that you need to add -lresolv to LIBS. Newer versions of linux
+ are basically threaded BIND, so you may or may not see complaints
+ if you accidentally mix BIND headers/libraries with virginal libc.
+ If you have BIND headers in /usr/local/include (resolv.h, etc)
+ you *should* be adding -lresolv to LIBS. Data structures may change
+ and you'd be asking for a core dump.
+
+AIX 3.x
This version of sendmail does not support MB, MG, and MR resource
records, which are supported by AIX sendmail.
@@ -940,6 +998,56 @@ AIX
necessary to replace the resolver, which will simplify installation.
A new BIND resolver can be found at http://www.isc.org/isc/.
+AIX 3.1.x
+ The supplied load average code only works correctly for AIX 3.2.x.
+ For 3.1, use -DLA_TYPE=LA_SUBR and get the latest ``monitor''
+ package by Jussi Maki <jmaki@hut.fi> from ftp.funet.fi in the
+ directory pub/unix/AIX/rs6000/monitor-1.12.tar.Z; use the loadavgd
+ daemon, and the getloadavg subroutine supplied with that package.
+ If you don't care about load average throttling, just turn off
+ load average checking using -DLA_TYPE=LA_ZERO.
+
+AIX 2.2.1
+ Date: Mon Dec 4 14:14:56 CST 1995
+ From: Mark Whetzel <markw@antimatr.houston.tx.us>
+ Subject: Porting sendmail 8.7.2 to AIX V2 on the RT.
+
+ This version of sendmail does not support MB, MG, and MR resource
+ records, which are supported by AIX sendmail.
+
+ AIX V2 on the RT does not have 'paths.h'. Create a null
+ file in the 'obj' directory to remove this compile error.
+
+ A patch file is needed to get the BSD 'db' library to compile
+ for AIX/RT. I have sent the necessary updates to the author,
+ but they may not be immediately available.
+
+ The original AIX/RT resolver libraries are very old, and you
+ should get the latest BIND to replace it. The 4.8.3 version
+ has been tested, but 4.9.x is out and should work.
+
+ To make the load average code work correctly requires an
+ external routine, as the kernel does not maintain system
+ load averages, similar to AIX V3.1.x. A reverse port of the
+ older 1.05 'monitor' load average daemon code written by
+ Jussi Maki that will work on AIX V2 for the RT is available
+ by E-mail to Mark Whetzel <markw@antimatr.houston.tx.us>.
+ That code depends on an external daemon to collect system
+ load information, and the external routine 'getloadavg',
+ that will return that information. The 'LA_SUBR' define
+ will handle this for AIX V2 on the RT.
+
+ Note: You will have to change the Makefile.AIX.2 to correctly
+ point to the locatons of the updated BIND source tree and
+ the location of the 'newdb' tree and library location.
+ You will also have to change the Makefile.AIX.2 to know
+ about the location of the 'getloadavg' routine if you use
+ the LA_SUBR define.
+
+
+ Manual pages will format correctly if given the mandoc macros
+ and used with nroff. I have not tried groff.
+
RISC/os
RISC/os from MIPS is a merged AT&T/Berkeley system. When you
compile on that platform you will get duplicate definitions
@@ -1081,7 +1189,7 @@ Listproc 6.0c
From: alansz@mellers1.psych.berkeley.edu (Alan Schwartz)
Subject: Listproc 6.0c + Sendmail 8.7 [Helpful hint]
- Just upgraded to sendmail 8.7, and discovered that listproc 6.0c
+ Just upgraded to sendmail 8.7, and discovered that listproc 6.0c
breaks, because it, by default, sends a blank "HELO" rather than
a "HELO hostname" when using the 'system' or 'telnet' mailmethod.
@@ -1089,6 +1197,56 @@ Listproc 6.0c
cause it to use "HELO hostname" (which Z-mail apparently requires
as well. :)
+LDAP
+ LDAP was provided by Booker Bense <bbense@networking.stanford.edu> of
+ Stanford University. From Booker:
+
+ - The patch attached to this message implements an Ldap map class.
+ Currently we are using this at stanford to support campus-wide
+ email addressing. This project is discussed at
+ http://www-leland.stanford.edu/group/networking/project/sunetid.html
+
+ - Currently we are using the ldap map as follows:
+
+ Kluser ldapx
+ -h"localhost borax.stanford.edu borate.stanford.edu boron.stanford.edu"
+ -k"mailacceptinggeneralid=%s" -v maildrop
+
+ and in Rule set S5
+
+ # Now attempt to lookup in luser (ldap map)
+ R< $L > $+ $: < $L > $( luser $1 $)
+ R< $* > $+ @ $+ $: < $3 > $2 Rewrite if forward
+
+ - The map definition supports most of the standard Map args plus most
+ of the command line options of ldapsearch. The software is currently
+ limited to only accepting the first entry returned. It expects that
+ the map defines an ldap filter that returns at most 1 valid entry.
+ It requires the ldap and lber libraries from the Umich Ldap3.2
+ release.
+
+ - KNOWN BUGS: It does not work under Digital Unix 3.2c, with gcc and
+ ldap3.2 or ldap3.3. It dumps core after attempting to take strlen
+ of a garbage string pointer in the lber libraries routine
+ ber_printf.
+
+ The string pointer in question is set to 0x50000000, when the
+ program crashes. If anyone recognizes where this magic number comes
+ from that would be really helpful.
+
+ I've tested the software on Solaris.2.4 with gcc and on NeXTStep3.2
+ and it runs without problems. If you have any questions, please
+ send them along.
+
+TCP Wrappers
+ If you are using -DTCPWRAPPERS to get TCP Wrappers support, you will
+ also need to install libwrap.a (you can get it from ftp.win.tue.nl)
+ and modify the Makefile to include -lwrap in the LIBS line.
+
+ If you have alternate MX sites for your site, be sure that all of
+ your MX sites reject the same set of hosts. If not, a bad guy whom
+ you reject will connect to your site, fail, and move on to the next
+ MX site, which will accept the mail for your and forward it on to you.
+--------------+
@@ -1190,4 +1348,4 @@ version.c The version number and information about this
Eric Allman
-(Version 8.113, last update 11/29/95 11:05:14)
+(Version 8.125, last update 10/18/96 07:32:40)
diff --git a/usr.sbin/sendmail/src/TRACEFLAGS b/usr.sbin/sendmail/src/TRACEFLAGS
index f2499aac0913..a5b25656e76a 100644
--- a/usr.sbin/sendmail/src/TRACEFLAGS
+++ b/usr.sbin/sendmail/src/TRACEFLAGS
@@ -62,9 +62,11 @@
53 util.c xfclose
54 err.c putoutmsg
55 conf.c lockfile
-59 Extended Load Average implementation from Christophe Wolfhugel
+56 mci.c persistent host status
+57 util.c snprintf
60 map.c
61 conf.c sm_gethostbyname
+62 multiple file descriptor checking
80 content length
81 sun remote mode
91 mci.c syslogging of MCI cache information
diff --git a/usr.sbin/sendmail/src/alias.c b/usr.sbin/sendmail/src/alias.c
index 62b6af96de4f..95de1ee8ff6f 100644
--- a/usr.sbin/sendmail/src/alias.c
+++ b/usr.sbin/sendmail/src/alias.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1983, 1995 Eric P. Allman
+ * Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -35,7 +35,7 @@
# include "sendmail.h"
#ifndef lint
-static char sccsid[] = "@(#)alias.c 8.52.1.3 (Berkeley) 9/16/96";
+static char sccsid[] = "@(#)alias.c 8.66 (Berkeley) 9/20/96";
#endif /* not lint */
@@ -152,8 +152,6 @@ alias(a, sendq, aliaslevel, e)
(void) strcat(obuf, "owner");
else
(void) strcat(obuf, a->q_user);
- if (!bitnset(M_USR_UPPER, a->q_mailer->m_flags))
- makelower(obuf);
owner = aliaslookup(obuf, &stat, e);
if (owner == NULL)
return;
@@ -207,6 +205,11 @@ aliaslookup(name, pstat, e)
}
if (!bitset(MF_OPEN, map->map_mflags))
return NULL;
+
+ /* special case POstMastER -- always use lower case */
+ if (strcasecmp(name, "postmaster") == 0)
+ name = "postmaster";
+
return (*map->map_class->map_lookup)(map, name, NULL, pstat);
}
/*
@@ -292,8 +295,7 @@ setalias(spec)
s = stab(class, ST_MAPCLASS, ST_FIND);
if (s == NULL)
{
- if (tTd(27, 1))
- printf("Unknown alias class %s\n", class);
+ syserr("setalias: unknown alias class %s", class);
}
else if (!bitset(MCF_ALIASOK, s->s_mapclass.map_cflags))
{
@@ -494,7 +496,7 @@ rebuildaliases(map, automatic)
!lockfile(fileno(af), map->map_file, NULL, LOCK_EX|LOCK_NB))
{
/* yes, they are -- wait until done */
- message("Alias file %s is already being rebuilt",
+ message("Alias file %s is locked (maybe being rebuilt)",
map->map_file);
if (OpMode != MD_INITALIAS)
{
@@ -710,10 +712,12 @@ readaliases(map, af, announcestats, logstats)
}
/*
- ** Insert alias into symbol table or DBM file
+ ** Insert alias into symbol table or database file.
+ **
+ ** Special case pOStmaStER -- always make it lower case.
*/
- if (!bitnset(M_USR_UPPER, al.q_mailer->m_flags))
+ if (strcasecmp(al.q_user, "postmaster") == 0)
makelower(al.q_user);
lhssize = strlen(al.q_user);
@@ -776,6 +780,7 @@ forward(user, sendq, aliaslevel, e)
{
char *pp;
char *ep;
+ bool got_transient;
if (tTd(27, 1))
printf("forward(%s)\n", user->q_paddr);
@@ -786,7 +791,7 @@ forward(user, sendq, aliaslevel, e)
if (user->q_home == NULL)
{
syserr("554 forward: no home");
- user->q_home = "/nosuchdirectory";
+ user->q_home = "/no/such/directory";
}
/* good address -- look for .forward file in home */
@@ -796,11 +801,11 @@ forward(user, sendq, aliaslevel, e)
if (ForwardPath == NULL)
ForwardPath = newstr("\201z/.forward");
+ got_transient = FALSE;
for (pp = ForwardPath; pp != NULL; pp = ep)
{
int err;
char buf[MAXPATHLEN+1];
- extern int include();
ep = strchr(pp, ':');
if (ep != NULL)
@@ -808,6 +813,8 @@ forward(user, sendq, aliaslevel, e)
expand(pp, buf, sizeof buf, e);
if (ep != NULL)
*ep++ = ':';
+ if (buf[0] == '\0')
+ continue;
if (tTd(27, 3))
printf("forward: trying %s\n", buf);
@@ -816,7 +823,8 @@ forward(user, sendq, aliaslevel, e)
break;
else if (transienterror(err))
{
- /* we have to suspend this message */
+ /* we may have to suspend this message */
+ got_transient = TRUE;
if (tTd(27, 2))
printf("forward: transient error on %s\n", buf);
#ifdef LOG
@@ -825,9 +833,18 @@ forward(user, sendq, aliaslevel, e)
e->e_id == NULL ? "NOQUEUE" : e->e_id,
buf, errstring(err));
#endif
- message("%s: %s: message queued", buf, errstring(err));
- user->q_flags |= QQUEUEUP;
- return;
}
}
+ if (pp == NULL && got_transient)
+ {
+ /*
+ ** There was no successful .forward open and at least one
+ ** transient open. We have to defer this address for
+ ** further delivery.
+ */
+
+ message("transient .forward open error: message queued");
+ user->q_flags |= QQUEUEUP;
+ return;
+ }
}
diff --git a/usr.sbin/sendmail/src/arpadate.c b/usr.sbin/sendmail/src/arpadate.c
index b207654f3130..418fd262e555 100644
--- a/usr.sbin/sendmail/src/arpadate.c
+++ b/usr.sbin/sendmail/src/arpadate.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1983, 1995 Eric P. Allman
+ * Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)arpadate.c 8.4.1.1 (Berkeley) 9/16/96";
+static char sccsid[] = "@(#)arpadate.c 8.6 (Berkeley) 9/16/96";
#endif /* not lint */
# include "sendmail.h"
diff --git a/usr.sbin/sendmail/src/clock.c b/usr.sbin/sendmail/src/clock.c
index 1490137170e2..39862f1d9e19 100644
--- a/usr.sbin/sendmail/src/clock.c
+++ b/usr.sbin/sendmail/src/clock.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1983, 1995 Eric P. Allman
+ * Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)clock.c 8.12 (Berkeley) 5/23/95";
+static char sccsid[] = "@(#)clock.c 8.13 (Berkeley) 2/21/96";
#endif /* not lint */
# include "sendmail.h"
diff --git a/usr.sbin/sendmail/src/convtime.c b/usr.sbin/sendmail/src/convtime.c
index adc38f73ed5f..807ae6c64dda 100644
--- a/usr.sbin/sendmail/src/convtime.c
+++ b/usr.sbin/sendmail/src/convtime.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1983, 1995 Eric P. Allman
+ * Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)convtime.c 8.4.1.1 (Berkeley) 9/16/96";
+static char sccsid[] = "@(#)convtime.c 8.7 (Berkeley) 9/15/96";
#endif /* not lint */
# include "sendmail.h"
diff --git a/usr.sbin/sendmail/src/envelope.c b/usr.sbin/sendmail/src/envelope.c
index a22f73caa853..66b97735e5a2 100644
--- a/usr.sbin/sendmail/src/envelope.c
+++ b/usr.sbin/sendmail/src/envelope.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1983, 1995 Eric P. Allman
+ * Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)envelope.c 8.76.1.2 (Berkeley) 9/16/96";
+static char sccsid[] = "@(#)envelope.c 8.93 (Berkeley) 9/26/96";
#endif /* not lint */
#include "sendmail.h"
@@ -82,6 +82,7 @@ newenvelope(e, parent)
**
** Parameters:
** e -- the envelope to deallocate.
+** fulldrop -- if set, do return receipts.
**
** Returns:
** none.
@@ -92,11 +93,14 @@ newenvelope(e, parent)
*/
void
-dropenvelope(e)
+dropenvelope(e, fulldrop)
register ENVELOPE *e;
+ bool fulldrop;
{
bool queueit = FALSE;
+ bool message_timeout = FALSE;
bool failure_return = FALSE;
+ bool delay_return = FALSE;
bool success_return = FALSE;
register ADDRESS *q;
char *id = e->e_id;
@@ -143,6 +147,9 @@ dropenvelope(e)
** Extract state information from dregs of send list.
*/
+ if (curtime() > e->e_ctime + TimeOuts.to_q_return[e->e_timeoutclass])
+ message_timeout = TRUE;
+
e->e_flags &= ~EF_QUEUERUN;
for (q = e->e_sendqueue; q != NULL; q = q->q_next)
{
@@ -151,8 +158,9 @@ dropenvelope(e)
queueit = TRUE;
/* see if a notification is needed */
- if (bitset(QBADADDR, q->q_flags) &&
- bitset(QPINGONFAILURE, q->q_flags))
+ if (bitset(QPINGONFAILURE, q->q_flags) &&
+ ((message_timeout && bitset(QQUEUEUP, q->q_flags)) ||
+ bitset(QBADADDR, q->q_flags)))
{
failure_return = TRUE;
if (q->q_owner == NULL && !emptyaddr(&e->e_from))
@@ -177,16 +185,19 @@ dropenvelope(e)
if (!queueit)
/* nothing to do */ ;
- else if (curtime() > e->e_ctime + TimeOuts.to_q_return[e->e_timeoutclass])
+ else if (message_timeout)
{
- (void) snprintf(buf, sizeof buf, "Cannot send message for %s",
- pintvl(TimeOuts.to_q_return[e->e_timeoutclass], FALSE));
- if (e->e_message != NULL)
- free(e->e_message);
- e->e_message = newstr(buf);
- message(buf);
- e->e_flags |= EF_CLRQUEUE;
- failure_return = TRUE;
+ if (failure_return)
+ {
+ (void) snprintf(buf, sizeof buf,
+ "Cannot send message within %s",
+ pintvl(TimeOuts.to_q_return[e->e_timeoutclass], FALSE));
+ if (e->e_message != NULL)
+ free(e->e_message);
+ e->e_message = newstr(buf);
+ message(buf);
+ e->e_flags |= EF_CLRQUEUE;
+ }
fprintf(e->e_xfp, "Message could not be delivered for %s\n",
pintvl(TimeOuts.to_q_return[e->e_timeoutclass], FALSE));
fprintf(e->e_xfp, "Message will be deleted from queue\n");
@@ -203,19 +214,7 @@ dropenvelope(e)
else if (TimeOuts.to_q_warning[e->e_timeoutclass] > 0 &&
curtime() > e->e_ctime + TimeOuts.to_q_warning[e->e_timeoutclass])
{
- bool delay_return = FALSE;
-
- for (q = e->e_sendqueue; q != NULL; q = q->q_next)
- {
- if (bitset(QQUEUEUP, q->q_flags) &&
- bitset(QPINGONDELAY, q->q_flags))
- {
- q->q_flags |= QDELAYED;
- delay_return = TRUE;
- }
- }
- if (delay_return &&
- !bitset(EF_WARNING|EF_RESPONSE, e->e_flags) &&
+ if (!bitset(EF_WARNING|EF_RESPONSE, e->e_flags) &&
e->e_class >= 0 &&
e->e_from.q_paddr != NULL &&
strcmp(e->e_from.q_paddr, "<>") != 0 &&
@@ -223,6 +222,18 @@ dropenvelope(e)
(strlen(e->e_from.q_paddr) <= (SIZE_T) 8 ||
strcasecmp(&e->e_from.q_paddr[strlen(e->e_from.q_paddr) - 8], "-request") != 0))
{
+ for (q = e->e_sendqueue; q != NULL; q = q->q_next)
+ {
+ if (bitset(QQUEUEUP, q->q_flags) &&
+ bitset(QPINGONDELAY, q->q_flags))
+ {
+ q->q_flags |= QDELAYED;
+ delay_return = TRUE;
+ }
+ }
+ }
+ if (delay_return)
+ {
(void) snprintf(buf, sizeof buf,
"Warning: could not send message for past %s",
pintvl(TimeOuts.to_q_warning[e->e_timeoutclass], FALSE));
@@ -231,7 +242,6 @@ dropenvelope(e)
e->e_message = newstr(buf);
message(buf);
e->e_flags |= EF_WARNING;
- failure_return = TRUE;
}
fprintf(e->e_xfp,
"Warning: message still undelivered after %s\n",
@@ -241,8 +251,8 @@ dropenvelope(e)
}
if (tTd(50, 2))
- printf("failure_return=%d success_return=%d queueit=%d\n",
- failure_return, success_return, queueit);
+ printf("failure_return=%d delay_return=%d success_return=%d queueit=%d\n",
+ failure_return, delay_return, success_return, queueit);
/*
** If we had some fatal error, but no addresses are marked as
@@ -263,21 +273,15 @@ dropenvelope(e)
** Send back return receipts as requested.
*/
-/*
- if (e->e_receiptto != NULL && bitset(EF_SENDRECEIPT, e->e_flags)
- && !bitset(PRIV_NORECEIPTS, PrivacyFlags))
-*/
- if (e->e_receiptto == NULL)
- e->e_receiptto = e->e_from.q_paddr;
- if (success_return && !failure_return &&
+ if (success_return && !failure_return && !delay_return && fulldrop &&
!bitset(PRIV_NORECEIPTS, PrivacyFlags) &&
- strcmp(e->e_receiptto, "<>") != 0)
+ strcmp(e->e_from.q_paddr, "<>") != 0)
{
auto ADDRESS *rlist = NULL;
e->e_flags |= EF_SENDRECEIPT;
- (void) sendtolist(e->e_receiptto, NULLADDR, &rlist, 0, e);
- (void) returntosender("Return receipt", rlist, FALSE, e);
+ (void) sendtolist(e->e_from.q_paddr, NULLADDR, &rlist, 0, e);
+ (void) returntosender("Return receipt", rlist, RTSF_NO_BODY, e);
}
e->e_flags &= ~EF_SENDRECEIPT;
@@ -285,8 +289,12 @@ dropenvelope(e)
** Arrange to send error messages if there are fatal errors.
*/
- if (failure_return && e->e_errormode != EM_QUIET)
+ if ((failure_return || delay_return) && e->e_errormode != EM_QUIET)
+ {
+ extern void savemail __P((ENVELOPE *, bool));
+
savemail(e, !bitset(EF_NO_BODY_RETN, e->e_flags));
+ }
/*
** Arrange to send warning messages to postmaster as requested.
@@ -299,7 +307,7 @@ dropenvelope(e)
auto ADDRESS *rlist = NULL;
(void) sendtolist(PostMasterCopy, NULLADDR, &rlist, 0, e);
- (void) returntosender(e->e_message, rlist, FALSE, e);
+ (void) returntosender(e->e_message, rlist, RTSF_PM_BOUNCE, e);
}
/*
@@ -499,7 +507,6 @@ settime(e)
char tbuf[20]; /* holds "current" time */
char dbuf[30]; /* holds ctime(tbuf) */
register struct tm *tm;
- extern char *arpadate();
extern struct tm *gmtime();
now = curtime();
@@ -548,7 +555,7 @@ openxscript(e)
if (e->e_xfp != NULL)
return;
p = queuename(e, 'x');
- fd = open(p, O_WRONLY|O_CREAT|O_APPEND, 0644);
+ fd = open(p, O_WRONLY|O_CREAT|O_APPEND, FileMode);
if (fd < 0)
{
syserr("Can't create transcript file %s", p);
@@ -754,7 +761,8 @@ setsender(from, e, delimptr, internal)
FullName = NULL;
}
- if ((pw = sm_getpwnam(e->e_from.q_user)) != NULL)
+ if (e->e_from.q_user[0] != '\0' &&
+ (pw = sm_getpwnam(e->e_from.q_user)) != NULL)
{
/*
** Process passwd file entry.
@@ -782,6 +790,10 @@ setsender(from, e, delimptr, internal)
FullName = newstr(buf);
}
}
+ else
+ {
+ e->e_from.q_home = "/no/such/directory";
+ }
if (FullName != NULL && !internal)
define('x', FullName, e);
}
@@ -874,31 +886,31 @@ struct eflags
struct eflags EnvelopeFlags[] =
{
- "OLDSTYLE", EF_OLDSTYLE,
- "INQUEUE", EF_INQUEUE,
- "NO_BODY_RETN", EF_NO_BODY_RETN,
- "CLRQUEUE", EF_CLRQUEUE,
- "SENDRECEIPT", EF_SENDRECEIPT,
- "FATALERRS", EF_FATALERRS,
- "DELETE_BCC", EF_DELETE_BCC,
- "RESPONSE", EF_RESPONSE,
- "RESENT", EF_RESENT,
- "VRFYONLY", EF_VRFYONLY,
- "WARNING", EF_WARNING,
- "QUEUERUN", EF_QUEUERUN,
- "GLOBALERRS", EF_GLOBALERRS,
- "PM_NOTIFY", EF_PM_NOTIFY,
- "METOO", EF_METOO,
- "LOGSENDER", EF_LOGSENDER,
- "NORECEIPT", EF_NORECEIPT,
- "HAS8BIT", EF_HAS8BIT,
- "NL_NOT_EOL", EF_NL_NOT_EOL,
- "CRLF_NOT_EOL", EF_CRLF_NOT_EOL,
- "RET_PARAM", EF_RET_PARAM,
- "HAS_DF", EF_HAS_DF,
- "IS_MIME", EF_IS_MIME,
- "DONT_MIME", EF_DONT_MIME,
- NULL
+ { "OLDSTYLE", EF_OLDSTYLE },
+ { "INQUEUE", EF_INQUEUE },
+ { "NO_BODY_RETN", EF_NO_BODY_RETN },
+ { "CLRQUEUE", EF_CLRQUEUE },
+ { "SENDRECEIPT", EF_SENDRECEIPT },
+ { "FATALERRS", EF_FATALERRS },
+ { "DELETE_BCC", EF_DELETE_BCC },
+ { "RESPONSE", EF_RESPONSE },
+ { "RESENT", EF_RESENT },
+ { "VRFYONLY", EF_VRFYONLY },
+ { "WARNING", EF_WARNING },
+ { "QUEUERUN", EF_QUEUERUN },
+ { "GLOBALERRS", EF_GLOBALERRS },
+ { "PM_NOTIFY", EF_PM_NOTIFY },
+ { "METOO", EF_METOO },
+ { "LOGSENDER", EF_LOGSENDER },
+ { "NORECEIPT", EF_NORECEIPT },
+ { "HAS8BIT", EF_HAS8BIT },
+ { "NL_NOT_EOL", EF_NL_NOT_EOL },
+ { "CRLF_NOT_EOL", EF_CRLF_NOT_EOL },
+ { "RET_PARAM", EF_RET_PARAM },
+ { "HAS_DF", EF_HAS_DF },
+ { "IS_MIME", EF_IS_MIME },
+ { "DONT_MIME", EF_DONT_MIME },
+ { NULL }
};
void
diff --git a/usr.sbin/sendmail/src/err.c b/usr.sbin/sendmail/src/err.c
index c231ef119d46..199fdd87ed87 100644
--- a/usr.sbin/sendmail/src/err.c
+++ b/usr.sbin/sendmail/src/err.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1983, 1995 Eric P. Allman
+ * Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)err.c 8.42.1.2 (Berkeley) 9/16/96";
+static char sccsid[] = "@(#)err.c 8.50 (Berkeley) 9/20/96";
#endif /* not lint */
# include "sendmail.h"
@@ -145,10 +145,30 @@ syserr(fmt, va_alist)
CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
uname, &MsgBuf[4]);
# endif /* LOG */
- if (olderrno == EMFILE)
+ switch (olderrno)
{
+ case EBADF:
+ case ENFILE:
+ case EMFILE:
+ case ENOTTY:
+#ifdef EFBIG
+ case EFBIG:
+#endif
+#ifdef ESPIPE
+ case ESPIPE:
+#endif
+#ifdef EPIPE
+ case EPIPE:
+#endif
+#ifdef ENOBUFS
+ case ENOBUFS:
+#endif
+#ifdef ESTALE
+ case ESTALE:
+#endif
printopenfds(TRUE);
mci_dump_all(TRUE);
+ break;
}
if (panic)
{
@@ -384,6 +404,11 @@ putoutmsg(msg, holdmsg, heldmsg)
if (!heldmsg && CurEnv->e_xfp != NULL && strchr("45", msg[0]) != NULL)
fprintf(CurEnv->e_xfp, "%s\n", msg);
+#ifdef LOG
+ if (LogLevel >= 15 && (OpMode == MD_SMTP || OpMode == MD_DAEMON))
+ syslog(LOG_INFO, "--> %s%s", msg, holdmsg ? " (held)" : "");
+#endif
+
if (msgcode == '8')
msg[0] = '0';
@@ -624,17 +649,29 @@ errstring(errnum)
case ECONNRESET:
bp = buf;
snprintf(bp, SPACELEFT(buf, bp), "%s", sys_errlist[errnum]);
- bp += strlen(buf);
+ bp += strlen(bp);
+ if (CurHostName != NULL)
+ {
+ if (errnum == ETIMEDOUT)
+ {
+ snprintf(bp, SPACELEFT(buf, bp), " with ");
+ bp += strlen(bp);
+ }
+ else
+ {
+ bp = buf;
+ snprintf(bp, SPACELEFT(buf, bp),
+ "Connection reset by ");
+ bp += strlen(bp);
+ }
+ snprintf(bp, SPACELEFT(buf, bp), "%s",
+ shortenstring(CurHostName, 203));
+ bp += strlen(buf);
+ }
if (SmtpPhase != NULL)
{
snprintf(bp, SPACELEFT(buf, bp), " during %s",
SmtpPhase);
- bp += strlen(bp);
- }
- if (CurHostName != NULL)
- {
- snprintf(bp, SPACELEFT(buf, bp), " with %s",
- shortenstring(CurHostName, 203));
}
return (buf);
diff --git a/usr.sbin/sendmail/src/ldap_map.h b/usr.sbin/sendmail/src/ldap_map.h
new file mode 100644
index 000000000000..488589b7f5a9
--- /dev/null
+++ b/usr.sbin/sendmail/src/ldap_map.h
@@ -0,0 +1,60 @@
+/*
+** Support for LDAP.
+**
+** Contributed by Booker C. Bense <bbense@networking.stanford.edu>.
+** Please go to him for support -- since I (Eric) don't run LDAP, I
+** can't help you at all.
+**
+** @(#)ldap_map.h 8.2 (Berkeley) 5/22/96
+*/
+
+#ifndef _LDAP_MAP_H
+#define _LDAP_MAP_H
+
+struct ldap_map_struct
+{
+ /* needed for ldap_open */
+ char *ldaphost;
+ int ldapport;
+
+ /* Options set in ld struct before ldap_bind_s */
+ int deref;
+ int timelimit;
+ int sizelimit;
+ int ldap_options;
+
+ /* args for ldap_bind_s */
+ LDAP *ld;
+ char *binddn;
+ char *passwd;
+ int method;
+
+ /* args for ldap_search_st */
+ char *base;
+ int scope;
+ char *filter;
+ char *attr;
+ int attrsonly;
+ struct timeval timeout;
+ LDAPMessage *res;
+};
+
+typedef struct ldap_map_struct LDAP_MAP_STRUCT;
+
+#define DEFAULT_LDAP_MAP_PORT LDAP_PORT
+#define DEFAULT_LDAP_MAP_SCOPE LDAP_SCOPE_SUBTREE
+#define DEFAULT_LDAP_MAP_BINDDN NULL
+#define DEFAULT_LDAP_MAP_PASSWD NULL
+#define DEFAULT_LDAP_MAP_METHOD LDAP_AUTH_SIMPLE
+#define DEFAULT_LDAP_MAP_TIMELIMIT 5
+#define DEFAULT_LDAP_MAP_DEREF LDAP_DEREF_NEVER
+#define DEFAULT_LDAP_MAP_SIZELIMIT 0
+#define DEFAULT_LDAP_MAP_ATTRSONLY 0
+#define LDAP_MAP_MAX_FILTER 256
+#ifdef LDAP_REFERRALS
+# define DEFAULT_LDAP_MAP_LDAP_OPTIONS LDAP_OPT_REFERRALS
+#else /* LDAP_REFERRALS */
+# define DEFAULT_LDAP_MAP_LDAP_OPTIONS 0
+#endif /* LDAP_REFERRALS */
+
+#endif /* _LDAP_MAP_H */
diff --git a/usr.sbin/sendmail/src/macro.c b/usr.sbin/sendmail/src/macro.c
index 94ef834bb082..e31d0deb21cb 100644
--- a/usr.sbin/sendmail/src/macro.c
+++ b/usr.sbin/sendmail/src/macro.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1983, 1995 Eric P. Allman
+ * Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)macro.c 8.13 (Berkeley) 7/10/95";
+static char sccsid[] = "@(#)macro.c 8.17 (Berkeley) 5/13/96";
#endif /* not lint */
# include "sendmail.h"
@@ -70,8 +70,10 @@ expand(s, buf, bufsize, e)
bool skipping; /* set if conditionally skipping output */
bool recurse = FALSE; /* set if recursion required */
int i;
+ int skiplev; /* skipping nesting level */
int iflev; /* if nesting level */
char xbuf[BUFSIZ];
+ static int explevel = 0;
if (tTd(35, 24))
{
@@ -81,6 +83,7 @@ expand(s, buf, bufsize, e)
}
skipping = FALSE;
+ skiplev = 0;
iflev = 0;
if (s == NULL)
s = "";
@@ -98,23 +101,29 @@ expand(s, buf, bufsize, e)
switch (c & 0377)
{
case CONDIF: /* see if var set */
+ iflev++;
c = *++s;
if (skipping)
- iflev++;
+ skiplev++;
else
skipping = macvalue(c, e) == NULL;
continue;
case CONDELSE: /* change state of skipping */
if (iflev == 0)
+ break;
+ if (skiplev == 0)
skipping = !skipping;
continue;
case CONDFI: /* stop skipping */
if (iflev == 0)
+ break;
+ iflev--;
+ if (skiplev == 0)
skipping = FALSE;
if (skipping)
- iflev--;
+ skiplev--;
continue;
case MACROEXPAND: /* macro interpolation */
@@ -135,7 +144,7 @@ expand(s, buf, bufsize, e)
** Interpolate q or output one character
*/
- if (skipping || xp >= &xbuf[sizeof xbuf])
+ if (skipping || xp >= &xbuf[sizeof xbuf - 1])
continue;
if (q == NULL)
*xp++ = c;
@@ -163,8 +172,15 @@ expand(s, buf, bufsize, e)
/* recurse as appropriate */
if (recurse)
{
- expand(xbuf, buf, bufsize, e);
- return;
+ if (explevel < MaxMacroRecursion)
+ {
+ explevel++;
+ expand(xbuf, buf, bufsize, e);
+ explevel--;
+ return;
+ }
+ syserr("expand: recursion too deep (%d max)",
+ MaxMacroRecursion);
}
/* copy results out */
diff --git a/usr.sbin/sendmail/src/makesendmail b/usr.sbin/sendmail/src/makesendmail
index df202e9163e2..1b266c3564a5 100644
--- a/usr.sbin/sendmail/src/makesendmail
+++ b/usr.sbin/sendmail/src/makesendmail
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (c) 1993 Eric P. Allman
+# Copyright (c) 1993, 1996 Eric P. Allman
# Copyright (c) 1993 The Regents of the University of California.
# All rights reserved.
#
@@ -32,7 +32,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# @(#)makesendmail 8.29 (Berkeley) 8/1/95
+# @(#)makesendmail 8.41 (Berkeley) 9/23/96
#
#
@@ -51,12 +51,12 @@ fi
#
# Do heuristic guesses !ONLY! for machines that do not have uname
#
-if [ -d /LocalApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
+if [ -d /NextApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
then
# probably a NeXT box
- arch=NeXT
- os=Mach
- rel=`strings /mach | grep 'Mach.*:' | sed -e 's/.* Mach //' -e 's/:.*//'`
+ arch=`hostinfo | sed -n 's/.*Processor type: \([^ ]*\).*/\1/p'`
+ os=NeXT
+ rel=`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`
elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]
then
# probably a Sony NEWS 4.x
@@ -85,8 +85,8 @@ fi
if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
then
arch=`uname -m | sed -e 's/ //g'`
- os=`uname -s | sed 's/\//-/g'`
- rel=`uname -r`
+ os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`
+ rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g'`
fi
#
@@ -104,6 +104,8 @@ in
sun4*) arch=sun4;;
9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
+
+ DS/907000) arch=ds90;;
esac
# tweak operating system type and release
@@ -112,12 +114,27 @@ in
DYNIX-ptx) os=PTX;;
Paragon*) os=Paragon;;
HP-UX) rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
- AIX) rel=`uname -v`;;
+ AIX) rel=`uname -v`
+ if [ "$rel" = "2" ]
+ then
+ arch=""
+ fi;;
BSD-386) os=BSD-OS;;
+ SCO_SV) os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
+ UNIX_System_V) if [ "$arch" = "ds90" ]
+ then
+ os="UXPDS"
+ rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
+ fi;;
esac
# get "base part" of operating system release
+rroot=`echo $rel | sed -e 's/\.[^.]*$//'`
rbase=`echo $rel | sed -e 's/\..*//'`
+if [ "$rroot" = "$rbase" ]
+then
+ rroot=$rel
+fi
# heuristic tweaks to clean up names -- PLEASE LIMIT THESE!
if [ "$os" = "unix" ]
@@ -164,11 +181,13 @@ else
sfx=".${SENDMAIL_SUFFIX}"
fi
-echo "Configuration: os=$os, rel=$rel, rbase=$rbase, arch=$arch, sfx=$sfx"
+echo "Configuration: os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx"
# now try to find a reasonable object directory
if [ -r obj.$os.$rel.$arch$sfx ]; then
obj=obj.$os.$rel.$arch$sfx
+elif [ -r obj.$os.$rroot.$arch$sfx ]; then
+ obj=obj.$os.$rroot.$arch$sfx
elif [ -r obj.$os.$rbase.x.$arch$sfx ]; then
obj=obj.$os.$rbase.x.$arch$sfx
elif [ -r obj.$os.$rel$sfx ]; then
@@ -196,6 +215,10 @@ else
makefile=Makefile.$os.$rel.$arch$sfx
elif [ -r Makefiles/Makefile.$os.$rel.$arch ]; then
makefile=Makefile.$os.$rel.$arch
+ elif [ -r Makefiles/Makefile.$os.$rroot.$arch$sfx ]; then
+ makefile=Makefile.$os.$rroot.$arch$sfx
+ elif [ -r Makefiles/Makefile.$os.$rroot.$arch ]; then
+ makefile=Makefile.$os.$rroot.$arch
elif [ -r Makefiles/Makefile.$os.$rbase.x.$arch$sfx ]; then
makefile=Makefile.$os.$rbase.x.$arch$sfx
elif [ -r Makefiles/Makefile.$os.$rbase.x.$arch ]; then
@@ -204,6 +227,10 @@ else
makefile=Makefile.$os.$rel$sfx
elif [ -r Makefiles/Makefile.$os.$rel ]; then
makefile=Makefile.$os.$rel
+ elif [ -r Makefiles/Makefile.$os.$rroot$sfx ]; then
+ makefile=Makefile.$os.$rroot$sfx
+ elif [ -r Makefiles/Makefile.$os.$rroot ]; then
+ makefile=Makefile.$os.$rroot
elif [ -r Makefiles/Makefile.$os.$rbase.x$sfx ]; then
makefile=Makefile.$os.$rbase.x$sfx
elif [ -r Makefiles/Makefile.$os.$rbase.x ]; then
@@ -216,6 +243,10 @@ else
makefile=Makefile.$rel.$arch$sfx
elif [ -r Makefiles/Makefile.$rel.$arch ]; then
makefile=Makefile.$rel.$arch
+ elif [ -r Makefiles/Makefile.$rroot.$arch$sfx ]; then
+ makefile=Makefile.$rroot.$arch$sfx
+ elif [ -r Makefiles/Makefile.$rroot.$arch ]; then
+ makefile=Makefile.$rroot.$arch
elif [ -r Makefiles/Makefile.$rbase.x.$arch$sfx ]; then
makefile=Makefile.$rbase.x.$arch$sfx
elif [ -r Makefiles/Makefile.$rbase.x.$arch ]; then
diff --git a/usr.sbin/sendmail/src/map.c b/usr.sbin/sendmail/src/map.c
index 13d38ce97bec..796e47247d93 100644
--- a/usr.sbin/sendmail/src/map.c
+++ b/usr.sbin/sendmail/src/map.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1992, 1995 Eric P. Allman.
+ * Copyright (c) 1992, 1995, 1996 Eric P. Allman.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -33,25 +33,29 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)map.c 8.108.1.2 (Berkeley) 9/16/96";
+static char sccsid[] = "@(#)map.c 8.140 (Berkeley) 10/12/96";
#endif /* not lint */
#include "sendmail.h"
#ifdef NDBM
# include <ndbm.h>
-#endif
-#ifdef NEWDB
# ifdef R_FIRST
ERROR README: You are running the Berkeley DB version of ndbm.h. See
ERROR README: the READ_ME file about tweaking Berkeley DB so it can
- ERROR README: coexist with NDBM, or delete -DNDBM from the Makefile.
+ ERROR README: coexist with NDBM, or delete -DNDBM from the Makefile
+ ERROR README: and use -DNEWDB instead.
# endif
+#endif
+#ifdef NEWDB
# include <db.h>
#endif
#ifdef NIS
struct dom_binding; /* forward reference needed on IRIX */
# include <rpcsvc/ypclnt.h>
+# ifdef NDBM
+# define NDBM_YP_COMPAT /* create YP-compatible NDBM files */
+# endif
#endif
/*
@@ -96,7 +100,9 @@ static char sccsid[] = "@(#)map.c 8.108.1.2 (Berkeley) 9/16/96";
#define DBMMODE 0644
-#define EX_NOTFOUND EX_NOHOST
+#ifndef EX_NOTFOUND
+# define EX_NOTFOUND EX_NOHOST
+#endif
extern bool aliaswait __P((MAP *, char *, int));
extern bool extract_canonname __P((char *, char *, char[], int));
@@ -204,6 +210,11 @@ map_parseargs(map, ap)
}
}
break;
+
+ case 't':
+ map->map_mflags |= MF_NODEFER;
+ break;
+
#ifdef RESERVED_FOR_SUN
case 'd':
map->map_mflags |= MF_DOMAIN_WIDE;
@@ -632,10 +643,10 @@ getcanonname(host, hbsize, trymx)
printf("getcanonname(%s), failed, stat=%d\n", host, stat);
#if NAMED_BIND
- if (stat == EX_NOHOST && !got_tempfail)
- h_errno = HOST_NOT_FOUND;
- else
+ if (got_tempfail)
h_errno = TRY_AGAIN;
+ else
+ h_errno = HOST_NOT_FOUND;
#endif
return FALSE;
@@ -724,6 +735,7 @@ ndbm_map_open(map, mode)
if (tTd(38, 2))
printf("ndbm_map_open(%s, %s, %d)\n",
map->map_mname, map->map_file, mode);
+ map->map_lockfd = -1;
#if LOCK_ON_OPEN
if (mode == O_RDONLY)
@@ -733,7 +745,7 @@ ndbm_map_open(map, mode)
#else
if (mode == O_RDWR)
{
-# ifdef NOFTRUNCATE
+# if NOFTRUNCATE
/*
** Warning: race condition. Try to lock the file as
** quickly as possible after opening it.
@@ -768,15 +780,15 @@ ndbm_map_open(map, mode)
if (!lockfile(dirfd, map->map_file, ".dir", LOCK_EX))
syserr("ndbm_map_open: cannot lock %s.dir",
map->map_file);
- if (ftruncate(dirfd, 0) < 0)
+ if (ftruncate(dirfd, (off_t) 0) < 0)
syserr("ndbm_map_open: cannot truncate %s.dir",
map->map_file);
- if (ftruncate(pagfd, 0) < 0)
+ if (ftruncate(pagfd, (off_t) 0) < 0)
syserr("ndbm_map_open: cannot truncate %s.pag",
map->map_file);
- /* we can safely unlock because others will wait for @:@ */
- close(dirfd);
+ /* have to save the lock for the duration (bletch) */
+ map->map_lockfd = dirfd;
close(pagfd);
# endif
}
@@ -807,12 +819,7 @@ ndbm_map_open(map, mode)
}
else
{
- /* exclusive lock for duration of rebuild */
-#if !LOCK_ON_OPEN
- if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags) &&
- lockfile(fd, map->map_file, ".dir", LOCK_EX))
-#endif
- map->map_mflags |= MF_LOCKED;
+ map->map_mflags |= MF_LOCKED;
}
if (fstat(dbm_dirfno((DBM *) map->map_db1), &st) >= 0)
map->map_mtime = st.st_mtime;
@@ -845,7 +852,8 @@ ndbm_map_lookup(map, name, av, statp)
{
if (key.dsize > sizeof keybuf - 1)
key.dsize = sizeof keybuf - 1;
- bcopy(key.dptr, keybuf, key.dsize + 1);
+ bcopy(key.dptr, keybuf, key.dsize);
+ keybuf[key.dsize] = '\0';
makelower(keybuf);
key.dptr = keybuf;
}
@@ -890,6 +898,7 @@ ndbm_map_store(map, lhs, rhs)
datum key;
datum data;
int stat;
+ char keybuf[MAXNAME + 1];
if (tTd(38, 12))
printf("ndbm_map_store(%s, %s, %s)\n",
@@ -897,6 +906,15 @@ ndbm_map_store(map, lhs, rhs)
key.dsize = strlen(lhs);
key.dptr = lhs;
+ if (!bitset(MF_NOFOLDCASE, map->map_mflags))
+ {
+ if (key.dsize > sizeof keybuf - 1)
+ key.dsize = sizeof keybuf - 1;
+ bcopy(key.dptr, keybuf, key.dsize);
+ keybuf[key.dsize] = '\0';
+ makelower(keybuf);
+ key.dptr = keybuf;
+ }
data.dsize = strlen(rhs);
data.dptr = rhs;
@@ -920,7 +938,7 @@ ndbm_map_store(map, lhs, rhs)
datum old;
old.dptr = ndbm_map_lookup(map, key.dptr, NULL, &xstat);
- if (old.dptr != NULL && *old.dptr != '\0')
+ if (old.dptr != NULL && *(char *) old.dptr != '\0')
{
old.dsize = strlen(old.dptr);
if (data.dsize + old.dsize + 2 > bufsiz)
@@ -959,7 +977,7 @@ ndbm_map_close(map)
if (bitset(MF_WRITABLE, map->map_mflags))
{
-#ifdef NIS
+#ifdef NDBM_YP_COMPAT
bool inclnull;
char buf[200];
@@ -968,11 +986,17 @@ ndbm_map_close(map)
if (strstr(map->map_file, "/yp/") != NULL)
{
+ long save_mflags = map->map_mflags;
+
+ map->map_mflags |= MF_NOFOLDCASE;
+
(void) snprintf(buf, sizeof buf, "%010ld", curtime());
ndbm_map_store(map, "YP_LAST_MODIFIED", buf);
(void) gethostname(buf, sizeof buf);
ndbm_map_store(map, "YP_MASTER_NAME", buf);
+
+ map->map_mflags = save_mflags;
}
if (inclnull)
@@ -983,6 +1007,12 @@ ndbm_map_close(map)
ndbm_map_store(map, "@", "@");
}
dbm_close((DBM *) map->map_db1);
+
+ /* release lock (if needed) */
+#if !LOCK_ON_OPEN
+ if (map->map_lockfd >= 0)
+ (void) close(map->map_lockfd);
+#endif
}
#endif
@@ -1004,6 +1034,8 @@ ndbm_map_close(map)
** be pokey about it. That's hard to do.
*/
+extern bool db_map_open __P((MAP *, int, DBTYPE));
+
bool
bt_map_open(map, mode)
MAP *map;
@@ -1044,6 +1076,7 @@ db_map_open(map, mode, dbtype)
i = strlen(buf);
if (i < 3 || strcmp(&buf[i - 3], ".db") != 0)
(void) strcat(buf, ".db");
+ map->map_lockfd = -1;
omode = mode;
@@ -1068,8 +1101,8 @@ db_map_open(map, mode, dbtype)
if (fd < 0)
{
- syserr("db_map_open: cannot pre-open database %s",
- buf);
+ if (!bitset(MF_OPTIONAL, map->map_mflags))
+ syserr("db_map_open: cannot pre-open database %s", buf);
close(fd);
return FALSE;
}
@@ -1084,8 +1117,10 @@ db_map_open(map, mode, dbtype)
saveerrno = errno;
#if !LOCK_ON_OPEN
- /* we can safely unlock now because others will wait for @:@ */
- close(fd);
+ if (mode == O_RDWR)
+ map->map_lockfd = fd;
+ else
+ (void) close(fd);
#endif
if (db == NULL)
@@ -1098,21 +1133,15 @@ db_map_open(map, mode, dbtype)
syserr("Cannot open DB database %s", map->map_file);
return FALSE;
}
+
+ if (mode == O_RDWR)
+ map->map_mflags |= MF_LOCKED;
#if !OLD_NEWDB
fd = db->fd(db);
# if LOCK_ON_OPEN
- if (fd >= 0)
+ if (fd >= 0 && mode == O_RDONLY)
{
- if (mode == O_RDONLY)
- (void) lockfile(fd, map->map_file, ".db", LOCK_UN);
- else
- map->map_mflags |= MF_LOCKED;
- }
-# else
- if (mode == O_RDWR && fd >= 0)
- {
- if (lockfile(fd, map->map_file, ".db", LOCK_EX))
- map->map_mflags |= MF_LOCKED;
+ (void) lockfile(fd, map->map_file, ".db", LOCK_UN);
}
# endif
#endif
@@ -1162,7 +1191,8 @@ db_map_lookup(map, name, av, statp)
if (key.size > sizeof keybuf - 1)
key.size = sizeof keybuf - 1;
key.data = keybuf;
- bcopy(name, keybuf, key.size + 1);
+ bcopy(name, keybuf, key.size);
+ keybuf[key.size] = '\0';
if (!bitset(MF_NOFOLDCASE, map->map_mflags))
makelower(keybuf);
#if !OLD_NEWDB
@@ -1217,6 +1247,7 @@ db_map_store(map, lhs, rhs)
DBT key;
DBT data;
register DB *db = map->map_db2;
+ char keybuf[MAXNAME + 1];
if (tTd(38, 12))
printf("db_map_store(%s, %s, %s)\n",
@@ -1224,6 +1255,15 @@ db_map_store(map, lhs, rhs)
key.size = strlen(lhs);
key.data = lhs;
+ if (!bitset(MF_NOFOLDCASE, map->map_mflags))
+ {
+ if (key.size > sizeof keybuf - 1)
+ key.size = sizeof keybuf - 1;
+ bcopy(key.data, keybuf, key.size);
+ keybuf[key.size] = '\0';
+ makelower(keybuf);
+ key.data = keybuf;
+ }
data.size = strlen(rhs);
data.data = rhs;
@@ -1293,6 +1333,11 @@ db_map_close(map)
if (db->close(db) != 0)
syserr("readaliases: db close failure");
+
+#if !LOCK_ON_OPEN
+ if (map->map_lockfd >= 0)
+ (void) close(map->map_lockfd);
+#endif
}
#endif
@@ -1356,7 +1401,7 @@ nis_map_open(map, mode)
if (yperr != 0)
{
if (!bitset(MF_OPTIONAL, map->map_mflags))
- syserr("421 NIS map %s specified, but NIS not running\n",
+ syserr("421 NIS map %s specified, but NIS not running",
map->map_file);
return FALSE;
}
@@ -1418,7 +1463,8 @@ nis_map_lookup(map, name, av, statp)
buflen = strlen(name);
if (buflen > sizeof keybuf - 1)
buflen = sizeof keybuf - 1;
- bcopy(name, keybuf, buflen + 1);
+ bcopy(name, keybuf, buflen);
+ keybuf[buflen] = '\0';
if (!bitset(MF_NOFOLDCASE, map->map_mflags))
makelower(keybuf);
yperr = YPERR_KEY;
@@ -1559,12 +1605,9 @@ nisplus_map_open(map, mode)
MAP *map;
int mode;
{
- register char *p;
- char qbuf[MAXLINE + NIS_MAXNAMELEN];
nis_result *res = NULL;
- u_int objs_len;
- nis_object *obj_ptr;
int retry_cnt, max_col, i;
+ char qbuf[MAXLINE + NIS_MAXNAMELEN];
if (tTd(38, 2))
printf("nisplus_map_open(%s, %s, %d)\n",
@@ -1727,7 +1770,8 @@ nisplus_map_lookup(map, name, av, statp)
buflen = strlen(name);
if (buflen > sizeof search_key - 1)
buflen = sizeof search_key - 1;
- bcopy(name, search_key, buflen + 1);
+ bcopy(name, search_key, buflen);
+ search_key[buflen] = '\0';
if (!bitset(MF_NOFOLDCASE, map->map_mflags))
makelower(search_key);
@@ -1851,7 +1895,6 @@ nisplus_getcanonname(name, hbsize, statp)
if (result->status == NIS_SUCCESS)
{
int count;
- char *str;
char *domain;
if ((count = NIS_RES_NUMOBJ(result)) != 1)
@@ -1865,7 +1908,8 @@ nisplus_getcanonname(name, hbsize, statp)
/* ignore second entry */
if (tTd(38, 20))
- printf("nisplus_getcanoname(%s), got %d entries, all but first ignored\n", name);
+ printf("nisplus_getcanoname(%s), got %d entries, all but first ignored\n",
+ name, count);
}
if (tTd(38, 20))
@@ -1934,6 +1978,559 @@ nisplus_default_domain()
#endif /* NISPLUS */
/*
+** LDAP Modules
+**
+** Contributed by Booker C. Bense <bbense@networking.stanford.edu>.
+** Get your support from him.
+*/
+
+#ifdef LDAPMAP
+
+# undef NEEDGETOPT /* used for something else in LDAP */
+
+# include <lber.h>
+# include <ldap.h>
+# include "ldap_map.h"
+
+/*
+** LDAP_MAP_OPEN -- open LDAP map
+**
+** Since LDAP is TCP-based there is not much we can or should do
+** here. It might be a good idea to attempt an open/close here.
+*/
+
+bool
+ldap_map_open(map, mode)
+ MAP *map;
+ int mode;
+{
+ if (tTd(38, 2))
+ printf("ldap_map_open(%s, %d)\n", map->map_mname, mode);
+
+ if (mode != O_RDONLY)
+ {
+ /* issue a pseudo-error message */
+#ifdef ENOSYS
+ errno = ENOSYS;
+#else
+# ifdef EFTYPE
+ errno = EFTYPE;
+# else
+ errno = ENXIO;
+# endif
+#endif
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+/*
+** LDAP_MAP_START -- actually open LDAP map
+**
+** Caching should be investigated.
+*/
+
+bool
+ldap_map_start(map)
+ MAP *map;
+{
+ LDAP_MAP_STRUCT *lmap;
+ LDAP *ld;
+
+ if (tTd(38, 2))
+ printf("ldap_map_start(%s)\n", map->map_mname);
+
+ lmap = (LDAP_MAP_STRUCT *) map->map_db1;
+
+ if (tTd(38,9))
+ printf("ldap_open(%s, %d)\n", lmap->ldaphost, lmap->ldapport);
+
+ if ((ld = ldap_open(lmap->ldaphost,lmap->ldapport)) == NULL)
+ {
+ if (!bitset(MF_OPTIONAL, map->map_mflags))
+ {
+ syserr("ldapopen failed to %s in map %s",
+ lmap->ldaphost, map->map_mname);
+ }
+ return FALSE;
+ }
+
+ ld->ld_deref = lmap->deref;
+ ld->ld_timelimit = lmap->timelimit;
+ ld->ld_sizelimit = lmap->sizelimit;
+ ld->ld_options = lmap->ldap_options;
+
+ if (ldap_bind_s(ld, lmap->binddn,lmap->passwd,lmap->method) != LDAP_SUCCESS)
+ {
+ if (!bitset(MF_OPTIONAL, map->map_mflags))
+ {
+ syserr("421 Cannot bind to map %s in ldap server %s",
+ map->map_mname, lmap->ldaphost);
+ }
+ }
+ else
+ {
+ /* We need to cast ld into the map structure */
+ lmap->ld = ld;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+/*
+** LDAP_MAP_CLOSE -- close ldap map
+*/
+
+void
+ldap_map_close(map)
+ MAP *map;
+{
+ LDAP_MAP_STRUCT *lmap ;
+ lmap = (LDAP_MAP_STRUCT *) map->map_db1;
+ if (lmap->ld != NULL)
+ ldap_unbind(lmap->ld);
+}
+
+
+#ifdef SUNET_ID
+/*
+** SUNET_ID_HASH -- Convert a string to it's Sunet_id canonical form
+** This only makes sense at Stanford University.
+*/
+
+char *
+sunet_id_hash(str)
+ char *str;
+{
+ char *p, *p_last;
+
+ p = str;
+ p_last = p;
+ while (*p != '\0')
+ {
+ if (islower(*p) || isdigit(*p))
+ {
+ *p_last = *p;
+ p_last++;
+ }
+ else if (isupper(*p))
+ {
+ *p_last = tolower(*p);
+ p_last++;
+ }
+ ++p;
+ }
+ if (*p_last != '\0')
+ *p_last = '\0';
+ return (str);
+}
+
+
+
+#endif /* SUNET_ID */
+/*
+** LDAP_MAP_LOOKUP -- look up a datum in a LDAP map
+*/
+
+char *
+ldap_map_lookup(map, name, av, statp)
+ MAP *map;
+ char *name;
+ char **av;
+ int *statp;
+{
+ LDAP_MAP_STRUCT *lmap = NULL;
+ LDAPMessage *entry;
+ char *vp;
+ auto int vsize;
+ char keybuf[MAXNAME + 1];
+ char filter[LDAP_MAP_MAX_FILTER + 1];
+ char **attr_values = NULL;
+ char *result;
+ int name_len;
+
+ if (tTd(38, 20))
+ printf("ldap_map_lookup(%s, %s)\n", map->map_mname, name);
+
+ /* actually open the map */
+ if (!ldap_map_start(map))
+ {
+ result = NULL;
+ *statp = EX_TEMPFAIL;
+ goto quick_exit;
+ }
+
+ /* Get ldap struct pointer from map */
+ lmap = (LDAP_MAP_STRUCT *) map->map_db1;
+
+ name_len = strlen(name);
+ if (name_len > MAXNAME)
+ name_len = MAXNAME;
+ strncpy(keybuf, name, name_len);
+ keybuf[name_len] = '\0';
+
+ if (!bitset(MF_NOFOLDCASE, map->map_mflags))
+#ifdef SUNET_ID
+ sunet_id_hash(keybuf);
+#else
+ makelower(keybuf);
+#endif /*SUNET_ID */
+
+ /* sprintf keybuf into filter */
+ snprintf(filter, sizeof filter, lmap->filter, keybuf);
+
+ if (ldap_search_st(lmap->ld, lmap->base,lmap->scope,filter,
+ &(lmap->attr), lmap->attrsonly, &(lmap->timeout),
+ &(lmap->res)) != LDAP_SUCCESS)
+ {
+ /* try close/opening map */
+ ldap_map_close(map);
+ if (!ldap_map_start(map))
+ {
+ result = NULL;
+ *statp = EX_TEMPFAIL;
+ goto quick_exit;
+ }
+ if (ldap_search_st(lmap->ld, lmap->base, lmap->scope, filter,
+ &(lmap->attr), lmap->attrsonly,
+ &(lmap->timeout), &(lmap->res))
+ != LDAP_SUCCESS)
+ {
+ if (!bitset(MF_OPTIONAL, map->map_mflags))
+ {
+ syserr("Error in ldap_search_st using %s in map %s",
+ filter, map->map_mname);
+ }
+ result = NULL;
+ *statp = EX_UNAVAILABLE;
+ goto quick_exit;
+ }
+ }
+
+ entry = ldap_first_entry(lmap->ld,lmap->res);
+ if (entry == NULL)
+ {
+ result = NULL;
+ *statp = EX_NOTFOUND;
+ goto quick_exit;
+ }
+
+ /* Need to build the args for map_rewrite here */
+ attr_values = ldap_get_values(lmap->ld,entry,lmap->attr);
+ if (attr_values == NULL)
+ {
+ /* bad things happened */
+ result = NULL;
+ *statp = EX_NOTFOUND;
+ goto quick_exit;
+ }
+
+ *statp = EX_OK;
+
+ /* If there is more that one use the first */
+ vp = attr_values[0];
+ vsize = strlen(vp);
+
+# ifdef LOG
+ if (LogLevel > 9)
+ syslog(LOG_INFO, "%s: ldap %.100s => %s",
+ CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
+ name, vp);
+# endif
+ if (bitset(MF_MATCHONLY, map->map_mflags))
+ result = map_rewrite(map, name, strlen(name), NULL);
+ else
+ result = map_rewrite(map, vp, vsize, av);
+
+ quick_exit:
+ if (attr_values != NULL)
+ ldap_value_free(attr_values);
+ if (lmap != NULL)
+ ldap_msgfree(lmap->res);
+ ldap_map_close(map);
+ return result ;
+}
+
+
+/*
+** LDAP_MAP_DEQUOTE - helper routine for ldap_map_parseargs
+*/
+
+char *
+ldap_map_dequote(str)
+ char *str;
+{
+ char *p;
+ char *start;
+ p = str;
+
+ if (*p == '"')
+ {
+ start = ++p;
+ /* Should probably swallow initial whitespace here */
+ }
+ else
+ {
+ return(str);
+ }
+ while (*p != '"' && *p != '\0')
+ {
+ p++;
+ }
+ if (*p != '\0')
+ *p = '\0';
+ return start;
+}
+
+/*
+** LDAP_MAP_PARSEARGS -- parse ldap map definition args.
+*/
+
+bool
+ldap_map_parseargs(map,args)
+ MAP *map;
+ char *args;
+{
+ register char *p = args;
+ register int done;
+ LDAP_MAP_STRUCT *lmap;
+
+ /* We need to alloc an LDAP_MAP_STRUCT struct */
+ lmap = (LDAP_MAP_STRUCT *) xalloc(sizeof(LDAP_MAP_STRUCT));
+
+ /* Set default int's here , default strings below */
+ lmap->ldapport = DEFAULT_LDAP_MAP_PORT;
+ lmap->deref = DEFAULT_LDAP_MAP_DEREF;
+ lmap->timelimit = DEFAULT_LDAP_MAP_TIMELIMIT;
+ lmap->sizelimit = DEFAULT_LDAP_MAP_SIZELIMIT;
+ lmap->ldap_options = DEFAULT_LDAP_MAP_LDAP_OPTIONS;
+ lmap->method = DEFAULT_LDAP_MAP_METHOD;
+ lmap->scope = DEFAULT_LDAP_MAP_SCOPE;
+ lmap->attrsonly = DEFAULT_LDAP_MAP_ATTRSONLY;
+ lmap->timeout.tv_sec = DEFAULT_LDAP_MAP_TIMELIMIT;
+ lmap->timeout.tv_usec = 0;
+
+ /* Default char ptrs to NULL */
+ lmap->binddn = NULL;
+ lmap->passwd = NULL;
+ lmap->base = NULL;
+ lmap->ldaphost = NULL;
+ map->map_mflags |= MF_TRY0NULL | MF_TRY1NULL;
+ for (;;)
+ {
+ while (isascii(*p) && isspace(*p))
+ p++;
+ if (*p != '-')
+ break;
+ switch (*++p)
+ {
+ case 'N':
+ map->map_mflags |= MF_INCLNULL;
+ map->map_mflags &= ~MF_TRY0NULL;
+ break;
+
+ case 'O':
+ map->map_mflags &= ~MF_TRY1NULL;
+ break;
+
+ case 'o':
+ map->map_mflags |= MF_OPTIONAL;
+ break;
+
+ case 'f':
+ map->map_mflags |= MF_NOFOLDCASE;
+ break;
+
+ case 'm':
+ map->map_mflags |= MF_MATCHONLY;
+ break;
+
+ case 'A':
+ map->map_mflags |= MF_APPEND;
+ break;
+
+ case 'q':
+ map->map_mflags |= MF_KEEPQUOTES;
+ break;
+
+ case 't':
+ map->map_mflags |= MF_NODEFER;
+ break;
+
+ case 'a':
+ map->map_app = ++p;
+ break;
+
+ /* Start of ldap_map specific args */
+ case 'k': /* search field */
+ while (isascii(*++p) && isspace(*p))
+ continue;
+ lmap->filter = p;
+ break;
+
+ case 'v': /* attr to return */
+ while (isascii(*++p) && isspace(*p))
+ continue;
+ lmap->attr = p;
+ break;
+
+ /* args stolen from ldapsearch.c */
+ case 'R': /* don't auto chase referrals */
+#ifdef LDAP_REFERRALS
+ lmap->ldap_options &= ~LDAP_OPT_REFERRALS;
+#else /* LDAP_REFERRALS */
+ syserr("compile with -DLDAP_REFERRALS for referral support\n");
+#endif /* LDAP_REFERRALS */
+ break;
+
+ case 'n': /* retrieve attribute names only -- no values */
+ lmap->attrsonly += 1;
+ break;
+
+ case 's': /* search scope */
+ if (strncasecmp(p, "base", 4) == 0)
+ {
+ lmap->scope = LDAP_SCOPE_BASE;
+ }
+ else if (strncasecmp(p, "one", 3) == 0)
+ {
+ lmap->scope = LDAP_SCOPE_ONELEVEL;
+ }
+ else if (strncasecmp(p, "sub", 3) == 0)
+ {
+ lmap->scope = LDAP_SCOPE_SUBTREE;
+ }
+ else
+ { /* bad config line */
+ if (!bitset(MCF_OPTFILE, map->map_class->map_cflags))
+ {
+ syserr("Scope must be [base|one|sub] not %s in map %s",
+ p, map->map_mname);
+ return FALSE;
+ }
+ }
+ break;
+
+ case 'h': /* ldap host */
+ while (isascii(*++p) && isspace(*p))
+ continue;
+ map->map_domain = p;
+ lmap->ldaphost = p;
+ break;
+
+ case 'b': /* search base */
+ while (isascii(*++p) && isspace(*p))
+ continue;
+ lmap->base = p;
+ break;
+
+ case 'p': /* ldap port */
+ while (isascii(*++p) && isspace(*p))
+ continue;
+ lmap->ldapport = atoi(p);
+ break;
+
+ case 'l': /* time limit */
+ while (isascii(*++p) && isspace(*p))
+ continue;
+ lmap->timelimit = atoi(p);
+ break;
+
+ }
+
+ /* need to account for quoted strings here arggg... */
+ done = isascii(*p) && isspace(*p);
+ while (*p != '\0' && !done)
+ {
+ if (*p == '"')
+ {
+ while (*++p != '"' && *p != '\0')
+ {
+ continue;
+ }
+ if (*p != '\0')
+ p++;
+ }
+ else
+ {
+ p++;
+ }
+ done = isascii(*p) && isspace(*p);
+ }
+
+ if (*p != '\0')
+ *p++ = '\0';
+ }
+
+ if (map->map_app != NULL)
+ map->map_app = newstr(ldap_map_dequote(map->map_app));
+
+ if (map->map_domain != NULL)
+ map->map_domain = newstr(ldap_map_dequote(map->map_domain));
+
+ /*
+ ** We need to swallow up all the stuff into a struct
+ ** and dump it into map->map_dbptr1
+ */
+
+ if (lmap->ldaphost != NULL)
+ lmap->ldaphost = newstr(ldap_map_dequote(lmap->ldaphost));
+ else
+ {
+ syserr("LDAP map: -h flag is required");
+ return FALSE;
+ }
+
+ if (lmap->binddn != NULL)
+ lmap->binddn = newstr(ldap_map_dequote(lmap->binddn));
+ else
+ lmap->binddn = DEFAULT_LDAP_MAP_BINDDN;
+
+
+ if (lmap->passwd != NULL)
+ lmap->passwd = newstr(ldap_map_dequote(lmap->passwd));
+ else
+ lmap->passwd = DEFAULT_LDAP_MAP_PASSWD;
+
+ if (lmap->base != NULL)
+ lmap->base = newstr(ldap_map_dequote(lmap->base));
+ else
+ {
+ syserr("LDAP map: -b flag is required");
+ return FALSE;
+ }
+
+
+ if (lmap->filter != NULL)
+ lmap->filter = newstr(ldap_map_dequote(lmap->filter));
+ else
+ {
+ if (!bitset(MCF_OPTFILE, map->map_class->map_cflags))
+ {
+ syserr("No filter given in map %s", map->map_mname);
+ return FALSE;
+ }
+ }
+ if (lmap->attr != NULL)
+ lmap->attr = newstr(ldap_map_dequote(lmap->attr));
+ else
+ {
+ if (!bitset(MCF_OPTFILE, map->map_class->map_cflags))
+ {
+ syserr("No return attribute in %s", map->map_mname);
+ return FALSE;
+ }
+ }
+
+ map->map_db1 = (ARBPTR_T) lmap;
+ return TRUE;
+}
+
+#endif /* LDAP Modules */
+ /*
** HESIOD Modules
*/
@@ -2066,7 +2663,7 @@ ni_map_open(map, mode)
{
char *p;
- if (tTd(38, 20))
+ if (tTd(38, 2))
printf("ni_map_open(%s, %s, %d)\n",
map->map_mname, map->map_file, mode);
@@ -2240,6 +2837,9 @@ ni_propval(keydir, keyprop, keyval, valprop, sepchar)
}
strcat(keybuf, keyval);
+ if (tTd(38, 21))
+ printf("ni_propval(%s, %s, %s, %s, %d) keybuf='%s'\n",
+ keydir, keyprop, keyval, valprop, sepchar, keybuf);
/*
** If the passed directory and property name are found
** in one of netinfo domains we need to search (starting
@@ -2248,11 +2848,13 @@ ni_propval(keydir, keyprop, keyval, valprop, sepchar)
** and return it.
*/
- for (i = 0; i < MAX_NI_LEVELS; ++i)
+ for (i = 0; i < MAX_NI_LEVELS && propval == NULL; i++)
{
if (i == 0)
{
nis = ni_open(NULL, LOCAL_NETINFO_DOMAIN, &ni);
+ if (tTd(38, 20))
+ printf("ni_open(LOCAL) = %d\n", nis);
}
else
{
@@ -2260,6 +2862,8 @@ ni_propval(keydir, keyprop, keyval, valprop, sepchar)
ni_free(lastni);
lastni = ni;
nis = ni_open(lastni, PARENT_NETINFO_DOMAIN, &ni);
+ if (tTd(38, 20))
+ printf("ni_open(PARENT) = %d\n", nis);
}
/*
@@ -2287,6 +2891,8 @@ ni_propval(keydir, keyprop, keyval, valprop, sepchar)
if (ni_lookupprop(ni, &nid, valprop, &ninl) != 0)
continue;
+ if (tTd(38, 20))
+ printf("ni_lookupprop: len=%d\n", ninl.ni_namelist_len);
/*
** See if we have an acceptable number of values.
*/
@@ -2327,6 +2933,8 @@ ni_propval(keydir, keyprop, keyval, valprop, sepchar)
ni_free(ni);
if (lastni != NULL && ni != lastni)
ni_free(lastni);
+ if (tTd(38, 20))
+ printf("ni_propval returns: '%s'\n", propval);
return propval;
}
@@ -2362,37 +2970,41 @@ text_map_open(map, mode)
if (*map->map_file == '\0')
{
- if (tTd(38, 2))
- printf("text_map_open(%s): file name required\n",
- map->map_mname);
+ syserr("text map \"%s\": file name required",
+ map->map_mname);
return FALSE;
}
if (map->map_file[0] != '/')
{
- if (tTd(38, 2))
- printf("text_map_open(%s, %s): file name must be fully qualified\n",
- map->map_mname, map->map_file);
+ syserr("text map \"%s\": file name must be fully qualified",
+ map->map_mname);
return FALSE;
}
/* check to see if this map actually accessable */
if (access(map->map_file, R_OK) <0)
+ {
+ if (tTd(38, 2))
+ printf("text_map_open(%s, %s): cannot access: %s\n",
+ map->map_mname, map->map_file, errstring(errno));
+ if (!bitset(MF_OPTIONAL, map->map_mflags))
+ syserr("text map \"%s\": cannot access file %s",
+ map->map_mname, map->map_file);
return FALSE;
+ }
/* check to see if this map actually exist */
if (stat(map->map_file, &sbuf) <0)
{
- if (tTd(38, 2))
- printf("text_map_open(%s, %s): cannot stat\n",
- map->map_mname, map->map_file);
+ syserr("text_map_open(%s, %s): cannot stat",
+ map->map_mname, map->map_file);
return FALSE;
}
if (!S_ISREG(sbuf.st_mode))
{
- if (tTd(38, 2))
- printf("text_map_open(%s): %s is not a regular file\n",
- map->map_mname, map->map_file);
+ syserr("text map \"%s\": %s is not a regular file",
+ map->map_mname, map->map_file);
return FALSE;
}
@@ -2402,10 +3014,9 @@ text_map_open(map, mode)
{
if (!isdigit(*map->map_keycolnm))
{
- if (tTd(38, 2))
- printf("text_map_open(%s, %s): -k should specify a number, not %s\n",
- map->map_mname, map->map_file,
- map->map_keycolnm);
+ syserr("text map \"%s\", file %s: -k should specify a number, not %s",
+ map->map_mname, map->map_file,
+ map->map_keycolnm);
return FALSE;
}
map->map_keycolno = atoi(map->map_keycolnm);
@@ -2417,8 +3028,7 @@ text_map_open(map, mode)
{
if (!isdigit(*map->map_valcolnm))
{
- if (tTd(38, 2))
- printf("text_map_open(%s, %s): -v should specify a number, not %s\n",
+ syserr("text map \"%s\", file %s: -v should specify a number, not %s",
map->map_mname, map->map_file,
map->map_valcolnm);
return FALSE;
@@ -2470,7 +3080,8 @@ text_map_lookup(map, name, av, statp)
buflen = strlen(name);
if (buflen > sizeof search_key - 1)
buflen = sizeof search_key - 1;
- bcopy(name, search_key, buflen + 1);
+ bcopy(name, search_key, buflen);
+ search_key[buflen] = '\0';
if (!bitset(MF_NOFOLDCASE, map->map_mflags))
makelower(search_key);
@@ -2526,19 +3137,17 @@ text_getcanonname(name, hbsize, statp)
int hbsize;
int *statp;
{
- int key_idx;
bool found;
FILE *f;
char linebuf[MAXLINE];
char cbuf[MAXNAME + 1];
- char fbuf[MAXNAME + 1];
char nbuf[MAXNAME + 1];
extern char *get_column __P((char *, int, char, char *, int));
if (tTd(38, 20))
printf("text_getcanonname(%s)\n", name);
- if (strlen(name) >= sizeof nbuf)
+ if (strlen(name) >= (SIZE_T) sizeof nbuf)
{
*statp = EX_UNAVAILABLE;
return FALSE;
@@ -2569,7 +3178,7 @@ text_getcanonname(name, hbsize, statp)
return FALSE;
}
- if (hbsize >= strlen(cbuf))
+ if ((SIZE_T) hbsize >= strlen(cbuf))
{
strcpy(name, cbuf);
*statp = EX_OK;
@@ -2736,9 +3345,9 @@ impl_map_open(map, mode)
map->map_mflags |= MF_IMPL_HASH;
if (hash_map_open(map, mode))
{
-#if defined(NDBM) && defined(NIS)
+# ifdef NDBM_YP_COMPAT
if (mode == O_RDONLY || strstr(map->map_file, "/yp/") == NULL)
-#endif
+# endif
return TRUE;
}
else
@@ -2866,12 +3475,13 @@ user_map_lookup(map, key, av, statp)
int *statp;
{
struct passwd *pw;
+ auto bool fuzzy;
if (tTd(38, 20))
printf("user_map_lookup(%s, %s)\n",
map->map_mname, key);
- pw = sm_getpwnam(key);
+ pw = finduser(key, &fuzzy);
if (pw == NULL)
return NULL;
if (bitset(MF_MATCHONLY, map->map_mflags))
@@ -2986,13 +3596,14 @@ prog_map_lookup(map, name, av, statp)
map->map_mname, errstring(errno));
rval = NULL;
}
- else if (i == 0 && tTd(38, 20))
+ else if (i == 0)
{
- printf("prog_map_lookup(%s): empty answer\n",
- map->map_mname);
+ if (tTd(38, 20))
+ printf("prog_map_lookup(%s): empty answer\n",
+ map->map_mname);
rval = NULL;
}
- if (i > 0)
+ else
{
buf[i] = '\0';
p = strchr(buf, '\n');
diff --git a/usr.sbin/sendmail/src/mci.c b/usr.sbin/sendmail/src/mci.c
index beff01977351..f901ea85e2d5 100644
--- a/usr.sbin/sendmail/src/mci.c
+++ b/usr.sbin/sendmail/src/mci.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995 Eric P. Allman
+ * Copyright (c) 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -33,10 +33,11 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)mci.c 8.22.1.1 (Berkeley) 9/16/96";
+static char sccsid[] = "@(#)mci.c 8.44 (Berkeley) 10/9/96";
#endif /* not lint */
#include "sendmail.h"
+#include <dirent.h>
/*
** Mail Connection Information (MCI) Caching Module.
@@ -62,10 +63,17 @@ static char sccsid[] = "@(#)mci.c 8.22.1.1 (Berkeley) 9/16/96";
** connection and reopen it. Note that this means that a
** server SMTP that doesn't support NOOP will hose the
** algorithm -- but that doesn't seem too likely.
+**
+** The persistent MCI code is donated by Mark Lovell and Paul
+** Vixie. It is based on the long term host status code in KJS
+** written by Paul but has been adapted by Mark to fit into the
+** MCI structure.
*/
MCI **MciCache; /* the open connection cache */
+extern int mci_generate_persistent_path __P((const char *, char *, int, bool));
+extern void mci_load_persistent __P((MCI *));
extern void mci_uncache __P((MCI **, bool));
/*
** MCI_CACHE -- enter a connection structure into the open connection cache
@@ -84,7 +92,6 @@ mci_cache(mci)
register MCI *mci;
{
register MCI **mcislot;
- extern MCI **mci_scan();
/*
** Find the best slot. This may cause expired connections
@@ -204,6 +211,8 @@ mci_uncache(mcislot, doquit)
return;
*mcislot = NULL;
+ mci_unlock_host(mci);
+
if (tTd(42, 5))
printf("mci_uncache: uncaching %x (%s) from slot %d (%d)\n",
mci, mci->mci_host, mcislot - MciCache, doquit);
@@ -279,7 +288,6 @@ mci_get(host, m)
{
register MCI *mci;
register STAB *s;
- extern MCI **mci_scan();
#ifdef DAEMON
extern SOCKADDR CurHostAddr;
@@ -297,6 +305,8 @@ mci_get(host, m)
mci = &s->s_mci;
mci->mci_host = s->s_name;
+ mci_load_persistent(mci);
+
if (tTd(42, 2))
{
printf("mci_get(%s %s): mci_state=%d, _flags=%x, _exitstat=%d, _errno=%d\n",
@@ -307,8 +317,10 @@ mci_get(host, m)
#ifdef SMTP
if (mci->mci_state == MCIS_OPEN)
{
+ extern int smtpprobe __P((MCI *));
+
/* poke the connection to see if it's still alive */
- smtpprobe(mci);
+ (void) smtpprobe(mci);
/* reset the stored state in the event of a timeout */
if (mci->mci_state != MCIS_OPEN)
@@ -330,7 +342,6 @@ mci_get(host, m)
# endif
}
#endif
-#ifdef MAYBE_NEXT_RELEASE
if (mci->mci_state == MCIS_CLOSED)
{
time_t now = curtime();
@@ -343,11 +354,36 @@ mci_get(host, m)
mci->mci_exitstat = EX_OK;
}
}
-#endif
return mci;
}
/*
+** MCI_SETSTAT -- set status codes in MCI structure.
+**
+** Parameters:
+** mci -- the MCI structure to set.
+** dstat -- the DSN status code.
+** rstat -- the SMTP status code.
+**
+** Returns:
+** none.
+*/
+
+void
+mci_setstat(mci, dstat, rstat)
+ MCI *mci;
+ char *dstat;
+ char *rstat;
+{
+ mci->mci_status = dstat;
+ if (rstat != NULL)
+ {
+ if (mci->mci_rstatus != NULL)
+ free(mci->mci_rstatus);
+ mci->mci_rstatus = newstr(rstat);
+ }
+}
+ /*
** MCI_DUMP -- dump the contents of an MCI structure.
**
** Parameters:
@@ -360,6 +396,32 @@ mci_get(host, m)
** none.
*/
+struct mcifbits
+{
+ int mcif_bit; /* flag bit */
+ char *mcif_name; /* flag name */
+};
+struct mcifbits MciFlags[] =
+{
+ { MCIF_VALID, "VALID" },
+ { MCIF_TEMP, "TEMP" },
+ { MCIF_CACHED, "CACHED" },
+ { MCIF_ESMTP, "ESMTP" },
+ { MCIF_EXPN, "EXPN" },
+ { MCIF_SIZE, "SIZE" },
+ { MCIF_8BITMIME, "8BITMIME" },
+ { MCIF_7BIT, "7BIT" },
+ { MCIF_MULTSTAT, "MULTSTAT" },
+ { MCIF_INHEADER, "INHEADER" },
+ { MCIF_CVT8TO7, "CVT8TO7" },
+ { MCIF_DSN, "DSN" },
+ { MCIF_8BITOK, "8BITOK" },
+ { MCIF_CVT7TO8, "CVT7TO8" },
+ { MCIF_INMIME, "INMIME" },
+ { 0, NULL }
+};
+
+
void
mci_dump(mci, logit)
register MCI *mci;
@@ -379,9 +441,25 @@ mci_dump(mci, logit)
snprintf(p, SPACELEFT(buf, p), "NULL");
goto printit;
}
+ snprintf(p, SPACELEFT(buf, p), "flags=%x", mci->mci_flags);
+ p += strlen(p);
+ if (mci->mci_flags != 0)
+ {
+ struct mcifbits *f;
+
+ *p++ = '<';
+ for (f = MciFlags; f->mcif_bit != 0; f++)
+ {
+ if (!bitset(f->mcif_bit, mci->mci_flags))
+ continue;
+ snprintf(p, SPACELEFT(buf, p), "%s,", f->mcif_name);
+ p += strlen(p);
+ }
+ p[-1] = '>';
+ }
snprintf(p, SPACELEFT(buf, p),
- "flags=%x, errno=%d, herrno=%d, exitstat=%d, state=%d, pid=%d,%s",
- mci->mci_flags, mci->mci_errno, mci->mci_herrno,
+ ",%serrno=%d, herrno=%d, exitstat=%d, state=%d, pid=%d,%s",
+ sep, mci->mci_errno, mci->mci_herrno,
mci->mci_exitstat, mci->mci_state, mci->mci_pid, sep);
p += strlen(p);
snprintf(p, SPACELEFT(buf, p),
@@ -392,6 +470,12 @@ mci_dump(mci, logit)
sep);
p += strlen(p);
snprintf(p, SPACELEFT(buf, p),
+ "status=%s, rstatus=%s,%s",
+ mci->mci_status == NULL ? "NULL" : mci->mci_status,
+ mci->mci_rstatus == NULL ? "NULL" : mci->mci_rstatus,
+ sep);
+ p += strlen(p);
+ snprintf(p, SPACELEFT(buf, p),
"host=%s, lastuse=%s",
mci->mci_host == NULL ? "NULL" : mci->mci_host,
ctime(&mci->mci_lastuse));
@@ -426,3 +510,742 @@ mci_dump_all(logit)
for (i = 0; i < MaxMciCache; i++)
mci_dump(MciCache[i], logit);
}
+ /*
+** MCI_LOCK_HOST -- Lock host while sending.
+**
+** If we are contacting a host, we'll need to
+** update the status information in the host status
+** file, and if we want to do that, we ought to have
+** locked it. This has the (according to some)
+** desirable effect of serializing connectivity with
+** remote hosts -- i.e.: one connection to a give
+** host at a time.
+**
+** Parameters:
+** mci -- containing the host we want to lock.
+**
+** Returns:
+** EX_OK -- got the lock.
+** EX_TEMPFAIL -- didn't get the lock.
+*/
+
+int
+mci_lock_host(mci)
+ MCI *mci;
+{
+ if (mci == NULL)
+ {
+ if (tTd(56, 1))
+ printf("mci_lock_host: NULL mci\n");
+ return EX_OK;
+ }
+
+ if (!SingleThreadDelivery)
+ return EX_OK;
+
+ return mci_lock_host_statfile(mci);
+}
+
+int
+mci_lock_host_statfile(mci)
+ MCI *mci;
+{
+ int savedErrno = errno;
+ int retVal = EX_OK;
+ char fname[MAXPATHLEN+1];
+
+ if (HostStatDir == NULL || mci->mci_host == NULL)
+ return EX_OK;
+
+ if (tTd(56, 2))
+ printf("mci_lock_host: attempting to lock %s\n",
+ mci->mci_host);
+
+ if (mci_generate_persistent_path(mci->mci_host, fname, sizeof fname, TRUE) < 0)
+ {
+ /* of course this should never happen */
+ if (tTd(56, 2))
+ printf("mci_lock_host: Failed to generate host path for %s\n",
+ mci->mci_host);
+
+ retVal = EX_TEMPFAIL;
+ goto cleanup;
+ }
+
+ if ((mci->mci_statfile = fopen(fname, "r+")) == NULL)
+ mci->mci_statfile = fopen(fname, "w");
+
+ if (mci->mci_statfile == NULL)
+ {
+ syserr("mci_lock_host: cannot create host lock file %s",
+ fname);
+ goto cleanup;
+ }
+
+ if (!lockfile(fileno(mci->mci_statfile), fname, "", LOCK_EX|LOCK_NB))
+ {
+ if (tTd(56, 2))
+ printf("mci_lock_host: couldn't get lock on %s\n",
+ fname);
+ fclose(mci->mci_statfile);
+ mci->mci_statfile = NULL;
+ retVal = EX_TEMPFAIL;
+ goto cleanup;
+ }
+
+ if (tTd(56, 12) && mci->mci_statfile != NULL)
+ printf("mci_lock_host: Sanity check -- lock is good\n");
+
+cleanup:
+ errno = savedErrno;
+ return retVal;
+}
+ /*
+** MCI_UNLOCK_HOST -- unlock host
+**
+** Clean up the lock on a host, close the file, let
+** someone else use it.
+**
+** Parameters:
+** mci -- us.
+**
+** Returns:
+** nothing.
+*/
+
+void
+mci_unlock_host(mci)
+ MCI *mci;
+{
+ int saveErrno = errno;
+
+ if (mci == NULL)
+ {
+ if (tTd(56, 1))
+ printf("mci_unlock_host: NULL mci\n");
+ return;
+ }
+
+ if (HostStatDir == NULL || mci->mci_host == NULL)
+ return;
+
+ if (!SingleThreadDelivery && mci_lock_host_statfile(mci) == EX_TEMPFAIL)
+ {
+ if (tTd(56, 1))
+ printf("mci_unlock_host: stat file already locked\n");
+ }
+ else
+ {
+ if (tTd(56, 2))
+ printf("mci_unlock_host: store prior to unlock\n");
+
+ mci_store_persistent(mci);
+ }
+
+ if (mci->mci_statfile != NULL)
+ {
+ fclose(mci->mci_statfile);
+ mci->mci_statfile = NULL;
+ }
+
+ errno = saveErrno;
+}
+ /*
+** MCI_LOAD_PERSISTENT -- load persistent host info
+**
+** Load information about host that is kept
+** in common for all running sendmails.
+**
+** Parameters:
+** mci -- the host/connection to load persistent info
+** for.
+**
+** Returns:
+** none.
+*/
+
+void
+mci_load_persistent(mci)
+ MCI *mci;
+{
+ int saveErrno = errno;
+ FILE *fp;
+ int status;
+ char fname[MAXPATHLEN+1];
+
+ if (mci == NULL)
+ {
+ if (tTd(56, 1))
+ printf("mci_load_persistent: NULL mci\n");
+ return;
+ }
+
+ if (HostStatDir == NULL || mci->mci_host == NULL)
+ return;
+
+ if (tTd(56, 1))
+ printf("mci_load_persistent: Attempting to load persistent information for %s\n",
+ mci->mci_host);
+
+ if (mci_generate_persistent_path(mci->mci_host, fname, sizeof fname, FALSE) < 0)
+ {
+ /* Not much we can do if the file isn't there... */
+ if (tTd(56, 1))
+ printf("mci_load_persistent: Couldn't generate host path\n");
+ goto cleanup;
+ }
+
+ fp = fopen(fname, "r");
+ if (fp == NULL)
+ {
+ /* I can't think of any reason this should ever happen */
+ if (tTd(56, 1))
+ printf("mci_load_persistent: open(%s): %s\n",
+ fname, errstring(errno));
+ goto cleanup;
+ }
+
+ FileName = fname;
+ (void) mci_read_persistent(fp, mci);
+ FileName = NULL;
+ fclose(fp);
+
+cleanup:
+ errno = saveErrno;
+ return;
+}
+ /*
+** MCI_READ_PERSISTENT -- read persistent host status file
+**
+** Parameters:
+** fp -- the file pointer to read.
+** mci -- the pointer to fill in.
+**
+** Returns:
+** -1 -- if the file was corrupt.
+** 0 -- otherwise.
+**
+** Warning:
+** This code makes the assumption that this data
+** will be read in an atomic fashion, and that the data
+** was written in an atomic fashion. Any other functioning
+** may lead to some form of insanity. This should be
+** perfectly safe due to underlying stdio buffering.
+*/
+
+int
+mci_read_persistent(fp, mci)
+ FILE *fp;
+ register MCI *mci;
+{
+ int ver;
+ register char *p;
+ char buf[MAXLINE];
+
+ if (fp == NULL)
+ syserr("mci_read_persistent: NULL fp");
+ if (mci == NULL)
+ syserr("mci_read_persistent: NULL mci");
+ if (tTd(56, 93))
+ {
+ printf("mci_read_persistent: fp=%x, mci=", fp);
+ mci_dump(mci, FALSE);
+ }
+
+ mci->mci_status = NULL;
+ if (mci->mci_rstatus != NULL)
+ free(mci->mci_rstatus);
+ mci->mci_rstatus = NULL;
+
+ rewind(fp);
+ while (fgets(buf, sizeof buf, fp) != NULL)
+ {
+ p = strchr(buf, '\n');
+ if (p != NULL)
+ *p = '\0';
+ switch (buf[0])
+ {
+ case 'V': /* version stamp */
+ ver = atoi(&buf[1]);
+ if (ver < 0 || ver > 0)
+ syserr("Unknown host status version %d: %d max",
+ ver, 0);
+ break;
+
+ case 'E': /* UNIX error number */
+ mci->mci_errno = atoi(&buf[1]);
+ break;
+
+ case 'H': /* DNS error number */
+ mci->mci_herrno = atoi(&buf[1]);
+ break;
+
+ case 'S': /* UNIX exit status */
+ mci->mci_exitstat = atoi(&buf[1]);
+ break;
+
+ case 'D': /* DSN status */
+ mci->mci_status = newstr(&buf[1]);
+ break;
+
+ case 'R': /* SMTP status */
+ mci->mci_rstatus = newstr(&buf[1]);
+ break;
+
+ case 'U': /* last usage time */
+ mci->mci_lastuse = atol(&buf[1]);
+ break;
+
+ case '.': /* end of file */
+ return 0;
+
+ default:
+ syserr("Unknown host status line \"%s\"", buf);
+ return -1;
+ }
+ }
+ return 0;
+}
+ /*
+** MCI_STORE_PERSISTENT -- Store persistent MCI information
+**
+** Store information about host that is kept
+** in common for all running sendmails.
+**
+** Parameters:
+** mci -- the host/connection to store persistent info for.
+**
+** Returns:
+** none.
+*/
+
+void
+mci_store_persistent(mci)
+ MCI *mci;
+{
+ int saveErrno = errno;
+
+ if (mci == NULL)
+ {
+ if (tTd(56, 1))
+ printf("mci_store_persistent: NULL mci\n");
+ return;
+ }
+
+ if (HostStatDir == NULL || mci->mci_host == NULL)
+ return;
+
+ if (tTd(56, 1))
+ printf("mci_store_persistent: Storing information for %s\n",
+ mci->mci_host);
+
+ if (mci->mci_statfile == NULL)
+ {
+ if (tTd(56, 1))
+ printf("mci_store_persistent: no statfile\n");
+ return;
+ }
+
+ rewind(mci->mci_statfile);
+#if !NOFTRUNCATE
+ (void) ftruncate(fileno(mci->mci_statfile), (off_t) 0);
+#endif
+
+ fprintf(mci->mci_statfile, "V0\n");
+ fprintf(mci->mci_statfile, "E%d\n", mci->mci_errno);
+ fprintf(mci->mci_statfile, "H%d\n", mci->mci_herrno);
+ fprintf(mci->mci_statfile, "S%d\n", mci->mci_exitstat);
+ if (mci->mci_status != NULL)
+ fprintf(mci->mci_statfile, "D%.80s\n",
+ denlstring(mci->mci_status, TRUE, FALSE));
+ if (mci->mci_rstatus != NULL)
+ fprintf(mci->mci_statfile, "R%.80s\n",
+ denlstring(mci->mci_rstatus, TRUE, FALSE));
+ fprintf(mci->mci_statfile, "U%ld\n", mci->mci_lastuse);
+ fprintf(mci->mci_statfile, ".\n");
+
+ fflush(mci->mci_statfile);
+
+cleanup:
+ errno = saveErrno;
+ return;
+}
+ /*
+** MCI_TRAVERSE_PERSISTENT -- walk persistent status tree
+**
+** Recursively find all the mci host files in `pathname'. Default to
+** main host status directory if no path is provided.
+** Call (*action)(pathname, host) for each file found.
+**
+** Note: all information is collected in a list before it is processed.
+** This may not be the best way to do it, but it seems safest, since
+** the file system would be touched while we are attempting to traverse
+** the directory tree otherwise (during purges).
+**
+** Parameters:
+** action -- function to call on each node. If returns < 0,
+** return immediately.
+** pathname -- root of tree. If null, use main host status
+** directory.
+**
+** Returns:
+** < 0 -- if any action routine returns a negative value, that
+** value is returned.
+** 0 -- if we successfully went to completion.
+*/
+
+int
+mci_traverse_persistent(action, pathname)
+ int (*action)();
+ char *pathname;
+{
+ struct stat statbuf;
+ DIR *d;
+ int ret = 0;
+
+ if (pathname == NULL)
+ pathname = HostStatDir;
+ if (pathname == NULL)
+ return -1;
+
+ if (tTd(56, 1))
+ printf("mci_traverse: pathname is %s\n", pathname);
+
+ ret = stat(pathname, &statbuf);
+ if (ret < 0)
+ {
+ if (tTd(56, 2))
+ printf("mci_traverse: Failed to stat %s: %s\n",
+ pathname, errstring(errno));
+ return ret;
+ }
+ if (S_ISDIR(statbuf.st_mode))
+ {
+ struct dirent *e;
+ char *newptr;
+ char newpath[MAXPATHLEN+1];
+
+ if ((d = opendir(pathname)) == NULL)
+ {
+ if (tTd(56, 2))
+ printf("mci_traverse: opendir %s: %s\n",
+ pathname, errstring(errno));
+ return -1;
+ }
+
+ if (strlen(pathname) >= sizeof newpath - MAXNAMLEN - 3)
+ {
+ if (tTd(56, 2))
+ printf("mci_traverse: path \"%s\" too long",
+ pathname);
+ return -1;
+ }
+ strcpy(newpath, pathname);
+ newptr = newpath + strlen(newpath);
+ *newptr++ = '/';
+
+ while ((e = readdir(d)) != NULL)
+ {
+ if (e->d_name[0] == '.')
+ continue;
+
+ strncpy(newptr, e->d_name,
+ sizeof newpath - (newptr - newpath) - 1);
+ newpath[sizeof newpath - 1] = '\0';
+
+ ret = mci_traverse_persistent(action, newpath);
+ if (ret < 0)
+ break;
+
+ /*
+ ** The following appears to be
+ ** necessary during purgest, since
+ ** we modify the directory structure
+ */
+
+ if (action == mci_purge_persistent)
+ rewinddir(d);
+ }
+ closedir(d);
+ }
+ else if (S_ISREG(statbuf.st_mode))
+ {
+ char *end = pathname + strlen(pathname) - 1;
+ char *start;
+ char *scan;
+ char host[MAXHOSTNAMELEN];
+ char *hostptr = host;
+
+ /*
+ ** Reconstruct the host name from the path to the
+ ** persistent information.
+ */
+
+ do
+ {
+ if (hostptr != host)
+ *(hostptr++) = '.';
+ start = end;
+ while (*(start - 1) != '/')
+ start--;
+
+ if (*end == '.')
+ end--;
+
+ for (scan = start; scan <= end; scan++)
+ *(hostptr++) = *scan;
+
+ end = start - 2;
+ } while (*end == '.');
+
+ *hostptr = '\0';
+
+ /*
+ ** Do something with the file containing the persistent
+ ** information.
+ */
+ ret = (*action)(pathname, host);
+ }
+
+ return ret;
+}
+ /*
+** MCI_PRINT_PERSISTENT -- print persisten info
+**
+** Dump the persistent information in the file 'pathname'
+**
+** Parameters:
+** pathname -- the pathname to the status file.
+** hostname -- the corresponding host name.
+**
+** Returns:
+** 0
+*/
+
+int
+mci_print_persistent(pathname, hostname)
+ char *pathname;
+ char *hostname;
+{
+ static int initflag = FALSE;
+ FILE *fp;
+ int status;
+ int width = Verbose ? 78 : 25;
+ bool locked;
+ MCI mcib;
+
+ if (!initflag)
+ {
+ initflag = TRUE;
+ printf(" -------------- Hostname --------------- How long ago ---------Results---------\n");
+ }
+
+ fp = fopen(pathname, "r+");
+
+ if (fp == NULL)
+ {
+ if (tTd(56, 1))
+ printf("mci_print_persistent: cannot open %s: %s\n",
+ pathname, errstring(errno));
+ return 0;
+ }
+
+ bzero(&mcib, sizeof mcib);
+ if (mci_read_persistent(fp, &mcib) < 0)
+ {
+ syserr("%s: could not read status file", pathname);
+ fclose(fp);
+ return 0;
+ }
+
+ locked = !lockfile(fileno(fp), pathname, "", LOCK_EX|LOCK_NB);
+ fclose(fp);
+
+ if (mcib.mci_rstatus == NULL)
+ printf("%c%-39s %12s %.*s\n",
+ locked ? '*' : ' ', hostname,
+ pintvl(curtime() - mcib.mci_lastuse, TRUE),
+ width, errstring(mcib.mci_errno));
+ else
+ printf("%c%-39s %12s %.*s\n",
+ locked ? '*' : ' ', hostname,
+ pintvl(curtime() - mcib.mci_lastuse, TRUE),
+ width, mcib.mci_rstatus);
+
+ return 0;
+}
+ /*
+** MCI_PURGE_PERSISTENT -- Remove a persistence status file.
+**
+** Parameters:
+** pathname -- path to the status file.
+** hostname -- name of host corresponding to that file.
+**
+** Returns:
+** 0
+*/
+
+int
+mci_purge_persistent(pathname, hostname)
+ char *pathname;
+ char *hostname;
+{
+ char *end = pathname + strlen(pathname) - 1;
+
+ if (tTd(56, 1))
+ printf("mci_purge_persistent: purging %s\n", pathname);
+
+ /* remove the file */
+ if (unlink(pathname) < 0)
+ {
+ if (tTd(56, 2))
+ printf("mci_purge_persistent: failed to unlink %s: %s\n",
+ pathname, errstring(errno));
+ return -1;
+ }
+
+ /*
+ ** remove empty parent directories.
+ */
+
+ for (;;)
+ {
+ while (*end != '/')
+ end--;
+ *(end--) = '\0';
+
+ if (*end != '.')
+ break;
+
+ if (tTd(56, 1))
+ printf("mci_purge_persistent: dpurge %s\n", pathname);
+
+ if (rmdir(pathname) < 0)
+ {
+ if (errno == ENOENT || errno == EEXIST)
+ break; /* directory is not empty */
+#ifdef ENOTEMTPY
+ if (errno == ENOTEMPTY)
+ break; /* BSDism */
+#endif
+ if (tTd(56, 2))
+ printf("mci_purge_persistent: rmdir %s: %s\n",
+ pathname, errstring(errno));
+ break;
+ }
+
+ }
+
+ return 0;
+}
+ /*
+** MCI_GENERATE_PERSISTENT_PATH -- generate path from hostname
+**
+** Given `host', convert from a.b.c to $QueueDir/.hoststat/c./b./a,
+** putting the result into `path'. if `createflag' is set, intervening
+** directories will be created as needed.
+**
+** Parameters:
+** host -- host name to convert from.
+** path -- place to store result.
+** pathlen -- length of path buffer.
+** createflag -- if set, create intervening directories as
+** needed.
+**
+** Returns:
+** 0 -- success
+** -1 -- failure
+*/
+
+int
+mci_generate_persistent_path(host, path, pathlen, createflag)
+ const char *host;
+ char *path;
+ int pathlen;
+ bool createflag;
+{
+ char *elem, *p, *x, ch;
+ int ret = 0;
+ int len;
+ char t_host[MAXHOSTNAMELEN];
+
+ /*
+ ** Rationality check the arguments.
+ */
+
+ if (host == NULL)
+ syserr("mci_generate_persistent_path: null host");
+ if (path == NULL)
+ syserr("mci_generate_persistent_path: null path");
+
+ if (tTd(56, 80))
+ printf("mci_generate_persistent_path(%s): ", host);
+
+ /* make certain this is not a bracketed host number */
+ if (strlen(host) > sizeof t_host - 1)
+ return -1;
+ if (host[0] == '[')
+ strcpy(t_host, host + 1);
+ else
+ strcpy(t_host, host);
+
+ /*
+ ** Delete any trailing dots from the hostname.
+ ** Leave 'elem' pointing at the \0.
+ */
+
+ elem = t_host + strlen(t_host);
+ while (elem > t_host && (elem[-1] == '.' || elem[-1] == ']'))
+ *--elem = '\0';
+
+ /* check for what will be the final length of the path */
+ len = strlen(HostStatDir) + 2;
+ for (p = (char *) host; *p != '\0'; p++)
+ {
+ if (*p == '|' || *p != '.')
+ len++;
+ len++;
+ }
+ if (len > pathlen)
+ return -1;
+
+ strcpy(path, HostStatDir);
+ p = path + strlen(path);
+
+ while (elem > t_host)
+ {
+ if (!path_is_dir(path, createflag))
+ {
+ ret = -1;
+ break;
+ }
+ elem--;
+ while (elem >= t_host && *elem != '.')
+ elem--;
+ *p++ = '/';
+ x = elem + 1;
+ while ((ch = *x++) != '\0' && ch != '.')
+ {
+ if (isupper(ch))
+ ch = tolower(ch);
+ if (ch == '|')
+ *p++ = '|'; /* | -> || */
+ else if (ch == '/')
+ ch = '|'; /* / -> | */
+ *p++ = ch;
+ }
+ if (elem >= t_host)
+ *p++ = '.';
+ *p = '\0';
+ }
+
+ if (tTd(56, 80))
+ {
+ if (ret < 0)
+ printf("FAILURE %d\n", ret);
+ else
+ printf("SUCCESS %s\n", path);
+ }
+
+ return (ret);
+}
diff --git a/usr.sbin/sendmail/src/mime.c b/usr.sbin/sendmail/src/mime.c
index 1c71a84ac6bb..670a6cd1635a 100644
--- a/usr.sbin/sendmail/src/mime.c
+++ b/usr.sbin/sendmail/src/mime.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994 Eric P. Allman
+ * Copyright (c) 1994, 1996 Eric P. Allman
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
*
@@ -36,7 +36,7 @@
# include <string.h>
#ifndef lint
-static char sccsid[] = "@(#)mime.c 8.30.1.1 (Berkeley) 9/16/96";
+static char sccsid[] = "@(#)mime.c 8.48 (Berkeley) 10/18/96";
#endif /* not lint */
/*
@@ -72,6 +72,10 @@ static char *MimeBoundaryNames[] =
{
"SYNTAX", "NOTSEP", "INTERMED", "FINAL"
};
+
+bool MapNLtoCRLF;
+
+extern int mimeboundary __P((char *, char **));
/*
** MIME8TO7 -- output 8 bit body in 7 bit format
**
@@ -125,11 +129,14 @@ mime8to7(mci, header, e, boundaries, flags)
char **pvp;
int argc = 0;
char *bp;
+ bool use_qp = FALSE;
struct args argv[MAXMIMEARGS];
char bbuf[128];
char buf[MAXLINE];
char pvpbuf[MAXLINE];
extern u_char MimeTokenTab[256];
+ extern int mime_getchar __P((FILE *, char **, int *));
+ extern int mime_getchar_crlf __P((FILE *, char **, int *));
if (tTd(43, 1))
{
@@ -143,6 +150,7 @@ mime8to7(mci, header, e, boundaries, flags)
}
printf("\n");
}
+ MapNLtoCRLF = TRUE;
p = hvalue("Content-Transfer-Encoding", header);
if (p == NULL ||
(pvp = prescan(p, '\0', pvpbuf, sizeof pvpbuf, NULL,
@@ -226,6 +234,13 @@ mime8to7(mci, header, e, boundaries, flags)
if (wordinclass(buf, 'n') || (cte != NULL && !wordinclass(cte, 'e')))
flags |= M87F_NO8BIT;
+#ifdef USE_B_CLASS
+ if (wordinclass(buf, 'b') || wordinclass(type, 'b'))
+ MapNLtoCRLF = FALSE;
+#endif
+ if (wordinclass(buf, 'q') || wordinclass(type, 'q'))
+ use_qp = TRUE;
+
/*
** Multipart requires special processing.
**
@@ -246,8 +261,12 @@ mime8to7(mci, header, e, boundaries, flags)
}
if (i >= argc)
{
- syserr("mime8to7: Content-Type: %s missing boundary", p);
+ syserr("mime8to7: Content-Type: \"%s\": missing boundary",
+ p);
p = "---";
+
+ /* avoid bounce loops */
+ e->e_flags |= EF_DONT_MIME;
}
else
{
@@ -260,6 +279,9 @@ mime8to7(mci, header, e, boundaries, flags)
syserr("mime8to7: multipart boundary \"%s\" too long",
p);
blen = sizeof bbuf - 1;
+
+ /* avoid bounce loops */
+ e->e_flags |= EF_DONT_MIME;
}
strncpy(bbuf, p, blen);
bbuf[blen] = '\0';
@@ -269,7 +291,12 @@ mime8to7(mci, header, e, boundaries, flags)
if (boundaries[i] == NULL)
break;
if (i >= MAXMIMENESTING)
+ {
syserr("mime8to7: multipart nesting boundary too deep");
+
+ /* avoid bounce loops */
+ e->e_flags |= EF_DONT_MIME;
+ }
else
{
boundaries[i] = bbuf;
@@ -332,7 +359,7 @@ mime8to7(mci, header, e, boundaries, flags)
}
/*
- ** Message/* types -- recurse exactly once.
+ ** Message/xxx types -- recurse exactly once.
**
** Class 's' is predefined to have "rfc822" only.
*/
@@ -422,9 +449,11 @@ mime8to7(mci, header, e, boundaries, flags)
if (tTd(43, 8))
{
- printf("mime8to7: %ld high bit(s) in %ld byte(s), cte=%s\n",
+ printf("mime8to7: %ld high bit(s) in %ld byte(s), cte=%s, type=%s/%s\n",
sectionhighbits, sectionsize,
- cte == NULL ? "[none]" : cte);
+ cte == NULL ? "[none]" : cte,
+ type == NULL ? "[none]" : type,
+ subtype == NULL ? "[none]" : subtype);
}
if (cte != NULL && strcasecmp(cte, "binary") == 0)
sectionsize = sectionhighbits;
@@ -453,14 +482,19 @@ mime8to7(mci, header, e, boundaries, flags)
if (feof(e->e_dfp))
bt = MBT_FINAL;
}
- else if (sectionsize / 8 < sectionhighbits)
+ else if (!MapNLtoCRLF ||
+ (sectionsize / 8 < sectionhighbits && !use_qp))
{
/* use base64 encoding */
int c1, c2;
- putline("Content-Transfer-Encoding: base64", mci);
if (tTd(43, 36))
printf(" ...Content-Transfer-Encoding: base64\n");
+ putline("Content-Transfer-Encoding: base64", mci);
+ snprintf(buf, sizeof buf,
+ "X-MIME-Autoconverted: from 8bit to base64 by %s id %s",
+ MyHostName, e->e_id);
+ putline(buf, mci);
putline("", mci);
mci->mci_flags &= ~MCIF_INHEADER;
while ((c1 = mime_getchar_crlf(e->e_dfp, boundaries, &bt)) != EOF)
@@ -519,9 +553,13 @@ mime8to7(mci, header, e, boundaries, flags)
for (p = "!\"#$@[\\]^`{|}~"; *p != '\0'; p++)
setbitn(*p, badchars);
- putline("Content-Transfer-Encoding: quoted-printable", mci);
if (tTd(43, 36))
printf(" ...Content-Transfer-Encoding: quoted-printable\n");
+ putline("Content-Transfer-Encoding: quoted-printable", mci);
+ snprintf(buf, sizeof buf,
+ "X-MIME-Autoconverted: from 8bit to quoted-printable by %s id %s",
+ MyHostName, e->e_id);
+ putline(buf, mci);
putline("", mci);
mci->mci_flags &= ~MCIF_INHEADER;
fromstate = 0;
@@ -693,7 +731,7 @@ mime_getchar(fp, boundaries, btp)
*bp++ = c;
}
*bp = '\0';
- bt = mimeboundary(&buf[1], boundaries);
+ bt = mimeboundary((char *) &buf[1], boundaries);
switch (bt)
{
case MBT_FINAL:
@@ -746,7 +784,7 @@ mime_getchar_crlf(fp, boundaries, btp)
return '\n';
}
c = mime_getchar(fp, boundaries, btp);
- if (c == '\n')
+ if (c == '\n' && MapNLtoCRLF)
{
sendlf = TRUE;
return '\r';
@@ -776,6 +814,7 @@ mimeboundary(line, boundaries)
int type = MBT_NOTSEP;
int i;
int savec;
+ extern int isboundary __P((char *, char **));
if (line[0] != '-' || line[1] != '-' || boundaries == NULL)
return MBT_NOTSEP;
@@ -864,4 +903,299 @@ isboundary(line, boundaries)
return -1;
}
-#endif /* MIME */
+#endif /* MIME8TO7 */
+
+#if MIME7TO8
+
+/*
+** MIME7TO8 -- output 7 bit encoded MIME body in 8 bit format
+**
+** This is a hack. Supports translating the two 7-bit body-encodings
+** (quoted-printable and base64) to 8-bit coded bodies.
+**
+** There is not much point in supporting multipart here, as the UA
+** will be able to deal with encoded MIME bodies if it can parse MIME
+** multipart messages.
+**
+** Note also that we wont be called unless it is a text/plain MIME
+** message, encoded base64 or QP and mailer flag '9' has been defined
+** on mailer.
+**
+** Contributed by Marius Olaffson <marius@rhi.hi.is>.
+**
+** Parameters:
+** mci -- mailer connection information.
+** header -- the header for this body part.
+** e -- envelope.
+**
+** Returns:
+** none.
+*/
+
+extern void mime_from64 __P((u_char *, u_char *, int));
+extern int mime_fromqp __P((u_char *, u_char **, int, int));
+
+void
+mime7to8(mci, header, e)
+ register MCI *mci;
+ HDR *header;
+ register ENVELOPE *e;
+{
+ register char *p;
+ char *cte;
+ char **pvp;
+ u_char *obp;
+ u_char ch, *fbufp, *obufp;
+ char buf[MAXLINE];
+ u_char obuf[MAXLINE + 1];
+ u_char fbuf[MAXLINE + 1];
+ char pvpbuf[MAXLINE];
+ extern u_char MimeTokenTab[256];
+
+ p = hvalue("Content-Transfer-Encoding", header);
+ if (p == NULL ||
+ (pvp = prescan(p, '\0', pvpbuf, sizeof pvpbuf, NULL,
+ MimeTokenTab)) == NULL ||
+ pvp[0] == NULL)
+ {
+ /* "can't happen" -- upper level should have caught this */
+ syserr("mime7to8: unparsable CTE %s", p == NULL ? "<NULL>" : p);
+
+ /* avoid bounce loops */
+ e->e_flags |= EF_DONT_MIME;
+
+ /* cheap failsafe algorithm -- should work on text/plain */
+ if (p != NULL)
+ {
+ snprintf(buf, sizeof buf,
+ "Content-Transfer-Encoding: %s", p);
+ putline(buf, mci);
+ }
+ putline("", mci);
+ mci->mci_flags &= ~MCIF_INHEADER;
+ while (fgets(buf, sizeof buf, e->e_dfp) != NULL)
+ putline(buf, mci);
+ return;
+ }
+ cataddr(pvp, NULL, buf, sizeof buf, '\0');
+ cte = newstr(buf);
+
+ putline("Content-Transfer-Encoding: 8bit", mci);
+ snprintf(buf, sizeof buf,
+ "X-MIME-Autoconverted: from %.200s to 8bit by %s id %s",
+ cte, MyHostName, e->e_id);
+ putline(buf, mci);
+ putline("", mci);
+ mci->mci_flags &= ~MCIF_INHEADER;
+
+ /*
+ ** Translate body encoding to 8-bit. Supports two types of
+ ** encodings; "base64" and "quoted-printable". Assume qp if
+ ** it is not base64.
+ */
+
+ if (strcasecmp(cte, "base64") == 0)
+ {
+ fbufp = fbuf;
+ while (fgets(buf, sizeof buf, e->e_dfp) != NULL)
+ {
+ obufp = obuf;
+ mime_from64((u_char *) buf, obuf, MAXLINE);
+ while ((ch = *obufp++) != '\0')
+ {
+ *fbufp++ = ch;
+ if (ch == '\n' || fbufp >= &fbuf[MAXLINE])
+ {
+ *fbufp = '\0';
+ putline((char *) fbuf, mci);
+ fbufp = fbuf;
+ }
+ }
+
+ /* force out partial last line */
+ if (fbufp > fbuf)
+ {
+ *fbufp = '\0';
+ putline((char *) fbuf, mci);
+ }
+ }
+ }
+ else
+ {
+ /* quoted-printable */
+ obp = obuf;
+ while (fgets(buf, sizeof buf, e->e_dfp) != NULL)
+ {
+ if (mime_fromqp((u_char *) buf, &obp, 0, &obuf[MAXLINE] - obp) == 0)
+ continue;
+
+ putline((char *) obuf, mci);
+ obp = obuf;
+ }
+ }
+ if (tTd(43, 3))
+ printf("\t\t\tmime7to8 => %s to 8bit done\n", cte);
+}
+ /*
+** The following is based on Borenstein's "codes.c" module, with simplifying
+** changes as we do not deal with multipart, and to do the translation in-core,
+** with an attempt to prevent overrun of output buffers.
+**
+** What is needed here are changes to defned this code better against
+** bad encodings. Questionable to always return 0xFF for bad mappings.
+*/
+
+static char index_hex[128] =
+{
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1, -1,-1,-1,-1,
+ -1,10,11,12, 13,14,15,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,10,11,12, 13,14,15,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1
+};
+
+#define HEXCHAR(c) (((c) < 0 || (c) > 127) ? -1 : index_hex[(c)])
+
+int
+mime_fromqp(infile, outfile, state, maxlen)
+ u_char *infile;
+ u_char **outfile;
+ int state; /* Decoding body (0) or header (1) */
+ int maxlen; /* Max # of chars allowed in outfile */
+{
+ int c1, c2;
+ int nchar = 0;
+
+ while ((c1 = *infile++) != '\0')
+ {
+ if (c1 == '=')
+ {
+ if ((c1 = *infile++) == 0)
+ break;
+
+ if (c1 == '\n') /* ignore it */
+ {
+ if (state == 0)
+ return 0;
+ }
+ else
+ {
+ if ((c2 = *infile++) == '\0')
+ break;
+
+ c1 = HEXCHAR(c1);
+ c2 = HEXCHAR(c2);
+
+ if (++nchar > maxlen)
+ break;
+
+ *(*outfile)++ = c1 << 4 | c2;
+ }
+ }
+ else
+ {
+ if (state == 1 && c1 == '_')
+ c1 = ' ';
+
+ if (++nchar > maxlen)
+ break;
+
+ *(*outfile)++ = c1;
+
+ if (c1 == '\n')
+ break;
+ }
+ }
+ *(*outfile)++ = '\0';
+ return 1;
+}
+
+static char index_64[128] =
+{
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
+ 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1,-1,-1,-1,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
+ 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
+ -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
+ 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
+};
+
+#define CHAR64(c) (((c) < 0 || (c) > 127) ? -1 : index_64[(c)])
+
+void
+mime_from64(infile, outfile, maxlen)
+ u_char *infile;
+ u_char *outfile;
+ int maxlen;
+{
+ int nchar = 0;
+ int c1, c2, c3, c4;
+
+ while ((c1 = *infile++) != '\0')
+ {
+ if (isascii(c1) && isspace(c1))
+ continue;
+
+ do
+ {
+ c2 = *infile++;
+ } while (isascii(c2) && isspace(c2));
+ if (c2 == '\0')
+ break;
+
+ do
+ {
+ c3 = *infile++;
+ } while (isascii(c3) && isspace(c3));
+ if (c3 == '\0')
+ break;
+
+ do
+ {
+ c4 = *infile++;
+ } while (isascii(c4) && isspace(c4));
+ if (c4 == '\0')
+ break;
+
+ if (c1 == '=' || c2 == '=')
+ {
+ continue;
+ }
+ c1 = CHAR64(c1);
+ c2 = CHAR64(c2);
+
+ if (++nchar > maxlen)
+ break;
+
+ *outfile++ = (c1 << 2) | ((c2 & 0x30) >> 4);
+
+ if (c3 != '=')
+ {
+ c3 = CHAR64(c3);
+
+ if (++nchar > maxlen)
+ break;
+
+ *outfile++ = ((c2 & 0x0f) << 4) | ((c3 & 0x3c) >> 2);
+ if (c4 != '=')
+ {
+ c4 = CHAR64(c4);
+
+ if (++nchar > maxlen)
+ break;
+
+ *outfile++ = ((c3 & 0x03) << 6) | c4;
+ }
+ }
+ }
+
+ *outfile = '\0';
+ return;
+}
+
+#endif /* MIME7TO8 */
diff --git a/usr.sbin/sendmail/src/queue.c b/usr.sbin/sendmail/src/queue.c
index eb5176eade91..75263b7007bb 100644
--- a/usr.sbin/sendmail/src/queue.c
+++ b/usr.sbin/sendmail/src/queue.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1983, 1995 Eric P. Allman
+ * Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -36,9 +36,9 @@
#ifndef lint
#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 8.98.1.3 (Berkeley) 9/16/96 (with queueing)";
+static char sccsid[] = "@(#)queue.c 8.125 (Berkeley) 10/12/96 (with queueing)";
#else
-static char sccsid[] = "@(#)queue.c 8.98.1.3 (Berkeley) 9/16/96 (without queueing)";
+static char sccsid[] = "@(#)queue.c 8.125 (Berkeley) 10/12/96 (without queueing)";
#endif
#endif /* not lint */
@@ -71,6 +71,8 @@ WORK *WorkQ; /* queue of things to be done */
#if !defined(NGROUPS_MAX) && defined(NGROUPS)
# define NGROUPS_MAX NGROUPS /* POSIX naming convention */
#endif
+
+extern int orderq __P((bool));
/*
** QUEUEUP -- queue a message up for future transmission.
**
@@ -261,6 +263,12 @@ queueup(e, announce)
*p++ = 'r';
if (bitset(EF_HAS8BIT, e->e_flags))
*p++ = '8';
+ if (bitset(EF_DELETE_BCC, e->e_flags))
+ *p++ = 'b';
+ if (bitset(EF_RET_PARAM, e->e_flags))
+ *p++ = 'd';
+ if (bitset(EF_NO_BODY_RETN, e->e_flags))
+ *p++ = 'n';
*p++ = '\0';
if (buf[0] != '\0')
fprintf(tfp, "F%s\n", buf);
@@ -298,6 +306,8 @@ queueup(e, announce)
putc('R', tfp);
if (bitset(QPRIMARY, q->q_flags))
putc('P', tfp);
+ if (bitset(QHASNOTIFY, q->q_flags))
+ putc('N', tfp);
if (bitset(QPINGONSUCCESS, q->q_flags))
putc('S', tfp);
if (bitset(QPINGONFAILURE, q->q_flags))
@@ -534,6 +544,7 @@ runqueue(forkflag)
int njobs;
int sequenceno = 0;
extern ENVELOPE BlankEnvelope;
+ extern void clrdaemon __P((void));
/*
** If no work will ever be selected, don't even bother reading
@@ -578,7 +589,7 @@ runqueue(forkflag)
#ifndef SIGCHLD
(void) waitfor(pid);
#else
- CurChildren++;
+ proc_list_add(pid);
#endif /* SIGCHLD */
if (QueueIntvl != 0)
(void) setevent(QueueIntvl, runqueue, TRUE);
@@ -592,6 +603,7 @@ runqueue(forkflag)
(void) setsignal(SIGCHLD, SIG_DFL);
#endif /* SIGCHLD */
(void) setsignal(SIGHUP, intsig);
+ Verbose = FALSE;
}
setproctitle("running queue: %s", QueueDir);
@@ -628,6 +640,15 @@ runqueue(forkflag)
initmaps(FALSE, e);
/*
+ ** If we are running part of the queue, always ignore stored
+ ** host status.
+ */
+
+ if (QueueLimitId != NULL || QueueLimitSender != NULL ||
+ QueueLimitRecipient != NULL)
+ HostStatDir = NULL;
+
+ /*
** Start making passes through the queue.
** First, read and sort the entire queue.
** Then, process the work in that order.
@@ -643,6 +664,7 @@ runqueue(forkflag)
WORK *w = WorkQ;
WorkQ = WorkQ->w_next;
+ e->e_to = NULL;
/*
** Ignore jobs that are too expensive for the moment.
@@ -652,8 +674,11 @@ runqueue(forkflag)
if (shouldqueue(w->w_pri, w->w_ctime))
{
if (Verbose)
- printf("\nSkipping %s (sequence %d of %d)\n",
+ {
+ message("");
+ message("Skipping %s (sequence %d of %d)",
w->w_name + 2, sequenceno, njobs);
+ }
}
else
{
@@ -661,8 +686,11 @@ runqueue(forkflag)
extern pid_t dowork();
if (Verbose)
- printf("\nRunning %s (sequence %d of %d)\n",
+ {
+ message("");
+ message("Running %s (sequence %d of %d)",
w->w_name + 2, sequenceno, njobs);
+ }
pid = dowork(w->w_name + 2, ForkQueueRuns, FALSE, e);
errno = 0;
if (pid != 0)
@@ -850,10 +878,15 @@ orderq(doall)
i |= NEED_R;
while (i != 0 && fgets(lbuf, sizeof lbuf, cf) != NULL)
{
+ int qfver = 0;
extern bool strcontainedin();
switch (lbuf[0])
{
+ case 'V':
+ qfver = atoi(&lbuf[1]);
+ break;
+
case 'P':
w->w_pri = atol(&lbuf[1]);
i &= ~NEED_P;
@@ -868,8 +901,20 @@ orderq(doall)
if (w->w_host == NULL &&
(p = strrchr(&lbuf[1], '@')) != NULL)
w->w_host = newstr(&p[1]);
- if (QueueLimitRecipient == NULL ||
- strcontainedin(QueueLimitRecipient, &lbuf[1]))
+ if (QueueLimitRecipient == NULL)
+ {
+ i &= ~NEED_R;
+ break;
+ }
+ if (qfver > 0)
+ {
+ p = strchr(&lbuf[1], ':');
+ if (p == NULL)
+ p = &lbuf[1];
+ }
+ else
+ p = &lbuf[1];
+ if (strcontainedin(QueueLimitRecipient, p))
i &= ~NEED_R;
break;
@@ -958,6 +1003,16 @@ orderq(doall)
qsort((char *) WorkList, wc, sizeof *WorkList, workcmpf2);
}
+ else if (QueueSortOrder == QS_BYTIME)
+ {
+ extern workcmpf3();
+
+ /*
+ ** Simple sort based on submission time only.
+ */
+
+ qsort((char *) WorkList, wc, sizeof *WorkList, workcmpf3);
+ }
else
{
extern workcmpf0();
@@ -1165,6 +1220,34 @@ workcmpf2(a, b)
return a->w_pri - b->w_pri;
}
/*
+** WORKCMPF3 -- simple submission-time-only compare function.
+**
+** Parameters:
+** a -- the first argument.
+** b -- the second argument.
+**
+** Returns:
+** -1 if a < b
+** 0 if a == b
+** +1 if a > b
+**
+** Side Effects:
+** none.
+*/
+
+int
+workcmpf3(a, b)
+ register WORK *a;
+ register WORK *b;
+{
+ if (a->w_ctime > b->w_ctime)
+ return 1;
+ else if (a->w_ctime < b->w_ctime)
+ return 1;
+ else
+ return 0;
+}
+ /*
** DOWORK -- do a work request.
**
** Parameters:
@@ -1276,7 +1359,7 @@ dowork(id, forkflag, requeueflag, e)
if (forkflag)
finis();
else
- dropenvelope(e);
+ dropenvelope(e, TRUE);
}
e->e_id = NULL;
return pid;
@@ -1310,7 +1393,6 @@ readqf(e)
char qf[20];
char buf[MAXLINE];
extern ADDRESS *setctluser __P((char *, int));
- extern void loseqfile();
/*
** Read and process the file.
@@ -1355,7 +1437,8 @@ readqf(e)
return FALSE;
}
- if (st.st_uid != geteuid() || bitset(S_IWOTH|S_IWGRP, st.st_mode))
+ if ((st.st_uid != geteuid() && geteuid() != RealUid) ||
+ bitset(S_IWOTH|S_IWGRP, st.st_mode))
{
# ifdef LOG
if (LogLevel > 0)
@@ -1374,6 +1457,9 @@ readqf(e)
if (st.st_size == 0)
{
/* must be a bogus file -- just remove it */
+ qf[0] = 'd';
+ (void) unlink(qf);
+ qf[0] = 'q';
(void) unlink(qf);
fclose(qfp);
return FALSE;
@@ -1408,6 +1494,8 @@ readqf(e)
register char *p;
u_long qflags;
ADDRESS *q;
+ int mid;
+ auto char *ep;
if (tTd(40, 4))
printf("+++++ %s\n", bp);
@@ -1448,6 +1536,10 @@ readqf(e)
{
switch (*p)
{
+ case 'N':
+ qflags |= QHASNOTIFY;
+ break;
+
case 'S':
qflags |= QPINGONSUCCESS;
break;
@@ -1472,6 +1564,8 @@ readqf(e)
if (q != NULL)
{
q->q_alias = ctladdr;
+ if (qfver >= 1)
+ q->q_flags &= ~Q_PINGFLAGS;
q->q_flags |= qflags;
q->q_orcpt = orcpt;
(void) recipient(q, &e->e_sendqueue, 0, e);
@@ -1508,8 +1602,7 @@ readqf(e)
break;
case 'I': /* data file's inode number */
- if (e->e_dfino == -1)
- e->e_dfino = atol(&buf[1]);
+ /* regenerated below */
break;
case 'K': /* time of last deliver attempt */
@@ -1548,6 +1641,18 @@ readqf(e)
case '8': /* has 8 bit data */
e->e_flags |= EF_HAS8BIT;
break;
+
+ case 'b': /* delete Bcc: header */
+ e->e_flags |= EF_DELETE_BCC;
+ break;
+
+ case 'd': /* envelope has DSN RET= */
+ e->e_flags |= EF_RET_PARAM;
+ break;
+
+ case 'n': /* don't return body */
+ e->e_flags |= EF_NO_BODY_RETN;
+ break;
}
}
break;
@@ -1557,7 +1662,8 @@ readqf(e)
break;
case '$': /* define macro */
- define(bp[1], newstr(&bp[2]), e);
+ mid = macid(&bp[1], &ep);
+ define(mid, newstr(ep), e);
break;
case '.': /* terminate file */
@@ -1566,7 +1672,7 @@ readqf(e)
default:
syserr("readqf: %s: line %d: bad line \"%s\"",
- qf, LineNumber, bp);
+ qf, LineNumber, shortenstring(bp, 203));
fclose(qfp);
loseqfile(e, "unrecognized line");
return FALSE;
@@ -1706,8 +1812,8 @@ printqueue()
CurrentLA = getla(); /* get load average */
printf("\t\tMail Queue (%d request%s", nrequests, nrequests == 1 ? "" : "s");
- if (nrequests > WorkListSize)
- printf(", only %d printed", WorkListSize);
+ if (MaxQueueRun > 0 && nrequests > MaxQueueRun)
+ printf(", only %d printed", MaxQueueRun);
if (Verbose)
printf(")\n--Q-ID-- --Size-- -Priority- ---Q-Time--- -----------Sender/Recipient-----------\n");
else
@@ -1775,7 +1881,7 @@ printqueue()
case 'S': /* sender name */
if (Verbose)
- printf("%8ld %10ld%c%.12s %.38s",
+ printf("%8ld %10ld%c%.12s %.78s",
dfsize,
w->w_pri,
bitset(EF_WARNING, flags) ? '+' : ' ',
@@ -1788,13 +1894,15 @@ printqueue()
{
printf("\n %10.10s", bodytype);
if (statmsg[0] != '\0')
- printf(" (%.60s)", statmsg);
+ printf(" (%.*s)",
+ Verbose ? 100 : 60,
+ statmsg);
}
break;
case 'C': /* controlling user */
if (Verbose)
- printf("\n\t\t\t\t (---%.34s---)",
+ printf("\n\t\t\t\t (---%.74s---)",
&buf[1]);
break;
@@ -1808,7 +1916,7 @@ printqueue()
p++;
}
if (Verbose)
- printf("\n\t\t\t\t\t %.38s", p);
+ printf("\n\t\t\t\t\t %.78s", p);
else
printf("\n\t\t\t\t %.45s", p);
break;
@@ -1966,7 +2074,8 @@ unlockqueue(e)
ENVELOPE *e;
{
if (tTd(51, 4))
- printf("unlockqueue(%s)\n", e->e_id);
+ printf("unlockqueue(%s)\n",
+ e->e_id == NULL ? "NOQUEUE" : e->e_id);
/* if there is a lock file in the envelope, close it */
if (e->e_lockfp != NULL)
@@ -2090,7 +2199,7 @@ loseqfile(e, why)
if (e == NULL || e->e_id == NULL)
return;
- if (strlen(e->e_id) > sizeof buf - 4)
+ if (strlen(e->e_id) > (SIZE_T) sizeof buf - 4)
return;
strcpy(buf, queuename(e, 'q'));
p = queuename(e, 'Q');
diff --git a/usr.sbin/sendmail/src/sendmail.hf b/usr.sbin/sendmail/src/sendmail.hf
index 14db22c68ee5..add62c1ae6de 100644
--- a/usr.sbin/sendmail/src/sendmail.hf
+++ b/usr.sbin/sendmail/src/sendmail.hf
@@ -1,14 +1,14 @@
cpyr
-cpyr Copyright (c) 1983, 1995 Eric P. Allman
+cpyr Copyright (c) 1983, 1995, 1996 Eric P. Allman
cpyr Copyright (c) 1988, 1993
cpyr The Regents of the University of California. All rights reserved.
cpyr
-cpyr @(#)sendmail.hf 8.7 (Berkeley) 10/1/95
+cpyr @(#)sendmail.hf 8.11 (Berkeley) 9/11/96
cpyr
-smtp Commands:
+smtp Topics:
smtp HELO EHLO MAIL RCPT DATA
smtp RSET NOOP QUIT HELP VRFY
-smtp EXPN VERB
+smtp EXPN VERB ETRN DSN
smtp For more info use "HELP <topic>".
smtp To report bugs in the implementation send email to
smtp sendmail-bugs@sendmail.org.
@@ -19,10 +19,29 @@ helo HELO <hostname>
helo Introduce yourself.
ehlo EHLO <hostname>
ehlo Introduce yourself, and request extended SMTP mode.
-mail MAIL FROM: <sender>
-mail Specifies the sender.
-rcpt RCPT TO: <recipient>
+ehlo Possible replies include:
+ehlo SEND Send as mail [RFC821]
+ehlo SOML Send as mail or terminal [RFC821]
+ehlo SAML Send as mail and terminal [RFC821]
+ehlo EXPN Expand the mailing list [RFC821]
+ehlo HELP Supply helpful information [RFC821]
+ehlo TURN Turn the operation around [RFC821]
+ehlo 8BITMIME Use 8-bit data [RFC1652]
+ehlo SIZE Message size declaration [RFC1870]
+ehlo VERB Verbose [Allman]
+ehlo ONEX One message transaction only [Allman]
+ehlo CHUNKING Chunking [RFC1830]
+ehlo BINARYMIME Binary MIME [RFC1830]
+ehlo PIPELINING Command Pipelining [RFC1854]
+ehlo DSN Delivery Status Notification [RFC1891]
+ehlo ETRN Remote Message Queue Starting [RFC1985]
+ehlo XUSR Initial (user) submission [Allman]
+mail MAIL FROM: <sender> [ <parameters> ]
+mail Specifies the sender. Parameters are ESMTP extensions.
+mail See "HELP DSN" for details.
+rcpt RCPT TO: <recipient> [ <parameters> ]
rcpt Specifies the recipient. Can be used any number of times.
+rcpt Parameters are ESMTP extensions. See "HELP DSN" for details.
data DATA
data Following text is collected as the message.
data End with a single dot.
@@ -56,6 +75,20 @@ saml implementation.
turn TURN
turn Reverses the direction of the connection. Not currently
turn implemented.
+etrn ETRN [ <hostname> | @<domain> | #<queuename> ]
+etrn Run the queue for the specified <hostname>, or
+etrn all hosts within a given <domain>, or a specially-named
+etrn <queuename> (implementation-specific).
+dsn MAIL FROM: <sender> [ RET={ FULL | HDRS} ] [ ENVID=<envid> ]
+dsn RCPT TO: <recipient> [ NOTIFY={NEVER,SUCCESS,FAILURE,DELAY} ]
+dsn [ ORCPT=<recipient> ]
+dsn SMTP Delivery Status Notifications.
+dsn Descriptions:
+dsn RET Return either the full message or only headers.
+dsn ENVID Sender's "envelope identifier" for tracking.
+dsn NOTIFY When to send a DSN. Multiple options are OK, comma-
+dsn delimited. NEVER must appear by itself.
+dsn ORCPT Original recipient.
-bt Help for test mode:
-bt ? :this help message.
-bt .Dmvalue :define macro `m' to `value'.
@@ -76,3 +109,5 @@ turn implemented.
-bt flags for header recipients.
-bt /canon hostname :try to canonify hostname.
-bt /map mapname key :look up `key' in the indicated `mapname'.
+-bt rules addr :run the indicated address through the named rules.
+-bt Rules can be a comma separated list of rules.
diff --git a/usr.sbin/sendmail/src/stab.c b/usr.sbin/sendmail/src/stab.c
index cfb02c69686b..5f707b118581 100644
--- a/usr.sbin/sendmail/src/stab.c
+++ b/usr.sbin/sendmail/src/stab.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1983, 1995 Eric P. Allman
+ * Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)stab.c 8.6 (Berkeley) 8/31/95";
+static char sccsid[] = "@(#)stab.c 8.9 (Berkeley) 10/17/96";
#endif /* not lint */
# include "sendmail.h"
@@ -71,6 +71,7 @@ stab(name, type, op)
register STAB **ps;
register int hfunc;
register char *p;
+ int len;
extern char lower();
if (tTd(36, 5))
@@ -129,11 +130,73 @@ stab(name, type, op)
if (tTd(36, 5))
printf("entered\n");
+ /* determine size of new entry */
+#ifdef FFR_MEMORY_MISER
+ if (type >= ST_MCI)
+ len = sizeof s->s_mci;
+ else
+ len = -1;
+ switch (type)
+ {
+ case ST_CLASS:
+ len = sizeof s->s_class;
+ break;
+
+ case ST_ADDRESS:
+ len = sizeof s->s_address;
+ break;
+
+ case ST_MAILER:
+ len = sizeof s->s_mailer;
+
+ case ST_ALIAS:
+ len = sizeof s->s_alias;
+ break;
+
+ case ST_MAPCLASS:
+ len = sizeof s->s_mapclass;
+ break;
+
+ case ST_MAP:
+ len = sizeof s->s_map;
+ break;
+
+ case ST_HOSTSIG:
+ len = sizeof s->s_hostsig;
+ break;
+
+ case ST_NAMECANON:
+ len = sizeof s->s_namecanon;
+ break;
+
+ case ST_MACRO:
+ len = sizeof s->s_macro;
+ break;
+
+ case ST_RULESET:
+ len = sizeof s->s_ruleset;
+ break;
+
+ case ST_SERVICE:
+ len = sizeof s->s_service;
+ break;
+ }
+ if (len < 0)
+ {
+ syserr("stab: unknown symbol type %d", type);
+ len = sizeof s->s_value;
+ }
+ len += sizeof *s - sizeof s->s_value;
+#else
+ len = sizeof *s;
+#endif
+
/* make new entry */
- s = (STAB *) xalloc(sizeof *s);
- bzero((char *) s, sizeof *s);
+ s = (STAB *) xalloc(len);
+ bzero((char *) s, len);
s->s_name = newstr(name);
s->s_type = type;
+ s->s_len = len;
/* link it in */
*ps = s;
diff --git a/usr.sbin/sendmail/src/stats.c b/usr.sbin/sendmail/src/stats.c
index f59885a60674..6d3aaedca4db 100644
--- a/usr.sbin/sendmail/src/stats.c
+++ b/usr.sbin/sendmail/src/stats.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1983, 1995 Eric P. Allman
+ * Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)stats.c 8.5 (Berkeley) 5/28/95";
+static char sccsid[] = "@(#)stats.c 8.6 (Berkeley) 2/21/96";
#endif /* not lint */
# include "sendmail.h"
diff --git a/usr.sbin/sendmail/src/sysexits.c b/usr.sbin/sendmail/src/sysexits.c
index ad4f1e1cffb8..cc1022a14e7d 100644
--- a/usr.sbin/sendmail/src/sysexits.c
+++ b/usr.sbin/sendmail/src/sysexits.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1983, 1995 Eric P. Allman
+ * Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)sysexits.c 8.5 (Berkeley) 5/24/95";
+static char sccsid[] = "@(#)sysexits.c 8.6 (Berkeley) 2/21/96";
#endif /* not lint */
#include <sendmail.h>
diff --git a/usr.sbin/sendmail/src/trace.c b/usr.sbin/sendmail/src/trace.c
index 9762cab18f59..380ecb565400 100644
--- a/usr.sbin/sendmail/src/trace.c
+++ b/usr.sbin/sendmail/src/trace.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1983, 1995 Eric P. Allman
+ * Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)trace.c 8.4 (Berkeley) 5/28/95";
+static char sccsid[] = "@(#)trace.c 8.5 (Berkeley) 2/21/96";
#endif /* not lint */
# include "sendmail.h"
diff --git a/usr.sbin/sendmail/src/useful.h b/usr.sbin/sendmail/src/useful.h
index 8f9009ecf0b0..309a0df9db0f 100644
--- a/usr.sbin/sendmail/src/useful.h
+++ b/usr.sbin/sendmail/src/useful.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995 Eric P. Allman
+ * Copyright (c) 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)useful.h 8.4 (Berkeley) 4/21/95
+ * @(#)useful.h 8.5 (Berkeley) 2/21/96
*/
# include <sys/types.h>
diff --git a/usr.sbin/sendmail/src/version.c b/usr.sbin/sendmail/src/version.c
index 6197db912f97..7544a9aaf0e4 100644
--- a/usr.sbin/sendmail/src/version.c
+++ b/usr.sbin/sendmail/src/version.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)version.c 8.7.6.4 (Berkeley) 9/17/96";
+static char sccsid[] = "@(#)version.c 8.8.2.1 (Berkeley) 10/18/96";
#endif /* not lint */
-char Version[] = "8.7.6";
+char Version[] = "8.8.2";
diff --git a/usr.sbin/sendmail/test/Results b/usr.sbin/sendmail/test/Results
index 133f28bdf62e..31a677143a61 100644
--- a/usr.sbin/sendmail/test/Results
+++ b/usr.sbin/sendmail/test/Results
@@ -10,8 +10,11 @@ SunOS 4.1.3 OK 93.09.25 Robert Elz
BSD 4.4 OK 93.07.19 eric (wierd results, but functional)
BSD 4.3Utah OK 93.07.19 eric
+FreeBSD 2.1-sta OK 96.04.14 Jaye Mathisen <mrcpu@cdsnet.net>
+
Ultrix 4.2A OK 93.07.19 eric
Ultrix 4.3A OK 93.07.19 Allan Johannesen
+Ultrix 4.5 OK 96.09.18 Gregory Neil Shapiro <gshapiro@wpi.edu>
HP-UX 8.07 OK 93.07.19 eric (on 7xx series)
HP-UX 8.02 OK 93.07.19 Michael Corrigan (on 8xx series)
@@ -21,10 +24,14 @@ HP-UX 9.01 OK 93.11.19 Cassidy (on 7xx series)
Solaris 2.1
Solaris 2.2 FAIL 93.07.19 Bill Wisner
Solaris 2.3 FAIL 95.11.22 Scott J. Kramer <sjk@lux.com>
+Solaris 2.5 OK 96.02.29 Carson Gaspar <carson@lehman.com>
OSF/1 T1.3-4 OK 93.07.19 eric (on DEC Alpha)
OSF/1 1.3 OK 94.12.10 Jeff A. Earickson (on Intel Paragon)
+OSF/1 3.2D OK 96.09.18 Gregory Neil Shapiro <gshapiro@wpi.edu>
+OSF/1 4.0 OK 96.09.18 Gregory Neil Shapiro <gshapiro@wpi.edu>
+CxOS 11.5 OK 96.07.08 Eric Schnoebelen <eric@cirr.com>
CxOS 11.0 OK 93.01.21 Eric Schnoebelen (CxOS 11.0 beta 1)
CxOS 10.x OK 93.01.21 Eric Schnoebelen
@@ -32,10 +39,12 @@ AIX 3.1.5 FAIL 93.08.07 David J. N. Begley
AIX 3.2.3e FAIL 93.07.26 Steve Bauer <sbauer@silver.sdsmt.edu>
AIX 3.2.4 FAIL 93.10.07 David J. N. Begley
AIX 3.2.5 FAIL 94.05.17 Steve Bauer <sbauer@hpcmmib.hpc.sdsmt.edu>
+AIX 4.2 OK 96.10.16 Steve Bauer <sbauer@krypton.hpc.sdsmt.edu>
IRIX 4.0.4 OK 93.09.25 Robert Elz
IRIX 5.2 OK 94.12.06 Mark Andrews <mandrews@alias.com>
IRIX 5.3 OK 94.12.06 Mark Andrews <mandrews@alias.com>
+IRIX 6.2 OK 96.09.16 Kari E. Hurtta <Kari.Hurtta@ozone.FMI.FI>
SCO 3.2v4.0 OK 93.10.02 Peter Wemm (with -lsocket from 3.2v4 devsys)
@@ -47,6 +56,7 @@ Linux 0.99p13 OK 93.09.27 Christian Kuhtz
Linux 0.99p14 OK 93.11.30 Christian Kuhtz <chk@data-hh.Hanse.DE>
Linux 1.0 OK 94.03.19 Shayne Smith <snsmith@rastus.brisnet.org.au>
Linux 1.2.13 OK 95.11.02 Sven Neuhaus <sven@ping.de>
+Linux 2.0.17 OK 96.09.03 Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
BSD/386 1.0 OK 93.11.13 Tony Sanders
@@ -63,8 +73,20 @@ OPSYS VERSION STATUS DATE TESTER/NOTES
Solaris 2.3 OK 95.11.22 Scott J. Kramer <sjk@lux.com>
Solaris 2.4 OK 95.09.22 Thomas 'Mike' Michlmayr <mike@cosy.sbg.ac.at>
+Solaris 2.5 OK 96.02.29 Carson Gaspar <carson@lehman.com>
Linux 1.2.13 FAIL 95.11.02 Sven Neuhaus <sven@ping.de>
+Linux 2.0.17 FAIL 96.09.03 Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
IRIX 5.2 OK 95.12.01 Mark Andrews <mandrews@aw.sgi.com>
IRIX 5.3 OK 95.12.01 Mark Andrews <mandrews@aw.sgi.com>
+IRIX 6.2 OK 96.09.16 Kari E. Hurtta <Kari.Hurtta@ozone.FMI.FI>
+
+FreeBSD 2.1-sta OK 96.04.14 Jaye Mathisen <mrcpu@cdsnet.net>
+
+Ultrix 4.5 FAIL 96.09.18 Gregory Neil Shapiro <gshapiro@wpi.edu>
+
+OSF/1 3.2D OK 96.09.18 Gregory Neil Shapiro <gshapiro@wpi.edu>
+OSF/1 4.0 OK 96.09.18 Gregory Neil Shapiro <gshapiro@wpi.edu>
+
+CxOS 11.5 FAIL 96.07.08 Eric Schnoebelen <eric@cirr.com>
diff --git a/usr.sbin/sendmail/test/t_seteuid.c b/usr.sbin/sendmail/test/t_seteuid.c
index 4dfe3d63bf77..f3bd52902f91 100644
--- a/usr.sbin/sendmail/test/t_seteuid.c
+++ b/usr.sbin/sendmail/test/t_seteuid.c
@@ -108,6 +108,7 @@ main()
exit(1);
}
+ printf("\nIt is safe to define USESETEUID on this system\n");
exit(0);
}
diff --git a/usr.sbin/sendmail/test/t_setreuid.c b/usr.sbin/sendmail/test/t_setreuid.c
index ca9a06f448b6..66220682224a 100644
--- a/usr.sbin/sendmail/test/t_setreuid.c
+++ b/usr.sbin/sendmail/test/t_setreuid.c
@@ -120,6 +120,7 @@ main()
exit(1);
}
+ printf("\nIt is safe to define HASSETREUID on this system\n");
exit(0);
}