summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/Debian-specific211
-rw-r--r--debian/README.Build114
-rw-r--r--debian/README.Debian.libmilter-dev25
-rw-r--r--debian/README.Debian.sendmail111
-rw-r--r--debian/README.Debian.sendmail-doc11
-rw-r--r--debian/README.dbs20
-rw-r--r--debian/README.potato128
-rw-r--r--debian/TODO49
-rw-r--r--debian/build/Build23
-rw-r--r--debian/build/autoconf.mk.in98
-rw-r--r--debian/build/autoconf.pl.in39
-rw-r--r--debian/build/autoconf.sh.in31
-rw-r--r--debian/build/changelog.sh.in59
-rw-r--r--debian/build/control.m4.in142
-rw-r--r--debian/build/install-sh251
-rw-r--r--debian/build/rules.in1189
-rw-r--r--debian/build/site.config.m4.in235
-rw-r--r--debian/build/update_chaos.in202
-rw-r--r--debian/build/version.c1
-rw-r--r--debian/cf/debian/autoconf.m4.in59
-rw-r--r--debian/cf/debian/sendmail.mc.in46
-rw-r--r--debian/cf/debian/starttls.m4.in52
-rw-r--r--debian/cf/debian/submit.mc.in56
-rw-r--r--debian/cf/domain/debian-msp.m4.in98
-rw-r--r--debian/cf/domain/debian-mta.m4.in134
-rw-r--r--debian/cf/feature/rhsbl.m440
-rw-r--r--debian/cf/feature/vnet.m470
-rw-r--r--debian/cf/hack/debian_auth.m4.in47
-rw-r--r--debian/cf/hack/msp_nullclient.m495
-rw-r--r--debian/cf/hack/nodns.m417
-rw-r--r--debian/cf/hack/spamtrap.m462
-rw-r--r--debian/cf/hack/virthost_by_ip.m4.in77
-rw-r--r--debian/cf/mailer/cyrus21.m466
-rw-r--r--debian/cf/mailer/xagent.m426
-rw-r--r--debian/cf/ostype/debian.m4.in110
-rw-r--r--debian/changelog104
-rw-r--r--debian/checksendmail/BSDI_CONTRIB18
-rw-r--r--debian/checksendmail/CVS/Entries5
-rw-r--r--debian/checksendmail/CVS/Repository1
-rw-r--r--debian/checksendmail/Makefile15
-rw-r--r--debian/checksendmail/address.resolve27
-rw-r--r--debian/checksendmail/checksendmail.8223
-rw-r--r--debian/checksendmail/checksendmail.perl383
-rw-r--r--debian/configure8658
-rw-r--r--debian/configure.ac1
-rw-r--r--debian/control99
-rw-r--r--debian/copyright91
-rw-r--r--debian/examples/Makefile.in124
-rw-r--r--debian/examples/amavis-doc/README8
-rw-r--r--debian/examples/amavis-doc/amavis-doc.lyx904
-rw-r--r--debian/examples/amavis/amavis-doc-1.html75
-rw-r--r--debian/examples/amavis/amavis-doc-2.html138
-rw-r--r--debian/examples/amavis/amavis-doc-3.html38
-rw-r--r--debian/examples/amavis/amavis-doc-4.html31
-rw-r--r--debian/examples/amavis/amavis-doc-5.html85
-rw-r--r--debian/examples/amavis/amavis-doc-6.html48
-rw-r--r--debian/examples/amavis/amavis-doc-7.html96
-rw-r--r--debian/examples/amavis/amavis-doc-8.html72
-rw-r--r--debian/examples/amavis/amavis-doc.html72
-rw-r--r--debian/examples/db/access88
-rw-r--r--debian/examples/db/aliases15
-rw-r--r--debian/examples/db/domaintable26
-rw-r--r--debian/examples/db/genericstable36
-rw-r--r--debian/examples/db/mailertable50
-rw-r--r--debian/examples/db/relay-domains34
-rw-r--r--debian/examples/db/sendmail.cM32
-rw-r--r--debian/examples/db/virtusertable8
-rw-r--r--debian/examples/dialup/ip-down.d57
-rw-r--r--debian/examples/dialup/ip-up.d130
-rw-r--r--debian/examples/ldap/sendmail.schema.v160
-rw-r--r--debian/examples/ldap/sendmail.schema.v2216
-rw-r--r--debian/examples/logcheck/ignore.d.paranoid/sendmail21
-rw-r--r--debian/examples/logcheck/ignore.d.server/sendmail21
-rw-r--r--debian/examples/logcheck/ignore.d.workstation/sendmail21
-rw-r--r--debian/examples/logcheck/violations.ignore.d/logcheck-sendmail12
-rw-r--r--debian/examples/logcheck/violations.ignore.d/sendmail12
-rw-r--r--debian/examples/milter/Makefile25
-rw-r--r--debian/examples/milter/sample.c236
-rw-r--r--debian/examples/milter/strl.h17
-rw-r--r--debian/examples/pam/smtp14
-rw-r--r--debian/examples/sasl/Sendmail.conf18
-rw-r--r--debian/examples/sasl/saslpasswd.conf17
-rw-r--r--debian/faq.txt3634
-rw-r--r--debian/libmilter-dev.dirs.in3
-rw-r--r--debian/libmilter-dev.postinst47
-rw-r--r--debian/libmilter-dev.postrm.in53
-rw-r--r--debian/libmilter-dev.preinst.in55
-rw-r--r--debian/libmilter-dev.prerm54
-rw-r--r--debian/local/Makefile.in143
-rw-r--r--debian/local/Parse_mc.pm.in933
-rw-r--r--debian/local/local_no_masquerade.m425
-rw-r--r--debian/local/parse_mc.in86
-rw-r--r--debian/local/provider10
-rw-r--r--debian/local/qtool.8213
-rw-r--r--debian/local/qtool.pl1234
-rw-r--r--debian/local/runq.831
-rw-r--r--debian/local/sendmail.in1121
-rw-r--r--debian/local/sendmailconfig.841
-rw-r--r--debian/local/sendmailconfig.in671
-rw-r--r--debian/local/service.switch7
-rw-r--r--debian/local/service.switch-nodns8
-rw-r--r--debian/local/socks_wrapper31
-rw-r--r--debian/local/update_auth.in250
-rw-r--r--debian/local/update_conf.in1140
-rw-r--r--debian/local/update_db.in591
-rw-r--r--debian/local/update_ldap.in118
-rw-r--r--debian/local/update_mc.in212
-rw-r--r--debian/local/update_mk.in661
-rw-r--r--debian/local/update_notices177
-rw-r--r--debian/local/update_sendmail77
-rw-r--r--debian/local/update_smrsh.in73
-rw-r--r--debian/local/update_sys.in282
-rw-r--r--debian/local/update_tcpd53
-rw-r--r--debian/local/update_tls.in305
-rw-r--r--debian/patches/8.12/8.12.3/CAN-2003-0681.patch87
-rw-r--r--debian/patches/8.12/8.12.3/CAN-2003-0694.patch15
-rw-r--r--debian/patches/8.12/8.12.3/bf.c.8.5130
-rw-r--r--debian/patches/8.12/8.12.3/domain.c.8.18116
-rw-r--r--debian/patches/8.12/8.12.3/dpatch.00150
-rw-r--r--debian/patches/8.12/8.12.3/dpatch.00219
-rw-r--r--debian/patches/8.12/8.12.3/dpatch.00352
-rw-r--r--debian/patches/8.12/8.12.3/dpatch.00452
-rw-r--r--debian/patches/8.12/8.12.3/dpatch.00554
-rw-r--r--debian/patches/8.12/8.12.3/dsa-doublebounce.patch20
-rw-r--r--debian/patches/8.12/8.12.3/dsa-expn.patch20
-rw-r--r--debian/patches/8.12/8.12.3/main.c.8.87617
-rw-r--r--debian/patches/8.12/8.12.3/maxseq.patch51
-rw-r--r--debian/patches/8.12/8.12.3/patch.milter.replbody63
-rw-r--r--debian/patches/8.12/8.12.3/proto.m4.8.64611
-rw-r--r--debian/patches/8.12/8.12.3/proto.m4.8.649.2.1318
-rw-r--r--debian/patches/8.12/8.12.3/recipient.c.8.330.2.117
-rw-r--r--debian/patches/8.12/8.12.3/security.parsaddr58
-rw-r--r--debian/patches/8.12/8.12.3/sendmail.8.12.security.cr.patch462
-rw-r--r--debian/patches/8.12/8.12.3/smrsh-20020924.patch63
-rw-r--r--debian/patches/8.12/8.12.3/socks.patch50
-rw-r--r--debian/patches/8.12/8.12.3/z_CVE-2006-0058.patch2768
-rw-r--r--debian/patches/contrib/etrn.patch0142
-rw-r--r--debian/patches/patches.index16
-rwxr-xr-xdebian/rules1189
-rw-r--r--debian/scripts/dbs-build.mk94
-rw-r--r--debian/scripts/dbs_split83
-rw-r--r--debian/scripts/dpkg-arch.mk7
-rw-r--r--debian/scripts/file2cat13
-rw-r--r--debian/sendmail-FAQ.doc-base12
-rw-r--r--debian/sendmail-doc.dirs.in5
-rw-r--r--debian/sendmail-doc.docs4
-rw-r--r--debian/sendmail-doc.postinst47
-rw-r--r--debian/sendmail-doc.postrm.in53
-rw-r--r--debian/sendmail-doc.preinst.in55
-rw-r--r--debian/sendmail-doc.prerm54
-rw-r--r--debian/sendmail.conffiles.in13
-rw-r--r--debian/sendmail.cron.daily.in101
-rw-r--r--debian/sendmail.dirs.in54
-rw-r--r--debian/sendmail.docs3
-rw-r--r--debian/sendmail.init.d.in42
-rw-r--r--debian/sendmail.links.in1
-rw-r--r--debian/sendmail.lintian-overrides16
-rw-r--r--debian/sendmail.logrotate86
-rw-r--r--debian/sendmail.menu.test24
-rw-r--r--debian/sendmail.postinst.in356
-rw-r--r--debian/sendmail.postrm.in119
-rw-r--r--debian/sendmail.preinst.in61
-rw-r--r--debian/sendmail.prerm.in153
-rw-r--r--debian/sendmail.suid.in2
-rw-r--r--debian/sensible_mda/Makefile.in61
-rw-r--r--debian/sensible_mda/sensible-mda.885
-rw-r--r--debian/sensible_mda/sensible-mda.c.in351
-rw-r--r--debian/sensible_mda/sensible-mda.c.old281
-rw-r--r--debian/sources1
169 files changed, 36292 insertions, 0 deletions
diff --git a/debian/Debian-specific b/debian/Debian-specific
new file mode 100644
index 0000000..7692165
--- /dev/null
+++ b/debian/Debian-specific
@@ -0,0 +1,211 @@
+Please take a gander at /usr/share/doc/sendmail/sendmail/README.Debian.gz -
+it has a quick overview of important matters.
+
+Changes: Items that cause a functional difference in the way
+ sendmail works.
+
+ These items *may* bite you if you aren't careful !
+
+Removed: Items that are not shipped
+
+Enhancements: Items above and beyond the base sendmail distribution
+ These will be Debian add ons, or items the sendmail folk
+ consider *not ready for prime time* (the _FFR_'s).
+
+ These items should *not* bite you, but be aware that
+ other distributions may not have anything comparable.
+
+Patches: Items correcting flaws in the original sendmail distribution
+ these items are culled from c.m.s, notes from developers,
+ and user input.
+
++++++++++++++++++++++++++++++Sendmail 8.12.0:++++++++++++++++++++++++++++++++
+
+ Changes:-------------------------------------------------------------
+ 1) rmail/rmail.c: Deliver mail foreground, not queued
+ Roland Rosenfeld (closes: bug #31138)
+
+ 2) cf/feature/local_procmail.m4: Remove -Y from procmail
+ (closes: bug #25639)
+
+ 3) sendmail/control.c: Make control socket mode 0660
+
+ 4) cf/mailer/cyrus.m4 Support cyrus-deliver
+
+ 5) cf/mailer/local.m4 Support FEATURE(dont_masquerade_local)
+
+ Removed:-------------------------------------------------------------
+
+ 1) TLS support disabled because the maintainer is in the US,
+ he'll need to wait until Debian supports crypto export from US.
+
+ 2) smtpd alias for sendmail (in smtpd package)
+ moved to /usr/lib/sm.bin
+
+ 3) hoststat alias for sendmail (in newscache package)
+ moved to /usr/lib/sm.bin
+
+ 4) vacation vacation program (in vacation package)
+ moved to /usr/lib/sm.bin
+
+ Enhancements:--------------------------------------------------------
+ 1) cf/cf/debproto.m4: Sample, mimimal sendmail.mc file
+ cf/ostype/debian.m4: Debian customizations for OSTYPE(debian)
+
+ 2) cf/feature/dont_masquerade_local.m4 -- superceded by
+ FEATURE(local_no_masquerade)
+
+ 3) cf/hack/nodns.m4: /etc/mail/service.switch-nodns
+ (closes: bug#24608)
+
+ 4) /etc/mail/sendmail.conf
+ /etc/init.d/sendmail Nice, powerfull means to control sendmail
+
+ Patches:-------------------------------------------------------------
+ 1) cf/mailer/cyrus.m4: Support Debian cyrus delivery agent pkg
+ Manoj Srivastava (closes: bug #63441)
+
++++++++++++++++++++++++++++++Sendmail 8.11.6:++++++++++++++++++++++++++++++++
+
+ Changes:-------------------------------------------------------------
+ 1) rmail/rmail.c: Deliver mail foreground, not queued
+ Roland Rosenfeld (closes: bug #31138)
+
+ 2) cf/feature/local_procmail.m4: Remove -Y from procmail
+ (closes: bug #25639)
+
+ 3) sendmail/control.c: Make control socket mode 0660
+
+ 4) cf/mailer/cyrus.m4 Support cyrus-deliver
+
+ 5) cf/mailer/local.m4 Support FEATURE(dont_masquerade_local)
+
+ Removed:-------------------------------------------------------------
+ 1) TLS support disabled because the maintainer is in the US,
+ he'll need to wait until Debian supports crypto export from US.
+ 2) smtpd alias for sendmail (in smtpd package)
+ moved to /usr/lib/sm.bin
+ 3) hoststat alias for sendmail (in newscache package)
+ moved to /usr/lib/sm.bin
+ 4) vacation vacation program (in vacation package)
+ moved to /usr/lib/sm.bin
+
+ Enhancements:--------------------------------------------------------
+ 1) cf/cf/debproto.m4: Sample, mimimal sendmail.mc file
+ cf/ostype/debian.m4: Debian customizations for OSTYPE(debian)
+
+ 2) cf/feature/dont_masquerade_local.m4
+ cf/mailer/local.m4: Don't masquerade local to local delivery
+ Wichert Akkerman
+
+ 3) cf/hack/nodns.m4: /etc/mail/service.switch-nodns
+ (closes: bug#24608)
+
+ 4) /etc/default/sendmail
+ /etc/init.d/sendmail Nice, powerfull means to control sendmail
+
+ Patches:-------------------------------------------------------------
+ 1) cf/mailer/cyrus.m4: Support Debian cyrus delivery agent pkg
+ Manoj Srivastava (closes: bug #63441)
+
+
++++++++++++++++++++++++++++++Sendmail 8.10.2:++++++++++++++++++++++++++++++++
+
+ Changes:-------------------------------------------------------------
+ 1) rmail/rmail.c: Deliver mail foreground, not queued
+ Roland Rosenfeld (closes: bug #31138)
+
+ 2) cf/feature/local_procmail.m4: Remove -Y from procmail
+ (closes: bug #25639)
+
+ 3) sendmail/control.c: Make control socket mode 0660
+
+ Removed:-------------------------------------------------------------
+ 1) smtpd alias for sendmail (in smtpd package)
+ 2) hoststat alias for sendmail (in newscache package)
+ 3) vacation vacation program (in vacation package)
+
+ Enhancements:--------------------------------------------------------
+ 1) cf/cf/debproto.m4: Sample, mimimal sendmail.mc file
+ cf/ostype/debian.m4: Debian customizations for OSTYPE(debian)
+
+ 2) cf/feature/dont_masquerade_local.m4
+ cf/mailer/local.m4: Don't masquerade local to local delivery
+ Wichert Akkerman
+
+ 3) cf/hack/nodns.m4: /etc/mail/service.switch-nodns
+ (closes: bug#24608)
+
+ 4) cf/feature/dssl.m4
+ cf/feature/imrss.m4
+ cf/feature/orbs.m4 Note, these are deprecated and will
+ cf/feature/orca.m4 be removed soon, please update to use
+ cf/feature/rbl.m4 the FEATURE(dnsbl,[addr],[message])
+
+ 5) /etc/default/sendmail
+ /etc/init.d/sendmail Nice, powerfull means to control sendmail
+
+ Patches:-------------------------------------------------------------
+ 1) cf/mailer/cyrus.m4: Support Debian cyrus delivery agent pkg
+ Manoj Srivastava (closes: bug #63441)
+
+ 2) mail.local/mail.local.c: Fix unsafe fgets in mail.local
+ Wichert Akkerman (closes: bug #63715)
+
+
++++++++++++++++++++++++++++++Sendmail 8.9.3:+++++++++++++++++++++++++++++++++
+
+ Changes:-------------------------------------------------------------
+ 1) rmail/rmail.c: Deliver mail foreground, not queued
+ Roland Rosenfeld (closes: bug #31138)
+
+ 2) cf/feature/local_procmail.m4: Remove -Y from procmail
+ (closes: bug #25639)
+
+ Removed:-------------------------------------------------------------
+ 1) smtpd alias for sendmail (in smtpd package)
+ 2) hoststat alias for sendmail (in newscache package)
+ 3) vacation vacation program (in vacation package)
+
+ Enhancements:--------------------------------------------------------
+ 1) cf/cf/debproto.m4: Sample, mimimal sendmail.mc file
+ cf/ostype/debian.m4: Debian customizations for OSTYPE(debian)
+
+ 2) cf/feature/dont_masquerade_local.m4
+ cf/mailer/local.m4: Don't masquerade local to local delivery
+ Wichert Akkerman
+
+ 3) cf/hack/nodns.m4: /etc/mail/service.switch-nodns
+ (closes: bug#24608)
+
+ 4) cf/feature/dssl.m4
+ cf/feature/imrss.m4
+ cf/feature/orbs.m4
+ cf/feature/orca.m4
+ cf/feature/rbl.m4
+ cf/m4/cfhead.m4
+ cf/m4/proto.m4: Anti spam/relay/etc
+ Claus Assmann
+
+ 5) cf/m4/proto.m4 (patch)
+ cf/feature/ldap.m4: Better support of LDAP maps
+
+ 6) cf/feature/local_procmail.m4: FEATURE(local_procmail) before MAILER(local)
+
+ Patches:-------------------------------------------------------------
+ 1) cf/mailer/cyrus/m4: Support Debian cyrus delivery agent pkg
+ Manoj Srivastava (closes: bug #63441)
+
+ 2) mail.local/mail.local.c: Fix unsafe fgets in mail.local
+ Wichert Akkerman (closes: bug #63715)
+
+ 3) src/mime.c
+ src/headers.c: Duplicate "Content-Transfer-Encoding"
+ Per Hedeland/c.m.s (closes: bug #28279)
+
+ 4) src/ldap_map.h
+ src/map.c: Correct LDAP mapping
+
+ 5) src/main.c: sendmail -bi(newalias) DOS
+ c.m.s (closes: bug #51126)
+vim: noautoindent
diff --git a/debian/README.Build b/debian/README.Build
new file mode 100644
index 0000000..d9f6868
--- /dev/null
+++ b/debian/README.Build
@@ -0,0 +1,114 @@
+ Welcome to the badlands production of Sendmail
+ 2001/08/07 12:00:00
+
+If you're reading this, I'll assume you'd like to build your own private
+copy of sendmail using the Debian supplied version as a starting point.
+
+I've tried (hard) to make this as easy as possible, and would greatly
+appreciate any feedback.
+
+I've built sendmail 8.7.6 - 8.12.0
+on Debian slink - sid with this setup.
+
+I see a few reasons to build sendmail yourself:
+ 1) You want to build the current package on an older/newer Debian release
+ 2) You want to port to a different architecture
+ 3) You want additional features not included in the stock distribution
+ 4) You want to remove features from the stock distribution
+ 5) You want to further customize/patch the stock distribution
+
+First, you'll need to locate, download, and unpack the source from a
+Debian site (which, I guess you've already done that if you are reading this).
+
+Then, what you do depends upon why you're building:
+
+ 1) You want to build the current package on an older/newer Debian release:
+ Hopefully, autoconf will automagically take care of things for you!
+ A) Build the package using whatever tools you're used to:
+ dpkg-buildpackage -rfakeroot -uc -us
+ debuild -rfakeroot -uc -us
+ etc.
+ B) If you get a successful build, great ! install it and enjoy !!!
+ C) If you get any build errors, contact me and we'll figure out what
+ to do... probably will be a simple update to the autoconf setup.
+
+ 2) You want to port to a different architecture:
+ This is pretty much like 1) except that you're more likely to run
+ into problems ;-( Likely error candidates are kernel/library headers
+ and lack of support for desired add-ons (other -dev packages).
+
+ See Known Issues below and Follow the directions for 1) above.
+
+ 3) You want additional features not included in the stock distribution:
+ This should be fairly rare, as the stock distribution includes just
+ about everything !!!
+
+ Follow the directions for 5) below and let me know - I'll most likely
+ add the support to the stock package, especially if it doesn't conflict
+ with other options.
+
+ 4) You want to remove features from the stock distribution:
+ This is likely to be due to some kind of library conflict, or a
+ desire to reduce the package size.
+
+ To remove most features, just make sure you *DO NOT* have the -dev
+ package for that feature installed - autoconf will do the rest !
+ In these cases, Follow the directions for 1) above.
+
+ Otherwise, Follow the directions for 5) below.
+
+ 5) You want to further customize/patch the stock distribution:
+ A) Decide which features you wish to support (LDAP,SASL,TLS, etc.)
+ B) Install the apropriate -dev packages (libssl-dev, etc.)
+ C) Evaluate the following files for updates:
+ debian/build/site.config.m4.in ==> Sendmail compile config
+ debian/cf/ostype/debian.m4.in ==> Common .mc file config
+ debian/cf/domain/debian-msp.m4.in ==> MSP .mc file config
+ debian/cf/domain/debian-mta.m4.in ==> MTA .mc file config
+ D) Examine debian/rules for possible overrides (listed in the
+ header... Don't change debian/rules because it will get replaced
+ by the configure step.
+ E) Create any necessary patches (or contact me for assistance).
+ Patches go in debian/patches/${version}/ and must be able
+ to be applied with -p0 from debian/.. There's almost always
+ at least one existing patch you can peek at for an example.
+ F) Build the package as outlined in 1) above.
+ G) Please pass the patch on to me, with any description you have
+ so that if it is common, it can get added to the Debian stock
+ distribution, and maybe forwarded upstream (with your approval).
+
+Known issues:
+ Arch:
+ arm: 1)
+ m68k: 2)
+ Sendmail:
+ <8.10.0 3)
+ Misc:
+ IPV6 4)
+
+ 1) Shared memory support requires a 2.2.x; x>=19 or 2.4.x kernel to
+ compile on. Runtime support also requires said kernels, but the
+ support can be turned on/off at runtime, so the real constraint
+ is having an appropriate kernel for building on.
+ - Can be overridden via configure option (see top of debia/rules)
+ - Defaulted by a arch test in configure - if you hit this on
+ your arch, let me know and I'll update the test.
+
+ 2) Compiler miss-optimizing long-long values
+ - Supported via a patch making the test variables volatile so
+ the beast builds. I don't know of any runtime problems, but hey...
+
+ 3) Sendmail <8.10.0 will *NOT* compile against libdb3-dev!
+ - Install libdb2-dev for the compilation (db2 and db3 can coexist
+ with newer libc/libdbx packages) - you can then reinstall libdb3-dev
+ if you need it for other things.
+
+ 4) IPV6 support requires the bind-8 developement package (bind-dev)
+ because the libc folk have changed things above and beyond bind-8,
+ and sendmail can't figure out what to do.
+
+PS: This is obviously a *very* rough draft, please let me know how to make
+ it more useful for you!
+
+--
+Rick Nelson (cowboy@debian.org)
diff --git a/debian/README.Debian.libmilter-dev b/debian/README.Debian.libmilter-dev
new file mode 100644
index 0000000..f621a7c
--- /dev/null
+++ b/debian/README.Debian.libmilter-dev
@@ -0,0 +1,25 @@
+The sendmail Mail Filter API (Milter) is designed to allow third-party
+programs access to mail messages as they are being processed in order to
+filter meta-information and content.
+
+NOTE: With Sendmail 8.12.0 and above, the Milter API is built-in.
+Before 8.12.0, both libmilter and the callouts in sendmail are marked
+as an FFR (For Future Release). This means that support is *NOT*
+guaranteed - but things have been working well, and the usenet/mailing
+list (comp.mail.sendmail) does help if you have questions/problems.
+
+Everything you'll need to create a milter filter is contained in
+/usr/share/doc/sendmail (for which you need to install sendmail-doc):
+
+ - libmilter/README Document on build/install/config for milter
+ NOTE: see updated make in milter directory
+ - cf.README Document on configuring milter in sendmail.mc
+ - RELEASE_NOTES Any late breaking news
+
+and /usr/share/sendmail/examples (for which you need to install sendmail):
+
+ - examples/milter/* Sample milter filter and makefile
+
+--
+Rick Nelson
+cowboy@debian.org
diff --git a/debian/README.Debian.sendmail b/debian/README.Debian.sendmail
new file mode 100644
index 0000000..6188f37
--- /dev/null
+++ b/debian/README.Debian.sendmail
@@ -0,0 +1,111 @@
+ ***** Important notes on sendmail 8.12.0 ****
+
+*) This is a significant improvement in security, functionality and speed !
+ I strongly urge you to install sendmail-doc and peruse files here and in
+ /usr/share/doc/sendmail-doc
+
+*) Sendmail has extended control over queue management, and these changes can
+ cause a performance drop if you don't change your local configuration.
+
+ Old:
+ MaxDaemonChildren controlled number of listener *and* queue runners
+
+ Sendmail would fork as many children as needed to run the queues
+
+ New:
+ MaxDaemonChildren still works as a total limit
+ MaxQueueChildren limits *only* the number of total queue runners
+ MaxRunnersPerQueue limits the number of runners per individual
+ queue (in 8.11+, you can have multiple queues) -- *AND* you
+ can override this global limit on per queue basis!
+ MaxQueueRunSize limits the number of messages processed per queue run
+
+ Sendmail only forks upto MaxRunnersPerQueue for each queue per run
+
+ The gotcha here is that MaxRunnersPerQueue defaults to one !
+
+ I've changed the default MaxRunnersPerQueue to 5, so deliveries aren't
+ single threaded, but you may want to have more or less than 5.
+
+*) Check out queue groups!!! It can significantly improve throughput
+ see /usr/share/doc/sendmail-doc/cf.README.gz
+ and /usr/share/doc/sendmail-doc/op/op.{ps,txt}.gz
+
+*) Sendmail is *much* more secure now, and you'll never have problems
+ because sendmail doesn't accept new submissions (when using the sendmail
+ command, TCP connections will still be refused).
+
+ Message submission (sendmail -bs, -m, etc.) now use a SGID binary and
+ a separate g+w message queue.
+
+ see /usr/share/doc/sendmail-doc/sendmail.SECURITY.gz for further info
+ on the changes - which should be transparent to both the admin and user.
+
+*) The Debian package includes the ability to run sendmail in a variety of
+ ways:
+ MTA listener (port 25): None, daemon, or via INETD
+ MTA queue runner: None, daemon, or via cron
+ MSP queue runner: None, daemon, or via cron
+ MTA queue aging: None, or via cron
+ See /etc/mail/sendmail.conf for more details
+
+*) Sendmail now supports multiple queues! You can distribute queues
+ across devices, and the queues are run independantly - improving
+ throughput !
+
+*) There are new queue sort orders - amongst them are:
+ FileName: removes the need to read .qf files
+ Random: good for multi-queue runners
+
+*) Virtual hosting support has been enhanced in the os/site debian.m4
+ file. If you need more, checkout DAEMON_OPTIONS (Modifier=b)
+ see /usr/share/doc/sendmail-doc/cf.README.gz
+ and /usr/share/doc/sendmail-doc/op.{ps,txt}.gz
+ let me know what you think - any more extensions you'd like to see?
+
+*) IPv6 support is inboard, but Linux does things oddly (and differently
+ wrt kernel versions)... To run IPv6 on 2.2.x and 2.4.x, try this:
+ FEATURE(`no_default_msa')dnl
+ CLIENT_OPTIONS(`Family=inet6, Modifier=h')dnl
+ DAEMON_OPTIONS(`Port=smtp, Name=MTA-v6, Family=inet6')dnl
+ DAEMON_OPTIONS(`Port=587, Name=MSA-v6, Family=inet6, M=aE')dnl
+
+*) Sendmail now always uses TCP wrappers (/etc/hosts.allow /etc/hosts.deny)
+ This is a change from prior versions where wrapper support was enabled
+ via sendmail.mc.
+
+ Please make sure you add the appropriate entry to the /etc/hosts.* file.
+ The most likely candidate is to place sendmail: all in /etc/hosts.allow
+
+*) sendmail.st (for mailstats command) is *NOT* automagically created
+ because writing the statistic can be a performance hinderance.
+ If you want statistics: touch /var/lib/sendmail/sendmail.st
+
+*) You should *really* read RELEASE_NOTES... There are *many* changes for
+ spam control.
+ A) Relaying is, by default, prohibitted
+ B) Mail from non-resolvable domains is, by default, prohibitted
+
+ **** Other information ****
+
+This Debian package includes an automatic configuration utility
+`sendmailconfig' which can be run at any time to modify the current sendmail
+configuration.
+
+Most mail-related configuration files are kept in the /etc/mail directory.
+
+Specialized configurations can be accomplished by editing the file
+/etc/mail/sendmail.mc by hand and then running `sendmailconfig' to generate
+and use the appropriate corresponding sendmail.cf file. Such configurations
+can make use of the m4 configuration macros kept in the
+/usr/share/sendmail/cf directory.
+
+See also the other documentation in this directory and in the optional
+directory /usr/share/doc/sendmail-doc (installed via sendmail-doc package).
+
+Finally, the file /etc/aliases holds a text representation of the current mail
+aliases. See the aliases(5) man page for more information. If you edit this
+file, be sure to run `newaliases' to update the corresponding binary database.
+
+Rick Nelson
+cowboy@debian.org
diff --git a/debian/README.Debian.sendmail-doc b/debian/README.Debian.sendmail-doc
new file mode 100644
index 0000000..358d1c8
--- /dev/null
+++ b/debian/README.Debian.sendmail-doc
@@ -0,0 +1,11 @@
+This is the documentation directory for the sendmail program.
+
+The material here is optional, but may be important in configuring
+sendmail for your use.
+
+Other information (and examples) can be found in the following directories:
+ 1) /usr/share/doc/sendmail Required documentation and examples
+ 2) /usr/share/doc/libmilter-dev Required documentation for Mail fILTERs
+
+Rick Nelson
+cowboy@debian.org
diff --git a/debian/README.dbs b/debian/README.dbs
new file mode 100644
index 0000000..946bac0
--- /dev/null
+++ b/debian/README.dbs
@@ -0,0 +1,20 @@
+This package uses a form of source build based on DBS. To setup the
+source, run "debian/rules setup". This will extract the pristine source in
+build-dir/, apply patches from debian/patches/ and split the package
+scripts from debian/packages.d/ into their component files.
+
+A few cavaets. Modifying the source in build-tree/ or the package files in
+debian/, will not be preserved after the "clean" target is run. Actual
+files for packages are in debian/packages.d/ and will be regerated after
+being modified.
+
+To create patches for the source, you can remember several steps. There
+are two targes for handling source. The "unpack" target, will simply
+unpack the tarball(s) into build-tree/ and "patch" will apply all patches
+from debian/patches/. If you make any changes you can generate a new patch
+using the "make_patch" target. This will move your current sources under
+build-tree/, unpack the source+patches again, and then generate a diff
+between the two. Note, you should run the "clean" target in the
+build-tree/ source before doing this, to get a clean patch.
+
+Ben
diff --git a/debian/README.potato b/debian/README.potato
new file mode 100644
index 0000000..94f4d7e
--- /dev/null
+++ b/debian/README.potato
@@ -0,0 +1,128 @@
+#
+# COMPILING THE DEBIAN SENDMAIL PACKAGE ON POTATO
+#
+I am writing this document to summarize the assistance that Richard A
+Nelson (Rick) <cowboy@debian.org> gave me in getting the
+sendmail-8.12.1-1 package to compile under Potato. Hopefully this
+will save him the effort of responding to other email from people as
+clueless as myself.
+
+Pre-requisites (supplied by potato):
+ Linux 2.2.19 or 2.4.7+ for shm support.
+ m4
+ debhelper 1.1.17+
+ groff
+ bsdmainutils
+ libopenldap-dev
+ libwrap0-dev
+ liblockfile-dev
+ libpam0g-dev
+ automake
+ libtool
+ libdb2-dev
+ dpkg-dev
+
+Pre-requisites (that you must fulfill on your own):
+ libsasl-dev
+
+Instructions on how to fulfill above dependency:
+1) download from your nearest Debian source mirror the cyrus-sasl
+ source. At the point of the writing of this document that was version
+ 1.5.24-9. The source should be in "debian/pool/main/c/cyrus-sasl",
+ you will need the following files (possibly replacing the version):
+ cyrus-sasl_1.5.24-9.diff.gz
+ cyrus-sasl_1.5.24-9.dsc
+ cyrus-sasl_1.5.24.orig.tar.gz
+
+2) extract the source using dpkg-source -x cyrus-sasl_1.5.24-9.dsc
+ This should create a directory cyrus-sasl-1.5.24/
+3) compile+package sasl, this can be accomplished in different
+ ways. For either of them you will need to cd into the source
+ directory you just extracted (cd cyrus-sasl-1.5.24). Then you will
+ need to execute one of the following sets of commands:
+ debian/rules build as a normal user
+ debian/rules binary as root
+ or
+ debian/rules binary as root
+ or
+ dpkg-buildpackage
+4) install the resulting packages with a command similar to:
+ cd ..;dpkg --install *1.5.24-9*deb
+
+At this time, all of the prerequisites should be fulfilled to build the
+sendmail-8.12.1-1 packages.
+
+Note: to get a functional sendmail binary, I had to uninstall
+libdb2-dev at this point. See note on libdb at the end of this
+document. If your sendmail binary segfaults on startup, try removing
+libdb2-dev and going through all the remaining steps again.
+
+
+Now on to the real reason why you are reading this, making a sendmail
+binary package:
+1) download the sendmail source from your nearest Debian source
+ mirror. At the point of the writing of this document that was
+ version 8.12.1-1. The source should be in "debian/pool/main/s/sendmail",
+ you will need the following files (possibly replacing the version):
+ sendmail_8.12.1-1.diff.gz
+ sendmail_8.12.1-1.dsc
+ sendmail_8.12.1.orig.tar.gz
+2) extract the source using dpkg-source -x sendmail_8.12.1-1.dsc
+ This should create a directory named sendmail-8.12.1/
+3) modify debian portion to remove perl-5.6.1 dependancy and to fix a
+ typo. Some or all of this step will possibly disappear from future
+ versions. First cd sendmail-8.12.1/debian
+ a) Fix typo in the debian rules file
+ Search for the string "dh_testversion 2"
+ if dh_testversion is immediately preceded by a / remove it.
+ i.e. if you see /dh_testversion change it to dh_testversion
+ *** Note: you no longer need to do this as of 8.12.1-2 !
+ b) Change directory into sendmail-8.12.1/debian/local. Edit the
+ following files:
+ Parse_mc.pm.in
+ parse_mc.in
+ update_conf.in
+ update_mk.in
+ commenting out the following lines:
+ use warnings;
+ no warnings qw(once);
+ you may optionally also with to remove the -w for the first line
+ of those files.
+4) compile+package sendmail, this can be accomplished in different
+ ways. For either of them you will need to cd into the source
+ directory you extracted (cd sendmail-8.12.1). Then you will
+ need to execute one of the following sets of commands:
+ debian/rules build as a normal user
+ debian/rules binary as root
+ or
+ debian/rules binary as root
+ or
+ dpkg-buildpackage
+5) install the resulting packages with a command similar to:
+ cd ..;dpkg --install *8.12.1-1*deb
+
+At this point you should have a working sendmail binary installed. It
+is time to start testing. If sendmail seg faults on start up (verify
+with sendmail -bD), you should read the following note on libdb,
+libdb2, and libdb3).
+
+
+Yours,
+
+William R Thomas <corvar@theonering.net>
+
+
+A note on libdb, libdb2, and libdb3:
+ Sendmail and all of the various libraries it uses must all use
+ the same version of libdb. The quick, dirty, easy way to verify
+ this is to use ldd to determine which libdb library is being
+ used in the finished binaries:
+ ldd /usr/lib/sendmail
+ ldd /usr/lib/libnss_db.so
+ ldd /usr/sbin/saslpasswd (if available)
+ ldd /usr/sbin/slapd (if available)
+ if everything has gone well, you should see that all of the
+ above files are using the same version of libdb.
+
+ To get everything on the same version of libdb, I needed to
+ uninstall libdb2-dev previous to compiling the sendmail package.
diff --git a/debian/TODO b/debian/TODO
new file mode 100644
index 0000000..8f9a89b
--- /dev/null
+++ b/debian/TODO
@@ -0,0 +1,49 @@
+Important:
+Misc:
+ * MSP/MTA split related
+ - -Am -bs failure if not root (can't write to /var/spool/mqueue)
+ would have to make queue dir 0660
+ * Don't do that ;-)
+ - queue cleaning for MSP -- do queue cleaning by subdirs
+ * 8.12 related ?
+ - recheck milter (Beta9+, its no longer _FFR_)
+ - debian/examples/milter needs looking at
+ * Debian stuff
+ - removing /etc/cron.d/sendmail to stop gid mismatch errors doesn't
+ work because cron may not see the update before scheduling...
+ shipping binary suid may solve this (and removes a small window
+ where calls to sendmail binary fail)
+ - split sendmail into sendmail/sendmail-common, with
+ sendmail-common containing /usr/share/sendmail stuff
+ - rules.in: why doesn't a failure in lower make propogate up?
+ - no need to configure rules, instead have rules depend upon
+ autoconf.mk !
+ - update debian/patches/patches.index
+ - create an LDAP migration script
+ - cleanup/extend sendmailconfig (debconf)
+ - support submit.mc updates (nullclient, etc)
+ - put stuff in sendmail.mc appropriately
+ above/below MAILER_DEFINITIONS
+ - sendmail -> mgetty/fax linkage
+ - sensible-mda: make sure mbox exists, setgid mail, drop suid
+
+Doc:
+
+FHS:
+ * /usr/lib/sendmail (obsolete link used by rmail/pine/others)
+
+IRC comments:
+* <wichert> cowboy: I use a LUSER_RELAY here, which sends everything to another machine. That other machine uses a different maildomain, so I would like the luserrelay to rewrite the from-address when relaying
+<cowboy> wichert: does genericstable work with the relay?
+<wichert> cowboy: that probably, but that will rewrite _all_ outgoing mail
+<cowboy> wichert: so you want it rewritten *only* when going through the relay?
+<wichert> cowboy: indeed. And only for the receiving persons
+<cowboy> wichert: hrm... I guess a new mailer def for the relay eh?
+<wichert> cowboy: probably, FEATUER(luser_relay,host,rewrite_to) or so, with the 3rd param being optional
+<cowboy> wichert: hrm... so you using aliases now?
+<wichert> cowboy: no, people who do a group-reply to something I sent just get errors now
+<cowboy> wichert: interesting... have you considered masquerading as your luser_relay, and then using generictable/user db to override for the uids that actually exist?
+<wichert> cowboy: sounds like a hack and certainly does not scale very well
+<cowboy> wichert: most definetly true ;-{
+
+* <wichert> cowboy: another thing: you might want to make a /usr/doc/sendmail/README.spam or so with info about all spam/relay-control hacks/features that are in the Debian package, with a couple of examples
diff --git a/debian/build/Build b/debian/build/Build
new file mode 100644
index 0000000..bf94717
--- /dev/null
+++ b/debian/build/Build
@@ -0,0 +1,23 @@
+#!/bin/sh
+#-----------------------------------------------------------------------------
+# $Sendmail: build/Build,v 8.12.0 2001/03/21 11:41:31 cowboy Exp $
+#
+# Copyright (c) 2001-2001 Richard Nelson. All Rights Reserved.
+#
+# Debian script to rationalize builds for Sendmail prior to 8.9.0
+#
+#-----------------------------------------------------------------------------
+set -e;
+
+# If ./Makefiles is a directory, we need to use makesendmail
+if [ -d Makefiles ]; then
+ sh makesendmail;
+
+# If ./Makefile.dist exists, use it
+elif [ -f Makefile.dist ]; then
+ (cd obj* && make;);
+
+# Otherwise, well, there's not much we can do
+else
+ :;
+ fi;
diff --git a/debian/build/autoconf.mk.in b/debian/build/autoconf.mk.in
new file mode 100644
index 0000000..c531e82
--- /dev/null
+++ b/debian/build/autoconf.mk.in
@@ -0,0 +1,98 @@
+#!/usr/bin/make -f
+#------------------------------------------------------------------------------
+# vim: syntax=make
+#
+# $Sendmail: autoconf.mk,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# Rules file for Sendmail @sm_version@@sm_revision@(@sm_version_math@)
+# on @sm_dist_name@ @sm_dist_vers@
+# via Debhelper V@DEBIAN_DH@
+#
+# Note: the .in file supports Sendmail @SM_MINVERS@ - @SM_MAXVERS@
+# on Debian slink, potato, woody, testing, sid, ...
+# but the generated file is customized to the version noted above.
+#
+# Richard Nelson <cowboy@debian.org> @sm_date@ @sm_time@ (@sm_utc@)
+#------------------------------------------------------------------------------
+#SHELL := /bin/sh -x
+
+# Variables for, and by, Autoconf (Don't touch these! edit config step)
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = ${DESTDIR}@bindir@
+sbindir = ${DESTDIR}@sbindir@
+libexecdir = ${DESTDIR}@libexecdir@
+datadir = ${DESTDIR}@datadir@
+sysconfdir = ${DESTDIR}@sysconfdir@
+sharedstatedir = ${DESTDIR}@sharedstatedir@
+localstatedir = ${DESTDIR}@localstatedir@
+libdir = ${DESTDIR}@libdir@
+includedir = ${DESTDIR}@includedir@
+infodir = ${DESTDIR}@infodir@
+mandir = ${DESTDIR}@mandir@
+srcdir = @srcdir@
+abs_srcdir = @abs_srcdir@
+top_srcdir = @top_srcdir@
+abs_top_srcdir = @abs_top_srcdir@
+builddir = @builddir@
+abs_builddir = @abs_builddir@
+top_builddir = @top_builddir@
+abs_top_builddir = @abs_top_builddir@
+VPATH = @srcdir@
+
+docdir = ${DESTDIR}@docdir@
+buildtree = @buildtree@
+
+# I like to preserve timestamps...
+INSTALL := @INSTALL@ -p
+INSTALL_PROGRAM := @INSTALL_PROGRAM@
+# We'll let the dh_strip program take care of this for us...
+#ifeq (,$(findstring nostrip,${DEB_BUILD_OPTIONS}))
+# override INSTALL_PROGRAM += -s
+# endif
+INSTALL_DATA := @INSTALL_DATA@
+# Scripts need to be executable also
+INSTALL_SCRIPT := @INSTALL_SCRIPT@ -m 0755
+
+# AutoConfig generated
+AC_CC := @CC@
+AC_CFLAGS := @CFLAGS@
+AC_DEFS := @CPPFLAGS@ @DEFS@
+AC_LDFLAGS := @LDFLAGS@
+AC_LIBS := @LIBS@
+
+# Define standard compile/install flags (skip if not yet configured)
+DUMMY_CC := $(shell echo '-CC-' | tr '-' '@')
+ifeq ("cc", "${AC_CC}")
+ ifeq ("y", "$(shell test -x /usr/bin/gcc-3.2 && echo 'y' || echo 'n')")
+ AC_CC := gcc-3.2
+ else
+ ifeq ("y", "$(shell test -x /usr/bin/gcc-3.1 && echo 'y' || echo 'n')")
+ AC_CC := gcc-3.1
+ endif
+ endif
+ endif
+ifneq ("${DUMMY_CC}", "${AC_CC}")
+ CC := ${AC_CC}
+ #DEFS := ${AC_DEFS} ${DEFINES}
+ DEFS := ${DEFINES}
+ LDFLAGS := ${AC_LDFLAGS}
+ LIBS := ${AC_LIBS}
+ endif
+ifeq (,${CFLAGS})
+ CFLAGS := -O2 -g -Wall ${DEFS}
+ endif
+# No longer needed, left as an example:
+# Force no optimization for arm - buggy compiler...
+ifeq ("arm", "${DEB_HOST_ARCH}")
+ override CFLAGS := -O0 -Wall
+ endif
+ifneq (,$(findstring noopt,${DEB_BUILD_OPTIONS}))
+ override CFLAGS += -O0
+ endif
diff --git a/debian/build/autoconf.pl.in b/debian/build/autoconf.pl.in
new file mode 100644
index 0000000..96ad3af
--- /dev/null
+++ b/debian/build/autoconf.pl.in
@@ -0,0 +1,39 @@
+#------------------------------------------------------------------------------
+# Autoconf variables - in a form suitable for sh, perl
+# @configure_input@
+#------------------------------------------------------------------------------
+# Variables for, and by, Autoconf (Don't touch these! edit config step)
+my ($PACKAGE_NAME, $PACKAGE_VERSION, $prefix, $exec_prefix, $bindir,
+ $sbindir, $libexecdir, $datadir, $sysconfdir, $sharedstatedir,
+ $localstatedir, $libdir, $includedir, $infodir, $mandir, $docdir,
+ $srcdir, $abs_srcdir, $top_srcdir, $abs_top_srcdir,
+ $builddir, $abs_builddir, $top_builddir, $abs_top_builddir,
+ $VPATH);
+BEGIN {
+ $PACKAGE_NAME = "@PACKAGE_NAME@";
+ $PACKAGE_VERSION = "@PACKAGE_VERSION@";
+ $prefix = "@prefix@";
+ $exec_prefix = "@exec_prefix@";
+ $bindir = "@bindir@";
+ $sbindir = "@sbindir@";
+ $libexecdir = "@libexecdir@";
+ $datadir = "@datadir@";
+ $sysconfdir = "@sysconfdir@";
+ $sharedstatedir = "@sharedstatedir@";
+ $localstatedir = "@localstatedir@";
+ $libdir = "@libdir@";
+ $includedir = "@includedir@";
+ $infodir = "@infodir@";
+ $mandir = "@mandir@";
+ $docdir = "@docdir@";
+ $srcdir = "@srcdir@";
+ $abs_srcdir = "@abs_srcdir@";
+ $top_srcdir = "@top_srcdir@";
+ $abs_top_srcdir = "@abs_top_srcdir@";
+ $builddir = "@builddir@";
+ $abs_builddir = "@abs_builddir@";
+ $top_builddir = "@top_builddir@";
+ $abs_top_builddir = "@abs_top_builddir@";
+ $VPATH = "@srcdir@";
+ };
+
diff --git a/debian/build/autoconf.sh.in b/debian/build/autoconf.sh.in
new file mode 100644
index 0000000..cac3d18
--- /dev/null
+++ b/debian/build/autoconf.sh.in
@@ -0,0 +1,31 @@
+#------------------------------------------------------------------------------
+# Autoconf variables - in a form suitable for sh, perl
+# @configure_input@
+#------------------------------------------------------------------------------
+# Variables for, and by, Autoconf (Don't touch these! edit config step)
+PACKAGE_NAME="@PACKAGE_NAME@";
+PACKAGE_VERSION="@PACKAGE_VERSION@";
+prefix="@prefix@";
+exec_prefix="@exec_prefix@";
+bindir="@bindir@";
+sbindir="@sbindir@";
+libexecdir="@libexecdir@";
+datadir="@datadir@";
+sysconfdir="@sysconfdir@";
+sharedstatedir="@sharedstatedir@";
+localstatedir="@localstatedir@";
+libdir="@libdir@";
+includedir="@includedir@";
+infodir="@infodir@";
+mandir="@mandir@";
+docdir="@docdir@";
+srcdir="@srcdir@";
+abs_srcdir="@abs_srcdir@"
+top_srcdir="@top_srcdir@"
+abs_top_srcdir="@abs_top_srcdir@"
+builddir="@builddir@"
+abs_builddir="@abs_builddir@"
+top_builddir="@top_builddir@"
+abs_top_builddir="@abs_top_builddir@"
+VPATH="@srcdir@"
+
diff --git a/debian/build/changelog.sh.in b/debian/build/changelog.sh.in
new file mode 100644
index 0000000..b05cc16
--- /dev/null
+++ b/debian/build/changelog.sh.in
@@ -0,0 +1,59 @@
+#!/bin/sh -e
+#-----------------------------------------------------------------------------
+# $Sendmail: changelog.sh,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# Debian script to generate changelogs for sendmail @sm_version@@sm_revision@
+#
+# Note: this file supports @SM_MINVERS@ - @SM_MAXVERS@
+#
+#-----------------------------------------------------------------------------
+set -e;
+#
+# Initialization
+PACKAGE='sendmail';
+
+# Create a combined changelog *IFF* we have the pieces/parts...
+if [ -d private/changelogs ]; then
+ echo "Building @PACKAGE_NAME@ @sm_version@@sm_revision@(@sm_version_math@) changelog.";
+ #
+ # Remove old combined changelog
+ rm -f changelog;
+ #
+ # Beta changelogs
+ if [ -f private/changelogs/@sm_version@ ]; then
+ cat private/changelogs/@sm_version@ \
+ >> changelog;
+ #
+ # 8.12 changelogs
+ elif [ @sm_version_math@ -ge 527360 ]; then
+ cat private/changelogs/8.12 >> changelog;
+ #
+ # 8.11 changelogs
+ elif [ @sm_version_math@ -ge 527104 ]; then
+ cat private/changelogs/8.11 >> changelog;
+ #
+ # 8.10 changelogs
+ elif [ @sm_version_math@ -ge 526848 ]; then
+ cat private/changelogs/8.10 >> changelog;
+ #
+ # 8.9 changelogs
+ elif [ @sm_version_math@ -ge 526592 ]; then
+ cat private/changelogs/8.9 >> changelog;
+ #
+ # 8.8 changelogs
+ elif [ @sm_version_math@ -ge 526336 ]; then
+ cat private/changelogs/8.8 >> changelog;
+ #
+ # 8.7 changelogs
+ elif [ @sm_version_math@ -ge 526080 ]; then
+ cat private/changelogs/8.7 >> changelog;
+ fi;
+ #
+ # Variable definitions
+ cat private/changelogs/vars >> changelog;
+ fi;
+
diff --git a/debian/build/control.m4.in b/debian/build/control.m4.in
new file mode 100644
index 0000000..054494a
--- /dev/null
+++ b/debian/build/control.m4.in
@@ -0,0 +1,142 @@
+dnl #--------------------------------------------------------------------------
+dnl # $Sendmail: control.m4,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+dnl #
+dnl # Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+dnl #
+dnl # @configure_input@
+dnl #
+dnl # Debian control.m4 for sendmail @sm_version@@sm_revision@(@sm_version_math@)
+dnl #
+dnl # Note: the .in file supports @SM_MINVERS@ - @SM_MAXVERS@, but the generated
+dnl # file is customized to the version noted above.
+dnl #
+dnl # Note: Exercise care in the feeding of this file, especially wrt quoting!
+dnl #
+dnl #--------------------------------------------------------------------------
+changequote([[, ]])dnl
+dnl #
+dnl # The source description
+dnl # Always built
+dnl #
+[[Source: sendmail
+Priority: extra
+Section: mail
+Maintainer: Richard A Nelson (Rick) <cowboy@debian.org>
+Standards-Version: 3.5.7.0
+Build-Depends-Indep: groff, bsdmainutils
+Build-Depends: m4, patch, debhelper (>= 1.1.17), @sm_badepends@]]
+dnl #
+dnl # The first arch=any package description
+dnl # Always built
+dnl #
+[[
+Package: sendmail
+Architecture: any
+Section: mail
+Replaces: mail-transport-agent, sendmail-tls
+Provides: mail-transport-agent
+Conflicts: mail-transport-agent
+Depends: adduser, m4, ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, @sm_depends@
+Recommends: @sm_recommends@
+Suggests: sendmail-doc (>= ${Source-Version}), mail-reader, procmail | mailagent | maildrop | deliver, make, logcheck, @sm_suggests@
+Description: A powerful, efficient, and scalable Mail Transport Agent
+ Sendmail is an alternative Mail Transport Agent (MTA) for Debian.
+ It is suitable for handling sophisticated mail configurations,
+ although this means that its configuration can also be complex.
+ Fortunately, easy thing can be done easily, and complex things
+ are possible, even if not easily understood ;) Sendmail is the *ONLY*
+ MTA with a Turing complete language to control *ALL* aspects of delivery!
+ .
+ Sendmail provides Security and SPAM/UCE/UBE protection via several means:]]dnl
+ifelse([[@sm_enable_tls@]], [[yes]], [[
+ - STARTTLS(SSL) RFC2487 encryption for mail reception/delivery.
+ - STARTTLS(SSL) authentication (certificate based) for access/relay control.]])dnl
+ifelse([[@sm_enable_auth@]], [[yes]], [[
+ - SMTP AUTH (SASL/PAM) authentication for access/relay control.]])[[
+ - ACCESS database (by IP/host) for access/relay control.
+ - Use of varied Realtime Blackhole Lists (RBL) to prevent access.
+ - Integration of LOGCHECK rules to fine-tune logging.
+ - Inboard POSIX Regular Expression processing of *all* headers.]]dnl
+ifelse([[@sm_enable_milter@]], [[yes]], [[
+ - Ability (via MILTER) to scan/change headers *and* body of *ALL* mail
+ A site may utilize zero, one, or more MILTERs.]])[[
+ - Reduced SUID exposures by running SGID smmsp/mail where possible.
+ .
+ Sendmail provides Performance and Scalability by:
+ - Allowing multiple queues, with the ability to tune both interval and
+ queue runners on a queue by queue basis.
+ - Providing (a Debian exclusive) an easy to configure means of queue-aging
+ to improve throughput by not continually retrying failed deliveries.]]dnl
+ifelse([[@sm_enable_ldap@]], [[yes]], [[
+ - Allowing most all maps/databases to be obtained via LDAP; reducing the
+ number of used databases and simplifying the maintenance of Sendmail.]])[[
+ - Reducing the file I/O where possible by buffering files in memory.
+ .
+ Sendmail provides site enhanced site configuration/customization by:
+ - Allowing the listener (usually port 25) to run as a daemon or via INETD.
+ - Allowing the queue runner (mail delivery) to run as a daemon or via CRON.
+ - Automagically updating configuration and databases on upgrades.
+ - Providing a Turing complete language for site customization of mail
+ handling.]]dnl
+ifelse([[@sm_enable_milter@]], [[yes]],[[
+ - Providing a means (MILTER) for a site to scan/change all email - both
+ incoming and outgoing. A site can write their own MILTER, or may use
+ any of those found on internet. To write your own MILTER, you'll need
+ to install the optional milter-dev package.]])[[
+ - Providing extensive documentation via the sendmail-doc (optional) package.
+ - Providing an inboard Mail Delivery Agent (MDA) (mail.local), but supporting
+ procmail, mailagent, maildrop, or deliver automatically if installed.
+ Sendmail will also deliver to anythings else (cyrus, etc) if asked to.
+ .
+ Sendmail includes *no* Mail User Agents (MUA), you'll have to
+ pick from the plethora of available MUAs (pine, mutt, vm, etc.)
+ .
+ This package supports @sm_databases@ maps,
+ and has enabled @sm_features@.]]dnl
+dnl #
+dnl # The second arch=any package (libmilter-dev)
+dnl # Only built if MILTER is enabled
+dnl #
+ifelse([[@sm_enable_dev@]], [[yes]], dnl
+ifelse([[@sm_enable_milter@]], [[yes]], [[
+
+Package: libmilter-dev
+Architecture: any
+Section: devel
+Suggests: sendmail-doc (>= ${Source-Version})
+Description: Sendmail Mail Filter API (Milter)
+ The Sendmail Mail Filter API (Milter) is designed to allow third-party
+ programs access to mail messages as they are being processed in order
+ to filter meta-information(headers) and content.
+ .
+ The Debian Sendmail package is built to support libmilter.
+ .
+ This is the libmilter static library and include files for development.
+ .
+ The documentation on building a Milter is in the sendmail-doc package.]]))dnl
+dnl #
+dnl # The first (and only) arch=all (sendmail-doc)
+dnl #
+ifelse([[@sm_enable_doc@]], [[yes]], [[
+
+Package: sendmail-doc
+Architecture: all
+Section: doc
+Description: A powerful, efficient, and scalable Mail Transport Agent
+ Sendmail is an alternative Mail Transport Agent (MTA) for
+ Debian. It is suitable for handling sophisticated mail
+ configurations, although this means that its configuration
+ can also be complex.
+ .
+ Because of the complexity, you may find yourself wanting to peruse
+ the documentation files included herein. The main files are:
+ 1) cf.README.gz -- A reference for all things in sendmail.{mc,cf}
+ 2) op.{ps,txt}.gz -- The care and feeding of Sendmail.
+ 3) faq.txt.gz -- Sendmail FAQ, current as of the package date.
+ .
+ Other files include the references for smrsh and libmilter.]])dnl
+dnl #
+dnl # Provide the requisite trailing newline
+dnl #
+
+
diff --git a/debian/build/install-sh b/debian/build/install-sh
new file mode 100644
index 0000000..b41a245
--- /dev/null
+++ b/debian/build/install-sh
@@ -0,0 +1,251 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=$mkdirprog
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+ '
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/debian/build/rules.in b/debian/build/rules.in
new file mode 100644
index 0000000..8ee3f6a
--- /dev/null
+++ b/debian/build/rules.in
@@ -0,0 +1,1189 @@
+#!/usr/bin/make -f
+#------------------------------------------------------------------------------
+# vim: syntax=make
+#
+# $Sendmail: rules,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# Rules file for Sendmail @sm_version@@sm_revision@(@sm_version_math@)
+# on @sm_dist_name@ @sm_dist_vers@
+# via Debhelper V@DEBIAN_DH@
+#
+# Note: the .in file supports Sendmail @SM_MINVERS@ - @SM_MAXVERS@
+# on Debian slink, potato, woody, testing, sid, ...
+# but the generated file is customized to the version noted above.
+#
+# The only thing to watch for is to make sure the changelog correctly
+# reflects the appropriate version and distribution!
+#
+# To support private builds:
+# 1) use the environment variables (defaults shown first):
+# CC=gcc|gcc-3.0..........-- choose compiler
+# CFLAGS='-O2 -Wall [-g]'.-- choose compile options
+# DEFINES=''..............-- additional -Dxxx
+# SM_CONF_OPT=''..........-- additional configure options
+# SM_BUILD_OPT=''.........-- additional build options
+# 2) Build the package using your normal setup:
+# A) [fakeroot] debian/rules binary
+# B) debuild -rfakeroot
+# C) dpkg-buildpackage -rfakeroot -uc -us
+#
+# DEB_BUILD_OPTIONS (global Debian package build options)
+# Debian specific, and common across package options
+# noopt - Do *NOT* compile with optimization (force -O0)
+# nostrip - Do *NOT* strip binaries (for debugging)
+#
+#
+# SM_CONF_OPT
+# Additional configure options and/or overrides may be specified thusly:
+# 1) export SM_CONF_OPT='--enable-shm=no'
+# dpkg-buildpackage -rfakeroot -uc -us
+# 2) SM_CONF_OPT='--enable-shm=no' dpkg-buildpackage
+# 3) debuild -e SM_CONF_OPT='--enable-shm=no'
+# etc...
+#
+# SM_BUILD_OPT
+# 1) export SM_BUILD_OPT='notls'
+# dpkg-buildpackage -rfakeroot -uc -us
+# 2) SM_BUILD_OPT='notls' dpkg-buildpackage -rfakeroot -uc -us
+# 3) debuild -e SM_BUILD_OPT='notls' -e CLFAGS='-O3 Wall'
+# etc...
+#
+# Supported options values for SM_BUILD_OPT:
+# notls Disable STARTTLS (OpenSSL) support
+# noauth Disable SMTP AUTH (sasl) support
+# nodev Disable generation of libmilter-dev package
+# nodoc Disable generation of sendmail-doc package
+#
+# This make file uses scripts from the DBS (0.8) package!
+#
+# Richard Nelson <cowboy@debian.org> @sm_date@ @sm_time@ (@sm_utc@)
+#------------------------------------------------------------------------------
+#SHELL := /bin/sh -x
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use. (we'll set it later)
+#export DH_COMPAT=4
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+# Support separate debian directory
+ifeq (yes, $(shell test -d debian && echo 'yes'))
+ debian_dir := debian
+ pwd_dir := ${PWD}
+else
+ debian_dir := .
+ pwd_dir := ${PWD}/..
+ endif
+
+# Determine build,host architectures (via dpkg-architecture)
+ifeq (, ${DEB_BUILD_ARCH})
+ ifeq (yes, $(shell test -x /usr/bin/dpkg-architecture && echo 'yes'))
+ include ${debian_dir}/scripts/dpkg-arch.mk
+ endif
+ endif
+
+# Check for cross-compilation
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+ ifneq (, $(DEB_BUILD_GNU_TYPE))
+ endif
+ endif
+
+# will want path info for some things... Like patches/changelogs...
+pwd_string := $(shell expr "${pwd_dir}" : '.*-\([0-9.].*\)')
+ifeq (, $(findstring +,${pwd_string}))
+ pwd_version := ${pwd_string}
+else
+ pwd_version := $(shell expr "${pwd_string}" : '.*+\([0-9.].*\)')
+ endif
+pwd_major := $(shell expr "${pwd_version}" : '\([0-9]*\.[0-9]*\)')
+
+# get package/version information from the changelog
+package := $(shell (cd ${debian_dir}/.. && \
+ dpkg-parsechangelog 2>/dev/null) | awk '/^Source:/ {print $$2}')
+version_string := $(shell (cd ${debian_dir}/.. && \
+ dpkg-parsechangelog 2>/dev/null) | awk '/^Version:/ {print $$2}')
+version_full := $(shell expr "${version_string}" : '\([^-]*\)')
+version_debian := $(shell expr "${version_string}" : '[^-]*\(-.*\)')
+version := ${version_full}
+version_major := $(shell expr "${version_full}" : '\([0-9]*\.[0-9]*\)')
+version_minor := $(shell expr "${version_full}" : '[0-9]*\.[0-9]*\.\(.*\)')
+ifneq (, $(findstring +,${version_minor}))
+ beta_version := $(shell expr "${version_full}" : '.*+\([0-9.].*\)')
+ beta_major := $(shell expr "${beta_version}" : '\([0-9]*\.[0-9]*\)')
+ beta_minor := $(shell expr "${beta_version}" : '[0-9]*\.[0-9]*\.\(.*\)')
+ ifneq (, $(beta_version))
+ version := ${beta_version}
+ version_major := ${beta_major}
+ version_minor := ${beta_minor}
+ endif
+ endif
+
+# Many things depend upon which release (slink, potato, woody, etc.)
+PKG_DIR := ${debian_dir}/${package}
+DATA_DIR := /usr/share
+ifeq (v4, $(shell (cd ${debian_dir}/.. && dh_testversion 4.0.0 2>/dev/null && echo 'v4')))
+ DH_COMPAT := 4
+else
+ ifeq (v3, $(shell (cd ${debian_dir}/.. && dh_testversion 3.0.0 2>/dev/null && echo 'v3')))
+ DH_COMPAT := 3
+ else
+ ifeq (v2, $(shell (cd ${debian_dir}/.. && dh_testversion 2.0.40 2>/dev/null && echo 'v2')))
+ DH_COMPAT := 2
+ else
+ DH_COMPAT := 1
+ PKG_DIR := ${debian_dir}/tmp
+ DATA_DIR := /usr
+ endif
+ endif
+ endif
+export DH_COMPAT
+
+# the dbs rules
+TAR_DIR := ${package}-${version}
+# Handle the case where the changelog is newer that what we're building
+ifneq (yes, $(shell test -e ${debian_dir}/../${TAR_DIR}.tar.gz && echo 'yes'))
+ TAR_DIR := ${package}-${pwd_version}
+ endif
+SOURCE_DIR := build-tree
+BUILD_TREE := ${SOURCE_DIR}/${TAR_DIR}
+PATCH_DIR := ${debian_dir}/patches/${version_major}/${version}
+SCRIPT_DIR := ${debian_dir}/scripts
+STAMP_DIR := ${debian_dir}/build/stampdir
+
+# Include Debian Autoconf settings
+ifeq (yes, $(shell test -e ${debian_dir}/build/autoconf.mk && echo 'yes'))
+ include ${debian_dir}/build/autoconf.mk
+else
+ include ${debian_dir}/build/autoconf.mk.in
+ endif
+
+# these are strictly for my own consuption
+PKG_DOC := ${debian_dir}/${package}-doc${docdir}/${package}-doc
+MAKE_SUBDIRS := examples local sensible_mda
+PACKAGES := sendmail sendmail-doc libmilter-dev
+SM_SUBDIRS := editmap libmilter mail.local mailstats \
+ makemap praliases rmail sendmail smrsh vacation
+#
+# We want delayed interpretation of the options !
+ifeq (yes, $(shell test -x /usr/bin/debuild && echo 'yes'))
+ DEB_BUILD = \
+ SM_CONF_OPT="${SM_CONF_OPT}" \
+ SM_BUILD_OPT="${SM_BUILD_OPT}" \
+ DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS}" \
+ debuild -e SM_CONF_OPT -e SM_BUILD_OPT
+else
+ DEB_BUILD = \
+ SM_CONF_OPT="${SM_CONF_OPT}" \
+ SM_BUILD_OPT="${SM_BUILD_OPT}" \
+ DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS}" \
+ dpkg-buildpackage
+ endif
+
+# Process build-time options:
+# 1) options from SM_BUILD_OPT (Prior to configure)
+# 2) defaults (Prior to configure)
+ENABLE_INDEP := yes
+ENABLE_ARCH := yes
+ENABLE_LIB := no
+ENABLE_BIN := yes
+ifneq (, $(findstring notls,${SM_BUILD_OPT}))
+ ENABLE_TLS := no
+else
+ ENABLE_TLS := yes
+ endif
+ifneq (, $(findstring noauth,${SM_BUILD_OPT}))
+ ENABLE_AUTH := no
+else
+ ENABLE_AUTH := yes
+ endif
+ifneq (, $(findstring nodev,${SM_BUILD_OPT}))
+ ENABLE_DEV := no
+else
+ ENABLE_DEV := yes
+ endif
+ifneq (, $(findstring nodoc,${SM_BUILD_OPT}))
+ ENABLE_DOC := no
+else
+ ENABLE_DOC := yes
+ endif
+#
+# Summarize above options into -INDEP and -ARCH for this Makefile
+ENABLE_INDEP := ${ENABLE_DOC}
+ifeq (no, ${ENABLE_BIN})
+ ifeq (no, ${ENABLE_LIB})
+ ifeq (no, ${ENABLE_DEV})
+ ENABLE_ARCH := no
+ endif
+ endif
+ endif
+
+all:
+ @echo 'Please specify a real target in the future...';
+ $(MAKE) -f ${debian_dir}/rules \
+ version_string=${pwd_string} \
+ SM_CONF_OPT="${SM_CONF_OPT}" SM_BUILD_OPT="${SM_BUILD_OPT}" \
+ DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS}" \
+ binary;
+
+
+#------------------------------------------------------------------------------
+# Rules to maintain the external Debian directory
+#------------------------------------------------------------------------------
+#-------------
+refresh-dbs:
+ @echo 'updating debian/scripts directory...';
+ cp -af /usr/share/dbs/* ${SCRIPT_DIR}/;
+ chmod a-w ${SCRIPT_DIR}/*;
+
+#-------------
+refresh-debian:
+ @dh_testdir;
+ @echo 'updating debian directory ...';
+ sudo $(RM) -r debian;
+ cp -a ../debian ./;
+ sudo $(RM) -r ${SOURCE_DIR} ${STAMP_DIR};
+ rm -f ${debian_dir}/config.status;
+ touch ${debian_dir}/rules;
+ $(MAKE) -f ${debian_dir}/rules \
+ version_string=${pwd_string} \
+ SM_CONF_OPT="${SM_CONF_OPT}" SM_BUILD_OPT="${SM_BUILD_OPT}" \
+ DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS}" \
+ debian-setup;
+
+debian-setup:
+ # Force a configure here, using $${PWD} so the changelog, etc.
+ # wind up with the right version numbers
+ rm -f ${debian_dir}/configure ${debian_dir}/config.status;
+ rm -f ${debian_dir}/build/autoconf.mk;
+ $(MAKE) -f ${debian_dir}/rules \
+ version_string=${pwd_string} \
+ SM_CONF_OPT="${SM_CONF_OPT}" SM_BUILD_OPT="${SM_BUILD_OPT}" \
+ DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS}" \
+ configure;
+ $(MAKE) -f ${debian_dir}/rules clean-debian;
+
+ # Remove pieces not needed for further building
+ find ${debian_dir}/patches -type d -a ! -name 'patches' \
+ -a ! -name 'contrib' \
+ -a ! -name "${pwd_major}" \
+ -a ! -name "${pwd_version}" \
+ | xargs -r $(RM) -r;
+ $(RM) -r ${debian_dir}/bugs ${debian_dir}/private ${debian_dir}/watch;
+ $(RM) ${debian_dir}/build/acinclude.m4 \
+ ${debian_dir}/build/aclocal.m4 \
+ ${debian_dir}/build/sendmail.m4 \
+ ${debian_dir}/build/ndbm.m4 \
+ ${debian_dir}/config.log ${debian_dir}/config.cache \
+ ${debian_dir}/config.status \
+ ${debian_dir}/build/config.guess ${debian_dir}/build/config.sub;
+ $(RM) -r ${debian_dir}/autom4te.cache;
+ # Fakeout Make to look like current
+ $(RM) ${debian_dir}/configure.ac;
+ echo `date` > ${debian_dir}/configure.ac;
+ touch ${debian_dir}/configure;
+ touch ${debian_dir}/rules;
+
+
+#-------------
+clean-debian:
+ @echo 'cleaning debian directory...';
+ find ${debian_dir} -name '*~' -o -name '\.*\.swp' \
+ | xargs -r rm;
+ $(RM) ${debian_dir}/*.sav;
+ $(RM) ${debian_dir}/config.log ${debian_dir}/config.cache \
+ ${debian_dir}/config.status \
+ ${debian_dir}/build/config.guess.sav \
+ ${debian_dir}/build/config.sub.sav;
+ $(RM) -r ${debian_dir}/autom4te.cache;
+ # can't touch control/changelog/configure -- needed by debuild, etc
+ for file in $$(find ${debian_dir} -type f -name '*\.in' \
+ -a ! -name 'configure.in'); do \
+ $(RM) $$(echo "$$file" | sed -e 's/\.in$$//'); \
+ done;
+ $(RM) ${STAMP_DIR}/autotools ${STAMP_DIR}/configure;
+
+#-------------
+refresh-faq:
+ @echo 'Refreshing FAQ'
+ @chmod u+w ${debian_dir}/faq.txt;
+ (cd ${debian_dir} && wget --passive-ftp --timestamping \
+ --cache=off http://www.sendmail.org/faq/faq.txt;);
+ @chmod a-w ${debian_dir}/faq.txt;
+ @echo 'Refreshing Misc'
+ @chmod u+w ${debian_dir}/cf/feature/rhsbl.m4;
+ (cd ${debian_dir}/cf/feature && wget --passive-ftp --timestamping \
+ --cache=off http://www.rfc-ignorant.org/rhsbl.m4;);
+ @chmod u-w ${debian_dir}/cf/feature/rhsbl.m4;
+
+
+#-------------
+world:
+ # Debian build daemons don't (for the nonce) support build-indep,
+ # so this rule allows *me* to build both arch and indep portions
+ # of sendmail in one go (so I don't forget).
+ @dh_testdir;
+ $(MAKE) -f ${debian_dir}/rules info;
+ time ${DEB_BUILD} -rfakeroot
+
+test:
+ @dh_testdir;
+ $(MAKE) -f ${debian_dir}/rules clean-debian;
+ fakeroot $(MAKE) -f ${debian_dir}/rules clean;
+ $(MAKE) -f ${debian_dir}/rules \
+ ENABLE_TLS=yes ENABLE_DEV=no ENABLE_DOC=no \
+ CFLAGS='-O2 -Wall' DEB_BUILD_OPTIONS='nostrip' configure;
+ #time ${DEB_BUILD} -rfakeroot -d -us -uc;
+ time $(MAKE) -f ${debian_dir}/rules build-arch;
+
+print:
+ @dh_testdir;
+ -(cd ${BUILD_TREE}/.. && \
+ for file in `find . -name 'README'`; do \
+ lpr $$file; \
+ done; );
+ -(cd ${BUILD_TREE}/.. && \
+ lpr */KNOWNBUGS; \
+ lpr */RELEASE_NOTES; \
+ lpr */sendmail/SECURITY; \
+ lpr */sendmail/TUNING; \
+ lpr */sendmail/TRACEFLAGS; \
+ lpr */doc/op/op.ps; \
+ lpr */cf/feature/nullclient.m4; \
+ lpr */cf/feature/msp.m4; \
+ );
+ -(cd ${debian_dir} && \
+ lpr ../../${debian_dir}/configure.ac; \
+ lpr ../../${debian_dir}/build/rules.in; \
+ lpr build/site.config.m4.in; \
+ lpr cf/hack/msp_nullclient.m4; \
+ );
+
+
+#------------------------------------------------------------------------------
+# Misc rules
+#------------------------------------------------------------------------------
+#-------------
+${STAMP_DIR}:
+ mkdir -p ${STAMP_DIR};
+
+
+#------------------------------------------------------------------------------
+# Autoconf rules
+#------------------------------------------------------------------------------
+#-------------
+${debian_dir}/rules: ${debian_dir}/build/rules.in ${debian_dir}/config.status
+ # *** *** *** configure changed ?!? *** *** ***
+ if [ -e ${debian_dir}/config.status ]; then \
+ chmod ug+x ${debian_dir}/config.status; \
+ (cd ${debian_dir} && ./config.status;); \
+ fi;
+
+#-------------
+${debian_dir}/config.status: ${debian_dir}/configure
+ # *** *** *** configure changed ?!? *** *** ***
+ if [ -e ${debian_dir}/config.status ]; then \
+ chmod ug+x ${debian_dir}/config.status; \
+ (cd ${debian_dir} && ./config.status --recheck;) \
+ fi;
+
+#-------------
+${debian_dir}/configure: ${debian_dir}/configure.ac
+ # *** *** *** configure.ac changed ?!? *** *** ***
+ cp -af ${debian_dir}/configure.ac \
+ ${debian_dir}/configure.in;
+ (cd ${debian_dir} && autoconf;);
+ $(RM) ${debian_dir}/configure.in;
+ chmod ug+x ${debian_dir}/configure;
+
+#-------------
+autotools: ${STAMP_DIR} ${STAMP_DIR}/autotools
+${STAMP_DIR}/autotools:
+
+ #Add here commands to setup the autotools environment
+
+ # Make sure we have the latest available config.{guess,sub}
+ # Allow the package to override either by faking the date...
+ if [ -e /usr/share/misc/config.guess -a \
+ -e ${debian_dir}/build/config.guess ]; then \
+ OLDDATEGUESS=`${debian_dir}/build/config.guess -t | tr -d - `; \
+ NEWDATEGUESS=`/usr/share/misc/config.guess -t | tr -d - `; \
+ if [ "$$OLDDATEGUESS" -lt "$$NEWDATEGUESS" ]; then \
+ if [ ! -e ${debian_dir}/build/config.guess.sav ]; then \
+ cp -pf ${debian_dir}/build/config.guess \
+ ${debian_dir}/build/config.guess.sav;\
+ fi; \
+ if [ -e ${debian_dir}/build/config.guess.sav ]; then \
+ cp -pf /usr/share/misc/config.guess \
+ ${debian_dir}/build/config.guess; \
+ fi; \
+ fi; \
+ fi;
+ if [ -e /usr/share/misc/config.sub -a \
+ -e ${debian_dir}/build/config.sub ]; then \
+ OLDDATESUB=`${debian_dir}/build/config.sub -t | tr -d - `; \
+ NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d - `; \
+ if [ "$$OLDDATESUB" -lt "$$NEWDATESUB" ]; then \
+ if [ ! -e ${debian_dir}/build/config.sub.sav ]; then \
+ cp -pf ${debian_dir}/build/config.sub \
+ ${debian_dir}/build/config.sub.sav; \
+ fi; \
+ if [ -e ${debian_dir}/build/config.sub.sav ]; then \
+ cp -pf /usr/share/misc/config.sub \
+ ${debian_dir}/build/config.sub; \
+ fi; \
+ fi; \
+ fi;
+
+ touch ${STAMP_DIR}/autotools;
+
+
+
+#------------------------------------------------------------------------------
+# Build/Package check rules
+#------------------------------------------------------------------------------
+#-------------
+info:
+
+ #--------------------------------------------------------------------
+ # The following information will be used for this run:
+ # Source = ${package} ${pwd_string}
+ # Package = ${package} ${version_string}
+ # Version = ${version_major}.${version_minor}${version_debian}
+ # Arch = ${DEB_BUILD_ARCH} on ${DEB_HOST_ARCH}
+ # Options
+ # config opt = ${SM_CONF_OPT}
+ # build opt = ${SM_BUILD_OPT}
+ # ENABLE_TLS = ${ENABLE_TLS}
+ # ENABLUE_AUTH= ${ENABLE_AUTH}
+ # ENABLE_DEV = ${ENABLE_DEV}
+ # ENABLE_DOC = ${ENABLE_DOC}
+ # compile opt = ${CC} ${CFLAGS} ${DEFINES}
+ # DEB_BUILD_OPTIONS = ${DEB_BUILD_OPTIONS}
+ # DH_VERBOSE = ${DH_VERBOSE}
+ # DH_OPTIONS = ${DH_OPTIONS}
+ # DH_COMPAT = ${DH_COMPAT}
+ #--------------------------------------------------------------------
+
+#-------------
+buildinfo:
+ @echo '';
+ @dpkg -l \
+ debhelper \
+ dpkg-dev \
+ gcc \
+ 'libc6*' \
+ binutils \
+ ldso \
+ make \
+ m4 \
+ libdb3 libdb3-dev \
+ libdb2 libdb2-dev \
+ libwrap0 libwrap0-dev \
+ libldap2 libldap2-dev \
+ libopenldap1 libopenldap-dev \
+ umich-libldap umich-libldap-dev \
+ libsasl7 libsasl-dev \
+ openssl libssl-dev 'libssl0*' \
+ ${BUILD_INFO} \
+ 2> /dev/null \
+ | awk '$$1 == "ii" { printf("%s-%s\n", $$2, $$3) }' \
+ | tee ${debian_dir}/${package}.buildinfo.Debian;
+ @echo '';
+ @chmod 644 ${debian_dir}/${package}.buildinfo.Debian;
+
+#-------------
+pristine:
+ @dh_testdir;
+ #$(MAKE) -f ${debian_dir}/rules info;
+ #
+ # Fail if there are any modifications to the original
+ # tarball, other than the debian directory
+ if [ -f ../${package}_${version_string}.diff.gz ]; then \
+ zgrep -e "^\+\+\+ " ../${package}_${version_string}.diff.gz \
+ | sed -e "/^\+\+\+ ${package}-${version}\/debian\/.*$$/d" - \
+ | sed -e "/^+\+\+ ${package}-${version}\/upstream\/patches\/.*$$/d" - \
+ | [ ! -z - ]; \
+ fi;
+
+ # Check for presence of TLS (crypto) enablement and bitch if found
+ @if (grep -qEe '^#TLS:[[:space:]]*yes' \
+ ${debian_dir}/build/site.config.m4); then \
+ echo '** ** --------------------------------------------------- ** **';\
+ echo '** ** This package contains crypto support ! Be careful ! ** **';\
+ echo '** ** --------------------------------------------------- ** **';\
+ fi;
+
+#-------------
+verify:
+ @dh_testdir;
+ # Verifying the md5 summs and signed files
+ @for file in $$(find . -maxdepth 1 -name '*.md5'); do \
+ echo "Checking MD5 source: $$file."; \
+ cat $$file; \
+ md5sum -c $$file; \
+ done;
+ @for file in $$(find . -maxdepth 1 -name '*.sig'); do \
+ echo "Checking signature file $$file."; \
+ part=$$(echo "$$file" | sed -e 's/\.sig$$//'); \
+ if [ -f $$part ]; then \
+ gpg --verify $$part.sig $$part || true; \
+ elif [ -f $$part.gz ]; then \
+ gunzip -c $$part.gz > $$part; \
+ gpg --verify $$part.sig $$part || true; \
+ rm $$part; \
+ fi; \
+ done;
+
+
+#------------------------------------------------------------------------------
+# User callable rules
+#------------------------------------------------------------------------------
+#-------------
+clean:
+ dh_testdir;
+ dh_testroot;
+
+ # Add here commands to clean up after the build process.
+ #-$(MAKE) clean;
+ #-$(MAKE) distclean;
+
+ # First, remove any patches, and source directories
+ #$(MAKE) -f ${debian_dir}/sys-build.mk source.clean;
+
+ # Debian stuff
+ $(RM) -r ${SOURCE_DIR} ${STAMP_DIR};
+ $(RM) ${debian_dir}/*.buildinfo.Debian;
+ for file in tmp ${PACKAGES};do \
+ $(RM) -r ${debian_dir}/$$file; \
+ done;
+
+ # Local stuff
+ for subdir in ${MAKE_SUBDIRS}; do \
+ (cd ${debian_dir}/$$subdir && $(MAKE) -f Makefile.in clean;); \
+ done;
+
+ifeq (3, $(shell test ${DH_COMPAT} -ge 3 && echo '3'))
+ # Debhelper V3 conffile handling - prevent duplicates
+ for file in $$(find ${debian_dir} -maxdepth 1 -type f \
+ -name '*\.conffiles\.sav'); do \
+ mv $$file $$(echo "$$file" | sed -e 's?\.sav$$??'); \
+ done;
+endif
+
+ # can't touch control/changelog/configure -- needed by debuild, etc
+ $(RM) ${debian_dir}/config.log ${debian_dir}/config.cache \
+ ${debian_dir}/config.status;
+ $(RM) -r ${debian_dir}/autom4te.cache
+ for file in $$(find ${debian_dir} -type f -name '*\.in' \
+ -a ! -name 'configure.in'); do \
+ $(RM) $$(echo "$$file" | sed -e 's/\.in$$//'); \
+ done;
+
+ # Restore pre-existing config.{guess,sub}
+ -if [ -e ${debian_dir}/buil/config.sub.sav ]; then \
+ cp -pf ${debian_dir}/build/config.sub.sav \
+ ${debian_dir}/build/config.sub \
+ && $(RM) ${debian_dir}/build/config.sub.sav; \
+ fi;
+ -if [ -e ${debian_dir}/build/config.guess.sav ]; then \
+ cp -pf ${debian_dir}/build/config.guess.sav \
+ ${debian_dir}/build/config.guess \
+ && $(RM) ${debian_dir}/build/config.guess.sav; \
+ fi;
+
+ # Cleanup after build (for pristine source, smaller diffs)
+ #find .. -name ${package}*.asc -size 0 -maxdepth 1 -exec rm {} ';';
+ dh_clean;
+
+
+#-------------
+setup: ${STAMP_DIR}/setup
+${STAMP_DIR}/setup:
+
+# Support separate debian directory
+ifeq (yes, $(shell test -d debian && echo 'yes'))
+ dh_testdir;
+
+ # unpack and patch source
+ $(MAKE) -f ${SCRIPT_DIR}/dbs-build.mk \
+ BUILD_TREE="${BUILD_TREE}" TAR_DIR="${TAR_DIR}" \
+ STAMP_DIR="${STAMP_DIR}" PATCH_DIR="${PATCH_DIR}" \
+ SCRIPT_DIR="${SCRIPT_DIR}" \
+ ${STAMP_DIR}/unpack ${STAMP_DIR}/patch;
+
+ touch ${STAMP_DIR}/setup;
+endif
+
+
+#-------------
+configure: ${STAMP_DIR}/configure
+${STAMP_DIR}/configure: ${STAMP_DIR}/setup ${STAMP_DIR}/autotools
+
+ $(MAKE) -f ${debian_dir}/rules info;
+
+ #Add here commands to configure the package.
+ #./configure --prefix=/usr
+
+ # Use autoconf to handle varying degrees of library support
+ # NOTE: options values are Yes/No/Auto, but auto isn't always
+ # used herein, as it can cause problems to be ignored
+ # so it is only used on items of lesser importance
+ chmod ug+x ${debian_dir}/configure;
+ (cd ${debian_dir} && \
+ ./configure \
+ --build=${DEB_BUILD_GNU_TYPE} \
+ --host=${DEB_HOST_GNU_TYPE} \
+ --prefix=/usr \
+ --libexecdir=/usr/lib/sm.bin \
+ --datadir=${DATA_DIR} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --infodir=${DATA_DIR}/info \
+ --mandir=${DATA_DIR}/man \
+ --srcdir=${pwd_dir}/debian \
+ --with-buildtree=${BUILD_TREE} \
+ --with-docdir=${DATA_DIR}/doc \
+ --with-revision=${version_debian} \
+ --enable-regex=auto \
+ --enable-ndbm=no \
+ --enable-newdb=yes \
+ --enable-nis=auto \
+ --enable-nisplus=auto \
+ --enable-ldap=yes \
+ --enable-hesiod=no \
+ --enable-tcpd=auto \
+ --enable-bind=no \
+ --enable-ipv6=auto \
+ --enable-maillock=yes \
+ --enable-auth=${ENABLE_AUTH} \
+ --enable-tls=${ENABLE_TLS} \
+ --enable-shm=auto \
+ --enable-doc=${ENABLE_DOC} \
+ --enable-dev=${ENABLE_DEV} \
+ ${SM_CONF_OPT} \
+ ;);
+ # CC="${CC}" CFLAGS="${CFLAGS}
+
+ifeq (3, $(shell test ${DH_COMPAT} -ge 3 && echo '3'))
+ # Debhelper V3 conffile handling - prevent duplicates
+ for file in $$(find ${debian_dir} -maxdepth 1 -type f \
+ -name '*.conffiles'); do \
+ mv $$file $$file.sav; \
+ done;
+endif
+
+ touch ${STAMP_DIR}/configure;
+
+
+#-------------
+build-indep: ${STAMP_DIR}/build-indep
+${STAMP_DIR}/build-indep: ${STAMP_DIR}/configure
+
+# Skip work if nothing to do...
+ifeq (yes, ${ENABLE_INDEP})
+ dh_testdir;
+
+ # Document what we're building against
+ $(MAKE) -f ${debian_dir}/rules buildinfo;
+
+ # Add here commands to build/compile the documentation/package.
+ #$(MAKE) doc;
+
+ # Only valid on newer (8.11+) Sendmails
+ #(cd ${BUILD_TREE}/doc/op/ && make op.txt);
+ # So we'll do it by hand...
+ $(RM) ${BUILD_TREE}/doc/op/op.txt;
+ pic -C ${BUILD_TREE}/doc/op/op.me | eqn -C -Tascii \
+ | GROFF_NO_SGR=1 groff -Tascii -me | ul -t dumb > ${BUILD_TREE}/doc/op/op.txt;
+
+ # Debian stuff
+ for subdir in ${MAKE_SUBDIRS}; do \
+ (cd ${debian_dir}/$$subdir && $(MAKE) build-indep;); \
+ done;
+endif
+
+ touch ${STAMP_DIR}/build-indep;
+
+
+#-------------
+build-arch: ${STAMP_DIR}/build-arch
+${STAMP_DIR}/build-arch: ${STAMP_DIR}/configure
+
+# Skip work if nothing to do...
+ifeq (yes, ${ENABLE_ARCH})
+ dh_testdir;
+
+ # Document what we're building against
+ $(MAKE) -f ${debian_dir}/rules buildinfo;
+
+ # Add here commands to compile the package.
+ #$(MAKE);
+
+ # Place our m4 configuration files for the sendmail build to use
+ if [ -d ${BUILD_TREE}/devtools/Site ]; then \
+ cp -f ${debian_dir}/build/site.config.m4 ${BUILD_TREE}/devtools/Site/; \
+ fi;
+
+ # Correct some paths in upstream man pages
+ sed -e "s?/usr/adm/sm.bin?${sysconfdir}/mail/smrsh?g" \
+ -e "s?sm.bin?${sysconfdir}/mail/smrsh?g" \
+ ${BUILD_TREE}/smrsh/smrsh.8 \
+ > ${BUILD_TREE}/smrsh/smrsh.8.new;
+ mv ${BUILD_TREE}/smrsh/smrsh.8.new ${BUILD_TREE}/smrsh/smrsh.8;
+ sed -e "s?/etc/mail/statistics?${localstatedir}/lib/sendmail/sendmail.st?g"\
+ ${BUILD_TREE}/sendmail/sendmail.8 \
+ > ${BUILD_TREE}/sendmail/sendmail.8.new;
+ mv ${BUILD_TREE}/sendmail/sendmail.8.new \
+ ${BUILD_TREE}/sendmail/sendmail.8;
+
+ # Finally, build the whole enchilada (we'll let sendmail figure
+ # which, if any of the dependant libraries each component needs)
+ for subdir in ${SM_SUBDIRS}; do \
+ if [ -d ${BUILD_TREE}/$${subdir} ]; then \
+ (cd ${BUILD_TREE}/$${subdir} && ./Build -S;); \
+ fi; \
+ done;
+
+ # Remove our config m4 files
+ $(RM) ${BUILD_TREE}/devtools/Site/site.config.m4;
+
+ # Debian stuff
+ for subdir in ${MAKE_SUBDIRS}; do \
+ (cd ${debian_dir}/$$subdir && $(MAKE) build-arch;); \
+ done;
+endif
+
+ touch ${STAMP_DIR}/build-arch;
+
+
+#-------------
+install-indep: ${STAMP_DIR}/install-indep
+${STAMP_DIR}/install-indep: DH_OPTIONS=-i
+${STAMP_DIR}/install-indep: ${STAMP_DIR}/build-indep
+
+# Skip work if nothing to do...
+ifeq (yes, ${ENABLE_INDEP})
+ dh_testdir;
+ dh_testroot;
+ dh_clean -k;
+ dh_installdirs;
+ if [ -x /usr/bin/dh_link ]; then dh_link; fi;
+
+ # Add here commands to install the documentation/package.
+ #$(MAKE) prefix=`pwd`/${PKG_DIR}/usr install;
+
+ # sendmail operations guide and other documentation
+ $(INSTALL_DATA) ${BUILD_TREE}/doc/op/op.ps ${PKG_DOC}/op;
+ $(INSTALL_DATA) ${BUILD_TREE}/doc/op/op.txt ${PKG_DOC}/op;
+ $(INSTALL_DATA) ${BUILD_TREE}/README ${PKG_DOC}/;
+ $(INSTALL_DATA) ${BUILD_TREE}/KNOWNBUGS ${PKG_DOC}/;
+ $(INSTALL_DATA) ${BUILD_TREE}/cf/README ${PKG_DOC}/cf.README;
+ $(INSTALL_DATA) debian/README.Debian.sendmail \
+ ${PKG_DOC}/sendmail/README.Debian;
+ $(INSTALL_DATA) ${BUILD_TREE}/sendmail/README \
+ ${PKG_DOC}/sendmail/;
+ if [ -f ${BUILD_TREE}/sendmail/SECURITY ]; then \
+ $(INSTALL_DATA) ${BUILD_TREE}/sendmail/SECURITY \
+ ${PKG_DOC}/sendmail/SECURITY; \
+ fi;
+ $(INSTALL_DATA) ${BUILD_TREE}/sendmail/TRACEFLAGS \
+ ${PKG_DOC}/sendmail/TRACEFLAGS;
+ if [ -f ${BUILD_TREE}/sendmail/TUNING ]; then \
+ $(INSTALL_DATA) ${BUILD_TREE}/sendmail/TUNING \
+ ${PKG_DOC}/sendmail/TUNING; \
+ fi;
+ sed -e "s?/usr/libexec?${libexecdir}?g" \
+ -e "s?/usr/ucb/vacation?${libexecdir}/vacation.sendmail?g" \
+ -e "s?/usr/adm/sm.bin?/etc/mail/smrsh?g" \
+ ${BUILD_TREE}/smrsh/README \
+ > ${PKG_DOC}/smrsh.README;
+ $(INSTALL_DATA) debian/faq.txt ${PKG_DOC}/;
+
+ # libmilter-dev package
+ if [ -d ${BUILD_TREE}/libmilter ]; then \
+ $(INSTALL_DATA) debian/README.Debian.libmilter-dev \
+ ${PKG_DOC}/libmilter/README.Debian; \
+ $(INSTALL_DATA) ${BUILD_TREE}/libmilter/README \
+ ${PKG_DOC}/libmilter/README; \
+ if [ -d ${BUILD_TREE}/libmilter/docs ]; then \
+ cp -a ${BUILD_TREE}/libmilter/docs/* \
+ ${PKG_DOC}/libmilter/html; \
+ fi; \
+ fi;
+
+ # Debian stuff
+ for subdir in ${MAKE_SUBDIRS}; do \
+ (cd ${debian_dir}/$$subdir && \
+ $(MAKE) install-indep \
+ DESTDIR="../../${PKG_DOC}";); \
+ done;
+
+ # Multiple package fixup
+ #dh_movefiles -i --sourcedir debian/${package};
+
+ # Actions from binary-common
+ #
+ dh_fixperms;
+ #
+ # Cleanup misc permissions, etc... (fakeroot, dh_fixperms, etc.)
+endif
+
+ touch ${STAMP_DIR}/install-indep;
+
+
+#-------------
+install-arch: ${STAMP_DIR}/install-arch
+${STAMP_DIR}/install-arch: DH_OPTIONS=-a
+${STAMP_DIR}/install-arch: ${STAMP_DIR}/build-arch
+
+# Skip work if nothing to do...
+ifeq (yes, ${ENABLE_ARCH})
+ dh_testdir;
+ dh_testroot;
+ dh_clean -k;
+ dh_installdirs;
+ if [ -x /usr/bin/dh_link ]; then dh_link; fi;
+
+ # Add here commands to install the package into ${PKG_DIR}.
+ #$(MAKE) prefix=`pwd`/${PKG_DIR}/usr install;
+
+ # sendmail install proper... with a little help ;-}
+ #$(MAKE) install DESTDIR="$${pwd}/${PKG_DIR}";
+
+ # Finally, install the whole enchilada
+ for subdir in ${SM_SUBDIRS}; do \
+ if [ -d ${BUILD_TREE}/$${subdir} ]; then \
+ if [ "$${subdir}" = 'libmilter' ]; then \
+ :; \
+ elif [ "$${subdir}" = 'mail.local' -o \
+ "$${subdir}" = 'rmail' ]; then \
+ (cd ${BUILD_TREE}/obj*/$${subdir} && \
+ $(MAKE) force-install \
+ DESTDIR="../../../../${PKG_DIR}";); \
+ else \
+ (cd ${BUILD_TREE}/obj*/$${subdir} && \
+ $(MAKE) install \
+ DESTDIR="../../../../${PKG_DIR}";); \
+ fi; \
+ fi; \
+ done;
+ # Support older Sendmail (below 8.10.0)
+ if [ -f ${PKG_DIR}${sysconfdir}/mail/sendmail.hf ]; then \
+ mv -f ${PKG_DIR}${sysconfdir}/mail/sendmail.hf \
+ ${PKG_DIR}${sysconfdir}/mail/helpfile; \
+ $(RM) ${PKG_DIR}${localstatedir}/lib/sendmail/sendmail.st; \
+ fi;
+
+ # FHS says that rmail belongs in ${sbindir}
+ mv ${PKG_DIR}${bindir}/rmail ${PKG_DIR}${sbindir}/rmail;
+
+ # Sendmail alias handling...
+ # NOTE: whilst smptd is a valid alias for sendmail, we don't create
+ # one so that we can co-exists with smtpd (a firewall frontend)
+ # NOTE: newscache package also contains ${sbindir}/hoststat
+ # NOTE: newalias, purgestat, etc. aren't for the general user..
+ # yeah, yeah, I know... these can be done with -b<flag>!
+ (cd ${PKG_DIR}${bindir} && \
+ $(RM) hoststat mailq newaliases purgestat smtpd;)
+ ln -sf ../sbin/sendmail ${PKG_DIR}${libdir}/sendmail;
+ (cd ${PKG_DIR}${sbindir} && for file in \
+ newaliases hoststat purgestat \
+ ; do \
+ ln -sf sendmail $$file; \
+ done;);
+ # Handle man pages for these aliases
+ (cd ${PKG_DIR}${mandir}/man8 && for file in \
+ hoststat.8.gz purgestat.8.gz \
+ ; do \
+ ln -sf sendmail.8.gz $$file; \
+ done;);
+ # Place those removed aliases in ${libexecdir} (mostly for me)
+ (cd ${PKG_DIR}${libexecdir} && for file in \
+ hoststat mailq newaliases purgestat smtpd; do \
+ ln -sf ../../sbin/sendmail $$file; \
+ done;);
+ # NOTE: with the MSP/MTA split, we'll provide our own mailstats (keep orig)
+ mv ${PKG_DIR}${sbindir}/mailstats \
+ ${PKG_DIR}${libexecdir}/mailstats;
+ # Special handling of vacation - Debian has a seperate package
+ # with a different version (sigh) keep our copy just in case...
+ if [ -d ${BUILD_TREE}/vacation ]; then \
+ mv ${PKG_DIR}${bindir}/vacation \
+ ${PKG_DIR}${libexecdir}/vacation.sendmail; \
+ mv ${PKG_DIR}${mandir}/man1/vacation.1 \
+ ${PKG_DIR}${mandir}/man1/vacation.sendmail.1; \
+ fi;
+ # m4 configuration directories
+ cp -a ${BUILD_TREE}/cf/* ${PKG_DIR}${datadir}/sendmail/cf;
+ $(RM) ${PKG_DIR}${datadir}/sendmail/cf/README;
+ $(RM) ${PKG_DIR}${datadir}/sendmail/cf/sendmail.schema;
+ $(RM) ${PKG_DIR}${datadir}/sendmail/cf/cf/Build;
+ $(RM) ${PKG_DIR}${datadir}/sendmail/cf/cf/Makefile;
+ $(RM) ${PKG_DIR}${datadir}/sendmail/cf/cf/*.cf;
+
+ # contributed stuff - scripts
+ sed -e 's?/usr/local/bin/perl?/usr/bin/perl?g' \
+ -e "s?/etc/sendmail.cf?${sysconfdir}/mail/sendmail.cf?g" \
+ ${BUILD_TREE}/contrib/etrn.pl \
+ > ${PKG_DIR}${sbindir}/etrn;
+ chmod 0755 ${PKG_DIR}${sbindir}/etrn;
+ if [ -f ${BUILD_TREE}/contrib/etrn.0 ]; then \
+ sed 's?/usr/local/bin/perl?/usr/bin/perl?g' \
+ ${BUILD_TREE}/contrib/etrn.0 \
+ > ${PKG_DIR}${mandir}/man8/etrn.8; \
+ else \
+ sed 's?/usr/local/bin/perl?/usr/bin/perl?g' \
+ ${BUILD_TREE}/contrib/etrn.pl \
+ > ${PKG_DIR}${mandir}/man8/etrn.8; \
+ fi;
+ sed -e 's?/usr/local/bin/perl?/usr/bin/perl?g' \
+ ${BUILD_TREE}/contrib/expn.pl \
+ > ${PKG_DIR}${bindir}/expn;
+ chmod 0755 ${PKG_DIR}${bindir}/expn;
+ sed 's?/usr/local/bin/perl?/usr/bin/perl?g' \
+ ${BUILD_TREE}/contrib/expn.pl \
+ > ${PKG_DIR}${mandir}/man8/expn.8;
+ sed -e "s?/etc/sendmail.cf?${sysconfdir}/mail/sendmail.cf?g" \
+ debian/checksendmail/checksendmail.perl \
+ > ${PKG_DIR}${sbindir}/checksendmail;
+ chmod 0755 ${PKG_DIR}${sbindir}/checksendmail;
+ $(INSTALL_DATA) debian/checksendmail/checksendmail.8 \
+ ${PKG_DIR}${mandir}/man8/;
+ sed -e 's?/usr/local/bin/perl?/usr/bin/perl?g' \
+ -e 's?/usr/sbin/sendmail -q30m -bd?/etc/init.d/sendmail start?g' \
+ ${BUILD_TREE}/contrib/smcontrol.pl \
+ > ${PKG_DIR}${datadir}/sendmail/smcontrol.pl;
+ chmod 0755 ${PKG_DIR}${datadir}/sendmail/smcontrol.pl;
+ $(INSTALL_SCRIPT) ${BUILD_TREE}/contrib/doublebounce.pl \
+ ${PKG_DIR}${datadir}/sendmail;
+ if [ -f ${BUILD_TREE}/contrib/qtool.pl ]; then \
+ sed -e 's?/usr/bin/env perl?/usr/bin/perl?g' \
+ ${BUILD_TREE}/contrib/qtool.pl \
+ > ${PKG_DIR}${datadir}/sendmail/qtool.pl; \
+ chmod 0755 ${PKG_DIR}${datadir}/sendmail/qtool.pl; \
+ $(INSTALL_DATA) ${BUILD_TREE}/contrib/qtool.8 \
+ ${PKG_DIR}${mandir}/man8/; \
+ fi;
+ if [ -f ${BUILD_TREE}/contrib/buildvirtuser ]; then \
+ $(INSTALL_SCRIPT) ${BUILD_TREE}/contrib/buildvirtuser \
+ ${PKG_DIR}${datadir}/sendmail/; \
+ fi;
+
+ # contributed stuff - examples
+ sed 's?/bin/perl?/usr/bin/perl?g' \
+ ${BUILD_TREE}/contrib/passwd-to-alias.pl \
+ > ${PKG_DIR}${datadir}/sendmail/examples/passwd-to-alias;
+ chmod 0755 ${PKG_DIR}${datadir}/sendmail/examples/passwd-to-alias;
+
+ # contributed stuff - m4 scripts
+ if [ -f ${BUILD_TREE}/contrib/domainmap.m4 ]; then \
+ $(INSTALL_DATA) ${BUILD_TREE}/contrib/domainmap.m4 \
+ ${PKG_DIR}${datadir}/sendmail/cf/feature; \
+ fi;
+ if [ -f ${BUILD_TREE}/contrib/dnsblaccess.m4 ]; then \
+ $(INSTALL_DATA) ${BUILD_TREE}/contrib/dnsblaccess.m4 \
+ ${PKG_DIR}${datadir}/sendmail/cf/hack; \
+ fi;
+
+ # Debian stuff
+ for subdir in ${MAKE_SUBDIRS}; do \
+ (cd ${debian_dir}/$$subdir && \
+ $(MAKE) install-arch \
+ DESTDIR="../../${PKG_DIR}";); \
+ done;
+ # Debian stuff - m4 scripts
+ (cd debian && \
+ for file in $$(find cf -type f -name '*.m4' -o -name '*.mc'); do \
+ $(INSTALL_DATA) $$file \
+ ../${PKG_DIR}${datadir}/sendmail/$$file; \
+ done;);
+ # Debian stuff - examples
+ $(INSTALL_DATA) debian/checksendmail/address.resolve \
+ ${PKG_DIR}${datadir}/sendmail/examples/;
+
+ # libmilter-dev package
+ifeq (yes, ${ENABLE_DEV})
+ if [ -d ${BUILD_TREE}/libmilter ]; then \
+ (cd ${BUILD_TREE}/obj*/libmilter && \
+ $(MAKE) install \
+ DESTDIR="../../../../debian/libmilter-dev";); \
+ $(INSTALL_PROGRAM) ${BUILD_TREE}/obj.*/libmilter/libmilter.a \
+ debian/libmilter-dev${libdir}/libmilter/; \
+ $(INSTALL_DATA) ${BUILD_TREE}/include/libmilter/mfapi.h \
+ debian/libmilter-dev${includedir}/libmilter/; \
+ if [ -f ${BUILD_TREE}/include/libmilter/mfdef.h ]; then \
+ $(INSTALL_DATA) ${BUILD_TREE}/include/libmilter/mfdef.h \
+ debian/libmilter-dev${includedir}/libmilter/; \
+ fi; \
+ $(INSTALL_PROGRAM) ${BUILD_TREE}/obj.*/libsmutil/libsmutil.a \
+ debian/libmilter-dev${libdir}/libmilter/; \
+ if [ -d ${BUILD_TREE}/libsm ]; then \
+ $(INSTALL_PROGRAM) ${BUILD_TREE}/obj.*/libsm/libsm.a \
+ debian/libmilter-dev${libdir}/libmilter/; \
+ fi; \
+ fi;
+endif
+
+ # Multiple package fixup
+ #dh_movefiles -a --sourcedir debian/${package};
+
+ # Actions from binary-common
+ #dh_installcron;
+ $(INSTALL_SCRIPT) debian/${package}.cron.daily \
+ ${PKG_DIR}${sysconfdir}/cron.daily/sendmail;
+ #dh_installlogrotate;
+ #$(INSTALL_DATA) debian/${package}.logrotate \
+ # ${PKG_DIR}${sysconfdir}/logrotate.d/sendmail;
+ #
+ dh_fixperms;
+ #
+ # Cleanup misc permissions, etc... (fakeroot, dh_fixperms, etc.)
+ chmod a+x ${PKG_DIR}${datadir}/sendmail/cf/sh/makeinfo.sh;
+ chown root:root ${PKG_DIR}${sysconfdir}/mail/helpfile;
+ chown root:root ${PKG_DIR}${sysconfdir}/mail/peers/provider;
+ chown root:root ${PKG_DIR}${sysconfdir}/mail/service.switch*;
+ #
+ # You may want to make some executables suid here.
+ chown root:mail ${PKG_DIR}${sbindir}/sendmail;
+ chmod 04755 ${PKG_DIR}${sbindir}/sendmail;
+ chown root:mail ${PKG_DIR}${libexecdir}/mailstats;
+ chmod 02755 ${PKG_DIR}${libexecdir}/mailstats;
+ chown root:mail ${PKG_DIR}${libexecdir}/mail.local;
+ chmod 0755 ${PKG_DIR}${libexecdir}/mail.local;
+ chown root:mail ${PKG_DIR}${libexecdir}/smrsh;
+ chmod 0755 ${PKG_DIR}${libexecdir}/smrsh;
+ chown root:mail ${PKG_DIR}${libexecdir}/sensible-mda;
+ chmod 0755 ${PKG_DIR}${libexecdir}/sensible-mda;
+
+ # Special case Perl for Debian Slink (2.1), debhelper v1
+ if [ ! -x /usr/bin/dh_perl ]; then \
+ echo 'perl:Depends=perl5|perl' >> debian/substvars; fi;
+
+ # Install Lintian overrides
+ $(INSTALL_DATA) -d -g root -m 755 ${PKG_DIR}${datadir}/lintian/overrides
+ $(INSTALL_DATA) -g root -m 644 debian/${package}.lintian-overrides \
+ ${PKG_DIR}${datadir}/lintian/overrides/${package}
+endif
+
+ touch ${STAMP_DIR}/install-arch;
+
+
+#-------------
+# This single target is used to build all the packages, all at once, or
+# one at a time. So keep in mind: any options passed to commands here will
+# affect _all_ packages. Anything you want to only affect one package
+# should be put in another target, such as the install target.
+#
+# Must not depend on anything. This is to be called by
+# binary-arch/binary-indep in another 'make' thread.
+binary-common:
+ # Need this version of debhelper for DH_OPTIONS to work.
+ dh_testversion 1.1.17;
+ dh_testdir;
+ dh_testroot;
+ # Done in install-xxx, but still need to get rid of *.debhelper !!!
+ #dh_clean -k;
+ $(RM) debian/*.debhelper;
+
+ dh_installchangelogs -k ${BUILD_TREE}/RELEASE_NOTES;
+ #-------- needs script name ala installinit ----
+ # Done in install-xxx
+ #dh_installcron;
+ if [ -x /usr/bin/dh_installdebconf ]; then dh_installdebconf; fi;
+ dh_installdocs;
+ #dh_installemacsen;
+ #dh_installexamples;
+ #if [ -x /usr/bin/dh_installinfo ]; then dh_installinfo; fi;
+ dh_installinit --init-script=sendmail;
+ #-------- needs script name ala installinit ----
+ # Done in install-xxx
+ #if [ -x /usr/bin/dh_installlogrotate ]; then dh_installlogrotate; fi;
+ if [ -x /usr/bin/dh_installman ]; then dh_installman; fi;
+ #dh_installmenu;
+ #dh_installmime;
+ #dh_undocumented;
+ if [ -x /usr/bin/dh_installpam ]; then dh_installpam; fi;
+ # Done in install-xxx
+ #if [ -x /usr/bin/dh_link ]; then dh_link; fi;
+ifeq (, $(findstring nostrip,${DEB_BUILD_OPTIONS}))
+ dh_strip;
+else
+ #dh_strip;
+endif
+ dh_compress;
+ # Done in install-xxx
+ #dh_fixperms;
+ # Need to special case this now that we're using dynamic uid/gid
+ #if [ -x /usr/sbin/suidregister -a -s /etc/suid.conf ]; then
+ # dh_suidregister; fi;
+ #
+ # Cleanup misc permissions, etc... (fakeroot, dh_fixperms, etc.)
+ # Done in install-xxx
+ #
+ # You may want to make some executables suid here.
+ # Done in install-xxx
+ #
+ #dh_makeshlibs;
+ dh_installdeb;
+ dh_shlibdeps;
+ if [ -x /usr/bin/dh_perl ]; then dh_perl; fi
+ dh_gencontrol;
+ dh_md5sums;
+ dh_builddeb;
+
+ $(MAKE) -f ${debian_dir}/rules pristine;
+
+
+#-------------
+# Build architecture independant packages using the common target.
+# (Uncomment this next line if you have such packages.)
+binary-indep: ${STAMP_DIR}/build-indep ${STAMP_DIR}/install-indep
+
+# Skip work if nothing to do...
+ifeq (yes, ${ENABLE_INDEP})
+ $(MAKE) -f ${debian_dir}/rules DH_OPTIONS=-i binary-common;
+endif
+
+
+#-------------
+# Build architecture dependant packages using the common target.
+binary-arch: ${STAMP_DIR}/build-arch ${STAMP_DIR}/install-arch
+
+# Skip work if nothing to do...
+ifeq (yes, ${ENABLE_ARCH})
+ $(MAKE) -f ${debian_dir}/rules DH_OPTIONS=-a binary-common;
+endif
+
+
+#-------------
+# Any other binary targets build just one binary package at a time.
+binary-%:
+ $(MAKE) -f ${debian_dir}/rules binary-common DH_OPTIONS=-p$*;
+
+
+#-------------
+# Below here is fairly generic really
+
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+# Due to buildd not (for the nonce) supporting build-arch, kluge next rule
+build: build-arch
+install: install-indep install-arch
+binary: binary-indep binary-arch
+.PHONY: refresh-dbs refresh-debian update-debian refresh-faq
+.PHONY: pristine
+.PHONY: info buildinfo
+.PHONY: setup autotools configure
+.PHONY: clean build build-indep build-arch
+.PHONY: install install-indep install-arch
+.PHONY: binary binary-indep binary-arch
+.SUFFIXES:
+.PRECIOUS: ${debian_dir}/rules
diff --git a/debian/build/site.config.m4.in b/debian/build/site.config.m4.in
new file mode 100644
index 0000000..e07df3b
--- /dev/null
+++ b/debian/build/site.config.m4.in
@@ -0,0 +1,235 @@
+#-----------------------------------------------------------------------------
+# $Sendmail: site.config.m4,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# Debian site.config.m4 for sendmail @sm_version@@sm_revision@(@sm_version_math@)
+#
+# Note: the .in file supports @SM_MINVERS@ - @SM_MAXVERS@, but the generated
+# file is customized to the version noted above.
+#
+#-----------------------------------------------------------------------------
+#
+#------------------------------------------------------------------
+# Sendmail @sm_version@@sm_revision@(@sm_version_math@) on @sm_date@ at @sm_time@ (@sm_utc@)
+#------------------------------------------------------------------
+#
+#------------------------------------------------------------------
+# The following sendmail features are included
+#------------------------------------------------------------------
+#REGEX: @sm_enable_regex@
+#NDBM: @sm_enable_ndbm@
+#NEWDB: @sm_enable_newdb@ @sm_newdb_lib@
+#NIS: @sm_enable_nis@
+#NISPLUS: @sm_enable_nisplus@
+#LDAP: @sm_enable_ldap@ @sm_ldap_lib@
+#HESIOD: @sm_enable_hesiod@ @sm_hesiod_parms@
+#TCPD: @sm_enable_tcpd@
+#BIND: @sm_enable_bind@
+#IPv6: @sm_enable_ipv6@
+#Maillock: @sm_enable_maillock@
+#MILTER: @sm_enable_milter@
+#SFIO: @sm_enable_sfio@
+#AUTH: @sm_enable_auth@ @sm_auth_lib@
+#TLS: @sm_enable_tls@
+#SHM: @sm_enable_shm@
+#FFRs: @sm_ffr@
+#M4_FFRs: @sm_m4_ffr@
+#
+#------------------------------------------------------------------
+# Packages and build dependancies (Debian packages)
+#------------------------------------------------------------------
+#Sendmail: sendmail
+#Sendmail-doc: @sm_enable_doc@
+#Libmilter-dev: @sm_enable_dev@
+#Build-Depends: @sm_badepends@
+#Depends: @sm_depends@
+#Recommends: @sm_recommends@
+#Suggests: @sm_suggests@
+#
+#------------------------------------------------------------------
+# Build Architecture (Debian)
+#------------------------------------------------------------------
+#DEB_BUILD_ARCH: @DEB_BUILD_ARCH@
+#DEB_BUILD_GNU_CPU: @DEB_BUILD_GNU_CPU@
+#DEB_BUILD_GNU_SYSTEM: @DEB_BUILD_GNU_SYSTEM@
+#DEB_BUILD_GNU_TYPE: @DEB_BUILD_GNU_TYPE@
+#DEB_HOST_ARCH: @DEB_HOST_ARCH@
+#DEB_HOST_GNU_CPU: @DEB_HOST_GNU_CPU@
+#DEB_HOST_GNU_SYSTEM: @DEB_HOST_GNU_SYSTEM@
+#DEB_HOST_GNU_TYPE: @DEB_HOST_GNU_TYPE@
+#
+#------------------------------------------------------------------
+# Autoconf variable settings defaults
+#------------------------------------------------------------------
+#prefix: @prefix@ /usr/local
+#exec_prefix: @exec_prefix@ ${prefix}
+#bindir: @bindir@ ${exec_prefix}/bin
+#sbindir: @sbindir@ ${exec_prefix}/sbin
+#libexecdir: @libexecdir@ ${exec_prefix}/libexec
+#datadir: @datadir@ ${prefix}/share
+#sysconfdir: @sysconfdir@ ${prefix}/etc
+#sharedstatedir: @sharedstatedir@ ${prefix}/com
+#localstatedir: @localstatedir@ ${prefix}/var
+#libdir: @libdir@ ${exec_prefix}/var
+#includedir: @includedir@ ${prefix}/include
+#oldincludedir: @oldincludedir@ /usr/include
+#infodir: @infodir@ ${prefix}/info
+#mandir: @mandir@ ${prefix}/man
+#docdir: @docdir@ ${prefix}/doc
+#srcdir: @srcdir@ configure or ..
+#
+#------------------------------------------------------------------
+# Build options for the various pieces parts of sendmail
+#------------------------------------------------------------------
+#
+# Make sure defaults are sound...
+define(`confLIBS', `')dnl # was -ldl
+#
+# global
+APPENDDEF(`confINCDIRS', `@sm_incdirs@')
+APPENDDEF(`confMAPDEF', `@sm_mapdef@')
+APPENDDEF(`confENVDEF', `@sm_envdef@')
+APPENDDEF(`confLIBS', `@sm_libs@')
+#
+# editmap
+APPENDDEF(`conf_editmap_ENVDEF', `@sm_editmap_envdef@')
+APPENDDEF(`conf_editmap_LIBS', `@sm_editmap_libs@')
+#
+# libmilter
+APPENDDEF(`conf_libmilter_ENVDEF', `@sm_libmilter_envdef@')
+APPENDDEF(`conf_libmilter_LIBS', `@sm_libmilter_libs@')
+#
+# libsm
+APPENDDEF(`conf_libsm_ENVDEF', `@sm_libsm_envdef@')
+APPENDDEF(`conf_libsm_LIBS', `@sm_libsm_libs@')
+#
+# libsmdb
+APPENDDEF(`conf_libsmdb_ENVDEF', `@sm_libsmdb_envdef@')
+APPENDDEF(`conf_libsmdb_LIBS', `@sm_libsmdb_libs@')
+#
+# libsmutil
+APPENDDEF(`conf_libsmutil_ENVDEF', `@sm_libsmutil_envdef@')
+APPENDDEF(`conf_libsmutil_LIBS', `@sm_libsmutil_libs@')
+#
+# mail.local
+APPENDDEF(`conf_mail_local_ENVDEF', `@sm_mail_local_envdef@')
+APPENDDEF(`conf_mail_local_LIBS', `@sm_mail_local_libs@')
+#
+# mailstats
+APPENDDEF(`conf_mailstats_ENVDEF', `@sm_mailstats_envdef@')
+APPENDDEF(`conf_mailstats_LIBS', `@sm_mailstats_libs@')
+#
+# makemap
+APPENDDEF(`conf_makemap_ENVDEF', `@sm_makemap_envdef@')
+APPENDDEF(`conf_makemap_LIBS', `@sm_makemap_libs@')
+#
+# praliases
+APPENDDEF(`conf_praliases_ENVDEF', `@sm_praliases_envdef@')
+APPENDDEF(`conf_praliases_LIBS', `@sm_praliases_libs@')
+#
+# rmail
+APPENDDEF(`conf_rmail_ENVDEF', `@sm_rmail_envdef@')
+APPENDDEF(`conf_rmail_LIBS', `@sm_rmail_libs@')
+#
+# sendmail
+APPENDDEF(`conf_sendmail_ENVDEF', `@sm_sendmail_envdef@')
+APPENDDEF(`conf_sendmail_LIBS', `@sm_sendmail_libs@')
+#
+# smrsh
+APPENDDEF(`conf_smrsh_ENVDEF', `@sm_smrsh_envdef@')
+APPENDDEF(`conf_smrsh_LIBS', `@sm_smrsh_libs@')
+#
+# vacation
+APPENDDEF(`conf_vacation_ENVDEF', `@sm_vacation_envdef@')
+APPENDDEF(`conf_vacation_LIBS', `@sm_vacation_libs@')
+#
+#------------------------------------------------------------------
+# Build-time selection not handled by autoconf above
+#------------------------------------------------------------------
+# none, for the nonce...
+#
+#------------------------------------------------------------------
+# Global Build time configuration
+#------------------------------------------------------------------
+# compilation/link
+define(`confCC', `@CC@')dnl #Compiler
+define(`confCCOPTS', `')dnl #CC options
+define(`confCCOPTS_SO' `-fPIC')dnl #Shared libraries
+define(`confLD', confCC)dnl #Linker
+define(`confLDOPTS', `')dnl #Linker opts
+define(`confLDOPTS_SO', `-shared -Wl')dnl #linker shared lib
+define(`confLIBDIRS', `')dnl #-L linker flags
+define(`confMTCCOPTS', `')dnl #Multi-thread cc opts
+define(`confMTLDOPTS', `')dnl #Multi-thread ld opts
+define(`confOPTIMIZE', `@CFLAGS@')dnl #Optimization
+#
+# paths, owners, and modes
+# Note: can't use smmsp here, it is dynamically created
+# Note: EBINDIR deserves a better home, suggestions?
+define(`confEBINDIR', `@libexecdir@')dnl #mail.local,smrsh,etc.
+define(`confGBINGRP', `mail')dnl #sgid binary group smmsp
+define(`confGBINMODE', `02755')dnl #sgid binary mode
+define(`confGBINOWN', `root')dnl #sgid binary owner
+define(`confHFDIR', `@sysconfdir@/mail')dnl #helpfile dir
+define(`confHFFILE', `helpfile')dnl #helpfile name
+define(`confINCGRP', `root')dnl #include group
+define(`confINCMODE', `0744')dnl #include mode
+define(`confINCOWN', `root')dnl #include owner
+ifelse(eval(@sm_version_math@ >= 527363), `1',dnl
+`define(`confINCLUDEDIR',`@includedir@')dnl #include target',
+`define(`confINCLUDEDIR',`@includedir@/libmilter')dnl #include target'
+)dnl
+define(`confINST_DEP', `')dnl #submit.cf clientmqueue
+define(`confLIBDIR', `@libdir@/libmilter')dnl #library dir
+define(`confLIBGRP', `root')dnl #library group
+define(`confLIBMODE', `0744')dnl #library mode
+define(`confLIBOWN', `root')dnl #library owner
+define(`confMANROOT', `@mandir@/man')dnl #man root
+define(`confMANROOTMAN',`@mandir@/man')dnl #man root
+define(`confMANGRP', `root')dnl #man group
+define(`confMANMODE', `0744')dnl #man mode
+define(`confMANOWN', `root')dnl #man owner
+define(`confMBINDIR', `@sbindir@')dnl #MTA bindir
+define(`confMBINGRP', `root')dnl #MTA bin grp
+define(`confMBINMODE', `0755')dnl #MTA bin mode
+define(`confMBINOWN', `root')dnl #MTA bin owner
+define(`confMSPQOWN', `mail')dnl #MSP queue owner smmsp
+define(`confMSP_QUEUE_DIR', `/var/spool/mqueue-client')dnl
+define(`confSBINDIR', `@sbindir@')dnl #suid bin dir
+define(`confSBINGRP', `root')dnl #suid bin grp
+define(`confSBINMODE', `04755')dnl #suid bin mode
+define(`confSBINOWN', `root')dnl #suid bin owner
+# Note, STDIR in /var/lib/sendmail... default is /var/spool/mqueue
+define(`confSTDIR', `@localstatedir@/lib/sendmail')dnl #Statistics dir
+define(`confSTFILE', `statistics')dnl #statistics name
+define(`confMSP_STFILE',`sm-client.st')dnl #MSP statistics name
+define(`confSTMODE', `0660')dnl #statistics mode
+define(`confUBINDIR', `@bindir@')dnl #usr bin dir
+define(`confUBINGRP', `mail')dnl #usr bin grp smmsp
+define(`confUBINMODE', `0755')dnl #usr bin mode
+define(`confUBINOWN', `root')dnl #usr bin owner
+#
+# don't provide links, I'll do them myself later
+# sigh... must have something in there or $(make install) croaks -- temp file
+define(`confLINKS', `sendmail-bin')dnl
+define(`confMTA_LINKS')dnl
+#
+# Force rmail installation
+define(`confFORCE_RMAIL')dnl
+#
+# don't install formatted man pages or sendmail.st
+dnl define(`confNO_MAN_INSTALL')dnl
+dnl define(`confNO_MAN_BUILD')dnl
+define(`confINSTALL_RAWMAN')dnl
+define(`confDONT_INSTALL_CATMAN', `')dnl # for 8.12
+define(`confMANDOC', `')dnl # for 8.9.3
+define(`confNROFF', `cat')dnl # for 8.9.3
+define(`confNO_STATISTICS_INSTALL')dnl
+#
+# flags
+#
+# Tests (should be temporary)
+#
diff --git a/debian/build/update_chaos.in b/debian/build/update_chaos.in
new file mode 100644
index 0000000..96e323c
--- /dev/null
+++ b/debian/build/update_chaos.in
@@ -0,0 +1,202 @@
+#!/bin/sh
+#-----------------------------------------------------------------------------
+# $Sendmail: update_chaos,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 2001-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# Debian script to rationalize builds for Sendmail @sm_version@@sm_revision@(@sm_math@)
+#
+# Note: the .in file supports @SM_MINVERS@ - @SM_MAXVERS@, but the generated
+# file is customized to the version noted above.
+#
+#-----------------------------------------------------------------------------
+set -e;
+
+#------------------------------------------------------------------
+# Exit, stage left, even... if not needed (private dir, or >= 8.10.0)
+#------------------------------------------------------------------
+BUILD_TREE='@srcdir@/../../build-tree/sendmail-@sm_version@';
+if [ ! -d ${BUILD_TREE} ]; then
+ exit 0;
+ fi;
+if [ -d ${BUILD_TREE}/devtools/bin ]; then
+ exit 0;
+ fi;
+
+echo "Rationalizing Sendmail-@sm_version@ setup...";
+
+#------------------------------------------------------------------
+# List of subdirectories to work on
+#------------------------------------------------------------------
+SUBDIRS="editmap libmilter mail.local mailstats
+ makemap praliases rmail sendmail smrsh vacation";
+
+#------------------------------------------------------------------
+# Match Sendmail's build directory conventions
+#------------------------------------------------------------------
+os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`;
+rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g'`;
+arch=`uname -m | sed -e 's/ //g'`;
+OBJ_DIR="obj.${os}.${rel}.${arch}";
+
+#------------------------------------------------------------------
+# Function to escape quotes (to survive subsequent sed)
+#------------------------------------------------------------------
+esq () {
+ result=$(echo "${1}" | sed -e 's?\"?\\\\\\\"?g');
+ };
+
+#------------------------------------------------------------------
+# Prior to 8.10.0, sendmail source was in the src directory
+# Prior to 8.10.0, devtools was called BuildTools
+# Create compatibility links (to look like 8.10.0+)
+#------------------------------------------------------------------
+if [ ! -d ${BUILD_TREE}/sendmail ]; then
+ echo "...Creating \${BUILD_TREE}/sendmail compatibility symlink";
+ ln -sf src ${BUILD_TREE}/sendmail;
+ if [ ! -d ${BUILD_TREE}/devtools ]; then
+ echo "...Creating \${BUILD_TREE}/devtools compatibility symlink";
+ ln -sf BuildTools ${BUILD_TREE}/devtools;
+ fi;
+ fi;
+
+#------------------------------------------------------------------
+# Prior to 8.10.0, objects were in the source directories, not separate
+# Create compatibility links (to look like 8.10.0+)
+#------------------------------------------------------------------
+echo "...Creating ${OBJ_DIR}/<dir> directories";
+mkdir -p ${BUILD_TREE}/${OBJ_DIR};
+for subdir in $SUBDIRS; do
+ if [ -d ${BUILD_TREE}/${subdir} ]; then
+ ln -sf "../${subdir}/${OBJ_DIR}" \
+ ${BUILD_TREE}/${OBJ_DIR}/${subdir};
+ fi;
+ done;
+
+#------------------------------------------------------------------
+# If 8.9.0+, we're done, get the flock outa here...
+#------------------------------------------------------------------
+if [ -e ${BUILD_TREE}/sendmail/Build ]; then
+ echo '...Done.';
+ exit 0;
+ fi;
+
+#------------------------------------------------------------------
+# Prior to 8.9.0, READ_ME was seen in a few places
+# Create compatibility links
+#------------------------------------------------------------------
+echo '...Creating READ_ME compatility symlinks';
+for file in $(find ${BUILD_TREE} -name 'READ_ME'); do
+ ln -sf READ_ME $(echo "${file}" | sed -e 's/READ_ME/README/');
+ done;
+
+#------------------------------------------------------------------
+# Prior to 8.9.0, MAKE was used instead of Build
+# We'll install a small wrapper for the earlier releases
+# Prior to 8.9.0, Only src directory had an obj.* subdirectory
+# Create compatibility links (to look like 8.9.0+)
+#------------------------------------------------------------------
+echo "...Creating <dir>/${OBJ_DIR}";
+for subdir in $SUBDIRS; do
+ if [ -d ${BUILD_TREE}/${subdir} ]; then
+ if [ ! -d ${BUILD_TREE}/${subdir}/Makefiles ]; then
+ mkdir -p ${BUILD_TREE}/${subdir}/${OBJ_DIR};
+ for file in `find ${BUILD_TREE}/${subdir} -type f`; do
+ cp -a $file ${BUILD_TREE}/${subdir}/${OBJ_DIR};
+ done;
+ fi;
+ cp -a debian/build/Build ${BUILD_TREE}/${subdir}/;
+ fi;
+ done;
+#
+#------------------------------------------------------------------
+# Kluge the Makefiles to comply with our file locations.
+#------------------------------------------------------------------
+echo '...Kluging Makefiles';
+for file in mailstats/Makefile.dist \
+ mail.local/Makefile.dist \
+ makemap/Makefile.dist \
+ praliases/Makefile.dist \
+ smrsh/Makefile.dist \
+ src/Makefiles/Makefile.Linux \
+ ; do
+ cp -a ${BUILD_TREE}/${file} ${BUILD_TREE}/${file}.save;
+ #
+ # Set local variables to allow for quoting...
+ esq "@sm_incdirs@";
+ sm_incdirs=$result;
+ esq "@sm_mapdef@";
+ sm_mapdef=$result;
+ esq "@sm_envdef@";
+ sm_envdef=$result;
+ esq "@sm_libs@";
+ sm_libs=$result;
+ #
+ # global
+ sed \
+ -e 's?-I/usr/sww/include??' \
+ -e 's?-I/usr/local/include??' \
+ -e 's?-L/usr/sww/lib??' \
+ -e 's?../src?../../src?g' \
+ -e "s?^INCDIRS=\(.*\)\$?INCDIRS=\1 $sm_incdirs?" \
+ -e "s?^DBMDEF=.*?DBMDEF=$sm_mapdef?" \
+ -e "s?^ENVDEF=\(.*\)\$?ENVDEF=\1 $sm_envdef?" \
+ -e "s?^LIBS=.*?LIBS=$sm_libs?" \
+ ${BUILD_TREE}/${file} > ${BUILD_TREE}/${file}.new;
+ mv ${BUILD_TREE}/${file}.new ${BUILD_TREE}/${file};
+ #
+ # compilation/link
+ sed \
+ -e 's?^O=.*?O=@CFLAGS@?' \
+ -e 's?^LIBDIRS=.*?LIBDIRS=?' \
+ ${BUILD_TREE}/${file} > ${BUILD_TREE}/${file}.new;
+ mv ${BUILD_TREE}/${file}.new ${BUILD_TREE}/${file};
+
+ #
+ # paths, owners, and modes
+ # Note: EBINDIR deserves a better home, suggestions?
+ sed \
+ -e 's?^BINDIR=.*?BINDIR=${DESTDIR}@sbindir@?' \
+ -e 's?^BINMODE=.*?BINMODE=04755?' \
+ -e 's?^BINGRP=.*?BINGRP=mail?' \
+ -e 's?^BINOWN=.*?BINOWN=root?' \
+ -e 's?^HFDIR=.*?HFDIR=${DESTDIR}@sysconfdir@/mail?' \
+ -e 's?^STDIR=.*?STDIR=${DESTDIR}@localstatedir@/lib/sendmail?' \
+ ${BUILD_TREE}/${file} > ${BUILD_TREE}/${file}.new;
+ mv ${BUILD_TREE}/${file}.new ${BUILD_TREE}/${file};
+
+ if [ "${file}" = 'mail.local/Makefile.dist' \
+ -o "${file}" = 'smrsh/Makefile.dist' \
+ ]; then
+ sed \
+ -e 's?^BINDIR=.*?BINDIR=${DESTDIR}@libexecdir@?' \
+ -e 's?^BINMODE=.*?BINMODE=04755?' \
+ -e 's?^BINGRP=.*?BINGRP=mail?' \
+ -e 's?^BINOWN=.*?BINOWN=root?' \
+ ${BUILD_TREE}/${file} > ${BUILD_TREE}/${file}.new;
+ echo 'force-install: install' >> ${BUILD_TREE}/${file}.new;
+ mv ${BUILD_TREE}/${file}.new ${BUILD_TREE}/${file};
+
+ elif [ "${file}" = 'mailstats/Makefile.dist' \
+ -o "${file}" = 'makemap/Makefile.dist' \
+ -o "${file}" = 'praliases/Makefile.dist' \
+ ]; then
+ sed \
+ -e 's?^BINDIR=.*?BINDIR=${DESTDIR}@sbindir@?' \
+ -e 's?^BINMODE=.*?BINMODE=0755?' \
+ -e 's?^BINGRP=.*?BINGRP=mail?' \
+ -e 's?^BINOWN=.*?BINOWN=root?' \
+ ${BUILD_TREE}/${file} > ${BUILD_TREE}/${file}.new;
+ mv ${BUILD_TREE}/${file}.new ${BUILD_TREE}/${file};
+ fi;
+
+ # For most directories, replace Makefile with our updated Makefile.dist
+ if [ "${file}" != 'src/Makefiles/Makefile.Linux' ]; then
+ cp ${BUILD_TREE}/${file} \
+ $(dirname "${BUILD_TREE}/${file}")/${OBJ_DIR}/Makefile;
+ fi;
+ done;
+
+echo '...Done.';
diff --git a/debian/build/version.c b/debian/build/version.c
new file mode 100644
index 0000000..c54b2b6
--- /dev/null
+++ b/debian/build/version.c
@@ -0,0 +1 @@
+char Version[] = "8.12.7";
diff --git a/debian/cf/debian/autoconf.m4.in b/debian/cf/debian/autoconf.m4.in
new file mode 100644
index 0000000..e9d6430
--- /dev/null
+++ b/debian/cf/debian/autoconf.m4.in
@@ -0,0 +1,59 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: autoconf.m4,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 2001-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# m4 autoconf config file for building Sendmail @sm_version@@sm_revision@
+#
+# Note: the .in file supports @SM_MINVERS@ - @SM_MAXVERS@, but the generated
+# file is customized to the version noted above.
+#
+#-----------------------------------------------------------------------------
+#
+divert(0)dnl
+VERSIONID(`$Id: autoconf.m4, v @sm_version@@sm_revision@ @sm_date@ @sm_time@ cowboy Exp $')
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Export (from autoconf to m4) some items of dubious value
+dnl #---------------------------------------------------------------------
+define(`SM_VERS', `@SM_VERS@')dnl
+define(`SM_DATE', `@SM_DATE@')dnl
+define(`SM_MINVERS', `@SM_MINVERS@')dnl
+define(`SM_MAXVERS', `@SM_MAXVERS@')dnl
+define(`SM_CPYRT', `@SM_CPYRT@')dnl
+define(`sm_date', `@sm_date@')dnl
+define(`sm_time', `@sm_time@')dnl
+define(`sm_utc', `@sm_utc@')dnl
+define(`sm_version', `@sm_version@')dnl
+define(`sm_revision', `@sm_revision@')dnl
+define(`sm_version_v', `@sm_version_v@')dnl
+define(`sm_version_r', `@sm_version_r@')dnl
+define(`sm_version_major', `@sm_version_major@')dnl
+define(`sm_version_minor', `@sm_version_minor@')dnl
+define(`sm_version_beta', `@sm_version_beta@')dnl
+define(`sm_version_math', `@sm_version_math@')dnl
+define(`sm_enable_regex', `@sm_enable_regex@')dnl
+define(`sm_enable_ndbm', `@sm_enable_ndbm@')dnl
+define(`sm_enable_newdb', `@sm_enable_newdb@')dnl
+define(`sm_newdb_lib', `@sm_newdb_lib@')dnl
+define(`sm_enable_nis', `@sm_enable_nis@')dnl
+define(`sm_enable_nisplus', `@sm_enable_nisplus@')dnl
+define(`sm_enable_ldap', `@sm_enable_ldap@')dnl
+define(`sm_ldap_lib', `@sm_ldap_lib@')dnl
+define(`sm_enable_hesiod', `@sm_enable_hesiod@')dnl
+define(`sm_hesiod_parms', `@sm_hesiod_parms@')dnl
+define(`sm_enable_tcpd', `@sm_enable_tcpd@')dnl
+define(`sm_enable_ipv6', `@sm_enable_ipv6@')dnl
+define(`sm_enable_maillock',`@sm_enable_maillock@')dnl
+define(`sm_enable_milter', `@sm_enable_milter@')dnl
+define(`sm_enable_sfio', `@sm_enable_sfio@')dnl
+define(`sm_enable_auth', `@sm_enable_auth@')dnl
+define(`sm_enable_tls', `@sm_enable_tls@')dnl
+define(`sm_enable_shm', `@sm_enable_shm@')dnl
+define(`sm_ffr', `@sm_ffr@')dnl
+define(`sm_m4_ffr', `@sm_m4_ffr@')dnl
+define(`sm_enable_dev', `@sm_enable_dev@')dnl
+define(`sm_enable_doc', `@sm_enable_doc@')dnl
diff --git a/debian/cf/debian/sendmail.mc.in b/debian/cf/debian/sendmail.mc.in
new file mode 100644
index 0000000..c52cadb
--- /dev/null
+++ b/debian/cf/debian/sendmail.mc.in
@@ -0,0 +1,46 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: debproto.mc,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# sendmail.mc prototype config file for building Sendmail @sm_version@
+#
+# Note: the .in file supports @SM_MINVERS@ - @SM_MAXVERS@, but the generated
+# file is customized to the version noted above.
+#
+# This file is used to configure Sendmail for use with Debian systems.
+#
+# If you modify this file, you will have to regenerate /etc/mail/sendmail.cf
+# by running this file through the m4 preprocessor via one of the following:
+# * `sendmailconfig`
+# * `make`
+# * `m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf`
+# The first two options are preferred as they will also update other files
+# that depend upon the contents of this file.
+#
+# The best documentation for this .mc file is:
+# /usr/share/doc/sendmail-doc/cf.README.gz
+#
+#-----------------------------------------------------------------------------
+divert(0)dnl
+#
+# Copyright (c) 1998-2002 Richard Nelson. All Rights Reserved.
+#
+# This file is used to configure Sendmail for use with Debian systems.
+#
+define(`_USE_ETC_MAIL_')dnl
+include(`@datadir@/sendmail/cf/m4/cf.m4')dnl
+VERSIONID(`$Id: sendmail.mc, v @sm_version@@sm_revision@ @sm_date@ @sm_time@ cowboy Exp $')
+OSTYPE(`debian')dnl
+DOMAIN(`debian-mta')dnl
+dnl #
+dnl # General defines
+dnl #
+dnl # SAFE_FILE_ENV: [undefined] If set, sendmail will do a chroot()
+dnl # into this directory before writing files.
+dnl # If *all* your user accounts are under /home then use that
+dnl # instead - it will prevent any writes outside of /home !
+dnl # define(`confSAFE_FILE_ENV', `')dnl
diff --git a/debian/cf/debian/starttls.m4.in b/debian/cf/debian/starttls.m4.in
new file mode 100644
index 0000000..d9de9d0
--- /dev/null
+++ b/debian/cf/debian/starttls.m4.in
@@ -0,0 +1,52 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: starttls.m4,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 2002-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# starttls.m4 m4 file to support user->MTA, MSP->MTA, and MTA->MTA
+# encryption and/or authentication.
+#
+# To use this file, add this line to sendmail.mc and possibly submit.mc:
+# `include(`@sysconfdir@/mail/tls/starttls.m4')dnl'
+#
+#-----------------------------------------------------------------------------
+#
+divert(0)dnl
+VERSIONID(`$Id: starttls.m4,v @sm_version@@sm_revision@ @sm_date@ @sm_time@ cowboy Exp $')
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Bring in Autoconf results
+dnl #---------------------------------------------------------------------
+ifdef(`sm_version', `dnl',
+`include(`@datadir@/sendmail/cf/debian/autoconf.m4')dnl')
+dnl #
+dnl # Check to see if inclusion is valid (version >= 8.11.0, tls enabled)
+ifelse(eval(sm_version_math >= 527104), `1', dnl
+`ifelse(sm_enable_tls, `yes', `dnl
+dnl #
+dnl # Do not touch anything above this line...
+dnl #
+dnl # CA directory - CA certs should be herein
+define(`confCACERT_PATH', `@sysconfdir@/ssl/certs')dnl
+dnl #
+dnl # CA file (may be the same as client/server certificate)
+define(`confCACERT', `@sysconfdir@/mail/tls/sendmail-server.crt')dnl
+dnl #
+dnl # Server certificate/key (can be in the same file, and shared w/client)
+dnl # NOTE: The key must *NOT* be encrypted !!!
+define(`confSERVER_CERT', `@sysconfdir@/mail/tls/sendmail-server.crt')dnl
+define(`confSERVER_KEY', `@sysconfdir@/mail/tls/sendmail-common.key')dnl
+dnl #
+dnl # Clien certificate/key (can be in the same file, and shared w/server)
+dnl # NOTE: The key must *NOT* be encrypted !!!
+define(`confCLIENT_CERT', `@sysconfdir@/mail/tls/sendmail-client.crt')dnl
+define(`confCLIENT_KEY', `@sysconfdir@/mail/tls/sendmail-common.key')dnl
+dnl #
+dnl # Optional settings
+dnl define(`confTLS_SRV_OPTIONS', `V')dnl # don't request user certs
+dnl #
+dnl # Do not touch anything below this line...
+)')dnl
diff --git a/debian/cf/debian/submit.mc.in b/debian/cf/debian/submit.mc.in
new file mode 100644
index 0000000..572b638
--- /dev/null
+++ b/debian/cf/debian/submit.mc.in
@@ -0,0 +1,56 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: submit.mc,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 2000-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# submit.mc prototype config file for building Sendmail @sm_version@
+#
+# Note: the .in file supports @SM_MINVERS@ - @SM_MAXVERS@, but the generated
+# file is customized to the version noted above.
+#
+# This file is used to configure Sendmail for use with Debian systems.
+#
+# If you modify this file, you will have to regenerate /etc/mail/submit.cf
+# by running this file through the m4 preprocessor via one of the following:
+# * `sendmailconfig`
+# * `make`
+# * `m4 /etc/mail/submit.mc > /etc/mail/submit.cf`
+# The first two options are preferred as they will also update other files
+# that depend upon the contents of this file.
+#
+# The best documentation for this .mc file is:
+# /usr/share/doc/sendmail-doc/cf.README.gz
+#
+#-----------------------------------------------------------------------------
+divert(0)dnl
+#
+# Copyright (c) 2000-2002 Richard Nelson. All Rights Reserved.
+#
+# This file is used to configure Sendmail for use with Debian systems.
+#
+define(`_USE_ETC_MAIL_')dnl
+include(`@datadir@/sendmail/cf/m4/cf.m4')dnl
+VERSIONID(`$Id: submit.mc, v @sm_version@@sm_revision@ @sm_date@ @sm_time@ cowboy Exp $')
+OSTYPE(`debian')dnl
+DOMAIN(`debian-msp')dnl
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Masquerading information, if needed, should go here
+dnl # You likely will not need this, as the MTA will do it
+dnl #---------------------------------------------------------------------
+dnl MASQUERADE_AS()dnl
+dnl FEATURE(`masquerade_envelope')dnl
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # The real reason we're here: the FEATURE(msp)
+dnl #---------------------------------------------------------------------
+FEATURE(`msp', `[127.0.0.1]', `MSA')dnl
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Some minor cleanup from FEATURE(msp)
+dnl #---------------------------------------------------------------------
+dnl #
+dnl #---------------------------------------------------------------------
diff --git a/debian/cf/domain/debian-msp.m4.in b/debian/cf/domain/debian-msp.m4.in
new file mode 100644
index 0000000..c3d04d5
--- /dev/null
+++ b/debian/cf/domain/debian-msp.m4.in
@@ -0,0 +1,98 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: debian-msp.m4,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# domain(debian-msp) config file for building Sendmail @sm_version@@sm_revision@
+#
+# Note: the .in file supports @SM_MINVERS@ - @SM_MAXVERS@, but the generated
+# file is customized to the version noted above.
+#
+#-----------------------------------------------------------------------------
+#
+divert(0)dnl
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Bring in Autoconf results
+dnl #---------------------------------------------------------------------
+ifdef(`sm_version', `dnl',
+`include(`@datadir@/sendmail/cf/debian/autoconf.m4')dnl')
+dnl #
+VERSIONID(`$Id: debian-msp.m4, v @sm_version@@sm_revision@ @sm_date@ @sm_time@ cowboy Exp $')
+define(`DEBIAN_MSP')dnl
+dnl #
+dnl # changes made herein *must* be reflected in parse_mc,update_db,debian.m4
+dnl #
+define(`MSP_QUEUE_DIR', `@localstatedir@/spool/mqueue-client')dnl
+define(`STATUS_FILE', `@localstatedir@/lib/sendmail/sm-client.st')dnl
+dnl #
+dnl # Since MSP only delivers to MTA, persistant status isn't needed
+define(`confHOST_STATUS_DIRECTORY', `')dnl
+dnl #
+dnl # For FHS, we use a subdirectory in /var/run (multiple files)
+dnl # For permissions, we use separate MSP/MTA subdirectories
+define(`confPID_FILE', `@localstatedir@/run/sendmail/msp/sendmail.pid')dnl
+define(`confCONTROL_SOCKET_NAME',
+ `@localstatedir@/run/sendmail/msp/smcontrol')dnl
+dnl #
+dnl # flags
+define(`confPROCESS_TITLE_PREFIX', `MSP')dnl
+define(`confCON_EXPENSIVE', `True')dnl
+define(`confNO_RCPT_ACTION', `add-to-undisclosed')dnl
+define(`confRRT_IMPLIES_DSN', `True')dnl
+define(`confSAFE_FILE_ENV', `/')dnl
+define(`confSAFE_QUEUE', `True')dnl
+define(`confQUEUE_FILE_MODE', `0660')dnl
+define(`confTEMP_FILE_MODE', `0600')dnl
+dnl #
+dnl # Provide some 'more reasonable' timeout values
+dnl # See SASL/TLS sections below for more timeout values
+dnl #
+define(`confTO_ICONNECT', `2s')dnl # rfc min= , def=5m
+define(`confTO_MAIL', `2m')dnl # rfc min=5m, def=10m, too long
+define(`confTO_DATAINIT', `2m')dnl # rfc min=2m, def=5m
+define(`confTO_RSET', `1m')dnl # rfc min= , def=5m
+define(`confTO_QUIT', `2m')dnl # rfc min= , def=2m
+define(`confTO_COMMAND', `5m')dnl # rfc min=5m, def=1h
+define(`confTO_IDENT', `5s')dnl # , def=5s, 0=skip
+define(`confTO_HOSTSTATUS',`0')dnl # , def=30m
+dnl #
+dnl # by default, disable Message Submission Agent (8.10.0+)
+ifelse(eval(sm_version_math >= 526848), `1',dnl
+`FEATURE(`no_default_msa')')
+dnl #
+dnl # Mail Submission Program uid/gid
+define(`confRUN_AS_USER', `smmsp')dnl
+define(`confTRUSTED_USER', confRUN_AS_USER)dnl
+dnl #
+dnl # Optional items (should be a subset site.config.m4 used for build)
+dnl # to prevent sendmail error messages
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # SMTP AUTH (SASL) support (sendmail 8.10.0 +)
+dnl # NOTE: we'll us inaddr_any instead of 127.0.0.1 (or not...)
+dnl # Sigh: MSP AUTH doesn't work in -bs mode (/etc/sasldb !o+r)
+dnl #---------------------------------------------------------------------
+ifelse(sm_enable_auth, `yes',dnl
+`define(`confAUTH_MECHANISMS',dnl
+ `GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5 PLAIN LOGIN')dnl'
+`TRUST_AUTH_MECH(`GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5 PLAIN LOGIN')'
+`ifelse(eval(sm_version_math >= 527360), `1',dnl
+`define(`confTO_AUTH', `2m')dnl # , def=10m'
+`define(`confDONT_BLAME_SENDMAIL',dnl
+defn(`confDONT_BLAME_SENDMAIL')`,GroupReadableSASLDBFile,GroupWritableSASLDBFile')dnl')'
+`DAEMON_OPTIONS(`Name=NoMTA, Addr=127.0.0.1, M=EA')dnl'
+)dnl
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # SMTP STARTTLS (OpenSSL) support (sendmail 8.11.0 +)
+dnl #---------------------------------------------------------------------
+ifelse(sm_enable_tls, `yes',dnl
+`ifelse(eval(sm_version_math >= 527360), `1',dnl
+`define(`confTO_STARTTLS', `2m')dnl # , def=10m'
+`define(`confDONT_BLAME_SENDMAIL',dnl
+ defn(`confDONT_BLAME_SENDMAIL')`,GroupReadableKeyFile')dnl')'
+)dnl
diff --git a/debian/cf/domain/debian-mta.m4.in b/debian/cf/domain/debian-mta.m4.in
new file mode 100644
index 0000000..1a82051
--- /dev/null
+++ b/debian/cf/domain/debian-mta.m4.in
@@ -0,0 +1,134 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: debian-mta.m4,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# domain(debian-mta) config file for building Sendmail @sm_version@@sm_revision@
+#
+# Note: the .in file supports @SM_MINVERS@ - @SM_MAXVERS@, but the generated
+# file is customized to the version noted above.
+#
+#-----------------------------------------------------------------------------
+#
+divert(0)dnl
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Bring in Autoconf results
+dnl #---------------------------------------------------------------------
+ifdef(`sm_version', `dnl' ,
+`include(`@datadir@/sendmail/cf/debian/autoconf.m4')dnl')
+dnl #
+VERSIONID(`$Id: debian-mta.m4, v @sm_version@@sm_revision@ @sm_date@ @sm_time@ cowboy Exp $')
+define(`DEBIAN_MTA')dnl
+dnl #
+dnl # changes made herein *must* be reflected in parse_mc,update_db,debian.m4
+dnl #
+define(`STATUS_FILE', `@localstatedir@/lib/sendmail/sendmail.st')dnl
+define(`confHOST_STATUS_DIRECTORY',
+ `@localstatedir@/lib/sendmail/host_status')dnl
+dnl #
+dnl # For FHS, we use a subdirectory in /var/run (multiple files)
+dnl # For permissions, we use separate MSP/MTA subdirectories
+define(`confPID_FILE', `@localstatedir@/run/sendmail/mta/sendmail.pid')dnl
+define(`confCONTROL_SOCKET_NAME',
+ `@localstatedir@/run/sendmail/mta/smcontrol')dnl
+dnl #
+dnl # flags
+define(`confPROCESS_TITLE_PREFIX', `MTA')dnl
+define(`confCON_EXPENSIVE', `True')dnl
+define(`confMAX_DAEMON_CHILDREN', `0')dnl
+define(`confNO_RCPT_ACTION', `add-to-undisclosed')dnl
+define(`confRRT_IMPLIES_DSN', `True')dnl
+define(`confSAFE_FILE_ENV', `/')dnl
+define(`confSAFE_QUEUE', `True')dnl
+define(`confQUEUE_FILE_MODE', `0600')dnl
+define(`confTEMP_FILE_MODE', `0600')dnl
+dnl #
+dnl # Provide some 'more reasonable' timeout values
+dnl # See SASL/TLS sections below for more timeout values
+dnl #
+define(`confTO_ICONNECT', `5s')dnl # rfc min= , def=5m
+define(`confTO_MAIL', `2m')dnl # rfc min=5m, def=10m, too long
+define(`confTO_DATAINIT', `2m')dnl # rfc min=2m, def=5m
+define(`confTO_RSET', `1m')dnl # rfc min= , def=5m
+define(`confTO_QUIT', `2m')dnl # rfc min= , def=2m
+define(`confTO_COMMAND', `5m')dnl # rfc min=5m, def=1h
+define(`confTO_IDENT', `5s')dnl # , def=5s, 0=skip
+dnl #
+dnl # Debian users have group writable directories/files by default (8.9.0+)
+ifelse(eval(sm_version_math >= 526592), `1',dnl
+`define(`confDONT_BLAME_SENDMAIL',dnl
+`AssumeSafeChown,ForwardFileInGroupWritableDirPath,GroupWritableForwardFileSafe,GroupWritableIncludeFileSafe,IncludeFileInGroupWritableDirPath')dnl'
+)dnl
+dnl #
+dnl # Don't warn for non-existant forward files (8.10.0+)
+ifelse(eval(sm_version_math >= 526848), `1',dnl
+`define(`confDONT_BLAME_SENDMAIL',dnl
+ defn(`confDONT_BLAME_SENDMAIL')`,DontWarnForwardFileInUnsafeDirPath')dnl'
+)dnl
+dnl #
+dnl # Allow group-writable include files (8.12.0+)
+ifelse(eval(sm_version_math >= 527360), `1',dnl
+`define(`confDONT_BLAME_SENDMAIL',dnl
+ defn(`confDONT_BLAME_SENDMAIL')`,GroupWritableIncludeFile')dnl'
+)dnl
+dnl #
+dnl # by default, disable Message Submission Agent (8.10.0+)
+dnl # except for 8.12.0+, where its needed for MSA !
+ifelse(eval(sm_version_math >= 526848), `1',dnl
+`ifelse(eval(sm_version_math < 527360), `1',dnl
+`FEATURE(`no_default_msa')',`dnl')')
+dnl #
+dnl # Allow mailq/hoststat to work with both MSP/MTA queues
+ifelse(eval(sm_version_math >= 527360), `1',dnl
+`define(`confQUEUE_FILE_MODE', `0640')dnl'
+`define(`confTEMP_FILE_MODE', `0644')dnl')
+dnl #
+dnl # For security, we default to not letting lusers run the queues
+dnl # If possible, we prevent sendmail -bv from reading things they shouldn't
+dnl #
+define(`confPRIVACY_FLAGS', `restrictqrun')
+ifelse(eval(sm_version_math >= 527360), `1',dnl
+`define(`confPRIVACY_FLAGS',dnl
+ defn(`confPRIVACY_FLAGS')`,restrictexpand')dnl')
+dnl #
+dnl # Provide a more reasonable default for number of queue-runners
+dnl # because many/most? people will not discover this themselves
+dnl # and the sendmail default is one!
+dnl #
+define(`confMAX_RUNNERS_PER_QUEUE', `5')dnl
+dnl #
+dnl # Optional items (should be a subset site.config.m4 used for build)
+dnl # to prevent sendmail error messages
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # SMTP AUTH (SASL) support (sendmail 8.10.0 +)
+dnl # PLAIN/LOGIN needed to support SASL auth via PAM ;(
+dnl # if this bothers you, you allow them only in conjunction w/STARTTLS !
+dnl # for 8.12.0+, add EXTERNAL as an available & trusted mech (w/STARTTLS)
+dnl #---------------------------------------------------------------------
+ifelse(sm_enable_auth, `yes',dnl
+`define(`confAUTH_MECHANISMS',dnl
+`GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5 PLAIN LOGIN')dnl'
+`TRUST_AUTH_MECH(`GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5 PLAIN LOGIN')'
+`ifelse(eval(sm_version_math >= 527360), `1',dnl
+`define(`confAUTH_MECHANISMS',dnl
+`EXTERNAL 'defn(`confAUTH_MECHANISMS'))dnl'
+`TRUST_AUTH_MECH(`EXTERNAL')'
+`define(`confTO_AUTH', `2m')dnl # , def=10m'
+`define(`confDONT_BLAME_SENDMAIL',dnl
+defn(`confDONT_BLAME_SENDMAIL')`,GroupReadableSASLDBFile,GroupWritableSASLDBFile')dnl')'
+)dnl
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # SMTP STARTTLS (OpenSSL) support (sendmail 8.11.0 +)
+dnl #---------------------------------------------------------------------
+ifelse(sm_enable_tls, `yes',dnl
+`ifelse(eval(sm_version_math >= 527360), `1',dnl
+`define(`confTO_STARTTLS', `2m')dnl # , def=10m'
+`define(`confDONT_BLAME_SENDMAIL',dnl
+ defn(`confDONT_BLAME_SENDMAIL')`,GroupReadableKeyFile')dnl')'
+)dnl
diff --git a/debian/cf/feature/rhsbl.m4 b/debian/cf/feature/rhsbl.m4
new file mode 100644
index 0000000..857ce58
--- /dev/null
+++ b/debian/cf/feature/rhsbl.m4
@@ -0,0 +1,40 @@
+divert(-1)
+#
+# Copyright (c) 2001 Derek J. Balling
+# All rights reserved.
+#
+# Permission to use granted for all purposes. If modifications are made
+# they are requested to be sent to <dredd@megacity.org> for inclusion in future
+# versions
+#
+# Allows (hopefully) for checking of access.db whitelisting now. This ONLY
+# works on sendmail-8.12.x ... use on any other version may require tinkering
+# by you the downloader.
+#
+divert(0)
+ifdef(`_RHSBL_R_',`dnl',`dnl
+VERSIONID(`$Id: rhsbl.m4,v 1.1 2001/08/27 15:41:15 dredd Exp $')
+define(`_RHSBL_R_',`')
+ifdef(`_DNSBL_R_',`dnl',`dnl
+LOCAL_CONFIG
+# map for DNS based blacklist lookups based on the sender RHS
+Kdnsbl host -T<TMP>')')
+divert(-1)
+define(`_RHSBL_SRV_', `_ARG_')dnl
+define(`_RHSBL_MSG_', `ifelse(len(X`'_ARG2_),`1',`"550 Mail from " $`'&{RHS} " refused by blackhole site '_RHSBL_SRV_`"',`_ARG2_')')dnl
+define(`_RHSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{RHS} " at '_RHSBL_SRV_`"',`_ARG2_')')dnl
+divert(8)
+LOCAL_RULESETS
+SLocal_check_mail
+# DNS based RHS spam list _RHSBL_SRV_
+R$+ $: <@> $>CanonAddr $&f
+R<@> $*<@$+.> $:<@>$1<@$2.>$|$>SearchList<+ rhs>$|<F:$1@$2><D:$2><>
+R$* $| <$={Accept}> $: OKSOFAR
+R<@> $*<@$+.> $| $* $: <?> $(dnsbl $2._RHSBL_SRV_. $: OK $) $(macro {RHS} $@ $2 $)
+R<@> $* $: OKSOFAR
+R<?>OK $: OKSOFAR
+ifelse(len(X`'_ARG3_),`1',
+`R<?>$+<TMP> $: TMPOK',
+`R<?>$+<TMP> $#error $@ 4.7.1 $: _RHSBL_MSG_TMP_')
+R<?>$+ $#error $@ 5.7.1 $: _RHSBL_MSG_
+divert(-1)
diff --git a/debian/cf/feature/vnet.m4 b/debian/cf/feature/vnet.m4
new file mode 100644
index 0000000..6086baf
--- /dev/null
+++ b/debian/cf/feature/vnet.m4
@@ -0,0 +1,70 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: ./vnet.m4,v 8.12.0 2001/09/24 12:00:00 cowboy Exp $
+#
+# Copyright (c) 2001-2001 Richard Nelson. All Rights Reserved.
+#
+# feature(vnet) config file for building Sendmail
+#
+#-----------------------------------------------------------------------------
+#
+divert(0)dnl
+dnl
+dnl
+dnl
+LOCAL_CONFIG
+######################################################################
+### vnet: support .rscs domain and XAGENT
+###
+######################################################################
+#
+# Support routing of .rscs nodes via XAGENT
+#
+# Define vnet/rscs node hlq
+CAvnet.ibm.com vnet rscs
+#
+# Note: you'll have to define your XAGENT node:
+#DAlexvmk.lexington.ibm.com
+dnl
+dnl
+dnl
+LOCAL_RULE_3
+######################################################################
+### vnet: support .rscs domain, XAGENT, and Lotus Notes
+###
+######################################################################
+#
+# Support Lotus Notes and VM TCP/IP MTAs
+#
+# Remove stupid route addressing (%hack) added by VM TCP/IP
+R$* % ibmus.rscs < @ $+> $* $: $1 < @ us.ibm.com > $3
+R$* % ibmuk.rscs < @ $+> $* $: $1 < @ uk.ibm.com > $3
+R$* % $-.rscs < @ $+> $* $: $1 < @ $2.rscs > $4
+# Now, try the domaintable yet again...
+R$* < @ $-.rscs > $* $: $1 < @ $(domaintable $2.rscs $) > $3
+# Finally, allow an override on simply the rscs domain...
+R$* < @ $-.rscs > $* $: $1 < @ $2.$(domaintable rscs $) > $3
+dnl
+dnl
+dnl
+LOCAL_NET_CONFIG
+######################################################################
+### vnet: Handle .rscs domain, deliver to *.ibm.com, etc...
+###
+######################################################################
+
+# Skip any local addresses
+# (or we'll get a "mail loops back to itself" error
+R$* < @ $=w . > $* $@ $1 < @ $2 . > $3 regular local name
+R$* < @ $=w > $* $@ $1 < @ $2 . > $3 regular local name
+
+# Recipients inside IBM--transfer the mail directly.
+
+R$* < @ $+.ibm.com > $* $#relay $@ $2.ibm.com $: $1 < @$2.ibm.com > $3
+R$* < @ $+.ibm.com. > $* $#relay $@ $2.ibm.com $: $1 < @$2.ibm.com > $3
+
+# Recipients of the form user@node.vnet get rewritten to
+# user@node.vnet.ibm.com, the message itself is forwarded to
+# the RSCS/VM node specified in $A.
+
+R$* < @ $-.$=A > $* $#relay $@ $A $: $1 < @$2.vnet.ibm.com > $4
diff --git a/debian/cf/hack/debian_auth.m4.in b/debian/cf/hack/debian_auth.m4.in
new file mode 100644
index 0000000..66510b1
--- /dev/null
+++ b/debian/cf/hack/debian_auth.m4.in
@@ -0,0 +1,47 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: debian_auth.m4,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 2001-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# debian_trustauth.m4 m4 file for
+# * supporting MSP->MTA and MTA->MTA authentication
+# * supporting the auth= parameter on the mail from: command.
+#
+# This file is an extremely simple example that lets *ALL* trusted users
+# sendmail, daemon, root, uucp, etc. proxy for any user.
+#
+# If you've a better idea, please let me know
+#
+#-----------------------------------------------------------------------------
+divert(0)dnl
+VERSIONID(`$Id: debian_auth.m4,v @sm_version@@sm_revision@ @sm_date@ @sm_time@ cowboy Exp $')
+dnl #
+dnl # MTA as Client authentication - only if authinfo/access_db *NOT* used...
+define(`confDEF_AUTH_INFO', `MAIL_SETTINGS_DIR`'default-auth-info')dnl
+dnl #
+dnl # add (fake) uid 'sendmail' to trusted users - it is used as the id
+dnl # for MSP->MTA, and MTA->MTA proxying.
+ifdef(`confTRUSTED_USERS',
+ `define(`confTRUSTED_USERS',
+ defn(`confTRUSTED_USERS')`,sendmail')',
+ `define(`confTRUSTED_USERS', `sendmail')')dnl
+dnl #
+dnl # Define local rulesets for trust_auth
+LOCAL_RULESETS
+#
+#-----------------------------------------------------------------------------
+# Local_trust_auth: Define who is able to authenticate for whom...
+# The sendmail default is to allow *IFF* authen == author
+# This ruleset also allows trusted users to authenicate as anyone - needed
+# for MSP->MTA and MTA->MTA forwarding of mail from: <...> auth=...
+SLocal_trust_auth
+R$* $: $&{auth_authen} Put authentication id in the workspace
+ifdef(`DEBIAN_DEBUG',dnl
+`R$* $: $(log authtype:$&{auth_type} $) $1
+R$* $: $(log authauthen:$&{auth_authen} $) $1
+R$* $: $(log authauthor:$&{auth_author} $) $1')dnl
+R$=t $@ $#ok Trusted users... Allow trusted users to auth= as anyone
+#-----------------------------------------------------------------------------
diff --git a/debian/cf/hack/msp_nullclient.m4 b/debian/cf/hack/msp_nullclient.m4
new file mode 100644
index 0000000..db9f8cc
--- /dev/null
+++ b/debian/cf/hack/msp_nullclient.m4
@@ -0,0 +1,95 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: ./msp_nullclient.m4,v 8.12.0 2001/05/23 14:30:00 cowboy Exp $
+#
+# Copyright (c) 2001-2001 Richard Nelson. All Rights Reserved.
+#
+# msp_nullclient.m4 m4 file for supporting a nullclient in the MSP
+# environment. That is, change the feature(msp) to feature(msp_nullclient)
+# in /etc/mail/submit.mc. An MTA listener is now optional, and you can
+# run with only MSP mode (setgid mail).
+#
+# This file is blatantly cut&pasted from nullclient.m4 and msp.m4 !!!
+#
+# If you've a better idea, please let me know
+#
+#-----------------------------------------------------------------------------
+#
+# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+# All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# By using this file, you agree to the terms and conditions set
+# forth in the LICENSE file which can be found at the top level of
+# the sendmail distribution.
+#
+#
+ifelse(defn(`_ARG_'), `', `errprint(`Hack "msp_nullclient" requires argument')',
+ `define(`_NULL_CLIENT_', _ARG_)')
+
+#
+# This is used only for relaying mail from a client to a hub when
+# that client does absolutely nothing else -- i.e., it is a "null
+# mailer". In this sense, it acts like the "R" option in Sun
+# sendmail.
+#
+
+divert(0)dnl
+VERSIONID(`$Id: msp_nullclient.m4,v 8.12.0 2001/05/23 14:30:00 cowboy Exp $')
+divert(-1)dnl
+
+dnl #
+dnl # This *MUST* be used within the context of MSP
+ifdef(`DEBIAN_MSP', `dnl', `DOMAIN(`debian-msp')')
+dnl #
+dnl # Restrict listening to localhost (to increase security)
+ifelse(defn(`_DPO_'), `',
+`DAEMON_OPTIONS(`Name=NoMTA, Addr=127.0.0.1, M=E')dnl')
+
+dnl #-------------------- Now the Nullclient carp ---------------------------
+undefine(`ALIAS_FILE')
+define(`MAIL_HUB', _NULL_CLIENT_)
+define(`SMART_HOST', _NULL_CLIENT_)
+define(`confFORWARD_PATH', `')
+ifdef(`confFROM_HEADER',, `define(`confFROM_HEADER', `<$g>')')
+dnl #-------------------- Now the MSP carp ----------------------------------
+ifdef(`STATUS_FILE',
+`define(`_F_',
+`define(`_b_', index(STATUS_FILE, `sendmail.st'))ifelse(_b_, `-1', `STATUS_FILE', `substr(STATUS_FILE, 0, _b_)sm-client.st')')
+define(`STATUS_FILE', _F_)
+undefine(`_b_') undefine(`_F_')',
+`define(`STATUS_FILE', `/var/run/sm-client.st')')
+define(`confUSE_MSP', `True')dnl
+define(`confFORWARD_PATH', `')dnl
+define(`confPRIVACY_FLAGS', `goaway,noetrn')dnl
+dnl ---------------------------------------------
+dnl run as this user (even if called by root)
+define(`confRUN_AS_USER', `smmsp')dnl
+define(`confTRUSTED_USER', `confRUN_AS_USER')dnl
+dnl ---------------------------------------------
+dnl This queue directory must have the same group
+dnl as sendmail and it must be group-writable.
+dnl notice: do not test for QUEUE_DIR, it is set in some ostype/*.m4 files
+ifdef(`MSP_QUEUE_DIR',
+`define(`QUEUE_DIR', `MSP_QUEUE_DIR')',
+`define(`QUEUE_DIR', `/var/spool/clientmqueue')')dnl
+dnl ---------------------------------------------
+ifdef(`confPID_FILE', `dnl',
+`define(`confPID_FILE', QUEUE_DIR`/sm-client.pid')')
+define(`confQUEUE_FILE_MODE', `0660')dnl
+FEATURE(`no_default_msa')dnl
+ifelse(defn(`_DPO_'), `',
+`DAEMON_OPTIONS(`Name=NoMTA, Addr=127.0.0.1, M=E')dnl')
+dnl #---------------------- Debian MSP fixup -------------------------------
+dnl define(`confHOST_STATUS_DIRECTORY', `/var/lib/sendmail/host_status')dnl
+define(`confRUN_AS_USER', `mail')dnl
+define(`confTRUSTED_USER', `confRUN_AS_USER')dnl
+dnl #---------------------- back to nullclient carp ------------------------
+define(`_DEF_LOCAL_MAILER_FLAGS', `lsDFM5q')
+MASQUERADE_AS(_NULL_CLIENT_)
+FEATURE(`allmasquerade')
+FEATURE(`masquerade_envelope')
+MAILER(`local')
+MAILER(`smtp')
diff --git a/debian/cf/hack/nodns.m4 b/debian/cf/hack/nodns.m4
new file mode 100644
index 0000000..1f3f71e
--- /dev/null
+++ b/debian/cf/hack/nodns.m4
@@ -0,0 +1,17 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: ./nodns.m4,v 8.12.0 2001/08/24 12:00:00 cowboy Exp $
+#
+# Copyright (c) 1999-2001 Richard Nelson. All Rights Reserved.
+#
+# hack/nodns.m4 m4 file for omitting DNS queries
+#
+# If you've a better idea, please let me know
+#
+#-----------------------------------------------------------------------------
+divert(0)dnl
+VERSIONID(`$Id: nodns.m4,v @sm_version@@sm_revision@ @sm_date@ @sm_time@ cowboy Exp $')
+undefine(`confBIND_OPTS')dnl
+define(`confSERVICE_SWITCH_FILE', `/etc/mail/service.switch-nodns')dnl
+define(`confDONT_PROBE_INTERFACES', `True')dnl
+FEATURE(nocanonify)dnl
diff --git a/debian/cf/hack/spamtrap.m4 b/debian/cf/hack/spamtrap.m4
new file mode 100644
index 0000000..9acd2c3
--- /dev/null
+++ b/debian/cf/hack/spamtrap.m4
@@ -0,0 +1,62 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: ./spamtrap.m4,v 8.12.0 2001/09/24 12:00:00 cowboy Exp $
+#
+# hack(spamtrap) config file for building Sendmail
+#
+# Courtesy of jeff@sdsc.edu (Jeff Makey)
+# via c.m.s posting Sat, 8 Sep 2001 07:44:26 +0000 (UTC)
+#
+# Spamtrap addresses go into the access file like this:
+#
+# To:spamtrap@pandora.orbl.org POISON
+# To:Friend@public.com POISON
+#
+#-----------------------------------------------------------------------------
+#
+divert(0)dnl
+LOCAL_CONFIG
+# provide access to macros as a map
+Kmacro macro
+
+LOCAL_RULESETS
+######################################################################
+### spamtrap: handle spamtrap(POISON) users
+###
+######################################################################
+#
+# This is not only redundant, but fails with feature(`delay_checks')
+#
+#SLocal_check_mail
+# Clear the "poison recipient" indicator macro for this message.
+#R$* $: $(macro {PoisonRecipient} $) $1
+
+SLocal_check_rcpt
+#
+# Spamtrap addresses go into the access file like this:
+# To:spamtrap@pandora.orbl.org POISON
+#
+# Certain recipients are "poison" and cause the
+# message to be rejected for all recipients.
+R$* $: $1 $| $1 create workspace to right of $|
+R$* $| $* <$+> $* $1 $| $3 focus on part in angle brackets
+R$* $| $+ $: $1 $| $>SearchList <!To> $| <E:$2> <>
+R$* $| <POISON> $: $1 $| $(macro {PoisonRecipient} $@ POISON $)
+R$* $| $* $: $1 delete workspace
+
+Scheck_eoh
+R$* $: $&{PoisonRecipient}
+RPOISON $#error $@ 5.7.1 $: 550 Mail sent to spam lists is not accepted here
+
+#
+# With a "To:Friend@public.com POISON" entry in the access file the
+# following ruleset will block certain types of spam too:
+#
+# Certain To headers are sure-fire spam signatures.
+HTo: $>CheckTo
+SCheckTo
+R$+ , $+ $@ $1 , $2 do not try to verify complex addresses
+R$* $: $1 $| $>SearchList <!To> $| <E:$1> <>
+R$* $| <POISON> $#error $@ 5.7.1 $: 550 Mail sent by spamware is not accepted here
+R$* $| $* $: $1 delete lookup result
+
diff --git a/debian/cf/hack/virthost_by_ip.m4.in b/debian/cf/hack/virthost_by_ip.m4.in
new file mode 100644
index 0000000..d304213
--- /dev/null
+++ b/debian/cf/hack/virthost_by_ip.m4.in
@@ -0,0 +1,77 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: virthost_by_ip.m4,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 2001-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# hack(virthost_by_ip) config file for building Sendmail @sm_version@@sm_revision@
+# Note: Also check op.{ps,txt} for the 'b' modifier to daemon_options - it
+# extends ip based virtual hosting.
+#
+# Note: the .in file supports @SM_MINVERS@ - @SM_MAXVERS@, but the generated
+# file is customized to the version noted above.
+#
+#-----------------------------------------------------------------------------
+#
+divert(0)dnl
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Bring in Autoconf results
+dnl #---------------------------------------------------------------------
+ifdef(`sm_version', `dnl',
+`include(`@datadir@/sendmail/cf/debian/autoconf.m4')dnl')
+dnl #
+VERSIONID(`$Id: virthost_by_ip.m4, v @sm_version@@sm_revision@ @sm_date@ @sm_time@ cowboy Exp $')
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Virtual hosting extensions - Login (greeting message)
+dnl #---------------------------------------------------------------------
+define(`confSMTP_LOGIN_MSG', `$?{if_name}${if_name}$|$j$. Sendmail $v/$Z; $b; (No UCE/UBE) $?{client_addr}logging access from: ${client_name}(${client_resolve})-$_$.')dnl
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Virtual hosting extensions - Received-by headers (8.12.0 style)
+dnl #---------------------------------------------------------------------
+dnl # 8.7.0+
+ifdef(`_REC_HDR_', `dnl',
+`define(`_REC_HDR_', `$?sfrom $s $.$?_($?s$|from $.$_)')dnl'
+`define(`_REC_END_', `for $u; $|;
+ $.$b')dnl'
+)
+dnl # AUTH(SASL) 8.10.0+
+ifdef(`_REC_AUTH_', `dnl',
+`define(`_REC_AUTH_', `$.$?{auth_type}(authenticated')dnl'
+`define(`_REC_FULL_AUTH_', `$.$?{auth_type}(user=${auth_authen} $?{auth_author}author=${auth_author} $.mech=${auth_type}')dnl'
+)
+dnl # TLS(SSL) 8.11.0+
+ifdef(`_REC_BY_', `dnl',
+`define(`_REC_BY_', `$.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}')dnl'
+`define(`_REC_TLS_', `(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u')dnl'
+)
+dnl # Now, override default settings for virtual hosting
+define(`_REC_BY_', `$.by $?{if_name}${if_name}$|$j$. ($v/$Z)$?r with $r$. id $i$?{tls_version}')dnl
+define(`confRECEIVED_HEADER', `_REC_HDR_
+ _REC_AUTH_$?{auth_ssf} (${auth_ssf} bits)$.)
+ _REC_BY_
+ _REC_TLS_
+ _REC_END_')dnl
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Virtual hosting extensions - ClientPortOptions (modifier=h)
+dnl # -- Use name of interface for HELO command
+dnl #---------------------------------------------------------------------
+ifelse(eval(sm_version_math >= 526848), `1',dnl
+`ifelse(defn(`_CPO_'), `dnl',
+`CLIENT_OPTIONS(`Modifier=h')dnl')dnl')
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Virtual hosting extensions - DaemonPortOptions (modifier=b)
+dnl # -- Bind to interface mail was received on
+dnl # I can't do this for you, because each use of DAEMON_OPTIONS will
+dnl # create a new listener !
+dnl #---------------------------------------------------------------------
+dnl ifelse(eval(sm_version_math >= 526848), `1',dnl
+dnl `ifelse(defn(`_DPO_'), `dnl',
+dnl `DAEMON_OPTIONS(`Modifier=b')dnl')dnl')
+
diff --git a/debian/cf/mailer/cyrus21.m4 b/debian/cf/mailer/cyrus21.m4
new file mode 100644
index 0000000..c12dce0
--- /dev/null
+++ b/debian/cf/mailer/cyrus21.m4
@@ -0,0 +1,66 @@
+PUSHDIVERT(-1)
+#
+# Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
+# All rights reserved.
+#
+# By using this file, you agree to the terms and conditions set
+# forth in the LICENSE file which can be found at the top level of
+# the sendmail distribution.
+#
+#
+# This code incorporates code from Carnegie Mellon University, whose
+# copyright notice and conditions of redistribution are as follows:
+#
+#***************************************************************************
+# (C) Copyright 1995 by Carnegie Mellon University
+#
+# All Rights Reserved
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted,
+# provided that the above copyright notice appear in all copies and that
+# both that copyright notice and this permission notice appear in
+# supporting documentation, and that the name of CMU not be
+# used in advertising or publicity pertaining to distribution of the
+# software without specific, written prior permission.
+#
+# CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+# CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+# SOFTWARE.
+#
+# Contributed to Berkeley by John Gardiner Myers <jgm+@CMU.EDU>.
+#
+
+errprint(`*** Warning: cyrus21 deprecated in favour of cyrusv2')
+errprint(`*** Please migrate to cyrusv2 ASAP')
+
+ifdef(`CYRUS_MAILER_USER',, `define(`CYRUS_MAILER_USER', `cyrus:mail')')
+define(`_CYRUS_QGRP', `ifelse(defn(`CYRUS_MAILER_QGRP'),`',`', ` Q=CYRUS_MAILER_QGRP,')')dnl
+
+_DEFIFNOT(`CYRUS_MAILER_FLAGS', `AhmXz5@/:|')
+ifdef(`CYRUS_MAILER_PATH',, `define(`CYRUS_MAILER_PATH', `[IPC]')')
+ifdef(`CYRUS_MAILER_ARGS',, `define(`CYRUS_MAILER_ARGS', `FILE /var/run/cyrus/socket/lmtp')')
+
+_DEFIFNOT(`CYRUS_BB_MAILER_FLAGS', `SuX')
+ifdef(`CYRUS_BB_MAILER_PATH',, `define(`CYRUS_BB_MAILER_PATH', `/usr/sbin/cyrdeliver')')
+ifdef(`CYRUS_BB_MAILER_ARGS',, `define(`CYRUS_BB_MAILER_ARGS', `cyrdeliver -m $u')')
+
+POPDIVERT
+
+##################################################
+### Cyrus Mailer specification ###
+##################################################
+
+VERSIONID(`$Id: cyrus21.m4, v8.23.1 2002/04/05 12:36:34 Omniflux Exp $')
+
+Mcyrus, P=CYRUS_MAILER_PATH, F=_MODMF_(CONCAT(`lsDFMnq', CYRUS_MAILER_FLAGS), `CYRUS'), E=\r\n, S=EnvFromL, R=EnvToL/HdrToL,
+ ifdef(`CYRUS_MAILER_MAX', `M=CYRUS_MAILER_MAX, ')U=CYRUS_MAILER_USER, T=DNS/RFC822/X-Unix,_CYRUS_QGRP
+ A=CYRUS_MAILER_ARGS
+
+Mcyrusbb, P=CYRUS_BB_MAILER_PATH, F=_MODMF_(CONCAT(`lsDFMnq1', CYRUS_BB_MAILER_FLAGS), `CYRUS'), S=EnvFromL, R=EnvToL/HdrToL,
+ ifdef(`CYRUS_MAILER_MAX', `M=CYRUS_MAILER_MAX, ')U=CYRUS_MAILER_USER, T=DNS/RFC822/X-Unix,_CYRUS_QGRP
+ A=CYRUS_BB_MAILER_ARGS
diff --git a/debian/cf/mailer/xagent.m4 b/debian/cf/mailer/xagent.m4
new file mode 100644
index 0000000..2a432d1
--- /dev/null
+++ b/debian/cf/mailer/xagent.m4
@@ -0,0 +1,26 @@
+PUSHDIVERT(-1)
+#
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# By using this file, you agree to the terms and conditions set
+# forth in the LICENSE file which can be found at the top level of
+# the sendmail distribution.
+#
+#
+
+ifdef(`XAGENT_MAILER_PATH',, `define(`XAGENT_MAILER_PATH', /usr/lib/xagent)')
+ifdef(`XAGENT_MAILER_FLAGS',, `define(`XAGENT_MAILER_FLAGS', `DFMueXLn')')
+ifdef(`XAGENT_MAILER_ARGS',, `define(`XAGENT_MAILER_ARGS', `xagent $h $u')')
+POPDIVERT
+####################################
+### XAGENT Mailer specification ###
+####################################
+
+VERSIONID(`@(#)xagent.m4 0.1 (ISSC) 4/19/1996')
+
+Mxagent, P=XAGENT_MAILER_PATH, F=XAGENT_MAILER_FLAGS, S=11/31, R=21/31,
+ _OPTINS(`XAGENT_MAILER_MAX', `M=', `, ')T=DNS/RFC822/X-Unix,
+ A=XAGENT_MAILER_ARGS, E=\n
diff --git a/debian/cf/ostype/debian.m4.in b/debian/cf/ostype/debian.m4.in
new file mode 100644
index 0000000..bf48888
--- /dev/null
+++ b/debian/cf/ostype/debian.m4.in
@@ -0,0 +1,110 @@
+divert(-1)dnl
+#-----------------------------------------------------------------------------
+# $Sendmail: debian.m4,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# ostype(debian) config file for building Sendmail @sm_version@@sm_revision@
+#
+# Note: the .in file supports @SM_MINVERS@ - @SM_MAXVERS@, but the generated
+# file is customized to the version noted above.
+#
+#-----------------------------------------------------------------------------
+#
+divert(0)dnl
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Bring in Autoconf results
+dnl #---------------------------------------------------------------------
+ifdef(`sm_version', `dnl',
+`include(`@datadir@/sendmail/cf/debian/autoconf.m4')dnl')
+dnl #
+VERSIONID(`$Id: debian.m4, v @sm_version@@sm_revision@ @sm_date@ @sm_time@ cowboy Exp $')
+define(`confCF_VERSION', `Debian@sm_revision@')dnl
+dnl #
+dnl # changes made herein *must* be reflected in parse_mc,update_db,debian.m4
+dnl #
+ifdef(`MAIL_SETTINGS_DIR', `dnl',
+ `define(`MAIL_SETTINGS_DIR', `@sysconfdir@/mail/')dnl')
+dnl # support 8.9.3 migration to 8.10.0 naming convention
+dnl # Note: this is too late... needs to be in sendmail.mc - at top
+ifdef(`_USE_ETC_MAIL_', `dnl', `define(`_USE_ETC_MAIL_')dnl')
+dnl #
+dnl # Define default greeting
+define(`confSMTP_LOGIN_MSG', `$j Sendmail $v/$Z; $b; (No UCE/UBE) $?{client_addr}logging access from: ${client_name}(${client_resolve})-$_$.')dnl
+dnl #
+dnl # Keep dead letter drop, it is the last resort home for abused mail
+define(`confDEAD_LETTER_DROP', `@localstatedir@/lib/sendmail/dead.letter')dnl
+dnl #
+dnl # Put status file in other than /etc/mail (sendmail default)
+dnl # Many people run with R/O /etc
+define(`STATUS_FILE', `@localstatedir@/lib/sendmail/sendmail.st')dnl
+define(`confHOST_STATUS_DIRECTORY',
+ `@localstatedir@/lib/sendmail/host_status')dnl
+dnl #
+dnl # Allow scanf extensions for common text files
+define(`confCR_FILE', `-o '`MAIL_SETTINGS_DIR`'relay-domains %[^\#]')dnl
+define(`confCT_FILE', `MAIL_SETTINGS_DIR`'trusted-users %[^\#]')dnl
+define(`confCW_FILE', `MAIL_SETTINGS_DIR`'local-host-names %[^\#]')dnl
+dnl #
+dnl # This *really* needs a better home
+define(`confEBINDIR', `@libexecdir@')dnl
+dnl #
+dnl # add .' to mustquote chars (and match the binary default)
+changequote([, ])dnl
+define([confMUST_QUOTE_CHARS], [.'])dnl
+changequote(`, ')dnl
+dnl #
+dnl # Default in 8.10+, used to be false (iirc), deprecated
+define(`confME_TOO', `True')dnl
+dnl #
+dnl # Set the default user/group for mailers (mail:mail)
+dnl # this should help NIS startup time
+dnl #
+define(`confDEF_USER_ID', `mail:mail')dnl
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # mailer paths and options
+dnl #---------------------------------------------------------------------
+define(`LOCAL_MAILER_PATH', `@libexecdir@/sensible-mda')dnl
+define(`LOCAL_MAILER_ARGS', `sensible-mda $g $u $h ${client_addr}')dnl
+define(`LOCAL_MAILER_FLAGS', `SPhnu9')dnl
+define(`LOCAL_SHELL_FLAGS', `u9')dnl
+define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl
+define(`PROCMAIL_MAILER_ARGS', `procmail -m $h $f $u')dnl
+define(`USENET_MAILER_PATH', `/usr/bin/inews')dnl
+dnl #
+dnl # Optional items (should be a subset site.config.m4 used for build)
+dnl # to prevent sendmail error messages
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # IPv6 support (new option for 8.12+)
+dnl # IPv6 causes problems for some DNS servers, work around them
+dnl #---------------------------------------------------------------------
+ifelse(sm_enable_ipv6, `yes',dnl
+`ifelse(eval(sm_version_math >= 527360), `1',dnl
+`define(`confBIND_OPTS', `+WorkAroundBrokenAAAA')dnl')')
+dnl #
+dnl #---------------------------------------------------------------------
+dnl # Milter (8.10.0-8.11.0) built-in with 8.12.0+
+dnl #---------------------------------------------------------------------
+ifelse(sm_enable_milter, `yes',dnl
+`define(`_FFR_MILTER')dnl')
+#
+#-------------------------------------------------------------------------
+#
+# Undocumented features are available in Debian Sendmail @sm_version@@sm_revision@.
+# * none
+#
+# _FFR_ features are available in Debian Sendmail @sm_version@@sm_revision@.
+ifelse(sm_enable_milter, `yes',dnl
+`# * milter')
+# * sm_ffr
+#-------------------------------------------------------------------------
+#
+# These _FFR_ features are for sendmail.mc processing
+#
+@sm_m4_ffr@
+#-------------------------------------------------------------------------
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..21d0882
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,104 @@
+sendmail (8.12.3-7.2) oldstable-security; urgency=high
+
+ * Non-maintainer upload by the Security Team
+ * Backported upstream patch to fix remote command execution
+ [debian/patches/8.12/8.12.3/z_CVE-2006-0058.patch, VU#834865]
+
+ -- Martin Schulze <joey@infodrom.org> Wed, 22 Mar 2006 23:24:46 +0100
+
+sendmail (8.12.3-7.1) stable-security; urgency=high
+
+ * Non-maintainer upload by the Security Team
+ * Corrected the patch to not use default settings for the sasldb
+ [debian/local/update_auth.in, CAN-2004-0833]
+
+ -- Martin Schulze <joey@infodrom.org> Mon, 13 Sep 2004 09:07:18 +0200
+
+sendmail (8.12.3-7) stable-security; urgency=high
+
+ * Don't update sasldb with default settings (thanks Hugo) CAN-2004-0833
+
+ -- Richard A Nelson (Rick) <cowboy@debian.org> Mon, 06 Sep 2004 12:00:00 -0000
+
+sendmail (8.12.3-6.6) stable-security; urgency=high
+
+ * Non-maintainer upload by the Security Team
+ * Fix vulnerability in ruleset parsing
+ [debian/patches/8.12/8.12.3/CAN-2003-0681.patch]
+
+ -- Matt Zimmerman <mdz@debian.org> Wed, 17 Sep 2003 14:34:02 -0400
+
+sendmail (8.12.3-6.5) stable-security; urgency=high
+
+ * Non-maintainer upload by the Security Team
+ * Fix vulnerability in parseaddr() which could be used to overwrite memory
+ [debian/patches/8.12/8.12.3/CAN-2003-0694.patch]
+
+ -- Matt Zimmerman <mdz@debian.org> Tue, 16 Sep 2003 16:28:18 -0400
+
+sendmail (8.12.3-6.4) stable-security; urgency=low
+
+ * Non-maintainer upload by the Security Team
+ * Create temporary files securely
+ Report and patches from Paul Szabo <psz@maths.usyd.edu.au>
+ [debian/checksendmail/checksendmail.perl,
+ contrib/doublebounce.pl,
+ contrib/expn.pl]
+ (Closes: #173243)
+ * Configure with --enable-bind=no and remove build-dep on bind-dev.
+ Linking with libbind broke LDAP support in 8.12.3-5
+ (Closes: #183434)
+ [debian/rules, debian/build/rules.in]
+
+ -- Matt Zimmerman <mdz@debian.org> Thu, 24 Apr 2003 13:02:08 -0400
+
+sendmail (8.12.3-6.3) stable-security; urgency=high
+
+ * Non-maintainer upload by the Security Team
+ * Corrected the patch to fix a potentially remotely exploitable bug.
+
+ -- Martin Schulze <joey@infodrom.org> Fri, 4 Apr 2003 15:39:21 +0200
+
+sendmail (8.12.3-6.2) stable-security; urgency=high
+
+ * Non-maintainer upload by the Security Team
+ * Fixed a buffer overflow in address parsing due to a char to int
+ conversion problem which is potentially remotely exploitable found by
+ Michal Zalewski. (VU#897604 CA-2003-12 CAN-2003-0161,
+ debian/patches/8.12/8.12.3/security.parsaddr)
+ * Force no optimization for arm - buggy compiler...
+
+ -- Martin Schulze <joey@infodrom.org> Tue, 1 Apr 2003 20:58:30 +0200
+
+sendmail (8.12.3-5) stable-security; urgency=urgent
+
+ * Finally, bring a working, installable (and removable) sendmail to
+ Woody !!!
+ * !!! A remote buffer overflow is squashed via upstream fix !!!
+ * The following GRAVE bugs are fixed
+ + sendmailconfig sets sm_path incorrectly (fixed in sid, but not woody)
+ + sendmail_8.12.3-4 cannot install from scratch
+ + sendmailconfig silly checks
+ + sendmailconfig no longer works (due to update_conf location)
+ Closes: #146331, #150179, #153908, #158445
+ * The following Serious Policy Violations
+ + sendmail preinst does not check for /etc/cron.d
+ Closes: #154702
+ * The following Important problems
+ + Lots of syslog messages regarding SSL after upgrade, reinstall fails
+ Closes: #158751
+ * The following Normal problems
+ + sendmailconfig assumes incorrectly location of loadable modules
+ + sendmail: package sendmail can't be removed/replaced
+ + not having STARTTLS configured spams messages to the logs
+ + sendmail: Installation fails to create SSL certificates
+ + sendmail issues in Woody
+ Closes: #160612, #162997, #170625, #169527, #171085, #171407
+ * Included (at no additional charge)
+ + Fix for numeric ids (got several mails on this - HESIOD problem)
+ + Several upstream patches for MX, MSP, SMRSH and improved DNS handling
+ that cleans up potential DOS issues
+
+ -- Richard A Nelson (Rick) <cowboy@debian.org> Tue, 21 Jan 2003 12:00:00 -0500
+
+/* vim:set ai et tw=80 */
diff --git a/debian/checksendmail/BSDI_CONTRIB b/debian/checksendmail/BSDI_CONTRIB
new file mode 100644
index 0000000..97871d5
--- /dev/null
+++ b/debian/checksendmail/BSDI_CONTRIB
@@ -0,0 +1,18 @@
+Software Package:
+ checksendmail
+
+Release/Version:
+ Dated 7/11/90.
+
+Retrieved from:
+ N/A.
+
+Bug reports:
+ This software package is maintained by the software contributor,
+ not BSDI. Please send any bug reports to both support@BSDI.COM
+ and polk@bsdi.com.
+
+Comments:
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+Modifications to this version made by BSDI:
diff --git a/debian/checksendmail/CVS/Entries b/debian/checksendmail/CVS/Entries
new file mode 100644
index 0000000..692e38d
--- /dev/null
+++ b/debian/checksendmail/CVS/Entries
@@ -0,0 +1,5 @@
+/BSDI_CONTRIB/1.1/Mon Jan 22 10:57:27 1996 Tue Oct 24 17:29:51 1995//
+/Makefile/1.3/Mon Jan 22 10:57:28 1996 Fri Jan 6 22:34:35 1995//
+/address.resolve/1.1.1.1/Mon Jan 22 10:57:28 1996 Thu Jan 13 14:15:30 1994//
+/checksendmail.8/1.1.1.1/Mon Jan 22 10:57:28 1996 Thu Jan 13 14:15:31 1994//
+/checksendmail.perl/1.1.1.1/Mon Jan 22 10:57:29 1996 Thu Jan 13 14:15:31 1994//
diff --git a/debian/checksendmail/CVS/Repository b/debian/checksendmail/CVS/Repository
new file mode 100644
index 0000000..b300606
--- /dev/null
+++ b/debian/checksendmail/CVS/Repository
@@ -0,0 +1 @@
+/master/contrib/checksendmail
diff --git a/debian/checksendmail/Makefile b/debian/checksendmail/Makefile
new file mode 100644
index 0000000..101ba4e
--- /dev/null
+++ b/debian/checksendmail/Makefile
@@ -0,0 +1,15 @@
+# BSDI $Id: Makefile,v 1.3 1995/01/07 05:34:35 donn Exp $
+
+MAN8= checksendmail.0
+
+all checksendmail: ${MAN8}
+
+clean depend tags:
+
+install: maninstall
+ install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ ${.CURDIR}/checksendmail.perl ${DESTDIR}${BINDIR}/checksendmail
+ install -c -o ${BINOWN} -g ${BINGRP} -m 0444 \
+ ${.CURDIR}/address.resolve ${DESTDIR}/usr/contrib/lib/
+
+.include <bsd.prog.mk>
diff --git a/debian/checksendmail/address.resolve b/debian/checksendmail/address.resolve
new file mode 100644
index 0000000..01f3011
--- /dev/null
+++ b/debian/checksendmail/address.resolve
@@ -0,0 +1,27 @@
+
+# BSDI $Id: address.resolve,v 1.1.1.1 1994/01/13 21:15:30 polk Exp $
+
+# Sample address resolution file for checksendmail(8)
+
+# local addresses
+user
+user@hilltop
+user@hilltop.BSDI.COM
+hilltop!polk
+
+# within-domain addresses
+user@bsdi.com
+user@ibapah
+user@ibapah.bsdi.com
+ibapah!user
+
+# faraway addresses
+user@xxxxxxx.com
+user@xxxxxxx.dom
+site!user
+
+# addresses with routing, etc.
+site1!site2!user
+user@xxxxxxx.dom@bar.dom
+site!user@xxxxxxx.dom
+site!user@uunet.uu.net
diff --git a/debian/checksendmail/checksendmail.8 b/debian/checksendmail/checksendmail.8
new file mode 100644
index 0000000..b129c35
--- /dev/null
+++ b/debian/checksendmail/checksendmail.8
@@ -0,0 +1,223 @@
+.\" BSDI $Id: checksendmail.8,v 1.1.1.1 1994/01/13 21:15:31 polk Exp $
+.Dd January 12, 1994
+.Dt CHECKSENDMAIL 8
+.Os
+.Sh NAME
+.Nm checksendmail
+.Nd verify sendmail address transformations.
+.Sh SYNOPSIS
+.Nm checksendmail
+.Op Fl C Ar file.cf
+.Op Fl r Ar resolve
+.Op Fl T Ar test.address
+.Op Fl b Ar sendmail_binary
+.Sh DESCRIPTION
+.Pp
+The
+.Nm checksendmail
+program is a
+.Xr perl
+script that aids the testing of
+.Xr sendmail 8 's
+various configuration files.
+.Nm checksendmail
+passes typical addresses (supplied in input files) through
+.Xr sendmail
+and prints the results of the resolution and transformation routines.
+.Pp
+The input files contain a list of addresses, one per line.
+For example:
+.Bd -literal -offset indent
+user
+user@site
+user@site.com
+.Ed
+.Pp
+The input file can contain comments started with a
+.Em #
+and blank lines.
+.Sh OPTIONS
+.Pp
+.Bl -tag -width Fl -compact -offset left
+.It Fl C Ar file.cf
+Use the
+.Xr sendmail
+configuration file
+.Ar file.cf
+instead of the default
+.Pa /etc/sendmail.cf
+file.
+.It Fl r Ar resolve
+Use
+.Ar resolve
+as the input file for the addresses to be used for mail resolving. Defaults
+to
+.Ar address.resolve .
+.It Fl T Ar test.address
+Use
+.Ar test.address
+as the single address to test. Cannot be used in conjunction with
+file setting flags.
+.It Fl B Ar sendmail_binary
+Use the specified
+.Ar sendmail_binary
+as the path to invoke sendmail (instead of
+.Pa /usr/sbin/sendmail ) .
+.El
+.Sh EXAMPLES
+.Pp
+The following command will pass the addresses in
+.Ar address.resolve
+through
+.Xr sendmail
+using the configuration information in
+.Ar myconfig.cf .
+.Bd -literal -offset left
+example% cat address.resolve
+user
+user@site
+user@site.com
+example% checksendmail \-C myconfig.cf
+config file: myconfig.cf resolve file: address.resolve
+towhom file: address.resolve fromwhom file: address.resolve
+Mail address resolution
+user --(ether )--> user[rmtc]
+user@site --(ether )--> user@site[rmtc]
+user@site.com --(ether )--> user@site.com[rmtc]
+`To' address transformations for mailer ether:
+user ----> user
+user@site ----> user@site
+user@site.com ----> user@site.com
+`From' address transformations for mailer ether:
+user ----> user
+user@site ----> user
+user@site.com ----> user
+.Ed
+.Pp
+The first section of the output shows how the addresses in the input
+files are resolved by
+.Xr sendmail 8 .
+Consider the following output line:
+.Pp
+.Dl user@site.com --(ether )--> user@site.com[rmtc]
+.Pp
+The input address
+.Em user@site.com
+resolves to use the
+.Em ether
+mailer. That mailer is directed to send the mail to
+to the user
+.Em user@site.com
+at site
+.Em rmtc
+(as indicated in the square brackets).
+.Pp
+The two later sections of output show how the addresses specified as
+the
+.Em To
+and
+.Em From
+address are transformed in the text of the
+headers. In the example above, the
+.Em To
+addresses are untouched.
+The
+.Em From
+addresses, however, all lose their machine information on
+the way through the mailer:
+.Pp
+.Dl user@site ----> user
+.Pp
+This may be desirable when using a configuration file on a
+workstation which is to be hidden as a mailhost from the rest of the
+network.
+.Pp
+The following is a set of addresses used at one site for the purposes of
+testing address resolution. Comments after the addresses detail why
+particular addresses are present:
+.Bl -tag -width "user@machine.com" -compact -offset indent
+.It user
+Standard trivial address
+.It user@rmtc
+qualified at one level
+.It user@rmtc.central
+qualified at two levels
+.It user@rmtc.central.sun.com
+qualified all the way
+.It rmtc!user
+local but specified as uucp
+.It user@summit
+a workstation (normally delivered locally, though)
+.It user@summit.central
+same but more qualified
+.It user@summit.central.sun.com
+same but fully qualified
+.It summit!user
+same but specified as uucp
+.It user@prisma
+Backward compatibility tests
+.It user@prisma.com
+.It prisma!user
+.It user@central
+Superior domain testing
+.It user@machine.central
+more qualified, but unknown
+.It user@summit.central
+more qualified and known
+.It user@eng
+name in faraway domain
+.It user@machine.eng
+unknown machine in faraway domain
+.It user@summit.eng
+local machine, far away domain
+.It user@hoback
+far away machine
+.It user@machine
+apparently local but unknown machine
+.It user@sun.com
+Standard trivial address
+.It user@machine.dom.sun.com
+fully qualified but unknown machine
+.It user@foo.com
+standard, known, really far away domain
+.It user@foo.dom
+standard, unknown, really far away domain
+.It site!user
+Single level uucp
+.It site1!site2!user
+Double level uucp
+.It user@foo.dom@bar.dom
+Trickier address
+.It site!user@foo.dom
+Mixed uucp/domain
+.It site!user@uunet.uu.net
+Mixed double uucp/domain
+.El
+.Sh NOTES
+Note that
+.Nm checksendmail
+is a
+.Xr perl
+script. If your site does not have
+.Xr perl 1 ,
+it can be obtained via anonymous
+.Xr ftp
+from
+.Em ftp.uu.net .
+.Pp
+.Xr sendmail
+requires that the user have access to directory specified by the
+.Em OQ
+parameter in the configuration file (normally
+.Pa /usr/spool/mqueue ) .
+.Nm checksendmail
+verifies that the user has access to this directory before allowing the
+test to continue.
+.Sh AUTHORS
+.Bd -literal
+Gene Kim
+Rob Kolstad
+Jeff Polk
+.Ed
+.Sh "SEE ALSO"
+.Xr sendmail 8
diff --git a/debian/checksendmail/checksendmail.perl b/debian/checksendmail/checksendmail.perl
new file mode 100644
index 0000000..14f4c14
--- /dev/null
+++ b/debian/checksendmail/checksendmail.perl
@@ -0,0 +1,383 @@
+#!/usr/bin/perl
+
+# BSDI $Id: checksendmail.perl,v 1.1.1.1 1994/01/13 21:15:31 polk Exp $
+
+# checksendmail
+#
+# The checksendmail program is a perl script that aids the testing
+# of sendmail's various configuration filse. checksendmail
+# passes typical addresses (supplied in input files) through
+# sendmail and prints the result of the resolution and
+# transformation routines.
+#
+# Gene Kim & Rob Kolstad & Jeff Polk, 7/11/90
+
+# -- -C config file
+# -- -r resolve_addresses_file
+# -- -T test one address
+# -- -b sendmail binary
+
+# XXX deficiencies: ``/etc/sendmail'' should be a parameter
+
+# defaults:
+ $resolve = "address.resolve";
+ $cffile = "/etc/sendmail.cf";
+ $sendmail = "/usr/sbin/sendmail";
+
+# Pre-create tmp files (so can use safely)
+use Fcntl;
+foreach ("/tmp/csm$$", "/tmp/csm.in$$") {
+ die "Can't pre-create $_" unless sysopen(T,$_,O_RDWR|O_CREAT|O_EXCL,0600) and close(T);
+}
+
+sub usage {
+ die "Usage: checksendmail [-C cffile.cf] [-r resolve_addrs_file [-T one\@test.addr\n";
+}
+
+for (unshift (@ARGV, "XX"); $#ARGV > 0; shift ARGV) {
+ if ($ARGV[1] eq "-C")
+ {
+ shift @ARGV;
+ if ($#ARGV >= 1) {$cffile = $ARGV[1]; }
+ else { &usage(); }
+ }
+ elsif ($ARGV[1] eq "-r")
+ {
+ if ($setfile & 1) { die "Can only set `resolve' once"; }
+ shift @ARGV;
+ if ($#ARGV < 1) { &usage(); }
+ $resolve = $ARGV[1];
+ $setfile += 1;
+ }
+ elsif ($ARGV[1] eq "-T")
+ {
+ if ($setfile) { die "Can't set other files and use -T"; }
+ shift @ARGV;
+ if ($#ARGV < 1) { &usage(); }
+ open (OUT, ">/tmp/csm.in$$") ||
+ die "Can't open >/tmp/csm.in$$";
+ $resolve = "/tmp/csm.in$$";
+ print OUT "$ARGV[1]\n";
+ close (OUT);
+ $setfile = 7;
+ }
+ elsif ($ARGV[1] eq "-b")
+ {
+ shift @ARGV;
+ if ($#ARGV >= 1) {$sendmail = $ARGV[1]; }
+ else { &usage(); }
+ }
+ else { &usage(); }
+}
+
+if (!-e $cffile) { die "Can't find configuration file $cffile\n"; }
+if (!-e $resolve) { die "Can't find name file $resolve\n"; }
+
+# make sure the user can access the ../mqueue directory
+
+$maildir = `grep ^OQ $cffile`;
+chop $maildir;
+$maildir =~ s/^OQ//;
+if ((!-r $maildir) || (!-x $maildir) || (!-w $maildir)) {
+ warn "checksendmail: can't access $maildir! trying anyway...\n";
+}
+
+chop($hostname = `hostname`);
+chop($pwd = `pwd`);
+print "system: $hostname\t\tcurrent dir: $pwd\n";
+print "config file: $cffile\t\tresolve file: $resolve\n";
+
+sub handler { # 1st argument is signal name
+ local($sig) = @_;
+ print STDERR "Caught a SIG$sig--shutting down\n";
+ unlink("/tmp/csm$$") || die "Can't unlink /tmp/csm$$";
+ unlink("/tmp/csm.in$$");
+ exit(0);
+}
+
+$SIG{'INT'} = 'handler';
+$SIG{'QUIT'} = 'handler';
+
+
+# glean the mailers used from the rule 0 tests
+
+sub parseresolve
+{
+ while (<MAIL>)
+ {
+ if (/^ADDRESS TEST MODE/) { next; }
+ if (/^Enter <ruleset>/) { next; }
+ if (/^>/) # INPUT LINE! (and last output is done)
+ {
+ chop;
+ if ($prevline) { # OUTPUT LINE!
+ &printparseresolve;
+ }
+ s/> *[0-9,]* *//g;
+ s/.*input: *//;
+ s/ //g;
+ s/"//g;
+ $input = $_;
+ }
+ else { chop; }
+ $prevline = $_;
+ }
+ &printparseresolve;
+}
+
+sub printparseresolve {
+ $prevline =~ s/.*returns: *//;
+ $prevline =~ s/"//g;
+ $prevline =~ s/ //g;
+ # Don't strip spaces off error messages
+ $prevline =~ s/ *([.!%<>]) */$1/g;
+ $prevline =~ s/ +([;?\$])/$1/g;
+ $prevline =~ s/([#\@:]) +/$1/g;
+
+# non-Sun test mode delimiters -> easily-readable style
+# Mark Sausville, MIT Media Laboratory, saus@media-lab.media.mit.edu
+ $prevline =~ s/\^V/\$#/;
+ $prevline =~ s/\^W/\$@/;
+ $prevline =~ s/\^X/\$:/;
+
+ #### $#ether$@sun-barr.Ebay.Sun.COM$:site!user@uunet.uu.NET
+ @t = split( '\$', $prevline);
+ $address = "XXX";
+ $remote = "XXX";
+ $mailer = "XXX";
+ for ($i = 1; $i <= $#t; $i++)
+ {
+ if (substr($t[$i], 0, 1) eq ":")
+ { $address = substr($t[$i], 1,999); }
+ if (substr($t[$i], 0, 1) eq "@")
+ { $remote = substr($t[$i], 1,999); }
+ if (substr($t[$i], 0, 1) eq "#")
+ { $mailer = substr($t[$i], 1,999);
+ $mailer =~ tr/A-Z/a-z/; }
+ }
+ printf("%-27.27s --(%-6.6s)--> %s[%s]\n", $input, $mailer,
+ $address, $remote);
+ if ($mailer ne "XXX") { $themailers{$mailer}.="$input ";}
+}
+
+# Parse output of sendmail name resolution
+
+sub parseaddress
+{
+## ADDRESS TEST MODE
+## Enter <ruleset> <address>
+## > rewrite: ruleset 3 input: "user"
+
+ open(MAIL, $_[0]) || die "Can't open $_[0]...\n";
+ local ($k, $address, $prevline, $mailer, $remote, $input);
+ print $_[1]; # the title
+
+ $done = 0;
+ while (<MAIL>)
+ {
+ if (/^> *$/) { $done = 1; }
+ if (/^ADDRESS TEST MODE/) { next; }
+ if (/^Enter <ruleset>/) { next; }
+ chop;
+ if (/^>/) # INPUT LINE! (and last output is done)
+ {
+ if ($prevline) { # OUTPUT LINE!
+ $prevline =~ s/.*returns: *//;
+ $prevline =~ s/"//g;
+ $prevline =~ s/ //g;
+#> rewrite: ruleset 3 input: "site" "!" "user" "@" "uunet" "." "uu" "." "net"
+#rewrite: ruleset 8 input: "site" "!" "user" "@" "uunet" "." "uu" "." "net"
+#>
+ printf("%-27.27s ----> %s\n", $input, $prevline);
+ }
+ s/> *[0-9,]* *//g;
+ s/.*input: *//;
+ s/ //g;
+ s/"//g;
+ $input = $_;
+ }
+ last if $done;
+ $prevline = $_;
+ }
+ close(MAIL);
+}
+
+
+# pass names from resolve files to sendmail
+
+open(IN, $resolve) || die "can't open $resolve\n";
+open(OUT, ">/tmp/csm$$") || die "can't open >/tmp/csm$$\n";
+while (<IN>)
+{
+ /^$/ && next;
+ /^#/ && next;
+ print OUT "3,0 $_";
+ chop;
+ $allinput .= " $_";
+}
+close(OUT);
+close(IN);
+$sendmailprog = "$sendmail -bt -C$cffile < /tmp/csm$$|";
+open(MAIL, $sendmailprog) || die "can't exec $sendmailprog...\n";
+print "Mail address resolution (rule 0)\n\n";
+&parseresolve();
+
+# calculate $f
+ $sendmailprog = "|$sendmail -bt -C$cffile > /tmp/csm$$";
+ open (OUT, $sendmailprog);
+ open (IN, $resolve);
+ $rules = "3,1,4";
+ while (<IN>) {
+ chop;
+ /^$/ && next;
+ /^#/ && next;
+ $address = $_;
+ print OUT "$rules $address\n";
+ }
+ print OUT "\n"; # stuff last line into sendmail
+ close(IN);
+ close(OUT);
+ &parseaddress ("/tmp/csm$$", "\n\n\$f address header transformations\n\n");
+
+# Get the R= and S= special rulesets from the configuration
+
+open(FID, "grep ^M $cffile|");
+while (<FID>)
+{
+# Mether, P=[IPC], F=msDFMueCX, S=11, R=21, A=IPC $h
+ chop;
+ $thisline = $_; $thisline =~ s/M//; $thisline =~ s/,.*//;
+ $thisline =~ tr/A-Z/a-z/;
+ $sendrule = $_; $sendrule =~ s/.*S=//; $sendrule =~ s/,.*//;
+ if ($sendrule=~q!/!) {
+ ($esendrule, $hsendrule) = split (q!/!, $sendrule);
+ }
+ else { $esendrule = $hsendrule = $sendrule; }
+ $recvrule = $_; $recvrule =~ s/.*R=//; $recvrule =~ s/,.*//;
+ if ($recvrule=~q!/!) {
+ ($erecvrule, $hrecvrule) = split (q!/!, $recvrule);
+ }
+ else { $erecvrule = $hrecvrule = $recvrule; }
+ $esendrules{$thisline} = $esendrule;
+ $hsendrules{$thisline} = $hsendrule;
+ $erecvrules{$thisline} = $erecvrule;
+ $hrecvrules{$thisline} = $hrecvrule;
+}
+close(FID);
+
+# pass names from various mailers through sendmail
+
+foreach $i (keys %themailers)
+{
+ $sendmailprog = "|$sendmail -bt -C$cffile > /tmp/csm$$";
+ if ($erecvrules{$i} == 0) {
+ print "\n\nCan't find recv rule for `$i', skipping this mailer <-------------------\n";
+ next;
+ }
+ open (OUT, $sendmailprog);
+ @namelist = split(/ /, $allinput);
+ $rules = "3,2,$erecvrules{$i},4";
+ foreach (@namelist) {
+ print OUT "$rules $_\n";
+ }
+ print OUT "\n"; # stuff last line into sendmail
+ close(OUT);
+ $note = "";
+ if ($erecvrules{$i} eq $hrecvrules{$i}) { $note = "and header "; }
+ &parseaddress ("/tmp/csm$$", "\n\n`To' envelope ${note}address transformations for mailer $i [$rules]:\n\n");
+}
+foreach $i (keys %themailers)
+{
+ $sendmailprog = "|$sendmail -bt -C$cffile > /tmp/csm$$";
+ if ($hrecvrules{$i} == 0) {
+ print "\n\nCan't find recv rule for `$i', skipping this mailer <-------------------\n";
+ next;
+ }
+ if ($hrecvrules{$i} ne $erecvrules{$i}) {
+ open (OUT, $sendmailprog);
+ @namelist = split(/ /, $allinput);
+ $rules = "3,2,$hrecvrules{$i},4";
+ foreach (@namelist) {
+ print OUT "$rules $_\n";
+ }
+ print OUT "\n"; # stuff last line into sendmail
+ close(OUT);
+ &parseaddress ("/tmp/csm$$", "\n\n`To' header address transformations for mailer $i [$rules]:\n\n");
+ }
+}
+
+# pass names from various mailers through sendmail
+foreach $i (keys %themailers)
+{
+ $sendmailprog = "|$sendmail -bt -C$cffile > /tmp/csm$$";
+ if ($esendrules{$i} == 0) {
+ print "\n\nCan't find send rule for `$i', skipping this mailer <-------------------\n";
+ next;
+ }
+ open (OUT, $sendmailprog);
+ open (IN, $resolve);
+ $rules = "3,1,$esendrules{$i},4";
+ while (<IN>) {
+ chop;
+ /^$/ && next;
+ /^#/ && next;
+ $address = $_;
+ print OUT "$rules $address\n";
+ }
+ print OUT "\n"; # stuff last line into sendmail
+ close(IN);
+ close(OUT);
+ $note = "";
+ if ($esendrules{$i} eq $hsendrles{$i}) {$note = "and header ";}
+ &parseaddress ("/tmp/csm$$", "\n\n`From' envelope ${note}address transformations for mailer $i [$rules]:\n\n");
+}
+foreach $i (keys %themailers)
+{
+ $sendmailprog = "|$sendmail -bt -C$cffile > /tmp/csm$$";
+ if ($hsendrules{$i} == 0) {
+ print "\n\nCan't find send rule for `$i', skipping this mailer <-------------------\n";
+ next;
+ }
+ open (OUT, $sendmailprog);
+ open (IN, $resolve);
+ $rules = "3,1,$hsendrules{$i},4";
+ while (<IN>) {
+ chop;
+ /^$/ && next;
+ /^#/ && next;
+ $address = $_;
+ print OUT "$rules $address\n";
+ }
+ print OUT "\n"; # stuff last line into sendmail
+ close(IN);
+ close(OUT);
+ &parseaddress ("/tmp/csm$$", "\n\n`From' address header transformations for mailer $i [$rules]:\n\n");
+}
+foreach $i (keys %themailers)
+{
+ $sendmailprog = "|$sendmail -bt -C$cffile > /tmp/csm$$";
+ if ($esendrules{$i} == 0) {
+ print "\n\nCan't find send rule for `$i', skipping this mailer <-------------------\n";
+ next;
+ }
+ open (OUT, $sendmailprog);
+ open (IN, $resolve);
+ $rules = "3,1,4,3,1,$hsendrules{$i},4"; # XXX esendrules? book p. 431???
+ while (<IN>) {
+ chop;
+ /^$/ && next;
+ /^#/ && next;
+ $address = $_;
+ print OUT "$rules $address\n";
+ }
+ print OUT "\n"; # stuff last line into sendmail
+ close(IN);
+ close(OUT);
+ $note = "";
+ if ($esendrules{$i} eq $hsendrles{$i}) {$note = "and header ";}
+ &parseaddress ("/tmp/csm$$", "\n\n\$g address transformations for mailer $i [$rules]:\n\n");
+}
+
+unlink("/tmp/csm$$") || die "Can't unlink /tmp/csm$$";
+unlink("/tmp/csm.in$$");
+
diff --git a/debian/configure b/debian/configure
new file mode 100644
index 0000000..37059e1
--- /dev/null
+++ b/debian/configure
@@ -0,0 +1,8658 @@
+#! /bin/sh
+# From configure.ac Revision: 8.12.7 .
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.53 for Sendmail 8.12.7.
+#
+# Report bugs to <bug/reportbug or sendmail@packages.debian.org>.
+#
+# #
+# # $Sendmail$
+# # from Sendmail: ./configure.ac,v 8.12.7 2003-01-20 15:00:00
+# #
+# cat <<EOF
+#
+# Copyright (c) 1998-2003 Richard Nelson. All Rights Reserved.
+#
+# Generated by Autoconf 2.53 for Sendmail 8.12.7
+#
+# Debian configure script for building Sendmail
+# Note: this file supports Sendmail 8.7.6 - 8.12.7
+# and has been tested on autoconf 2.12, 2.13, 2.50, 2.52, 2.53
+#
+#
+# EOF
+#
+#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# NLS nuisances.
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
+ { $as_unset LANG || test "${LANG+set}" != set; } ||
+ { LANG=C; export LANG; }
+(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
+ { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
+ { LC_ALL=C; export LC_ALL; }
+(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
+ { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
+ { LC_TIME=C; export LC_TIME; }
+(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
+ { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
+ { LC_CTYPE=C; export LC_CTYPE; }
+(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
+ { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
+ { LANGUAGE=C; export LANGUAGE; }
+(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
+ { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
+ { LC_COLLATE=C; export LC_COLLATE; }
+(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
+ { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
+ { LC_NUMERIC=C; export LC_NUMERIC; }
+(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
+ { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
+ { LC_MESSAGES=C; export LC_MESSAGES; }
+
+
+# Name of the executable.
+as_me=`(basename "$0") 2>/dev/null ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conftest.sh
+ echo "exit 0" >>conftest.sh
+ chmod +x conftest.sh
+ if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conftest.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME='Sendmail'
+PACKAGE_TARNAME='sendmail'
+PACKAGE_VERSION='8.12.7'
+PACKAGE_STRING='Sendmail 8.12.7'
+PACKAGE_BUGREPORT='bug/reportbug or sendmail@packages.debian.org'
+
+ac_unique_file="./build/rules.in"
+ac_default_prefix=/usr
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures Sendmail 8.12.7 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of Sendmail 8.12.7:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-regex=.........Allow REGEX maps [auto]
+ --enable-ndbm=..........Allow NDBM maps [auto]
+ --enable-newdb=.........Allow NEWDB maps [auto]
+ --enable-nis=...........Allow NIS maps [auto]
+ --enable-nisplus=.......Allow NISPLUS maps [auto]
+ --enable-ldap=..........Allow LDAP maps [auto]
+ --enable-hesiod=........Allow HESIOD maps [auto]
+ --enable-tcpd=..........Allow TCP wrappers [auto]
+ --enable-bind=..........Allow BIND usage [auto]
+ --enable-ipv6=..........Allow IPv6 usage [auto]
+ --enable-maillock=......Allow maillock [auto]
+ --enable-milter=........Allow milter [auto]
+ --enable-sfio=..........Allow SFIO usage [auto]
+ --enable-auth=..........Allow SMTP auth [auto]
+ --enable-tls=...........Allow TLS/SSL [auto]
+ --enable-shm=...........Allow shared memory [auto]
+ --enable-doc=...........Build sendmail-doc pkg
+ --enable-dev=...........Build libmilter-dev pkg
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-buildtree=.......Build directory [.]
+ --with-docdir=..........Document directory [PREFIX/doc]
+ --with-revision=........Package revision ['']
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <bug/reportbug or sendmail@packages.debian.org>.
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+Sendmail configure 8.12.7
+generated by GNU Autoconf 2.53
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+
+#
+# $Sendmail$
+# from Sendmail: ./configure.ac,v 8.12.7 2003-01-20 15:00:00
+#
+cat <<EOF
+
+ Copyright (c) 1998-2003 Richard Nelson. All Rights Reserved.
+
+ Generated by Autoconf 2.53 for Sendmail 8.12.7
+
+ Debian configure script for building Sendmail
+ Note: this file supports Sendmail 8.7.6 - 8.12.7
+ and has been tested on autoconf 2.12, 2.13, 2.50, 2.52, 2.53
+
+
+EOF
+
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by Sendmail $as_me 8.12.7, which was
+generated by GNU Autoconf 2.53. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell meta-characters.
+ac_configure_args=
+ac_sep=
+for ac_arg
+do
+ case $ac_arg in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n ) continue ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ ac_sep=" " ;;
+ esac
+ # Get rid of the leading space.
+done
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core core.* *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_version='2.53';
+ac_aux_dir=
+for ac_dir in ./build $srcdir/./build; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ./build $srcdir/./build" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in ./build $srcdir/./build" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+
+SM_VERS='8.12.7';
+SM_DATE='2003-01-20 15:00:00';
+SM_MINVERS='8.7.6';
+SM_MAXVERS='8.12.7';
+SM_CPYRT='2003';
+
+
+
+
+
+
+#-------------------------------------------------------------------
+# Determine date/time of build
+#-------------------------------------------------------------------
+#sm_date=[`date --iso-8601=seconds`]; # <== Not valid on older systems !!!
+sm_date=`date +%Y-%m-%dT%H:%M:%S%z`;
+sm_utc=$(expr "$sm_date" : '.*T.*\([+-].*\)');
+sm_time=$(expr "$sm_date" : '.*T\(.*\)[+-]');
+sm_date=$(expr "$sm_date" : '\(.*\)T');
+
+
+#-------------------------------------------------------------------
+# Determine sendmail version
+#-------------------------------------------------------------------
+if test -f ../build-tree/*/sendmail/version.c; then
+ version_file='../build-tree/*/sendmail/version.c';
+ sm_version=`sed -ne "s/char[[:space:]]*Version\[\] = \"\([^\"]*\)\";/\1/p" $version_file`;
+else
+ curr_dir=$(echo `pwd` | sed -e 's/\/debian$//' -);
+ version=$(expr "${curr_dir}" : '.*-\([0-9.].*\)');
+ beta_version=$(expr "${curr_dir}" : '.*+\([0-9.].*\)');
+ if test -z "$beta_version"; then
+ sm_version="$version";
+ else
+ sm_version="$beta_version";
+ fi;
+ fi;
+if test -z "$sm_version"; then
+ version_file='./build/version.c';
+ if test -f $version_file; then
+ sm_version=`sed -ne "s/char[[:space:]]*Version\[\] = \"\([^\"]*\)\";/\1/p" $version_file`;
+ fi;
+ fi;
+
+if test -z "$sm_version"; then
+ { { echo "$as_me:$LINENO: error: could not determine Sendmail version" >&5
+echo "$as_me: error: could not determine Sendmail version" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+PACKAGE_VERSION="${sm_version}";
+PACKAGE_STRING="${PACKAGE_NAME} ${PACKAGE_VERSION}";
+
+#
+# break the version into pieces for easier comparisons
+# v,r = separate components (8.12.0.Beta7 = 8 12)
+# major = 1st two components (8.9.3 -> 8.9)
+# minor = last component (8.9.3 -> 3)
+# beta = suffix for beta version (8.12.0.Beta7 -> 7)
+# math = for numeric (<, >=, etc.) comparisons
+# 8.12.7 = 527367 (8.12 = 527360)
+# 8.11.6 = 527110 (8.11 = 527104)
+# 8.10.2 = 526850 (8.10 = 526848)
+# 8.9.3 = 526595 (8.9 = 526592)
+# 8.8.8 = 526344 (8.8 = 526336)
+# 8.7.6 = 526086 (8.7 = 526080)
+v2i () {
+ sm_version_test=`expr 65536 \* $(expr "$1" : '\([0-9]*\)') + \
+ 256 \* $(expr "$1" : '[0-9]*\.\([0-9]*\)') + \
+ $(expr "$1" : '[0-9]*\.[0-9]*\.\([0-9]*\)')`;
+ #echo "v2i($1)=$sm_version_test";
+ };
+i2v () {
+ val=$1;
+ major=`expr $val / 65536`;
+ val=`expr $val % 65536`;
+ minor=`expr $val / 256`;
+ val=`expr $val % 256`;
+ result="$major.$minor.$val";
+ #echo "i2v($1)=$result";
+ #return $result;
+ };
+sm_version_v=`expr $sm_version : '\([0-9]*\)'`;
+sm_version_r=`expr $sm_version : '[0-9]*\.\([0-9]*\)'`;
+sm_version_major="$sm_version_v.$sm_version_r";
+sm_version_minor=`expr $sm_version : '[0-9]*\.[0-9]*\.\([0-9]*\)'`;
+sm_version_beta=`expr $sm_version : '[0-9]*\.[0-9]*\.[0-9]*\.Beta\([0-9]*\)'`;
+sm_version_math=`expr 65536 \* $sm_version_v \
+ + 256 \* $sm_version_r \
+ + $sm_version_minor`;
+
+
+
+
+#-------------------------------------------------------------------
+# Configuration for Sendmail
+#-------------------------------------------------------------------
+#checks for programs
+#checks for libraries
+#checks for header files
+#checks for typedefs
+#checks for structures
+#checks for compiler characteristics
+#checks for library functions
+#checks for system services
+
+#-------------------------------------------------------------------
+# Initialize variables
+#-------------------------------------------------------------------
+#
+# Initialize variables - value is one of:
+# no: don't even try to include support for
+# yes: require support for
+# auto: support if present, warn if not
+#
+#-------------------------------------------------------------------
+
+# Check whether --with-buildtree or --without-buildtree was given.
+if test "${with_buildtree+set}" = set; then
+ withval="$with_buildtree"
+ buildtree="$withval"
+else
+ docdir='.'
+fi;
+
+# Check whether --with-docdir or --without-docdir was given.
+if test "${with_docdir+set}" = set; then
+ withval="$with_docdir"
+ docdir="$withval"
+else
+ docdir='${prefix}/doc'
+fi;
+
+# Check whether --with-revision or --without-revision was given.
+if test "${with_revision+set}" = set; then
+ withval="$with_revision"
+ sm_revision="$withval"
+else
+ sm_revision=''
+fi;
+# Check whether --enable-regex or --disable-regex was given.
+if test "${enable_regex+set}" = set; then
+ enableval="$enable_regex"
+ sm_enable_regex="$enableval"
+else
+ sm_enable_regex=auto
+fi;
+# Check whether --enable-ndbm or --disable-ndbm was given.
+if test "${enable_ndbm+set}" = set; then
+ enableval="$enable_ndbm"
+ sm_enable_ndbm="$enableval"
+else
+ sm_enable_ndbm=auto
+fi;
+# Check whether --enable-newdb or --disable-newdb was given.
+if test "${enable_newdb+set}" = set; then
+ enableval="$enable_newdb"
+ sm_enable_newdb="$enableval"
+else
+ sm_enable_newdb=auto
+fi;
+# Check whether --enable-nis or --disable-nis was given.
+if test "${enable_nis+set}" = set; then
+ enableval="$enable_nis"
+ sm_enable_nis="$enableval"
+else
+ sm_enable_nis=auto
+fi;
+# Check whether --enable-nisplus or --disable-nisplus was given.
+if test "${enable_nisplus+set}" = set; then
+ enableval="$enable_nisplus"
+ sm_enable_nisplus="$enableval"
+else
+ sm_enable_nisplus=auto
+fi;
+# Check whether --enable-ldap or --disable-ldap was given.
+if test "${enable_ldap+set}" = set; then
+ enableval="$enable_ldap"
+ sm_enable_ldap="$enableval"
+else
+ sm_enable_ldap=auto
+fi;
+# Check whether --enable-hesiod or --disable-hesiod was given.
+if test "${enable_hesiod+set}" = set; then
+ enableval="$enable_hesiod"
+ sm_enable_hesiod="$enableval"
+else
+ sm_enable_hesiod=auto
+fi;
+# Check whether --enable-tcpd or --disable-tcpd was given.
+if test "${enable_tcpd+set}" = set; then
+ enableval="$enable_tcpd"
+ sm_enable_tcpd="$enableval"
+else
+ sm_enable_tcpd=auto
+fi;
+# Check whether --enable-bind or --disable-bind was given.
+if test "${enable_bind+set}" = set; then
+ enableval="$enable_bind"
+ sm_enable_bind="$enableval"
+else
+ sm_enable_bind=auto
+fi;
+# Check whether --enable-ipv6 or --disable-ipv6 was given.
+if test "${enable_ipv6+set}" = set; then
+ enableval="$enable_ipv6"
+ sm_enable_ipv6="$enableval"
+else
+ sm_enable_ipv6=auto
+fi;
+# Check whether --enable-maillock or --disable-maillock was given.
+if test "${enable_maillock+set}" = set; then
+ enableval="$enable_maillock"
+ sm_enable_maillock="$enableval"
+else
+ sm_enable_maillock=auto
+fi;
+# Check whether --enable-milter or --disable-milter was given.
+if test "${enable_milter+set}" = set; then
+ enableval="$enable_milter"
+ sm_enable_milter="$enableval"
+else
+ sm_enable_milter=auto
+fi;
+# Check whether --enable-sfio or --disable-sfio was given.
+if test "${enable_sfio+set}" = set; then
+ enableval="$enable_sfio"
+ sm_enable_sfio="$enableval"
+else
+ sm_enable_sfio=auto
+fi;
+# Check whether --enable-auth or --disable-auth was given.
+if test "${enable_auth+set}" = set; then
+ enableval="$enable_auth"
+ sm_enable_auth="$enableval"
+else
+ sm_enable_auth=auto
+fi;
+# Check whether --enable-tls or --disable-tls was given.
+if test "${enable_tls+set}" = set; then
+ enableval="$enable_tls"
+ sm_enable_tls="$enableval"
+else
+ sm_enable_tls=auto
+fi;
+# Check whether --enable-shm or --disable-shm was given.
+if test "${enable_shm+set}" = set; then
+ enableval="$enable_shm"
+ sm_enable_shm="$enableval"
+else
+ sm_enable_shm=auto
+fi;
+# Check whether --enable-doc or --disable-doc was given.
+if test "${enable_doc+set}" = set; then
+ enableval="$enable_doc"
+ sm_enable_doc="$enableval"
+else
+ sm_enable_doc=auto
+fi;
+# Check whether --enable-dev or --disable-dev was given.
+if test "${enable_dev+set}" = set; then
+ enableval="$enable_dev"
+ sm_enable_dev="$enableval"
+else
+ sm_enable_dev=auto
+fi;
+
+#-------------------------------------------------------------------
+# Resolve variables for sendmail Makefiles and .m4 where
+# exec_prefix=${prefix} will not work...
+#-------------------------------------------------------------------
+#eval PACKAGE_VERSION="${PACKAGE_VERSION}"
+#eval PACKAGE_STRING="${PACKAGE_STRING}"
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+eval prefix="${prefix}";
+eval exec_prefix="${exec_prefix}";
+eval bindir="${bindir}";
+eval sbindir="${sbindir}";
+eval libexecdir="${libexecdir}";
+eval datadir="${datadir}";
+eval sysconfdir="${sysconfdir}";
+eval sharedstatedir="${sharedstatedir}";
+eval localstatedir="${localstatedir}";
+eval libdir="${libdir}";
+eval includedir="${includedir}";
+eval oldincludedir="${oldincludedir}";
+eval infodir="${infodir}";
+eval mandir="${mandir}";
+eval srcdir="${srcdir}";
+
+
+eval buildtree="${buildtree}";
+eval docdir="${docdir}";
+
+#-------------------------------------------------------------------
+# Determine Distribution and version to build for
+#-------------------------------------------------------------------
+sm_dist_name='';
+sm_dist_vers='';
+DEBIAN='';
+DEBIAN_DH='';
+echo "$as_me:$LINENO: checking for Debian" >&5
+echo $ECHO_N "checking for Debian... $ECHO_C" >&6
+if test ! -f /etc/debian_version ; then
+ DEBIAN='no';
+ echo "$as_me:$LINENO: result: \"$DEBIAN\"" >&5
+echo "${ECHO_T}\"$DEBIAN\"" >&6
+else
+ DEBIAN='yes';
+ sm_dist_name='Debian';
+ sm_dist_vers=`cat /etc/debian_version`;
+ # Determine which level of debhelper we're building with
+ DEBIAN_DH='1';
+ if test -x /usr/bin/dh_testversion; then
+ # Must run this test above the debian directory
+ if (cd .. && dh_testversion 4.1.0 2>/dev/null); then
+ DEBIAN_DH='4.1';
+ elif (cd .. && dh_testversion 4.0.0 2>/dev/null); then
+ DEBIAN_DH='4';
+ elif (cd .. && dh_testversion 3.0.0 2>/dev/null); then
+ DEBIAN_DH='3';
+ elif (cd .. && dh_testversion 2.0.40 2>/dev/null); then
+ DEBIAN_DH='2';
+ else
+ DEBIAN_DH='1';
+ fi;
+ fi;
+ if test -x /usr/bin/dpkg-architecture; then
+ eval `dpkg-architecture -s`;
+ fi;
+ sm_build_arch="$DEB_BUILD_ARCH"
+ sm_host_arch="$DEB_HOST_ARCH"
+
+
+
+
+ echo "$as_me:$LINENO: result: $DEBIAN, using debhelper v$DEBIAN_DH" >&5
+echo "${ECHO_T}$DEBIAN, using debhelper v$DEBIAN_DH" >&6
+ fi;
+
+#-------------------------------------------------------------------
+# Announce our presence...
+#-------------------------------------------------------------------
+
+echo ""
+echo "Autoconf ${ac_version} for Sendmail ${sm_version}${sm_revision} \
+on ${sm_dist_name} ${sm_dist_vers} ${sm_build_arch}/${sm_host_arch}.";
+echo ""
+
+#-------------------------------------------------------------------
+# Required programs
+# cc, cpp
+# install
+# egrep
+# std includes
+#-------------------------------------------------------------------
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$as_dir/$ac_word" ${1+"$@"}
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null;
+ ls a.out conftest 2>/dev/null;
+ ls a.* conftest.* 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;;
+ a.out ) # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5
+echo "$as_me: error: C compiler cannot create executables" >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ ''\
+ '#include <stdlib.h>' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+$ac_declaration
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_declaration
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <assert.h>
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <assert.h>
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+
+#-------------------------------------------------------------------
+# Variables used in site.config.m4.in to set corresponding Build vars
+#-------------------------------------------------------------------
+# Global
+sm_incdirs='';
+sm_mapdef='';
+sm_envdef='';
+sm_libs='';
+# editmap
+sm_editmap_envdef='';
+sm_editmap_libs='';
+# libmilter
+sm_libmilter_envdef='';
+sm_libmilter_libs='';
+# libsm
+sm_libsm_envdef='';
+sm_libsm_libs='';
+# libsmdb
+sm_libsmdb_envdef='';
+sm_libsmdb_libs='';
+# libsmutil
+sm_libsmutil_envdef='';
+sm_libsmutil_libs='';
+# mail.local
+sm_mail_local_envdef='';
+sm_mail_local_libs='';
+# mailstats
+sm_mailstats_envdef='';
+sm_mailstats_libs='';
+# makemap
+sm_makemap_envdef='';
+sm_makemap_libs='';
+# praliases
+sm_praliases_envdef='';
+sm_praliases_libs='';
+# rmail
+sm_rmail_envdef='';
+sm_rmail_libs='';
+# sendmail
+sm_sendmail_envdef='';
+sm_sendmail_libs='';
+# smrsh
+sm_smrsh_envdef='';
+sm_smrsh_libs='';
+# vacation
+sm_vacation_envdef='';
+sm_vacation_libs='';
+
+#-------------------------------------------------------------------
+# Auxilliary variables
+#-------------------------------------------------------------------
+sm_databases='';
+sm_features='';
+sm_badepends='';
+sm_depends='';
+sm_recommends='';
+sm_suggests='';
+sm_newdb_lib='';
+sm_ldap_lib='';
+sm_hesiod_parms='';
+sm_ffr='';
+sm_m4_ffr='';
+
+
+#-------------------------------------------------------------------
+# Override default/specified values
+#-------------------------------------------------------------------
+# Change pid from /var/run to /var/run/sendmail/mta to alleviate clutter
+sm_sendmail_envdef="$sm_sendmail_envdef \
+-D_PATH_SENDMAILPID=\\\"${localstatedir}/run/sendmail/mta/sendmail.pid\\\"";
+# Set paths for smrsh
+sm_smrsh_envdef="$sm_smrsh_envdef \
+-DCMDDIR=\\\"${sysconfdir}/mail/smrsh\\\"";
+sm_smrsh_envdef="$sm_smrsh_envdef -DPATH=\\\"/usr/bin:/bin\\\"";
+#
+# Everything we'll build on has strerror(3)
+sm_libsm_envdef="$sm_libsm_envdef -DHASSTRERROR=1";
+sm_sendmail_envdef="$sm_sendmail_envdef -DHASSTRERROR=1";
+#
+# The next two require a patch to {include/sm,sendmail,src}/conf.h
+# and would give duplicate definition warnings if left herein
+#sm_sendmail_envdef="$sm_sendmail_envdef -DUSESETEUID=1 -DHASGETUSERSHELL=1";
+sm_sendmail_envdef="$sm_sendmail_envdef -DHASFCHMOD=1 -DHASSETRLIMIT=1";
+#
+# flock() doens't work over NFS and there's a rumour of b0rkedness in
+# Linux 2.4.x kernels ;(
+sm_sendmail_envdef="$sm_sendmail_envdef -DHASFLOCK=0";
+#
+# version specific setup
+if test "$sm_version_major" = "8.12"; then
+ sm_sendmail_envdef="$sm_sendmail_envdef -DUSESETEUID=1 -DHASGETUSERSHELL=1";
+ #
+ # Note: There is a problem with both <=2.2.19 and <=2.4.2-acx in
+ # that setitimer() sometimes looses events, this is mentioned
+ # in the man page, but seems to hit even in non-pathologically
+ # heavy loading. So, we revert back to alarm() - which, thusfar
+ # has proven stable.
+ # Note: This actually seems to have been a sendmail issue fixed in 8.12.3
+ sm_libsm_envdef="$sm_libsm_envdef -DSM_CONF_SETITIMER=1";
+ #
+ # Note: this *only* for testing... there is a performance hit
+ #sm_libsm_envdef="$sm_libsm_envdef -DSM_OMIT_BOGUS_WARNINGS";
+ sm_ffr="$sm_ffr -D_FFR_MAX_FORWARD_ENTRIES=1";
+ sm_ffr="$sm_ffr -D_FFR_QUEUEDELAY=1";
+ sm_ffr="$sm_ffr -D_FFR_CONTROL_MSTAT";
+ sm_ffr="$sm_ffr -D_FFR_GROUPREADABLEAUTHINFOFILE";
+ sm_ffr="$sm_ffr -D_FFR_DAEMON_NETUNIX";
+ sm_ffr="$sm_ffr -D_FFR_SHM_STATUS";
+ sm_ffr="$sm_ffr -D_FFR_QUEUE_SCHED_DBG"; # Debugging....%%%%%%%%%%%%
+ sm_ffr="$sm_ffr -D_FFR_RHS";
+ sm_ffr="$sm_ffr -D_FFR_MAIL_MACRO";
+ sm_m4_ffr="$sm_m4_ffr define(\`_FFR_MAIL_MACRO')";
+ sm_ffr="$sm_ffr -D_FFR_NO_PIPE";
+ sm_ffr="$sm_ffr -D_FFR_QUARANTINE";
+ sm_mailstats_envdef="$sm_mailstats_envdef -D_FFR_QUARANTINE";
+ sm_vacation_envdef="$sm_vaction_envdef -D_FFR_RETURN_ADDR";
+elif test "$sm_version_major" = "8.11"; then
+ sm_vacation_envdef="$sm_vaction_envdef -D_FFR_DEBUG=1";
+ sm_vacation_envdef="$sm_vaction_envdef -D_FFR_LISTDB=1";
+ sm_ffr="$sm_ffr -D_FFR_TESTMODE_DROP_PRIVS=1";
+ sm_ffr="$sm_ffr -D_FFR_ADDR_TYPE=1";
+ sm_ffr="$sm_ffr -D_FFR_ARITH=1";
+ sm_ffr="$sm_ffr -D_FFR_QUEUE_FILE_MODE=1";
+ sm_ffr="$sm_ffr -D_FFR_MAX_FORWARD_ENTRIES=1";
+ sm_ffr="$sm_ffr -D_FFR_QUEUEDELAY=1";
+elif test "$sm_version_major" = "8.10"; then
+ sm_ffr="$sm_ffr -D_FFR_ADDR_TYPE=1";
+ sm_ffr="$sm_ffr -D_FFR_ARITH=1";
+ sm_ffr="$sm_ffr -D_FFR_QUEUE_FILE_MODE=1";
+ sm_ffr="$sm_ffr -D_FFR_MAX_FORWARD_ENTRIES=1";
+ sm_ffr="$sm_ffr -D_FFR_QUEUEDELAY=1";
+elif test "$sm_version_major" = "8.9"; then
+ sm_ffr="$sm_ffr -D_FFR_MAX_MIME_HEADER_LENGTH=1";
+ sm_ffr="$sm_ffr -D_FFR_MAX_HEADERS_LENGTH=1";
+ sm_ffr="$sm_ffr -D_FFR_MAXRCPT_OPTION=1";
+ sm_ffr="$sm_ffr -D_FFR_DSN_RRT_OPTION=1";
+ sm_ffr="$sm_ffr -D_FFR_CONTROL_SOCKET=1";
+ sm_ffr="$sm_ffr -D_FFR_TRUSTED_USER=1";
+ sm_ffr="$sm_ffr -D_FFR_MAP_SYSLOG=1";
+ sm_ffr="$sm_ffr -D_DONT_PROBE_INTERFACES_OPTION=1";
+ sm_ffr="$sm_ffr -D_FFR_PIDFILE_OPTION=1";
+ sm_ffr="$sm_ffr -D_FFR_DEADLETTERDROP_OPTION=1";
+ sm_ffr="$sm_ffr -D_FFR_QUEUE_FILE_MODE=1";
+ fi;
+
+# 8.12.5+
+v2i 8.12.5;
+if test $sm_version_math -ge $sm_version_test; then
+ :;
+else
+ sm_mail_local_envdef="$sm_mail_local_envdef \
+-D_PATH_MAILDIR=\\\"${localstatedir}/mail\\\"";
+ sm_rmail_envdef="$sm_rmail_envdef \
+-D_PATH_SENDMAIL=\\\"${sbindir}/sendmail\\\"";
+ sm_vacation_envdef="$sm_vacation_envdef \
+-D_PATH_SENDMAIL=\\\"${sbindir}/sendmail\\\"";
+ fi;
+
+# 8.12.0+
+v2i 8.12.0;
+if test $sm_version_math -ge $sm_version_test; then
+ :;
+else
+ :;
+ fi;
+
+# 8.11.0+
+v2i 8.11.0;
+if test $sm_version_math -ge $sm_version_test; then
+ :;
+else
+ sm_enable_tls=no;
+ fi;
+
+# 8.10.0+
+v2i 8.10.0;
+if test $sm_version_math -ge $sm_version_test; then
+ # SRCROUTE works quite well with glibc 2.1+ (should test for this...)
+ sm_sendmail_envdef="$sm_sendmail_envdef -DIP_SRCROUTE=1";
+ # Allow setting Hostname from $j...
+ sm_ffr="$sm_ffr -D_FFR_RESET_MACRO_GLOBALS";
+ sm_mail_local_envdef="$sm_mail_local_envdef -DCONTENTLENGTH";
+ # Note: the next line is commented to *prevent* mode 660 files in /var/mail
+ #sm_mail_local_envdef="$sm_mail_local_envdef -DMAILGID=8";
+else
+ sm_enable_milter=no;
+ sm_enable_auth=no;
+ sm_enable_ipv6=no;
+ sm_sendmail_envdef="$sm_sendmail_envdef \
+-D_PATH_VARTMP=\\\"${localstatedir}/lib/sendmail\\\"";
+ sm_sendmail_envdef="$sm_sendmail_envdef \
+-D_PATH_SENDMAILCF=\\\"${sysconfdir}/mail/sendmail.cf\\\"";
+ fi;
+
+# 8.9.0+
+v2i 8.9.0;
+if test $sm_version_math -ge $sm_version_test; then
+ :;
+else
+ :;
+ fi;
+
+# 8.8.0+
+v2i 8.8.0;
+if test $sm_version_math -ge $sm_version_test; then
+ :;
+else
+ sm_enable_ldap=no;
+ sm_enable_tcpd=no;
+ fi;
+
+# Shared memory support (on 8.12, but needs a recent kernel)
+# Note: there is a race condition where sometimes sendmail can't
+# use shared memory because the prior pid didn't delete it
+# but we override the linux default for performance reasons
+# (or rather we would, if most users weren't on kernels that
+# don't properly support it - < 2.2.19 or 2.4.1)
+# *ANY* arch still on a 2.2.x; x<19 must *NOT* enable this...
+if test "$sm_enable_shm" != "no"; then
+ v2i 8.12.0;
+ if test $sm_version_math -lt $sm_version_test; then
+ sm_enable_shm=no;
+ fi;
+ if test "arm" = "${sm_host_arch}"; then
+ sm_enable_shm=no;
+ fi;
+ fi;
+if test "$sm_enable_shm" != "no"; then
+ sm_enable_shm=yes;
+ fi;
+
+
+# Milter (_FFR_ on 8.10, 8.11, native on 8.12+)
+if test "$sm_enable_milter" != "no"; then
+ v2i 8.10.0;
+ if test $sm_version_math -ge $sm_version_test; then
+ sm_enable_milter=yes;
+ v2i 8.12.0;
+ if test $sm_version_math -ge $sm_version_test; then
+ sm_sendmail_envdef="$sm_sendmail_envdef -DMILTER";
+ sm_libmilter_envdef="$sm_libmilter_envdef \
+-D_FFR_MILTER_ROOT_UNSAFE";
+ else
+ sm_libmilter_envdef="$sm_libmilter_envdef -D_FFR_MILTER";
+ sm_sendmail_envdef="$sm_sendmail_envdef -D_FFR_MILTER";
+ fi;
+ fi;
+ fi;
+
+
+# SFIO (required for TLS and security layer of SASL on 8.11)
+# We'll let it go through here on any version (to check headers), but
+# issue no messages unless needed...
+if test "$sm_enable_tls" != "no"; then
+ if test $sm_enable_sfio != no; then
+ sm_enable_sfio=auto;
+ elif test $sm_enable_tls = yes; then
+ if test "$sm_version_major" = "8.11"; then
+ { { echo "$as_me:$LINENO: error: SFIO is disabled, but you asked for TLS" >&5
+echo "$as_me: error: SFIO is disabled, but you asked for TLS" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ elif test $sm_enable_tls = auto; then
+ if test "$sm_version_major" = "8.11"; then
+ { echo "$as_me:$LINENO: WARNING: SFIO is disabled, not trying TLS" >&5
+echo "$as_me: WARNING: SFIO is disabled, not trying TLS" >&2;}
+ fi;
+ fi;
+elif test $sm_enable_sfio != no; then
+ if test "$sm_version_major" = "8.11"; then
+ { echo "$as_me:$LINENO: WARNING: TLS is disabled, no need for SFIO" >&5
+echo "$as_me: WARNING: TLS is disabled, no need for SFIO" >&2;}
+ fi;
+ sm_enable_sfio=no;
+ fi;
+
+#-------------------------------------------------------------------
+# logrotate - not on Debian Slink (2.1)
+#-------------------------------------------------------------------
+if test "${DEBIAN_DH}" != '1'; then
+ sm_suggests="$sm_suggests, logrotate";
+ fi;
+
+#-------------------------------------------------------------------
+#
+# Check for presence of REGEX headers
+#
+sm_have_regex=no;
+if test $sm_enable_regex != no; then
+ # On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in regex.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ sm_have_regex=yes
+
+else
+ sm_have_regex=no
+fi
+
+done
+
+
+ if test $ac_cv_header_regex_h = yes ; then
+ echo "$as_me:$LINENO: checking for regfree" >&5
+echo $ECHO_N "checking for regfree... $ECHO_C" >&6
+if test "${ac_cv_func_regfree+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char regfree (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char regfree ();
+char (*f) ();
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_regfree) || defined (__stub___regfree)
+choke me
+#else
+f = regfree;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_regfree=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_regfree=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_regfree" >&5
+echo "${ECHO_T}$ac_cv_func_regfree" >&6
+if test $ac_cv_func_regfree = yes; then
+ :
+
+else
+ { { echo "$as_me:$LINENO: error: POSIX regex required." >&5
+echo "$as_me: error: POSIX regex required." >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+
+ fi;
+
+ if test $sm_have_regex = yes; then
+ sm_databases="$sm_databases, REGEX";
+ sm_mapdef="$sm_mapdef -DMAP_REGEX";
+ elif test $sm_enable_regex = auto; then
+ { echo "$as_me:$LINENO: WARNING: Could not locate REGEX package" >&5
+echo "$as_me: WARNING: Could not locate REGEX package" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: Could not locate REGEX package" >&5
+echo "$as_me: error: Could not locate REGEX package" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+sm_enable_regex=$sm_have_regex;
+
+#-------------------------------------------------------------------
+#
+# Check for presence of NDBM headers
+#
+sm_have_ndbm=no;
+if test $sm_enable_ndbm != no; then
+
+
+for ac_header in ndbm.h db1/ndbm.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ sm_have_ndbm=yes
+
+else
+ sm_have_ndbm=no
+fi
+
+done
+
+
+ if test $sm_have_ndbm != no; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+ #if defined(HAVE_DB1_NDBM_H)
+ #include <db1/ndbm.h>
+ #elif defined(HAVE_NDBM_H)
+ #include <ndbm.h>
+ #endif
+ dbm_pagfno(0);
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "DBM_PAGFNO_NOT_AVAILABLE" >/dev/null 2>&1; then
+ sm_have_ndbm=no
+fi
+rm -f conftest*
+
+
+ if test $sm_have_ndbm = no; then
+ { echo "$as_me:$LINENO: WARNING: DB emulation of ndbm not sufficient, -lndbm ignored" >&5
+echo "$as_me: WARNING: DB emulation of ndbm not sufficient, -lndbm ignored" >&2;}
+ fi;
+ fi;
+
+ if test $sm_have_ndbm != no; then
+ echo "$as_me:$LINENO: checking for main in -lndbm" >&5
+echo $ECHO_N "checking for main in -lndbm... $ECHO_C" >&6
+if test "${ac_cv_lib_ndbm_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lndbm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_ndbm_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_ndbm_main=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ndbm_main" >&5
+echo "${ECHO_T}$ac_cv_lib_ndbm_main" >&6
+if test $ac_cv_lib_ndbm_main = yes; then
+ sm_have_ndmb=yes
+
+else
+ sm_have_ndmb=no
+fi
+
+
+ if test $sm_have_ndbm = no; then
+ { echo "$as_me:$LINENO: WARNING: Could not find -lndbm" >&5
+echo "$as_me: WARNING: Could not find -lndbm" >&2;}
+ fi;
+ fi;
+
+ # only libsmdb and sendmail #include <ndbm.h>, but libsmdb is needed
+ # by most of the other components
+ if test $sm_have_ndbm = yes; then
+ sm_databases="$sm_databases, DBM";
+ sm_mapdef="$sm_mapdef -DNDBM";
+ sm_editmap_libs="$sm_editmap_libs -lndbm";
+ sm_makemap_libs="$sm_makemap_libs -lndbm";
+ sm_praliases_libs="$sm_praliases_libs -lndbm";
+ sm_sendmail_libs="$sm_sendmail_libs -lndbm";
+ sm_vacation_libs="$sm_vacation_libs -lndbm";
+ elif test $sm_enable_ndbm = auto; then
+ { echo "$as_me:$LINENO: WARNING: Could not locate NDBM package" >&5
+echo "$as_me: WARNING: Could not locate NDBM package" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: Could not locate NDBM package" >&5
+echo "$as_me: error: Could not locate NDBM package" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+sm_enable_ndbm=$sm_have_ndbm;
+
+#-------------------------------------------------------------------
+#
+# Check for presence of NEWDB headers (and determine version)
+#
+sm_have_newdb=no;
+sm_use_185=no;
+sm_newdb_lib=;
+if test $sm_enable_newdb != no; then
+
+
+
+
+
+
+
+
+
+
+for ac_header in db4/db.h db3/db.h db2/db.h db1/db.h db.h \
+ db4/db_185.h db3/db_185.h db2/db_185.h \
+ db1/db_185.h db_185.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_db4_db_h = yes -o \
+ $ac_cv_header_db3_db_h = yes -o \
+ $ac_cv_header_db2_db_h = yes -o \
+ $ac_cv_header_db1_db_h = yes -o \
+ $ac_cv_header_db_h = yes ; then
+ sm_have_newdb=yes;
+ fi;
+
+ if test $sm_have_newdb = yes; then
+ echo "$as_me:$LINENO: checking newdb version" >&5
+echo $ECHO_N "checking newdb version... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+ #if defined(HAVE_DB4_DB_H)
+ #include <db4/db.h>
+ #elif defined(HAVE_DB_H)
+ #include <db.h>
+ #endif
+ #if DB_VERSION_MAJOR >= 4
+ sm_newdb_lib=4
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "sm_newdb_lib=4" >/dev/null 2>&1; then
+ sm_newdb_lib=db-4.0
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+ #if defined(HAVE_DB3_DB_H)
+ #include <db3/db.h>
+ #elif defined(HAVE_DB_H)
+ #include <db.h>
+ #endif
+ #if DB_VERSION_MAJOR >= 3
+ sm_newdb_lib=3
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "sm_newdb_lib=3" >/dev/null 2>&1; then
+ sm_newdb_lib=db3
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+ #if defined(HAVE_DB2_DB_H)
+ #include <db2/db.h>
+ #elif defined(HAVE_DB_H)
+ #include <db.h>
+ #endif
+ #if DB_VERSION_MAJOR >= 2
+ sm_newdb_lib=2
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "sm_newdb_lib=2" >/dev/null 2>&1; then
+ sm_newdb_lib=db2
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+ #if defined(HAVE_DB1_DB_H)
+ #include <db1/db.h>
+ #elif defined(HAVE_DB_H)
+ #include <db.h>
+ #endif
+ #ifndef DB_VERSION_MAJOR
+ #define DB_VERSION_MAJOR 1
+ #endif
+ #if DB_VERSION_MAJOR >= 1
+ sm_newdb_lib=1
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "sm_newdb_lib=1" >/dev/null 2>&1; then
+ sm_newdb_lib=db1
+fi
+rm -f conftest*
+
+
+fi
+rm -f conftest*
+
+
+fi
+rm -f conftest*
+
+
+fi
+rm -f conftest*
+
+ # < 8.10.x can't handle db3+
+ v2i 8.10.0;
+ if test $sm_version_math -lt $sm_version_test; then
+ #if test $ac_cv_header_db3_db_185_h = yes -o \
+ # $ac_cv_header_db_185_h = yes; then
+ # sm_use_185=yes;
+ #else
+ ac_cv_header_db4_db_h=no;
+ ac_cv_header_db3_db_h=no;
+ if test $sm_newdb_lib = db-4.0 -o \
+ $sm_newdb_lib = db3; then
+ if test $ac_cv_header_db2_db_h = yes; then
+ { echo "$as_me:$LINENO: WARNING: <8.10.0 & $sm_newdb_lib: trying db2" >&5
+echo "$as_me: WARNING: <8.10.0 & $sm_newdb_lib: trying db2" >&2;}
+ sm_newdb_lib=db2;
+ else
+ { echo "$as_me:$LINENO: WARNING: <8.10.0 & $sm_newdb_lib: trying db1" >&5
+echo "$as_me: WARNING: <8.10.0 & $sm_newdb_lib: trying db1" >&2;}
+ sm_newdb_lib=db1;
+ fi;
+ fi;
+ # fi;
+ fi;
+ # < 8.9.0 can't handle db2+ ????
+ v2i 8.9.0;
+ if test $sm_version_math -lt $sm_version_test; then
+ ac_cv_header_db4_db_h=no;
+ ac_cv_header_db3_db_h=no;
+ ac_cv_header_db2_db_h=no;
+ if test $sm_newdb_lib = db2; then
+ { echo "$as_me:$LINENO: WARNING: <8.9.0 & $sm_newdb_lib: trying db1" >&5
+echo "$as_me: WARNING: <8.9.0 & $sm_newdb_lib: trying db1" >&2;}
+ sm_newdb_lib=db1;
+ fi;
+ fi;
+ echo "$as_me:$LINENO: result: $sm_newdb_lib" >&5
+echo "${ECHO_T}$sm_newdb_lib" >&6
+ if test "X$sm_newdb_lib" = "X"; then
+ { echo "$as_me:$LINENO: WARNING: NEWDB version unknown, omitting support!" >&5
+echo "$as_me: WARNING: NEWDB version unknown, omitting support!" >&2;}
+ sm_have_newdb=no;
+ fi;
+ fi;
+
+ # Check first for a library matching the db version (-ldb4, etc)
+ # then check to see if -ldb will work
+ if test $sm_have_newdb != no; then
+ sm_old_libs="$LIBS";
+ if test $sm_newdb_lib = db-4.0; then
+ as_ac_Lib=`echo "ac_cv_lib_$sm_newdb_lib''_db_create_4000" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for db_create_4000 in -l$sm_newdb_lib" >&5
+echo $ECHO_N "checking for db_create_4000 in -l$sm_newdb_lib... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$sm_newdb_lib $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char db_create_4000 ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+db_create_4000 ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ :
+else
+
+ echo "$as_me:$LINENO: checking for db_create_4000 in -ldb" >&5
+echo $ECHO_N "checking for db_create_4000 in -ldb... $ECHO_C" >&6
+if test "${ac_cv_lib_db_db_create_4000+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldb $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char db_create_4000 ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+db_create_4000 ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_db_db_create_4000=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_db_db_create_4000=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_db_db_create_4000" >&5
+echo "${ECHO_T}$ac_cv_lib_db_db_create_4000" >&6
+if test $ac_cv_lib_db_db_create_4000 = yes; then
+ sm_newdb_lib='db'
+else
+ sm_have_newdb=no
+fi
+
+fi
+ elif test $sm_newdb_lib = db3; then
+ as_ac_Lib=`echo "ac_cv_lib_$sm_newdb_lib''_db_create" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for db_create in -l$sm_newdb_lib" >&5
+echo $ECHO_N "checking for db_create in -l$sm_newdb_lib... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$sm_newdb_lib $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char db_create ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+db_create ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ :
+else
+
+ echo "$as_me:$LINENO: checking for db_create in -ldb" >&5
+echo $ECHO_N "checking for db_create in -ldb... $ECHO_C" >&6
+if test "${ac_cv_lib_db_db_create+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldb $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char db_create ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+db_create ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_db_db_create=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_db_db_create=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_db_db_create" >&5
+echo "${ECHO_T}$ac_cv_lib_db_db_create" >&6
+if test $ac_cv_lib_db_db_create = yes; then
+ sm_newdb_lib='db'
+else
+ sm_have_newdb=no
+fi
+
+fi
+ elif test $sm_newdb_lib = db2; then
+ as_ac_Lib=`echo "ac_cv_lib_$sm_newdb_lib''_db_open" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for db_open in -l$sm_newdb_lib" >&5
+echo $ECHO_N "checking for db_open in -l$sm_newdb_lib... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$sm_newdb_lib $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char db_open ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+db_open ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ :
+else
+
+ echo "$as_me:$LINENO: checking for db_open in -ldb" >&5
+echo $ECHO_N "checking for db_open in -ldb... $ECHO_C" >&6
+if test "${ac_cv_lib_db_db_open+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldb $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char db_open ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+db_open ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_db_db_open=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_db_db_open=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_db_db_open" >&5
+echo "${ECHO_T}$ac_cv_lib_db_db_open" >&6
+if test $ac_cv_lib_db_db_open = yes; then
+ sm_newdb_lib='db'
+else
+ sm_have_newdb=no
+fi
+
+fi
+ else
+ as_ac_Lib=`echo "ac_cv_lib_$sm_newdb_lib''_dbopen" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for dbopen in -l$sm_newdb_lib" >&5
+echo $ECHO_N "checking for dbopen in -l$sm_newdb_lib... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$sm_newdb_lib $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dbopen ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+dbopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ :
+else
+
+ echo "$as_me:$LINENO: checking for dbopen in -ldb" >&5
+echo $ECHO_N "checking for dbopen in -ldb... $ECHO_C" >&6
+if test "${ac_cv_lib_db_dbopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldb $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dbopen ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+dbopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_db_dbopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_db_dbopen=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_db_dbopen" >&5
+echo "${ECHO_T}$ac_cv_lib_db_dbopen" >&6
+if test $ac_cv_lib_db_dbopen = yes; then
+ sm_newdb_lib='db'
+else
+ sm_have_newdb=no
+fi
+
+fi
+ fi;
+ if test $sm_newdb_lib = db; then
+ as_ac_Lib=`echo "ac_cv_lib_$sm_newdb_lib''_dbopen" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for dbopen in -l$sm_newdb_lib" >&5
+echo $ECHO_N "checking for dbopen in -l$sm_newdb_lib... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$sm_newdb_lib $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dbopen ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+dbopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ :
+else
+
+ echo "$as_me:$LINENO: checking for dbopen in -ldb" >&5
+echo $ECHO_N "checking for dbopen in -ldb... $ECHO_C" >&6
+if test "${ac_cv_lib_db_dbopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldb $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dbopen ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+dbopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_db_dbopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_db_dbopen=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_db_dbopen" >&5
+echo "${ECHO_T}$ac_cv_lib_db_dbopen" >&6
+if test $ac_cv_lib_db_dbopen = yes; then
+ sm_newdb_lib='db'
+else
+ sm_have_newdb=no
+fi
+
+fi
+ fi;
+ LIBS="$sm_old_libs";
+
+ if test $sm_have_newdb != yes; then
+ { echo "$as_me:$LINENO: WARNING: Could not find -l$sm_newdb_lib (or -ldb)" >&5
+echo "$as_me: WARNING: Could not find -l$sm_newdb_lib (or -ldb)" >&2;}
+ fi;
+ fi;
+
+ # only libsmdb and sendmail #include <db.h>, but libsmdb is needed
+ # by most of the other components
+ if test $sm_have_newdb = yes; then
+ if test \( $ac_cv_header_db4_db_h = yes -a $sm_newdb_lib = db-4.0 \) \
+ -o \( $ac_cv_header_db3_db_h = yes -a $sm_newdb_lib = db3 \) \
+ -o \( $ac_cv_header_db2_db_h = yes -a $sm_newdb_lib = db2 \) \
+ -o \( $ac_cv_header_db1_db_h = yes -a $sm_newdb_lib = db1 \); then
+ sm_libsmdb_envdef="$sm_libsmdb_envdef -I/usr/include/$sm_newdb_lib";
+ sm_sendmail_envdef="$sm_sendmail_envdef -I/usr/include/$sm_newdb_lib";
+ fi;
+ if test $sm_use_185 = yes; then
+ :
+ #sm_libsmdb_envdef="$sm_libsmdb_envdef -Ddb.h db_185.h";
+ #sm_sendmail_envdef="$sm_sendmail_envdef -Ddb.h db_185.h";
+ fi;
+ junk=$(echo "${sm_newdb_lib}" | sed -e 's/^db\(-\)\?//');
+ sm_databases="$sm_databases, DB";
+ if test $junk != 1; then
+ sm_badepends="$sm_badepends, libdb${junk}-dev";
+ fi;
+ sm_mapdef="$sm_mapdef -DNEWDB";
+ junk=$(echo "${sm_newdb_lib}" | sed -e 's/^db//');
+ sm_newdb_lib="-ldb${junk}";
+ sm_editmap_libs="$sm_editmap_libs $sm_newdb_lib";
+ sm_makemap_libs="$sm_makemap_libs $sm_newdb_lib";
+ sm_praliases_libs="$sm_praliases_libs $sm_newdb_lib";
+ sm_sendmail_libs="$sm_sendmail_libs $sm_newdb_lib";
+ sm_vacation_libs="$sm_vacation_libs $sm_newdb_lib";
+ elif test $sm_enable_newdb = auto; then
+ { echo "$as_me:$LINENO: WARNING: Could not locate NEWDB (libdb{4,3,2,1,}-dev) package" >&5
+echo "$as_me: WARNING: Could not locate NEWDB (libdb{4,3,2,1,}-dev) package" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: Could not locate NEWDB (libdb{4,3,2,1,}-dev) package" >&5
+echo "$as_me: error: Could not locate NEWDB (libdb{4,3,2,1,}-dev) package" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+sm_enable_newdb=$sm_have_newdb;
+
+
+#-------------------------------------------------------------------
+#
+# Check for presence of NIS headers
+#
+sm_have_nis=no;
+if test $sm_enable_nis != no; then
+
+for ac_header in rpcsvc/ypclnt.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ sm_have_nis=yes
+
+else
+ sm_have_nis=no
+fi
+
+done
+
+
+ if test $sm_have_nis = yes; then
+ echo "$as_me:$LINENO: checking for main in -lnsl" >&5
+echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_nsl_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_nsl_main=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6
+if test $ac_cv_lib_nsl_main = yes; then
+ sm_have_nis=yes
+
+else
+ sm_have_nis=no
+fi
+
+
+ if test $sm_have_nis != yes; then
+ { echo "$as_me:$LINENO: WARNING: Could not find -lnsl" >&5
+echo "$as_me: WARNING: Could not find -lnsl" >&2;}
+ fi;
+ fi;
+
+ if test $sm_have_nis = yes; then
+ sm_databases="$sm_databases, NIS";
+ sm_mapdef="$sm_mapdef -DNIS";
+ sm_sendmail_libs="$sm_sendmail_libs -lnsl";
+ elif test $sm_enable_nis = auto; then
+ { echo "$as_me:$LINENO: WARNING: Could not locate NIS package" >&5
+echo "$as_me: WARNING: Could not locate NIS package" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: Could not locate NIS package" >&5
+echo "$as_me: error: Could not locate NIS package" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+sm_enable_nis=$sm_have_nis;
+
+#-------------------------------------------------------------------
+#
+# Check for presence of NISPLUS headers
+#
+sm_have_nisplus=no;
+if test $sm_enable_nisplus != no; then
+
+for ac_header in rpcsvc/nis.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ sm_have_nisplus=yes
+
+else
+ sm_have_nisplus=no
+fi
+
+done
+
+
+ if test $sm_have_nisplus = yes -a \
+ $sm_have_nis = no; then
+ echo "$as_me:$LINENO: checking for main in -lnsl" >&5
+echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_nsl_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_nsl_main=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6
+if test $ac_cv_lib_nsl_main = yes; then
+ sm_have_nis=yes
+
+else
+ sm_have_nis=no
+fi
+
+
+ if test $sm_have_nis != yes; then
+ { echo "$as_me:$LINENO: WARNING: Could not find -lnsl" >&5
+echo "$as_me: WARNING: Could not find -lnsl" >&2;}
+ fi;
+ fi;
+
+ if test $sm_have_nisplus = yes; then
+ sm_databases="$sm_databases, NIS+";
+ sm_mapdef="$sm_mapdef -DNISPLUS";
+ if test $sm_have_nis != yes; then
+ sm_sendmail_libs="$sm_sendmail_libs -lnsl";
+ fi;
+ elif test $sm_enable_nisplus = auto; then
+ { echo "$as_me:$LINENO: WARNING: Could not locate NISPLUS package" >&5
+echo "$as_me: WARNING: Could not locate NISPLUS package" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: Could not locate NISPLUS package" >&5
+echo "$as_me: error: Could not locate NISPLUS package" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+sm_enable_nisplus=$sm_have_nisplus;
+
+#-------------------------------------------------------------------
+#
+# Check for presence of LDAP headers (support OpenLDAP v2/v1, Umich)
+#
+sm_have_ldap=no;
+sm_have_ldap_init=no;
+sm_have_ldap_memfree=no;
+sm_ldap_inc=;
+sm_ldap_lib=;
+sm_ldap_pkg=;
+if test $sm_enable_ldap != no; then
+
+
+for ac_header in ldap.h umich-ldap/ldap.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ if test $ac_cv_header_ldap_h = yes; then
+ echo "$as_me:$LINENO: checking for main in -lldap" >&5
+echo $ECHO_N "checking for main in -lldap... $ECHO_C" >&6
+if test "${ac_cv_lib_ldap_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lldap -llber $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_ldap_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_ldap_main=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_main" >&5
+echo "${ECHO_T}$ac_cv_lib_ldap_main" >&6
+if test $ac_cv_lib_ldap_main = yes; then
+ sm_have_ldap=yes
+
+else
+ sm_have_ldap=no
+
+fi
+
+ echo "$as_me:$LINENO: checking for ldap_init in -lldap" >&5
+echo $ECHO_N "checking for ldap_init in -lldap... $ECHO_C" >&6
+if test "${ac_cv_lib_ldap_ldap_init+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lldap -llber $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char ldap_init ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+ldap_init ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_ldap_ldap_init=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_ldap_ldap_init=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_init" >&5
+echo "${ECHO_T}$ac_cv_lib_ldap_ldap_init" >&6
+if test $ac_cv_lib_ldap_ldap_init = yes; then
+ sm_have_ldap_init=yes
+
+else
+ sm_have_ldap_init=no
+
+fi
+
+ echo "$as_me:$LINENO: checking for ldap_memfree in -lldap" >&5
+echo $ECHO_N "checking for ldap_memfree in -lldap... $ECHO_C" >&6
+if test "${ac_cv_lib_ldap_ldap_memfree+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lldap -llber $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char ldap_memfree ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+ldap_memfree ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_ldap_ldap_memfree=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_ldap_ldap_memfree=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_memfree" >&5
+echo "${ECHO_T}$ac_cv_lib_ldap_ldap_memfree" >&6
+if test $ac_cv_lib_ldap_ldap_memfree = yes; then
+ sm_have_ldap_memfree=yes
+
+else
+ sm_have_ldap_memfree=no
+
+fi
+
+
+ if test $sm_have_ldap = yes; then
+ echo "$as_me:$LINENO: checking for main in -llber" >&5
+echo $ECHO_N "checking for main in -llber... $ECHO_C" >&6
+if test "${ac_cv_lib_lber_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-llber $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_lber_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_lber_main=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_lber_main" >&5
+echo "${ECHO_T}$ac_cv_lib_lber_main" >&6
+if test $ac_cv_lib_lber_main = yes; then
+ sm_have_ldap=yes
+
+else
+ sm_have_ldap=no
+fi
+
+ fi;
+
+ if test $sm_have_ldap = yes; then
+ echo "$as_me:$LINENO: checking for openldap package" >&5
+echo $ECHO_N "checking for openldap package... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+ #if defined(HAVE_LDAP_H)
+ #include <ldap.h>
+ #if defined(LDAP_VERSION3)
+ sm_ldap_version=3
+ #else
+ sm_ldap_version=2
+ #endif
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "sm_ldap_version=3" >/dev/null 2>&1; then
+ sm_ldap_pkg="libldap2-dev"
+
+else
+ sm_ldap_pkg="libopenldap-dev"
+fi
+rm -f conftest*
+
+ echo "$as_me:$LINENO: result: $sm_ldap_pkg" >&5
+echo "${ECHO_T}$sm_ldap_pkg" >&6
+ fi;
+
+ if test $sm_have_ldap = yes; then
+ sm_badepends="$sm_badepends, $sm_ldap_pkg"
+ sm_ldap_lib="-lldap -llber";
+ else
+ { echo "$as_me:$LINENO: WARNING: Could not find OpenLDAP -lldap or -llber" >&5
+echo "$as_me: WARNING: Could not find OpenLDAP -lldap or -llber" >&2;}
+ fi;
+ fi;
+
+ if test "X$ac_cv_header_umich_ldap_ldap_h" = Xyes -a \
+ $sm_have_ldap != yes; then
+ echo "$as_me:$LINENO: checking for main in -lumich_ldap" >&5
+echo $ECHO_N "checking for main in -lumich_ldap... $ECHO_C" >&6
+if test "${ac_cv_lib_umich_ldap_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lumich_ldap -lumich_lber $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_umich_ldap_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_umich_ldap_main=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_umich_ldap_main" >&5
+echo "${ECHO_T}$ac_cv_lib_umich_ldap_main" >&6
+if test $ac_cv_lib_umich_ldap_main = yes; then
+ sm_have_ldap=yes
+
+else
+ sm_have_ldap=no
+
+fi
+
+
+ if test $sm_have_ldap = yes; then
+ echo "$as_me:$LINENO: checking for main in -lumich_lber" >&5
+echo $ECHO_N "checking for main in -lumich_lber... $ECHO_C" >&6
+if test "${ac_cv_lib_umich_lber_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lumich_lber $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_umich_lber_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_umich_lber_main=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_umich_lber_main" >&5
+echo "${ECHO_T}$ac_cv_lib_umich_lber_main" >&6
+if test $ac_cv_lib_umich_lber_main = yes; then
+ sm_have_ldap=yes
+
+else
+ sm_have_ldap=no
+fi
+
+ fi;
+
+ if test $sm_have_ldap = yes; then
+ sm_badepends="$sm_badepends, umich-libldap-dev";
+ sm_ldap_inc="-I/usr/include/umich-ldap";
+ sm_ldap_lib="-lumich_ldap -lumich_lber";
+ else
+ { echo "$as_me:$LINENO: WARNING: Could not find UMich -lldap or -llber" >&5
+echo "$as_me: WARNING: Could not find UMich -lldap or -llber" >&2;}
+ fi;
+ fi;
+
+ if test $sm_have_ldap = yes; then
+ #
+ # sendmail/conf.h includes LDAP, so everything does...
+ sm_databases="$sm_databases, LDAP";
+ sm_mapdef="$sm_mapdef -DLDAPMAP";
+ sm_incdirs="$sm_incdirs $sm_ldap_inc";
+ #sm_libs="$sm_libs $sm_ldap_lib";
+ sm_editmap_libs="$sm_editmap_libs $sm_ldap_lib";
+ sm_libsm_libs="$sm_libsm_libs $sm_ldap_lib";
+ sm_mail_local_libs="$sm_mail_local_libs $sm_ldap_lib";
+ sm_mailstats_libs="$sm_mailstats_libs $sm_ldap_lib";
+ sm_makemap_libs="$sm_makemap_libs $sm_ldap_lib";
+ sm_praliases_libs="$sm_praliases_libs $sm_ldap_lib";
+ sm_rmail_libs="$sm_rmail_libs $sm_ldap_lib";
+ sm_sendmail_libs="$sm_sendmail_libs $sm_ldap_lib";
+ sm_smrsh_libs="$sm_smrsh_libs $sm_ldap_lib";
+ sm_vacation_libs="$sm_vacation_libs $sm_ldap_lib";
+ if test $sm_have_ldap_init = yes; then
+ sm_libsm_envdef="$sm_libsm_envdef -DLDAP_REFERRALS";
+ sm_sendmail_envdef="$sm_sendmail_envdef -DLDAP_REFERRALS";
+ sm_libsm_envdef="$sm_libsm_envdef -D_FFR_LDAP_URI";
+ sm_sendmail_envdef="$sm_sendmail_envdef -D_FFR_LDAP_URI";
+ sm_libsm_envdef="$sm_libsm_envdef -D_FFR_LDAP_SETVERSION";
+ sm_sendmail_envdef="$sm_sendmail_envdef -D_FFR_LDAP_SETVERSION";
+ fi;
+ if test $sm_have_ldap_memfree = yes; then
+ sm_libsm_envdef="$sm_libsm_envdef -DSM_CONF_LDAP_MEMFREE";
+ fi;
+ elif test $sm_enable_ldap = auto; then
+ { echo "$as_me:$LINENO: WARNING: Could not locate LDAP (libldap2-dev) package" >&5
+echo "$as_me: WARNING: Could not locate LDAP (libldap2-dev) package" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: Could not locate LDAP (libldap2-dev) package" >&5
+echo "$as_me: error: Could not locate LDAP (libldap2-dev) package" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+sm_enable_ldap=$sm_have_ldap;
+
+#-------------------------------------------------------------------
+#
+# Check for presence of resolve(and/or bind) headers
+# if found, enable other maps dependant upon resolver libraries
+#
+# Since GLIBC 2.2.1 has mucked with resolv.h, we must build w/bind 8.2.2p7
+# Unfortunately, this will fsck up HESIOD (bind 8.2 only has partial support)
+# It also messed with openLDAP - making it not work ;(
+#
+# We're now using resolv.h - as it seems to be working (w/sendmail changes)
+#
+sm_have_resolve=no;
+sm_have_bind=no;
+resolve_lib='';
+resolve_inc='';
+#if test $sm_enable_resolv != no; then
+
+
+for ac_header in resolv.h bind/resolv.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_resolv_h = yes; then
+ sm_have_resolve=yes;
+ fi;
+ if test $ac_cv_header_bind_resolv_h = yes; then
+ sm_have_bind=yes;
+ fi;
+
+ if test $ac_cv_header_resolv_h = yes; then
+ echo "$as_me:$LINENO: checking for __res_query in -lresolv" >&5
+echo $ECHO_N "checking for __res_query in -lresolv... $ECHO_C" >&6
+if test "${ac_cv_lib_resolv___res_query+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lresolv $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char __res_query ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+__res_query ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_resolv___res_query=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_resolv___res_query=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_resolv___res_query" >&5
+echo "${ECHO_T}$ac_cv_lib_resolv___res_query" >&6
+if test $ac_cv_lib_resolv___res_query = yes; then
+ sm_have_resolve=yes
+
+else
+ echo "$as_me:$LINENO: checking for res_query in -lresolv" >&5
+echo $ECHO_N "checking for res_query in -lresolv... $ECHO_C" >&6
+if test "${ac_cv_lib_resolv_res_query+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lresolv $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char res_query ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+res_query ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_resolv_res_query=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_resolv_res_query=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_query" >&5
+echo "${ECHO_T}$ac_cv_lib_resolv_res_query" >&6
+if test $ac_cv_lib_resolv_res_query = yes; then
+ sm_have_resolve=yes
+
+else
+ sm_have_resolve=no
+fi
+
+
+fi
+
+
+ if test $sm_have_resolve = yes; then
+ resolve_inc='';
+ resolve_lib='-lresolv';
+ else
+ { echo "$as_me:$LINENO: WARNING: Could not find -lresolv" >&5
+echo "$as_me: WARNING: Could not find -lresolv" >&2;}
+ fi;
+ fi;
+
+ if test $ac_cv_header_bind_resolv_h = yes; then
+ echo "$as_me:$LINENO: checking for __res_query in -lbind" >&5
+echo $ECHO_N "checking for __res_query in -lbind... $ECHO_C" >&6
+if test "${ac_cv_lib_bind___res_query+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbind $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char __res_query ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+__res_query ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_bind___res_query=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_bind___res_query=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_bind___res_query" >&5
+echo "${ECHO_T}$ac_cv_lib_bind___res_query" >&6
+if test $ac_cv_lib_bind___res_query = yes; then
+ sm_have_bind=yes
+
+else
+ sm_have_bind=no
+fi
+
+
+ if test $sm_have_bind = yes; then
+ if test $sm_enable_bind = yes; then
+ sm_badepends="$sm_badepends, bind-dev";
+ resolve_inc='-I/usr/include/bind';
+ resolve_lib='-lbind -lresolv';
+ else
+ sm_have_bind=no;
+ fi;
+ else
+ { echo "$as_me:$LINENO: WARNING: Could not find -lbind (bind-dev)" >&5
+echo "$as_me: WARNING: Could not find -lbind (bind-dev)" >&2;}
+ fi;
+ fi;
+
+ if test $sm_have_resolve = yes; then
+ v2i 8.12.0;
+ if test $sm_version_math -ge $sm_version_test; then
+ sm_databases="$sm_databases, DNS";
+ fi;
+ #sm_incdirs="$sm_incdirs $resolve_inc";
+ #sm_libs="$sm_libs "$resolve_lib";
+ sm_sendmail_envdef="$sm_sendmail_envdef $resolve_inc";
+ sm_sendmail_libs="$sm_sendmail_libs $resolve_lib";
+ else
+ { { echo "$as_me:$LINENO: error: Could not locate RESOLV package" >&5
+echo "$as_me: error: Could not locate RESOLV package" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+# fi;
+sm_enable_bind=$sm_have_bind;
+
+#-------------------------------------------------------------------
+#
+# Check for presence of HESIOD headers
+# Note: if using libhesiod, we should have HES_GETMAILHOST
+# if using libbind, it doesn't have HES_GETMAILHOST ;-{
+#
+sm_have_hesiod=no;
+sm_hesiod_parms='';
+if test $sm_enable_hesiod != no; then
+
+
+for ac_header in hesiod.h bind/hesiod.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_hesiod_h = yes; then
+ sm_have_hesiod=yes;
+ elif test $ac_cv_header_bind_hesiod_h = yes -a \
+ $sm_have_bind = yes; then
+ sm_have_hesiod=yes;
+ fi;
+
+ if test $sm_have_hesiod = yes; then
+ echo "$as_me:$LINENO: checking for hes_getmailhost" >&5
+echo $ECHO_N "checking for hes_getmailhost... $ECHO_C" >&6
+ CPPFLAGS_SAVE="$CPPFLAGS";
+ CPPFLAGS="$resolve_inc";
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+ #include <hesiod.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "hes_getmailhost\(" >/dev/null 2>&1; then
+ sm_hesiod_parms="-DHES_GETMAILHOST"
+fi
+rm -f conftest*
+
+ CPPFLAGS="$CPPFLAGS_SAVE";
+ if test -z "$sm_hesiod_parms"; then
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ else
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ fi;
+ fi;
+
+ if test $sm_have_hesiod = yes; then
+ sm_databases="$sm_databases, HESIOD";
+ sm_badepends="$sm_badepends, libhesiod-dev";
+ sm_mapdef="$sm_mapdef -DHESIOD";
+ sm_libsmutil_envdef="$sm_libsmutil_envdef $resolve_inc";
+ sm_sendmail_envdef="$sm_sendmail_envdef $sm_hesiod_parms";
+ # Need following if not using bind headers
+ if test -z "$resolve_inc"; then
+ sm_sendmail_libs="$sm_sendmail_libs -lhesiod";
+ fi;
+ elif test $sm_enable_hesiod = auto; then
+ { echo "$as_me:$LINENO: WARNING: Could not locate HESIOD (libhesiod-dev) package" >&5
+echo "$as_me: WARNING: Could not locate HESIOD (libhesiod-dev) package" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: Could not locate HESIOD (libhesiod-dev) package" >&5
+echo "$as_me: error: Could not locate HESIOD (libhesiod-dev) package" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+sm_enable_hesiod=$sm_have_hesiod;
+
+#-------------------------------------------------------------------
+#
+# Check for presence of TCP Wrapper headers
+#
+sm_have_tcpd=no;
+if test $sm_enable_tcpd != no; then
+
+for ac_header in tcpd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ sm_have_tcpd=yes
+
+else
+ sm_have_tcpd=no
+fi
+
+done
+
+
+ if test $ac_cv_header_tcpd_h = yes ; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+ int allow_severity = 0;
+ int deny_severity = 0;
+
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+hosts_access()
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ sm_have_tcpd=yes
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+sm_have_tcpd=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ fi;
+
+ if test $sm_have_tcpd = yes; then
+ echo "$as_me:$LINENO: checking for main in -lwrap" >&5
+echo $ECHO_N "checking for main in -lwrap... $ECHO_C" >&6
+if test "${ac_cv_lib_wrap_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lwrap $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_wrap_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_wrap_main=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_wrap_main" >&5
+echo "${ECHO_T}$ac_cv_lib_wrap_main" >&6
+if test $ac_cv_lib_wrap_main = yes; then
+ sm_have_tcpd=yes
+
+else
+ sm_have_tcpd=no
+fi
+
+
+ if test $sm_have_tcpd != yes; then
+ { echo "$as_me:$LINENO: WARNING: Could not find -lwrap (libwrap0-dev)" >&5
+echo "$as_me: WARNING: Could not find -lwrap (libwrap0-dev)" >&2;}
+ fi;
+ fi;
+
+ if test $sm_have_tcpd = yes; then
+ sm_features="$sm_features, TCPWrappers";
+ sm_badepends="$sm_badepends, libwrap0-dev";
+ sm_sendmail_envdef="$sm_sendmail_envdef -DTCPWRAPPERS";
+ sm_sendmail_libs="$sm_sendmail_libs -lwrap";
+ elif test $sm_enable_tcpd = auto; then
+ { echo "$as_me:$LINENO: WARNING: TCPD(libwrap0-dev) protection not supported!" >&5
+echo "$as_me: WARNING: TCPD(libwrap0-dev) protection not supported!" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: TCPD(libwrap0-dev) protection not supported!" >&5
+echo "$as_me: error: TCPD(libwrap0-dev) protection not supported!" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+sm_enable_tcpd=$sm_have_tcpd;
+
+#-------------------------------------------------------------------
+#
+# Check for presence of IPV6 headers
+#
+sm_have_ipv6=no;
+if test $sm_enable_ipv6 != no; then
+
+for ac_header in netinet/ip6.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ sm_have_ipv6=yes
+
+else
+ sm_have_ipv6=no
+fi
+
+done
+
+
+ if test $ac_cv_header_netinet_ip6_h = yes ; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+ #include <netdb.h>
+ #if defined(AI_DEFAULT)
+ sm_have_ipv6=yes
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "sm_have_ipv6=yes" >/dev/null 2>&1; then
+ sm_have_ipv6=yes
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+ #include <bind/netdb.h>
+ #if defined(AI_DEFAULT)
+ sm_have_ipv6=yes
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "sm_have_ipv6=yes" >/dev/null 2>&1; then
+ sm_have_ipv6=yes
+fi
+rm -f conftest*
+
+
+fi
+rm -f conftest*
+
+ if test $sm_have_ipv6 = no; then
+ { { echo "$as_me:$LINENO: error: Your level of netdb precludes IPv6 support" >&5
+echo "$as_me: error: Your level of netdb precludes IPv6 support" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+
+ if test $sm_have_ipv6 = yes; then
+
+for ac_func in getaddrinfo
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+char (*f) ();
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ sm_have_ipv6=yes
+
+else
+ sm_have_ipv6=no
+fi
+done
+
+ if test $sm_have_ipv6 = no; then
+ { { echo "$as_me:$LINENO: error: IPv6 support requires getaddrinfo" >&5
+echo "$as_me: error: IPv6 support requires getaddrinfo" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+
+ if test $sm_have_ipv6 = yes; then
+ v2i 8.10.0;
+ if test $sm_version_math -ge $sm_version_test; then
+ sm_features="$sm_features, IPv6";
+ sm_sendmail_envdef="$sm_sendmail_envdef -DNETINET6";
+ # Need following if using bind headers
+ if test ! -z "$resolve_inc"; then
+ sm_sendmail_envdef="$sm_sendmail_envdef -DNEEDSGETIPNODE=0";
+ fi;
+ fi;
+ elif test $sm_enable_ipv6 = auto; then
+ { echo "$as_me:$LINENO: WARNING: Could not locate IPv6 package" >&5
+echo "$as_me: WARNING: Could not locate IPv6 package" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: Could not locate IPv6 package" >&5
+echo "$as_me: error: Could not locate IPv6 package" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+sm_enable_ipv6=$sm_have_ipv6;
+
+#-------------------------------------------------------------------
+#
+# Check for presence of maillock headers
+#
+sm_have_maillock=no;
+if test $sm_enable_maillock != no; then
+
+for ac_header in maillock.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ sm_have_maillock=yes
+
+else
+ sm_have_maillock=no
+fi
+
+done
+
+
+ if test $ac_cv_header_maillock_h = yes ; then
+ echo "$as_me:$LINENO: checking for main in -llockfile" >&5
+echo $ECHO_N "checking for main in -llockfile... $ECHO_C" >&6
+if test "${ac_cv_lib_lockfile_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-llockfile $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_lockfile_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_lockfile_main=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_lockfile_main" >&5
+echo "${ECHO_T}$ac_cv_lib_lockfile_main" >&6
+if test $ac_cv_lib_lockfile_main = yes; then
+ sm__have_maillock=yes
+
+else
+ sm_have_maillock=no
+fi
+
+
+ if test $sm_have_maillock != yes; then
+ { echo "$as_me:$LINENO: WARNING: Could not find -llockfile (liblockfile-dev)" >&5
+echo "$as_me: WARNING: Could not find -llockfile (liblockfile-dev)" >&2;}
+ fi;
+ fi;
+
+ if test $sm_have_maillock = yes; then
+ sm_features="$sm_features, LockFile";
+ sm_badepends="$sm_badepends, liblockfile-dev";
+ sm_mail_local_envdef="$sm_mail_local_envdef -DMAILLOCK";
+ sm_mail_local_libs="$sm_mail_local_libs -llockfile";
+ elif test $sm_enable_maillock = auto; then
+ { echo "$as_me:$LINENO: WARNING: Could not locate liblockfile-dev package" >&5
+echo "$as_me: WARNING: Could not locate liblockfile-dev package" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: Could not locate liblockfile-dev package" >&5
+echo "$as_me: error: Could not locate liblockfile-dev package" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+sm_enable_maillock=$sm_have_maillock;
+
+#-------------------------------------------------------------------
+#
+# Check for presence of SFIO headers
+# Note: required for TLS and security layer of SASL on 8.11)
+# Note: SFIO is *only* used if required, but we allow the checks
+# on any version (for header test) - just issue no messages
+# unless needed
+#
+sm_have_sfio=no;
+if test $sm_enable_sfio != no; then
+ CPPFLAGS_SAVE="$CPPFLAGS";
+ CPPFLAGS="-I/usr/include/sfio"
+
+for ac_header in sfio/stdio.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ sm_have_sfio=yes
+
+else
+ sm_have_sfio=no
+fi
+
+done
+
+ CPPFLAGS="$CPPFLAGS_SAVE";
+
+ if test $ac_cv_header_sfio_stdio_h = yes ; then
+ echo "$as_me:$LINENO: checking for main in -lsfio" >&5
+echo $ECHO_N "checking for main in -lsfio... $ECHO_C" >&6
+if test "${ac_cv_lib_sfio_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsfio $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_sfio_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_sfio_main=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_sfio_main" >&5
+echo "${ECHO_T}$ac_cv_lib_sfio_main" >&6
+if test $ac_cv_lib_sfio_main = yes; then
+ sm_have_sfio=yes
+
+else
+ sm_have_sfio=no
+fi
+
+
+ if test $sm_have_sfio != yes; then
+ { echo "$as_me:$LINENO: WARNING: Could not find -lsfio (sfio-dev)" >&5
+echo "$as_me: WARNING: Could not find -lsfio (sfio-dev)" >&2;}
+ fi;
+ fi;
+
+ # SFIO is only required for TLS/SASL on 8.11, ignore it otherwise
+ # when using it, however, it hits *everything*, put it in the front!
+ if test "$sm_version_major" = "8.11"; then
+ if test $sm_have_sfio = yes; then
+ sm_badepends="$sm_badepends, sfio-dev";
+ sm_incdirs="-I/usr/include/sfio $sm_incdirs";
+ sm_envdef="-DSFIO $sm_envdef";
+ sm_libs="-lsfio $sm_libs";
+ elif test $sm_enable_sfio = auto; then
+ { echo "$as_me:$LINENO: WARNING: SFIO, and therefore TLS not supported!" >&5
+echo "$as_me: WARNING: SFIO, and therefore TLS not supported!" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: SFIO, and therefore TLS not supported!" >&5
+echo "$as_me: error: SFIO, and therefore TLS not supported!" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ else
+ sm_have_sfio=no;
+ fi;
+ fi;
+sm_enable_sfio=$sm_have_sfio;
+
+#-------------------------------------------------------------------
+#
+# Check for presence of SASL headers (for SMTP auth)
+#
+sm_have_auth=no;
+sm_auth_lib='?';
+if test $sm_enable_auth != no; then
+
+
+for ac_header in sasl/sasl.h sasl.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ if test $ac_cv_header_sasl_sasl_h = yes \
+ -o $ac_cv_header_sasl_h = yes; then
+ sm_have_auth=yes;
+ else
+ sm_have_auth=no;
+ fi;
+
+ if test $sm_have_auth = yes; then
+ echo "$as_me:$LINENO: checking sasl version" >&5
+echo $ECHO_N "checking sasl version... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+ #if defined(HAVE_SASL_SASL_H)
+ #include <sasl/sasl.h>
+ #elif defined(HAVE_SASL_H)
+ #include <sasl.h>
+ #endif
+ #if SASL_VERSION_MAJOR >= 2
+ sm_auth_lib=2
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "sm_auth_lib=2" >/dev/null 2>&1; then
+ sm_auth_lib=2
+else
+ sm_auth_lib=1
+fi
+rm -f conftest*
+
+ echo "$as_me:$LINENO: result: $sm_auth_lib" >&5
+echo "${ECHO_T}$sm_auth_lib" >&6
+ if test "X$sm_auth_lib" = "X"; then
+ { echo "$as_me:$LINENO: WARNING: SASL version unknown, omitting support!" >&5
+echo "$as_me: WARNING: SASL version unknown, omitting support!" >&2;}
+ sm_have_auth=no;
+ fi;
+ fi;
+
+ # < 8.12.4 can't handle saslv2+
+ v2i 8.12.99; # FIXME: need ldap & saslv2 1st !!!
+ if test $sm_version_math -lt $sm_version_test; then
+ if test $sm_auth_lib = 2; then
+ { echo "$as_me:$LINENO: WARNING: <8.12.4 & saslv$sm_auth_lib: trying saslv1" >&5
+echo "$as_me: WARNING: <8.12.4 & saslv$sm_auth_lib: trying saslv1" >&2;}
+ sm_auth_lib=1;
+ fi;
+ fi;
+
+ if test $sm_auth_lib = 2; then
+ junk='sasl2';
+ else
+ junk='sasl';
+ fi;
+
+ as_ac_Lib=`echo "ac_cv_lib_$junk''_sasl_client_init" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for sasl_client_init in -l$junk" >&5
+echo $ECHO_N "checking for sasl_client_init in -l$junk... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$junk $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char sasl_client_init ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+sasl_client_init ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ sm_have_auth=yes
+
+else
+ sm_have_auth=no
+fi
+
+
+ if test $sm_have_auth != yes; then
+ { echo "$as_me:$LINENO: WARNING: Could not find -l${junk} (lib${junk}-dev)" >&5
+echo "$as_me: WARNING: Could not find -l${junk} (lib${junk}-dev)" >&2;}
+ fi;
+
+ if test $sm_have_auth = yes; then
+ sm_features="$sm_features, SMTP AUTH(SASL)";
+ sm_badepends="$sm_badepends, lib${junk}-dev";
+ sm_suggests="$sm_suggests, ${junk}-bin";
+ sm_suggests="$sm_suggests, lib${junk}-modules-plain";
+ sm_suggests="$sm_suggests, lib${junk}-digestmd5-plain";
+ sm_suggests="$sm_suggests | lib${junk}-digestmd5-des";
+ sm_sendmail_envdef="$sm_sendmail_envdef -DSASL";
+ if test $ac_cv_header_sasl_sasl_h = yes; then
+ sm_sendmail_envdef="$sm_sendmail_envdef -I/usr/include/sasl";
+ fi;
+ if test "$sm_version_major" = "8.12"; then
+ :;
+ elif test "$sm_version_major" = "8.11"; then
+ sm_ffr="$sm_ffr -D_FFR_UNSAFE_SASL=1";
+ sm_ffr="$sm_ffr -D_FFR_SASL_OPTS=1";
+ sm_ffr="$sm_ffr -D_FFR_DEFAUTHINFO_MECHS=1";
+ elif test "$sm_version_major" = "8.10"; then
+ sm_ffr="$sm_ffr -D_FFR_UNSAFE_SASL=1";
+ sm_ffr="$sm_ffr -D_FFR_SASL_OPTS=1";
+ sm_ffr="$sm_ffr -D_FFR_DEFAUTHINFO_MECHS=1";
+ fi;
+ sm_sendmail_libs="$sm_sendmail_libs -l${junk}";
+ elif test $sm_enable_auth = auto; then
+ { echo "$as_me:$LINENO: WARNING: SMTP authentication not supported!" >&5
+echo "$as_me: WARNING: SMTP authentication not supported!" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: SMTP authentication not supported!" >&5
+echo "$as_me: error: SMTP authentication not supported!" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+sm_enable_auth=$sm_have_auth;
+
+
+#-------------------------------------------------------------------
+#
+# Check for presence of SSL headers
+#
+sm_have_tls=no;
+if test $sm_enable_tls != no; then
+
+for ac_header in openssl/ssl.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ sm_have_tls=yes
+
+else
+ sm_have_tls=no
+fi
+
+done
+
+
+ if test $ac_cv_header_openssl_ssl_h = yes; then
+ echo "$as_me:$LINENO: checking for SSL_library_init in -lssl" >&5
+echo $ECHO_N "checking for SSL_library_init in -lssl... $ECHO_C" >&6
+if test "${ac_cv_lib_ssl_SSL_library_init+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssl -lcrypto $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char SSL_library_init ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+SSL_library_init ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_ssl_SSL_library_init=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_ssl_SSL_library_init=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_library_init" >&5
+echo "${ECHO_T}$ac_cv_lib_ssl_SSL_library_init" >&6
+if test $ac_cv_lib_ssl_SSL_library_init = yes; then
+ sm_have_tls=yes
+
+else
+ sm_have_tls=no
+
+fi
+
+
+ if test $sm_have_tls != yes; then
+ { echo "$as_me:$LINENO: WARNING: Could not find -lssl (libssl-dev)" >&5
+echo "$as_me: WARNING: Could not find -lssl (libssl-dev)" >&2;}
+ fi;
+ fi;
+
+ # SFIO is required for TLS/SSL support on 8.11
+ if test $sm_have_tls = yes; then
+ if test $sm_have_sfio != yes -a \
+ "$sm_version_major" = '8.11'; then
+ { echo "$as_me:$LINENO: WARNING: SFIO is required for SSL privacy protection!" >&5
+echo "$as_me: WARNING: SFIO is required for SSL privacy protection!" >&2;}
+ sm_have_tls=no;
+ fi;
+ fi;
+
+ if test $sm_have_tls = yes; then
+ v2i 8.11.0;
+ if test $sm_version_math -ge $sm_version_test; then
+ sm_features="$sm_features, STARTTLS(SSL)";
+ sm_badepends="$sm_badepends, libssl-dev";
+ sm_suggests="$sm_suggests, openssl";
+ sm_sendmail_envdef="$sm_sendmail_envdef -DSTARTTLS";
+ sm_sendmail_libs="$sm_sendmail_libs -lcrypto -lssl";
+ sm_ffr="$sm_ffr -D_FFR_TLS_1";
+ fi;
+ v2i 8.12.0;
+ if test $sm_version_math -ge $sm_version_test; then
+ sm_ffr="$sm_ffr -D_FFR_SMTP_SSL";
+ fi;
+ elif test $sm_enable_tls = auto; then
+ { echo "$as_me:$LINENO: WARNING: SSL/TLS privacy protection not supported!" >&5
+echo "$as_me: WARNING: SSL/TLS privacy protection not supported!" >&2;}
+ else
+ { { echo "$as_me:$LINENO: error: SSL/TLS privacy protection not supported!" >&5
+echo "$as_me: error: SSL/TLS privacy protection not supported!" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;
+ fi;
+sm_enable_tls=$sm_have_tls;
+
+#-------------------------------------------------------------------
+# Any requisite variable cleanup
+#-------------------------------------------------------------------
+sm_databases=$(echo "${sm_databases}" | sed -e 's/^, //');
+sm_features=$(echo "${sm_features}" | sed -e 's/^, //');
+sm_badepends=$(echo "${sm_badepends}" | sed -e 's/^, //');
+sm_depends=$(echo "${sm_depends}" | sed -e 's/^, //');
+sm_recommends=$(echo "${sm_recommends}" | sed -e 's/^, //');
+sm_suggests=$(echo "${sm_suggests}" | sed -e 's/^, //');
+
+#-------------------------------------------------------------------
+# Add any FFRs to sendmail_ENVDEF
+#-------------------------------------------------------------------
+sm_sendmail_envdef="$sm_sendmail_envdef $sm_ffr";
+
+#-------------------------------------------------------------------
+# Below 8.10.0, there aren't separate variables per component... munge
+# hell yeah, the output is butt-ugly (duplicates, ordering), but too bad!
+# its not like (sane) people will be looking at these files anyway...
+#-------------------------------------------------------------------
+v2i 8.10.0;
+if test $sm_version_math -lt $sm_version_test; then
+ sm_envdef="$sm_envdef $sm_sendmail_envdef";
+ sm_envdef="$sm_envdef $sm_mail_local_envdef";
+ sm_envdef="$sm_envdef $sm_rmail_envdef";
+ sm_envdef="$sm_envdef $sm_smrsh_envdef";
+ sm_libs="$sm_libs $sm_sendmail_libs";
+ sm_libs="$sm_libs $sm_mail_local_libs";
+ fi;
+
+
+#-------------------------------------------------------------------
+# Fini - define configuration files, and commands upon them
+#-------------------------------------------------------------------
+ac_config_files="$ac_config_files ./build/autoconf.mk ./build/autoconf.pl ./build/autoconf.sh ./build/changelog.sh ./build/control.m4 ./build/update_chaos ./build/site.config.m4 ./rules:./build/rules.in ./libmilter-dev.dirs ./libmilter-dev.postrm ./libmilter-dev.preinst ./sendmail-doc.dirs ./sendmail-doc.postrm ./sendmail-doc.preinst ./sendmail.conffiles ./sendmail.cron.daily ./sendmail.dirs ./sendmail.init.d ./sendmail.links ./sendmail.postinst ./sendmail.postrm ./sendmail.preinst ./sendmail.prerm ./sendmail.suid ./cf/debian/autoconf.m4 ./cf/debian/sendmail.mc ./cf/debian/starttls.m4 ./cf/debian/submit.mc ./cf/domain/debian-msp.m4 ./cf/domain/debian-mta.m4 ./cf/hack/debian_auth.m4 ./cf/hack/virthost_by_ip.m4 ./cf/ostype/debian.m4 ./examples/Makefile ./local/Makefile ./local/Parse_mc.pm ./local/parse_mc ./local/sendmailconfig ./local/sendmail ./local/update_auth ./local/update_conf ./local/update_db ./local/update_ldap ./local/update_mc ./local/update_mk ./local/update_smrsh ./local/update_sys ./local/update_tls ./sensible_mda/Makefile ./sensible_mda/sensible-mda.c"
+ac_config_commands="$ac_config_commands default"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overriden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if cmp -s $cache_file confcache; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
+t quote
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output. A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# NLS nuisances.
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
+ { $as_unset LANG || test "${LANG+set}" != set; } ||
+ { LANG=C; export LANG; }
+(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
+ { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
+ { LC_ALL=C; export LC_ALL; }
+(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
+ { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
+ { LC_TIME=C; export LC_TIME; }
+(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
+ { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
+ { LC_CTYPE=C; export LC_CTYPE; }
+(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
+ { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
+ { LANGUAGE=C; export LANGUAGE; }
+(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
+ { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
+ { LC_COLLATE=C; export LC_COLLATE; }
+(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
+ { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
+ { LC_NUMERIC=C; export LC_NUMERIC; }
+(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
+ { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
+ { LC_MESSAGES=C; export LC_MESSAGES; }
+
+
+# Name of the executable.
+as_me=`(basename "$0") 2>/dev/null ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conftest.sh
+ echo "exit 0" >>conftest.sh
+ chmod +x conftest.sh
+ if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conftest.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by Sendmail $as_me 8.12.7, which was
+generated by GNU Autoconf 2.53. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+Sendmail config.status 8.12.7
+configured by $0, generated by GNU Autoconf 2.53,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ shift
+ set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
+ shift
+ ;;
+ -*);;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_need_defaults=false;;
+ esac
+
+ case $1 in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
+ exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ shift
+ CONFIG_FILES="$CONFIG_FILES $1"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $1"
+ ac_need_defaults=false;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+_ACEOF
+
+
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "./build/autoconf.mk" ) CONFIG_FILES="$CONFIG_FILES ./build/autoconf.mk" ;;
+ "./build/autoconf.pl" ) CONFIG_FILES="$CONFIG_FILES ./build/autoconf.pl" ;;
+ "./build/autoconf.sh" ) CONFIG_FILES="$CONFIG_FILES ./build/autoconf.sh" ;;
+ "./build/changelog.sh" ) CONFIG_FILES="$CONFIG_FILES ./build/changelog.sh" ;;
+ "./build/control.m4" ) CONFIG_FILES="$CONFIG_FILES ./build/control.m4" ;;
+ "./build/update_chaos" ) CONFIG_FILES="$CONFIG_FILES ./build/update_chaos" ;;
+ "./build/site.config.m4" ) CONFIG_FILES="$CONFIG_FILES ./build/site.config.m4" ;;
+ "./rules" ) CONFIG_FILES="$CONFIG_FILES ./rules:./build/rules.in" ;;
+ "./libmilter-dev.dirs" ) CONFIG_FILES="$CONFIG_FILES ./libmilter-dev.dirs" ;;
+ "./libmilter-dev.postrm" ) CONFIG_FILES="$CONFIG_FILES ./libmilter-dev.postrm" ;;
+ "./libmilter-dev.preinst" ) CONFIG_FILES="$CONFIG_FILES ./libmilter-dev.preinst" ;;
+ "./sendmail-doc.dirs" ) CONFIG_FILES="$CONFIG_FILES ./sendmail-doc.dirs" ;;
+ "./sendmail-doc.postrm" ) CONFIG_FILES="$CONFIG_FILES ./sendmail-doc.postrm" ;;
+ "./sendmail-doc.preinst" ) CONFIG_FILES="$CONFIG_FILES ./sendmail-doc.preinst" ;;
+ "./sendmail.conffiles" ) CONFIG_FILES="$CONFIG_FILES ./sendmail.conffiles" ;;
+ "./sendmail.cron.daily" ) CONFIG_FILES="$CONFIG_FILES ./sendmail.cron.daily" ;;
+ "./sendmail.dirs" ) CONFIG_FILES="$CONFIG_FILES ./sendmail.dirs" ;;
+ "./sendmail.init.d" ) CONFIG_FILES="$CONFIG_FILES ./sendmail.init.d" ;;
+ "./sendmail.links" ) CONFIG_FILES="$CONFIG_FILES ./sendmail.links" ;;
+ "./sendmail.postinst" ) CONFIG_FILES="$CONFIG_FILES ./sendmail.postinst" ;;
+ "./sendmail.postrm" ) CONFIG_FILES="$CONFIG_FILES ./sendmail.postrm" ;;
+ "./sendmail.preinst" ) CONFIG_FILES="$CONFIG_FILES ./sendmail.preinst" ;;
+ "./sendmail.prerm" ) CONFIG_FILES="$CONFIG_FILES ./sendmail.prerm" ;;
+ "./sendmail.suid" ) CONFIG_FILES="$CONFIG_FILES ./sendmail.suid" ;;
+ "./cf/debian/autoconf.m4" ) CONFIG_FILES="$CONFIG_FILES ./cf/debian/autoconf.m4" ;;
+ "./cf/debian/sendmail.mc" ) CONFIG_FILES="$CONFIG_FILES ./cf/debian/sendmail.mc" ;;
+ "./cf/debian/starttls.m4" ) CONFIG_FILES="$CONFIG_FILES ./cf/debian/starttls.m4" ;;
+ "./cf/debian/submit.mc" ) CONFIG_FILES="$CONFIG_FILES ./cf/debian/submit.mc" ;;
+ "./cf/domain/debian-msp.m4" ) CONFIG_FILES="$CONFIG_FILES ./cf/domain/debian-msp.m4" ;;
+ "./cf/domain/debian-mta.m4" ) CONFIG_FILES="$CONFIG_FILES ./cf/domain/debian-mta.m4" ;;
+ "./cf/hack/debian_auth.m4" ) CONFIG_FILES="$CONFIG_FILES ./cf/hack/debian_auth.m4" ;;
+ "./cf/hack/virthost_by_ip.m4" ) CONFIG_FILES="$CONFIG_FILES ./cf/hack/virthost_by_ip.m4" ;;
+ "./cf/ostype/debian.m4" ) CONFIG_FILES="$CONFIG_FILES ./cf/ostype/debian.m4" ;;
+ "./examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES ./examples/Makefile" ;;
+ "./local/Makefile" ) CONFIG_FILES="$CONFIG_FILES ./local/Makefile" ;;
+ "./local/Parse_mc.pm" ) CONFIG_FILES="$CONFIG_FILES ./local/Parse_mc.pm" ;;
+ "./local/parse_mc" ) CONFIG_FILES="$CONFIG_FILES ./local/parse_mc" ;;
+ "./local/sendmailconfig" ) CONFIG_FILES="$CONFIG_FILES ./local/sendmailconfig" ;;
+ "./local/sendmail" ) CONFIG_FILES="$CONFIG_FILES ./local/sendmail" ;;
+ "./local/update_auth" ) CONFIG_FILES="$CONFIG_FILES ./local/update_auth" ;;
+ "./local/update_conf" ) CONFIG_FILES="$CONFIG_FILES ./local/update_conf" ;;
+ "./local/update_db" ) CONFIG_FILES="$CONFIG_FILES ./local/update_db" ;;
+ "./local/update_ldap" ) CONFIG_FILES="$CONFIG_FILES ./local/update_ldap" ;;
+ "./local/update_mc" ) CONFIG_FILES="$CONFIG_FILES ./local/update_mc" ;;
+ "./local/update_mk" ) CONFIG_FILES="$CONFIG_FILES ./local/update_mk" ;;
+ "./local/update_smrsh" ) CONFIG_FILES="$CONFIG_FILES ./local/update_smrsh" ;;
+ "./local/update_sys" ) CONFIG_FILES="$CONFIG_FILES ./local/update_sys" ;;
+ "./local/update_tls" ) CONFIG_FILES="$CONFIG_FILES ./local/update_tls" ;;
+ "./sensible_mda/Makefile" ) CONFIG_FILES="$CONFIG_FILES ./sensible_mda/Makefile" ;;
+ "./sensible_mda/sensible-mda.c" ) CONFIG_FILES="$CONFIG_FILES ./sensible_mda/sensible-mda.c" ;;
+ "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=$TMPDIR/cs$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@SM_VERS@,$SM_VERS,;t t
+s,@SM_DATE@,$SM_DATE,;t t
+s,@SM_MINVERS@,$SM_MINVERS,;t t
+s,@SM_MAXVERS@,$SM_MAXVERS,;t t
+s,@SM_CPYRT@,$SM_CPYRT,;t t
+s,@sm_date@,$sm_date,;t t
+s,@sm_time@,$sm_time,;t t
+s,@sm_utc@,$sm_utc,;t t
+s,@sm_version@,$sm_version,;t t
+s,@sm_version_v@,$sm_version_v,;t t
+s,@sm_version_r@,$sm_version_r,;t t
+s,@sm_version_major@,$sm_version_major,;t t
+s,@sm_version_minor@,$sm_version_minor,;t t
+s,@sm_version_beta@,$sm_version_beta,;t t
+s,@sm_version_math@,$sm_version_math,;t t
+s,@sm_revision@,$sm_revision,;t t
+s,@buildtree@,$buildtree,;t t
+s,@docdir@,$docdir,;t t
+s,@sm_dist_name@,$sm_dist_name,;t t
+s,@sm_dist_vers@,$sm_dist_vers,;t t
+s,@DEBIAN@,$DEBIAN,;t t
+s,@DEBIAN_DH@,$DEBIAN_DH,;t t
+s,@DEB_BUILD_ARCH@,$DEB_BUILD_ARCH,;t t
+s,@DEB_BUILD_GNU_CPU@,$DEB_BUILD_GNU_CPU,;t t
+s,@DEB_BUILD_GNU_SYSTEM@,$DEB_BUILD_GNU_SYSTEM,;t t
+s,@DEB_BUILD_GNU_TYPE@,$DEB_BUILD_GNU_TYPE,;t t
+s,@DEB_HOST_ARCH@,$DEB_HOST_ARCH,;t t
+s,@DEB_HOST_GNU_CPU@,$DEB_HOST_GNU_CPU,;t t
+s,@DEB_HOST_GNU_SYSTEM@,$DEB_HOST_GNU_SYSTEM,;t t
+s,@DEB_HOST_GNU_TYPE@,$DEB_HOST_GNU_TYPE,;t t
+s,@sm_build_arch@,$sm_build_arch,;t t
+s,@sm_host_arch@,$sm_host_arch,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@CPP@,$CPP,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@sm_incdirs@,$sm_incdirs,;t t
+s,@sm_mapdef@,$sm_mapdef,;t t
+s,@sm_envdef@,$sm_envdef,;t t
+s,@sm_libs@,$sm_libs,;t t
+s,@sm_editmap_envdef@,$sm_editmap_envdef,;t t
+s,@sm_editmap_libs@,$sm_editmap_libs,;t t
+s,@sm_libmilter_envdef@,$sm_libmilter_envdef,;t t
+s,@sm_libmilter_libs@,$sm_libmilter_libs,;t t
+s,@sm_libsm_envdef@,$sm_libsm_envdef,;t t
+s,@sm_libsm_libs@,$sm_libsm_libs,;t t
+s,@sm_libsmdb_envdef@,$sm_libsmdb_envdef,;t t
+s,@sm_libsmdb_libs@,$sm_libsmdb_libs,;t t
+s,@sm_libsmutil_envdef@,$sm_libsmutil_envdef,;t t
+s,@sm_libsmutil_libs@,$sm_libsmutil_libs,;t t
+s,@sm_mail_local_envdef@,$sm_mail_local_envdef,;t t
+s,@sm_mail_local_libs@,$sm_mail_local_libs,;t t
+s,@sm_mailstats_envdef@,$sm_mailstats_envdef,;t t
+s,@sm_mailstats_libs@,$sm_mailstats_libs,;t t
+s,@sm_makemap_envdef@,$sm_makemap_envdef,;t t
+s,@sm_makemap_libs@,$sm_makemap_libs,;t t
+s,@sm_praliases_envdef@,$sm_praliases_envdef,;t t
+s,@sm_praliases_libs@,$sm_praliases_libs,;t t
+s,@sm_rmail_envdef@,$sm_rmail_envdef,;t t
+s,@sm_rmail_libs@,$sm_rmail_libs,;t t
+s,@sm_sendmail_envdef@,$sm_sendmail_envdef,;t t
+s,@sm_sendmail_libs@,$sm_sendmail_libs,;t t
+s,@sm_smrsh_envdef@,$sm_smrsh_envdef,;t t
+s,@sm_smrsh_libs@,$sm_smrsh_libs,;t t
+s,@sm_vacation_envdef@,$sm_vacation_envdef,;t t
+s,@sm_vacation_libs@,$sm_vacation_libs,;t t
+s,@sm_databases@,$sm_databases,;t t
+s,@sm_features@,$sm_features,;t t
+s,@sm_badepends@,$sm_badepends,;t t
+s,@sm_depends@,$sm_depends,;t t
+s,@sm_recommends@,$sm_recommends,;t t
+s,@sm_suggests@,$sm_suggests,;t t
+s,@sm_newdb_lib@,$sm_newdb_lib,;t t
+s,@sm_ldap_lib@,$sm_ldap_lib,;t t
+s,@sm_hesiod_parms@,$sm_hesiod_parms,;t t
+s,@sm_ffr@,$sm_ffr,;t t
+s,@sm_m4_ffr@,$sm_m4_ffr,;t t
+s,@sm_enable_doc@,$sm_enable_doc,;t t
+s,@sm_enable_dev@,$sm_enable_dev,;t t
+s,@sm_enable_shm@,$sm_enable_shm,;t t
+s,@sm_enable_milter@,$sm_enable_milter,;t t
+s,@sm_enable_regex@,$sm_enable_regex,;t t
+s,@sm_enable_ndbm@,$sm_enable_ndbm,;t t
+s,@sm_enable_newdb@,$sm_enable_newdb,;t t
+s,@sm_enable_nis@,$sm_enable_nis,;t t
+s,@sm_enable_nisplus@,$sm_enable_nisplus,;t t
+s,@sm_enable_ldap@,$sm_enable_ldap,;t t
+s,@sm_enable_bind@,$sm_enable_bind,;t t
+s,@sm_enable_hesiod@,$sm_enable_hesiod,;t t
+s,@sm_enable_tcpd@,$sm_enable_tcpd,;t t
+s,@sm_enable_ipv6@,$sm_enable_ipv6,;t t
+s,@sm_enable_maillock@,$sm_enable_maillock,;t t
+s,@sm_enable_sfio@,$sm_enable_sfio,;t t
+s,@sm_enable_auth@,$sm_enable_auth,;t t
+s,@sm_auth_lib@,$sm_auth_lib,;t t
+s,@sm_enable_tls@,$sm_enable_tls,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { case "$ac_dir" in
+ [\\/]* | ?:[\\/]* ) as_incr_dir=;;
+ *) as_incr_dir=.;;
+esac
+as_dummy="$ac_dir"
+for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
+ case $as_mkdir_dir in
+ # Skip DOS drivespec
+ ?:) as_incr_dir=$as_mkdir_dir ;;
+ *)
+ as_incr_dir=$as_incr_dir/$as_mkdir_dir
+ test -d "$as_incr_dir" ||
+ mkdir "$as_incr_dir" ||
+ { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+done; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ default )
+#
+# Update the files just created
+echo 'creating ./changelog';
+chmod ug+x ./build/changelog.sh;
+./build/changelog.sh;
+echo 'creating ./control';
+m4 ./build/control.m4 > ./control;
+echo 'Updating Build setup';
+chmod ug+x ./build/update_chaos;
+(cd ../ && ./debian/build/update_chaos);
+#
+# Make *.{pre,post}{rm,inst} executable
+chmod ug+x ./libmilter-dev.postrm;
+chmod ug+x ./libmilter-dev.preinst;
+chmod ug+x ./sendmail-doc.postrm;
+chmod ug+x ./sendmail-doc.preinst;
+chmod ug+x ./sendmail.cron.daily;
+chmod ug+x ./sendmail.init.d;
+chmod ug+x ./sendmail.postinst;
+chmod ug+x ./sendmail.postrm;
+chmod ug+x ./sendmail.preinst;
+chmod ug+x ./sendmail.prerm;
+#
+# Make rules, */Makefile executable
+chmod ug+x ./rules;
+chmod ug+x ./local/Makefile;
+chmod ug+x ./sensible_mda/Makefile;
+#
+# Make other, misc files executable
+chmod ug+x ./local/Parse_mc.pm;
+chmod ug+x ./local/parse_mc;
+chmod ug+x ./local/sendmailconfig;
+chmod ug+x ./local/sendmail;
+chmod ug+x ./local/update_auth;
+chmod ug+x ./local/update_conf;
+chmod ug+x ./local/update_db;
+chmod ug+x ./local/update_ldap;
+chmod ug+x ./local/update_mc;
+chmod ug+x ./local/update_mk;
+chmod ug+x ./local/update_smrsh;
+chmod ug+x ./local/update_sys;
+chmod ug+x ./local/update_tls;
+ ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff --git a/debian/configure.ac b/debian/configure.ac
new file mode 100644
index 0000000..4bd0a41
--- /dev/null
+++ b/debian/configure.ac
@@ -0,0 +1 @@
+Mon Mar 3 22:36:13 UTC 2003
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..98b25d5
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,99 @@
+Source: sendmail
+Priority: extra
+Section: mail
+Maintainer: Richard A Nelson (Rick) <cowboy@debian.org>
+Standards-Version: 3.5.7.0
+Build-Depends-Indep: groff, bsdmainutils
+Build-Depends: m4, patch, debhelper (>= 1.1.17), libdb3-dev, libldap2-dev, libwrap0-dev, liblockfile-dev, libsasl-dev, libssl-dev
+
+Package: sendmail
+Architecture: any
+Section: mail
+Replaces: mail-transport-agent, sendmail-tls
+Provides: mail-transport-agent
+Conflicts: mail-transport-agent
+Depends: adduser, m4, ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends},
+Recommends:
+Suggests: sendmail-doc (>= ${Source-Version}), mail-reader, procmail | mailagent | maildrop | deliver, make, logcheck, logrotate, sasl-bin, libsasl-modules-plain, libsasl-digestmd5-plain | libsasl-digestmd5-des, openssl
+Description: A powerful, efficient, and scalable Mail Transport Agent
+ Sendmail is an alternative Mail Transport Agent (MTA) for Debian.
+ It is suitable for handling sophisticated mail configurations,
+ although this means that its configuration can also be complex.
+ Fortunately, easy thing can be done easily, and complex things
+ are possible, even if not easily understood ;) Sendmail is the *ONLY*
+ MTA with a Turing complete language to control *ALL* aspects of delivery!
+ .
+ Sendmail provides Security and SPAM/UCE/UBE protection via several means:
+ - STARTTLS(SSL) RFC2487 encryption for mail reception/delivery.
+ - STARTTLS(SSL) authentication (certificate based) for access/relay control.
+ - SMTP AUTH (SASL/PAM) authentication for access/relay control.
+ - ACCESS database (by IP/host) for access/relay control.
+ - Use of varied Realtime Blackhole Lists (RBL) to prevent access.
+ - Integration of LOGCHECK rules to fine-tune logging.
+ - Inboard POSIX Regular Expression processing of *all* headers.
+ - Ability (via MILTER) to scan/change headers *and* body of *ALL* mail
+ A site may utilize zero, one, or more MILTERs.
+ - Reduced SUID exposures by running SGID smmsp/mail where possible.
+ .
+ Sendmail provides Performance and Scalability by:
+ - Allowing multiple queues, with the ability to tune both interval and
+ queue runners on a queue by queue basis.
+ - Providing (a Debian exclusive) an easy to configure means of queue-aging
+ to improve throughput by not continually retrying failed deliveries.
+ - Allowing most all maps/databases to be obtained via LDAP; reducing the
+ number of used databases and simplifying the maintenance of Sendmail.
+ - Reducing the file I/O where possible by buffering files in memory.
+ .
+ Sendmail provides site enhanced site configuration/customization by:
+ - Allowing the listener (usually port 25) to run as a daemon or via INETD.
+ - Allowing the queue runner (mail delivery) to run as a daemon or via CRON.
+ - Automagically updating configuration and databases on upgrades.
+ - Providing a Turing complete language for site customization of mail
+ handling.
+ - Providing a means (MILTER) for a site to scan/change all email - both
+ incoming and outgoing. A site can write their own MILTER, or may use
+ any of those found on internet. To write your own MILTER, you'll need
+ to install the optional milter-dev package.
+ - Providing extensive documentation via the sendmail-doc (optional) package.
+ - Providing an inboard Mail Delivery Agent (MDA) (mail.local), but supporting
+ procmail, mailagent, maildrop, or deliver automatically if installed.
+ Sendmail will also deliver to anythings else (cyrus, etc) if asked to.
+ .
+ Sendmail includes *no* Mail User Agents (MUA), you'll have to
+ pick from the plethora of available MUAs (pine, mutt, vm, etc.)
+ .
+ This package supports REGEX, DB, NIS, NIS+, LDAP, DNS maps,
+ and has enabled TCPWrappers, IPv6, LockFile, SMTP AUTH(SASL), STARTTLS(SSL).
+
+Package: libmilter-dev
+Architecture: any
+Section: devel
+Suggests: sendmail-doc (>= ${Source-Version})
+Description: Sendmail Mail Filter API (Milter)
+ The Sendmail Mail Filter API (Milter) is designed to allow third-party
+ programs access to mail messages as they are being processed in order
+ to filter meta-information(headers) and content.
+ .
+ The Debian Sendmail package is built to support libmilter.
+ .
+ This is the libmilter static library and include files for development.
+ .
+ The documentation on building a Milter is in the sendmail-doc package.
+
+Package: sendmail-doc
+Architecture: all
+Section: doc
+Description: A powerful, efficient, and scalable Mail Transport Agent
+ Sendmail is an alternative Mail Transport Agent (MTA) for
+ Debian. It is suitable for handling sophisticated mail
+ configurations, although this means that its configuration
+ can also be complex.
+ .
+ Because of the complexity, you may find yourself wanting to peruse
+ the documentation files included herein. The main files are:
+ 1) cf.README.gz -- A reference for all things in sendmail.{mc,cf}
+ 2) op.{ps,txt}.gz -- The care and feeding of Sendmail.
+ 3) faq.txt.gz -- Sendmail FAQ, current as of the package date.
+ .
+ Other files include the references for smrsh and libmilter.
+
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..d561c8b
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,91 @@
+This is the Debian Linux prepackaged version of Sendmail, a powerful mail
+transport agent.
+
+This package was put together by Robert Leslie <rob@mars.org>, was
+maintained by Johnie Ingram <johnie@debian.org>, and is now being
+maintained by Richard Nelson <cowboy@debian.org>. The sources were
+were obtained from:
+
+ ftp://ftp.sendmail.org/pub/sendmail/
+
+ The following copyright applies to this software:
+
+ SENDMAIL LICENSE
+
+The following license terms and conditions apply, unless a different
+license is obtained from Sendmail, Inc., 6425 Christie Ave, Fourth Floor,
+Emeryville, CA 94608, or by electronic mail at license@sendmail.com.
+
+License Terms:
+
+Use, Modification and Redistribution (including distribution of any
+modified or derived work) in source and binary forms is permitted only if
+each of the following conditions is met:
+
+1. Redistributions qualify as "freeware" or "Open Source Software" under
+ one of the following terms:
+
+ (a) Redistributions are made at no charge beyond the reasonable cost of
+ materials and delivery.
+
+ (b) Redistributions are accompanied by a copy of the Source Code or by an
+ irrevocable offer to provide a copy of the Source Code for up to three
+ years at the cost of materials and delivery. Such redistributions
+ must allow further use, modification, and redistribution of the Source
+ Code under substantially the same terms as this license. For the
+ purposes of redistribution "Source Code" means the complete compilable
+ and linkable source code of sendmail including all modifications.
+
+2. Redistributions of source code must retain the copyright notices as they
+ appear in each source code file, these license terms, and the
+ disclaimer/limitation of liability set forth as paragraph 6 below.
+
+3. Redistributions in binary form must reproduce the Copyright Notice,
+ these license terms, and the disclaimer/limitation of liability set
+ forth as paragraph 6 below, in the documentation and/or other materials
+ provided with the distribution. For the purposes of binary distribution
+ the "Copyright Notice" refers to the following language:
+ "Copyright (c) 1998-2001 Sendmail, Inc. All rights reserved."
+
+4. Neither the name of Sendmail, Inc. nor the University of California nor
+ the names of their contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission. The name "sendmail" is a trademark of Sendmail, Inc.
+
+5. All redistributions must comply with the conditions imposed by the
+ University of California on certain embedded code, whose copyright
+ notice and conditions for redistribution are as follows:
+
+ (a) Copyright (c) 1988, 1993 The Regents of the University of
+ California. All rights reserved.
+
+ (b) Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ (i) Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ (ii) 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.
+
+ (iii) 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.
+
+6. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY
+ SENDMAIL, INC. 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 SENDMAIL, INC., THE REGENTS OF THE UNIVERSITY OF
+ CALIFORNIA 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 DAMAGES.
+
+$Revision: 8.10 $, Last updated $Date: 2001/02/14 04:39:34 $
diff --git a/debian/examples/Makefile.in b/debian/examples/Makefile.in
new file mode 100644
index 0000000..aef3815
--- /dev/null
+++ b/debian/examples/Makefile.in
@@ -0,0 +1,124 @@
+#!/usr/bin/make -f
+#------------------------------------------------------------------------------
+# vim: syntax=make
+#
+# $Sendmail: Makefile,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# Rules file for Sendmail @sm_version@@sm_revision@(@sm_version_math@)
+# on @sm_dist_name@ @sm_dist_vers@
+# via Debhelper V@DEBIAN_DH@
+#
+# Note: the .in file supports Sendmail @SM_MINVERS@ - @SM_MAXVERS@
+# on Debian slink, potato, woody, testing, sid, ...
+# but the generated file is customized to the version noted above.
+#
+# Richard Nelson <cowboy@debian.org> @sm_date@ @sm_time@ (@sm_utc@)
+#------------------------------------------------------------------------------
+#SHELL=/bin/sh -x
+
+# Include Debian Autoconf settings
+-include ../build/autoconf.mk
+
+ALL_SUBDIRS = . amavis db dialup ldap logcheck milter pam sasl tls
+DATA_SUBDIRS = amavis db ldap pam sasl tls
+SCRIPT_SUBDIRS = dialup
+
+all:
+
+clean:
+ for subdir in ${ALL_SUBDIRS}; do \
+ rm -rf $${subdir}/core $${subdir}/*~; \
+ done;
+
+setup:
+
+build-indep:
+build-arch:
+ #
+ # Debian Local additions / changes
+ #
+ # examples/ldap/sendmail.schema.v2 - conditional
+ #
+ if (grep -qEe "^#LDAP:[[:space:]]*yes" ../build/site.config.m4); then \
+ if [ -e ../../${buildtree}/cf/sendmail.schema ]; then \
+ $(INSTALL_DATA) ../../${buildtree}/cf/sendmail.schema \
+ ldap/sendmail.schema.v2; \
+ fi; \
+ fi;
+
+install-indep: build-indep
+install-arch: build-arch
+ #
+ # Debian Local additions / changes
+ #
+ # ${sysconfdir}/ppp/ip-{up,down}.d - unconditional
+ #
+ $(INSTALL) -d ${sysconfdir}/ppp/ip-up.d;
+ $(INSTALL_SCRIPT) dialup/ip-up.d \
+ ${sysconfdir}/ppp/ip-up.d/sendmail;
+ $(INSTALL) -d ${sysconfdir}/ppp/ip-down.d;
+ $(INSTALL_SCRIPT) dialup/ip-down.d \
+ ${sysconfdir}/ppp/ip-down.d/sendmail;
+ #
+ # ${sysconfdir}/pam.d - unconditional
+ #
+ $(INSTALL) -d ${sysconfdir}/pam.d;
+ $(INSTALL_DATA) pam/* \
+ ${sysconfdir}/pam.d;
+ #
+ # ${sysconfdir}/logcheck - unconditional
+ #
+ (cd logcheck && \
+ for file in $$(find . -type d); do \
+ $(INSTALL) -d ../${sysconfdir}/logcheck/$$file; \
+ done;);
+ for file in $$(find logcheck -type f -name '*sendmail'); do \
+ $(INSTALL_DATA) $$file \
+ ${sysconfdir}/logcheck/$$(echo "$$file" \
+ | sed -e 's?^.*logcheck/??'); \
+ done;
+ #
+ # ${datadir}/sendmail/examples - unconditional
+ #
+ for subdir in ${DATA_SUBDIRS}; do \
+ $(INSTALL) -d ${datadir}/sendmail/examples/$$subdir; \
+ find $$subdir -type f ! -name '*.in' | xargs -ri \
+ $(INSTALL_DATA) '{}' ${datadir}/sendmail/examples/$$subdir; \
+ done;
+ for subdir in ${SCRIPT_SUBDIRS}; do \
+ $(INSTALL) -d ${datadir}/sendmail/examples/$$subdir; \
+ find $$subdir -type f ! -name '*.in' | xargs -ri \
+ $(INSTALL_SCRIPT) '{}' ${datadir}/sendmail/examples/$$subdir; \
+ done;
+ # Can't simply $(INSTALL) logcheck, has subdirs...
+ $(INSTALL) -d ${datadir}/sendmail/examples/logcheck;
+ cp -a logcheck/* \
+ ${datadir}/sendmail/examples/logcheck;
+ #
+ # ${datadir}/sendmail/examples - conditional
+ #
+ if (grep -qEe "^#MILTER:[[:space:]]*yes" ../build/site.config.m4); then \
+ $(INSTALL) -d ${datadir}/sendmail/examples/milter; \
+ $(INSTALL_DATA) milter/* \
+ ${datadir}/sendmail/examples/milter; \
+ chmod a+x \
+ ${datadir}/sendmail/examples/milter/Makefile; \
+ fi;
+
+#-------------
+# Below here is fairly generic really
+
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+build: build-indep build-arch
+install: install-indep install-arch
+.PHONY: all
+.PHONY: setup
+.PHONY: clean build build-indep build-arch
+.PHONY: install install-indep install-arch
+.PHONY: source diff
diff --git a/debian/examples/amavis-doc/README b/debian/examples/amavis-doc/README
new file mode 100644
index 0000000..c2e3d86
--- /dev/null
+++ b/debian/examples/amavis-doc/README
@@ -0,0 +1,8 @@
+The files herein are from Jean-Paul Stewart <jps@maxlingua.com>
+
+To add to the sendmail/examples directory:
+ 1) place new amavis-doc.tar.gz in this directory
+ 2) tar -xzf amavis-doc.tar.gz
+ 3) mv amavis-doc/amavis-doc.lyx ./
+ 4) rm ../amavis/*
+ 5) mv amavis-doc/* ../amavis/
diff --git a/debian/examples/amavis-doc/amavis-doc.lyx b/debian/examples/amavis-doc/amavis-doc.lyx
new file mode 100644
index 0000000..180015b
--- /dev/null
+++ b/debian/examples/amavis-doc/amavis-doc.lyx
@@ -0,0 +1,904 @@
+#LyX 1.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 218
+\textclass linuxdoc
+\language english
+\inputencoding default
+\fontscheme default
+\graphics default
+\paperfontsize 10
+\spacing single
+\papersize Default
+\paperpackage a4
+\use_geometry 0
+\use_amsmath 0
+\paperorientation portrait
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\defskip medskip
+\quotes_language english
+\quotes_times 2
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+
+\layout Title
+\added_space_top vfill \added_space_bottom vfill
+How to Install Amavis-milter for Debian Sendmail
+\layout Author
+
+Jean-Paul Stewart <jps@maxlingua.com>
+\layout Date
+
+23.10.2001
+\layout Abstract
+
+This document provides a step-by-step guide to the installation and configuratio
+n of the Amavis antivirus software available from
+\begin_inset LatexCommand \url{http://www.amavis.org/}
+
+\end_inset
+
+ on the Debian GNU/Linux operating system.
+ It has been adapted from the documentation available there.
+ Amavis supports many different methods of implementation.
+ I have chosen to implement Amavis-libmilter as the interface between Amavis
+ and Sendmail.
+ Another option with Amavis + Sendmail, which I am not describing here,
+ involves employing Amavis as a sort of intermediate local delivery agent.
+ Please be advised that this software requires an existing CLI antivirus
+ scanning engine and database.
+ The selection and procurement of such software is not discussed in this
+ document.
+ There is ample information available at the amavis.org site.
+ These installation examples make extensive use of the outstanding Sendmail
+ and libmilter-dev Debian packages maintained by Richard
+\begin_inset Quotes eld
+\end_inset
+
+cowboy
+\begin_inset Quotes erd
+\end_inset
+
+ Nelson.
+ Thanks Cowboy! Thank you Amavis developers!
+\layout Standard
+
+
+\begin_inset LatexCommand \tableofcontents{}
+
+\end_inset
+
+
+\layout Section
+
+Software Dependencies
+\layout Enumerate
+
+At a minimum you need to be running the Debian 3.0 (Woody) distribution from
+
+\begin_inset LatexCommand \url{http://www.debian.org/}
+
+\end_inset
+
+.
+ Older versions of Debian do not provide an adequate sendmail package (they
+ lack the libmilter API).
+\layout Enumerate
+
+Obviously, sendmail needs to be installed on your system.
+\layout Enumerate
+
+As mentioned in the abstract, you will have to obtain your own antiviral
+ engine from an independent vendor.
+\layout Enumerate
+
+The
+\begin_inset Quotes eld
+\end_inset
+
+file
+\begin_inset Quotes erd
+\end_inset
+
+ package.
+\layout Enumerate
+
+The
+\begin_inset Quotes eld
+\end_inset
+
+arc
+\begin_inset Quotes erd
+\end_inset
+
+ utility.
+ It is not available as a Debian package.
+ You can obtain the source code for this program at
+\begin_inset LatexCommand \url{ftp://metalab.unc.edu/pub/Linux/utils/compress/arc521.tar.Z}
+
+\end_inset
+
+.
+
+\layout Enumerate
+
+The
+\begin_inset Quotes eld
+\end_inset
+
+bzip2
+\begin_inset Quotes erd
+\end_inset
+
+ package.
+\layout Enumerate
+
+The
+\begin_inset Quotes eld
+\end_inset
+
+lha
+\begin_inset Quotes erd
+\end_inset
+
+ package.
+\layout Enumerate
+
+The
+\begin_inset Quotes eld
+\end_inset
+
+unarj
+\begin_inset Quotes erd
+\end_inset
+
+ package.
+\layout Enumerate
+
+The
+\begin_inset Quotes eld
+\end_inset
+
+unrar
+\begin_inset Quotes erd
+\end_inset
+
+ package.
+\layout Enumerate
+
+The
+\begin_inset Quotes eld
+\end_inset
+
+zoo
+\begin_inset Quotes erd
+\end_inset
+
+ package.
+\layout Enumerate
+
+You may need to install a few perl modules.
+ The required modules are
+\layout Itemize
+
+IO-stringy
+\layout Itemize
+
+Syslog
+\layout Itemize
+
+MailTools
+\layout Itemize
+
+MIME-Base64
+\layout Itemize
+
+MIME-tools
+\layout Itemize
+
+Convert-UUlib
+\layout Itemize
+
+Convert-TNEF
+\layout Itemize
+
+Compress-Zlib
+\layout Itemize
+
+Archive-Tar
+\layout Itemize
+
+Archive-Zip
+\layout Itemize
+
+libnet
+\layout Section
+
+Installing the Software Dependencies
+\layout Standard
+
+Update your distribution files with the usual:
+\layout Verbatim
+
+apt-get update
+\layout Standard
+
+and install file, bzip2, lha, unarj, unrar, and zoo in one shot with:
+\layout Verbatim
+
+apt-get install file bzip2 lha unarj unrar zoo
+\layout Standard
+
+Install all the perl modules in one shot with:
+\layout Verbatim
+
+apt-get install libio-stringy-perl libunix-syslog-perl libmailtools-perl
+ libmime-base64-perl libmime-perl libconvert-uulib-perl libconvert-tnef-perl
+ libcompress-zlib-perl libarchive-tar-perl libarchive-zip-perl libnet-perl
+\layout Standard
+
+Installing the
+\begin_inset Quotes eld
+\end_inset
+
+arc
+\begin_inset Quotes erd
+\end_inset
+
+ utility is much more of a hassle.
+ Furthermore, it is an unmaintained old MS-DOS port with a non-free license.
+ I will describe what I did to compile it on a Intel platform (suggestions
+ on better ways to do this are appreciated).
+ The next few steps assume that you have the GNU
+\begin_inset Quotes eld
+\end_inset
+
+make
+\begin_inset Quotes erd
+\end_inset
+
+ and
+\begin_inset Quotes eld
+\end_inset
+
+gcc
+\begin_inset Quotes erd
+\end_inset
+
+ packges installed on your system.
+ If this is not the case then try:
+\layout Verbatim
+
+apt-get install make gcc
+\layout Standard
+
+Let's create a temporary directory somewhere so that we can make a mess
+ in it.
+ Since my login is
+\begin_inset Quotes eld
+\end_inset
+
+jps
+\begin_inset Quotes erd
+\end_inset
+
+, I made a directory named
+\begin_inset Quotes eld
+\end_inset
+
+/home/jps/tmp/
+\begin_inset Quotes erd
+\end_inset
+
+.
+ Copy the arc521.tar.Z file into your new temporary diretory and type:
+\layout Verbatim
+
+uncompress arc521.tar.Z; tar xf arc521.tar
+\layout Standard
+
+or something equivalent to uncompress and untar the archive.
+ This will create a bunch of files.
+ We need to delete some lines from the file named
+\begin_inset Quotes eld
+\end_inset
+
+arcdos.c
+\begin_inset Quotes erd
+\end_inset
+
+.
+ It is probably set to be read-only, so type:
+\layout Verbatim
+
+chmod u+w arcdos.c
+\layout Standard
+
+Open arcdos.c for editing and delete (or comment out) lines 35-38 inclusive.
+ (It is the definition of a structure that begins with
+\begin_inset Quotes eld
+\end_inset
+
+struct timeval
+\begin_inset Quotes erd
+\end_inset
+
+ on line 35 and ends with
+\begin_inset Quotes eld
+\end_inset
+
+};
+\begin_inset Quotes erd
+\end_inset
+
+ on line 38).
+ We are done with that, so close the file.
+ Now type:
+\layout Verbatim
+
+make
+\layout Standard
+
+This command WILL FAIL with a bunch of warnings and an error message complaining
+ about
+\begin_inset Quotes eld
+\end_inset
+
+tmclock.o
+\begin_inset Quotes erd
+\end_inset
+
+, but it accomplished some necessary things anyway.
+ Now open the file named
+\begin_inset Quotes eld
+\end_inset
+
+Makefile
+\begin_inset Quotes erd
+\end_inset
+
+ for editing.
+ Go to the line that says
+\begin_inset Quotes eld
+\end_inset
+
+System = -DBSD=1
+\begin_inset Quotes erd
+\end_inset
+
+.
+ It should be on line 31.
+ Change the line so that it says:
+\layout Verbatim
+
+System = -DSYSV=1
+\layout Standard
+
+Close the Makefile and run make again by typing:
+\layout Verbatim
+
+make
+\layout Standard
+
+That should compile the
+\begin_inset Quotes eld
+\end_inset
+
+arc
+\begin_inset Quotes erd
+\end_inset
+
+ utility successfully.
+ You can ignore the warnings about
+\begin_inset Quotes eld
+\end_inset
+
+mktemp
+\begin_inset Quotes erd
+\end_inset
+
+ and
+\begin_inset Quotes eld
+\end_inset
+
+mkstemp
+\begin_inset Quotes erd
+\end_inset
+
+.
+ There should now be an executable program with the name of
+\begin_inset Quotes eld
+\end_inset
+
+arc
+\begin_inset Quotes erd
+\end_inset
+
+ in your temporary directory.
+ As root, copy this file to
+\begin_inset Quotes eld
+\end_inset
+
+/usr/local/bin
+\begin_inset Quotes erd
+\end_inset
+
+ or the usual place where you keep home-cooked binaries.
+ Just make sure that it is in your path.
+ Test this by typing
+\begin_inset Quotes eld
+\end_inset
+
+arc
+\begin_inset Quotes erd
+\end_inset
+
+ and see if the arc usage guide scrolls up your terminal.
+ You can delete all the files in your temporary directory now, but leave
+ the directory itself because we will be using it later.
+ Aren't .deb packages so much easier?
+\layout Section
+
+Example Installation of an Antivirus Scanner
+\layout Standard
+
+I am using a Linux commandline scanner from NAI Associates, Inc.
+ You will have to avail yourself of the documentation at
+\begin_inset LatexCommand \url{http://www.amavis.org/}
+
+\end_inset
+
+ if you don't know where to obtain a scanner.
+ For example, you could place your scanner binary along with its' data files
+ in a directory named
+\begin_inset Quotes eld
+\end_inset
+
+/usr/local/share/av
+\begin_inset Quotes erd
+\end_inset
+
+.
+ Then create a symlink to the binary in the
+\begin_inset Quotes eld
+\end_inset
+
+/usr/local/bin
+\begin_inset Quotes erd
+\end_inset
+
+ directory.
+ This way, the command to execute the scanner is in your path, and the Amavis
+ configure script will find it.
+ For a more advanced configuration (once you have the easy stuff out of
+ the way), take a look at the example start-stop script at the end of this
+ document.
+\layout Section
+
+Obtaining the Libmilter Sourcecode and Libraries
+\layout Standard
+
+In order to be able to build Amavis with the libmilter interface, you need
+ to have the Sendmail's libmilter sourcecode and libraries available.
+ Don't worry, this is very easy with Debian.
+ The following command will dowload everything required to your system:
+\layout Verbatim
+
+apt-get install libmilter-dev
+\layout Section
+
+Obtaining the Amavis Sourcecode
+\layout Subsection
+
+Checking the latest copy out of CVS
+\layout Standard
+
+\begin_float footnote
+\layout Standard
+
+As of October 23, 2001; the CVS copy might not compile.
+ Skip to the next section if you don't want to fool around.
+\end_float
+Now that we have extracted the libmilter files, the next step is to obtain
+ the latest copy of the Amavis sourcecode.
+ We will retrieve this code from the Amavis CVS repository at
+\begin_inset LatexCommand \url{http://sourceforge.net/}
+
+\end_inset
+
+.
+ If you do not already have the CVS package installed on your system, you
+ can obtain it with the command:
+\layout Verbatim
+
+apt-get install cvs
+\layout Verbatim
+
+cvs -d:pserver:anonymous@cvs.amavis.sourceforge.net:/cvsroot/amavis login
+\layout Standard
+
+You will be logging in anonymously, so just press enter at the password
+ prompt.
+ If CVS gives you a hard time about
+\begin_inset Quotes eld
+\end_inset
+
+$HOME/.cvspass
+\begin_inset Quotes erd
+\end_inset
+
+ not existing, then simply type:
+\layout Verbatim
+
+touch $HOME/.cvspass
+\layout Standard
+
+and issue the command once more.
+ With these preliminaries out of the way we can download the actual source
+ with:
+\layout Verbatim
+
+cvs -z3 -d:pserver:anonymous@cvs.amavis.sourceforge.net:/cvsroot/amavis co
+ amavis
+\layout Standard
+
+This will create a subdirectory named
+\begin_inset Quotes eld
+\end_inset
+
+amavis
+\begin_inset Quotes erd
+\end_inset
+
+ in your temporary directory.
+ Please skip to section titled
+\begin_inset Quotes eld
+\end_inset
+
+Building Amavis
+\begin_inset Quotes erd
+\end_inset
+
+.
+\layout Subsection
+
+If the CVS copy blows chunks
+\layout Standard
+
+If you are like me, and the CVS copy died hideously during
+\begin_inset Quotes eld
+\end_inset
+
+./configure
+\begin_inset Quotes erd
+\end_inset
+
+, then download the the
+\begin_inset Quotes eld
+\end_inset
+
+official
+\begin_inset Quotes erd
+\end_inset
+
+ CVS snapshot from
+\begin_inset LatexCommand \url{http://sourceforge.net/projects/amavis/}
+
+\end_inset
+
+.
+ The available version at the time of this writing was
+\begin_inset Quotes eld
+\end_inset
+
+amavisd-snaphot-20010714
+\begin_inset Quotes erd
+\end_inset
+
+.
+ You can dowload this as a tarball.
+ Copy this file into your temporary directory and run:
+\layout Verbatim
+
+tar zxf <filename>
+\layout Standard
+
+That should give you a nice directory of sourcecode.
+\layout Section
+
+Building Amavis
+\layout Standard
+
+Regardless of the method you used to obtain it, please change to your new
+ amavis sourcecode directory and type the following command to build Amavis
+ with libmilter:
+\layout Verbatim
+
+LDFLAGS=
+\begin_inset Quotes erd
+\end_inset
+
+-L/usr/lib/libmilter
+\begin_inset Quotes erd
+\end_inset
+
+ ./configure --with-amavisuser=amavis --prefix=/usr/local --with-runtime-dir=/var
+/local/amavis --enable-milter --with-sendmail-source=/usr/include/libmilter
+\layout Standard
+
+Then simply run make by typing:
+\layout Verbatim
+
+make
+\layout Standard
+
+This will create, among other things, the amavisd perl script and the amavis-mil
+ter binary in your
+\begin_inset Quotes eld
+\end_inset
+
+<amavis-sourcecode-directory>/amavis/
+\begin_inset Quotes erd
+\end_inset
+
+ directory.
+ If the previous steps failed for any reason, go to the section titled
+\begin_inset Quotes eld
+\end_inset
+
+If the CVS copy blows chunks
+\begin_inset Quotes erd
+\end_inset
+
+ and rerun the
+\begin_inset Quotes eld
+\end_inset
+
+Building Amavis
+\begin_inset Quotes erd
+\end_inset
+
+ section from the beginning.
+\layout Section
+
+Installing and Running Amavis
+\layout Standard
+
+Hopefully we passed the correct options to the Amavis configure script so
+ that when we install it, the Debian file system policy won't be violated.
+ That would be bad karma.
+ Create a user named
+\begin_inset Quotes eld
+\end_inset
+
+amavis
+\begin_inset Quotes erd
+\end_inset
+
+ with:
+\layout Verbatim
+
+useradd amavis
+\layout Standard
+
+From the amavis-sourcecode-directory type:
+\layout Verbatim
+
+make install
+\layout Standard
+
+If everythiny worked, the install script should have
+\layout Itemize
+
+copied the amavisd perl script to /usr/local/sbin
+\layout Itemize
+
+copied the amavis-milter binary to /usr/local/sbin
+\layout Itemize
+
+created the /var/local/amavis directory with owner amavis and mode 2700
+ or 0700
+\layout Itemize
+
+created a file named /etc/amavisd.conf
+\layout Standard
+
+Now you will need to create an alias in /etc/aliases or /etc/mail/aliases
+ (or wherever you keep your mail aliases) for the
+\begin_inset Quotes eld
+\end_inset
+
+virusalert
+\begin_inset Quotes erd
+\end_inset
+
+ email address that Amavis will try and send virus reports to.
+ Generally, this should be the system administrator.
+\layout Standard
+
+Don't forget to rebuild the aliases file by issuing:
+\layout Verbatim
+
+newaliases
+\layout Standard
+
+Finally, open up the /etc/mail/sendmail.mc file for editing and insert the
+ following two lines anywhere after the line the begins with
+\begin_inset Quotes eld
+\end_inset
+
+## Custom configurations
+\begin_inset Quotes erd
+\end_inset
+
+ (it is near the bottom):
+\layout Verbatim
+
+define(`_FFR_MILTER', `1')dnl
+\layout Verbatim
+
+INPUT_MAIL_FILTER(`milter-amavis', `S=local:/var/local/amavis/amavis-milter.sock,
+ T=S:10m;R:10m;E:10m')dnl
+\layout Standard
+
+After you close the /etc/mail/sendmail.mc file, start-up amavis-milter and
+ amavisd with the following three commands:
+\layout Verbatim
+
+rm -rf /var/local/amavis/amavis-milter.sock
+\layout Verbatim
+
+nohup /usr/local/sbin/amavis-milter -p /var/local/amavis/amavis-milter.sock
+ &
+\layout Verbatim
+
+/usr/local/sbin/amavisd
+\layout Standard
+
+Now that Amavis is ready and running, you can fire-up your new sendmail
+ configuration with:
+\layout Verbatim
+
+sendmailconfig
+\layout Standard
+
+This command will recreate the /etc/mail/sendmail.cf file from the /etc/mail/send
+mail.mc file and reload the sendmail daemon.
+ An alternate approach is to delete the /etc/mail/sendmail.cf file, run
+\begin_inset Quotes eld
+\end_inset
+
+make
+\begin_inset Quotes erd
+\end_inset
+
+ in the /etc/mail directory, and restart sendmail with
+\begin_inset Quotes eld
+\end_inset
+
+/etc/init.d/sendmail restart
+\begin_inset Quotes erd
+\end_inset
+
+ (or whatever it is that you use).
+\layout Section
+
+An Example Startup script
+\layout Code
+
+#!/bin/sh
+\layout Code
+
+# /etc/init.d/amavis-ramdisk
+\layout Code
+
+# Script to run Amavis from a ram disk.
+\layout Code
+
+\layout Code
+
+# I keep my antiviral scanner and data files on a ramdisk for speed.
+\layout Code
+
+AVDIR="/usr/local/share/av.original"
+\layout Code
+
+RAMDISK="/usr/local/share/av.ramdisk"
+\layout Code
+
+AMAVISBIN="/usr/local/sbin"
+\layout Code
+
+AMAVISSOCK="/var/local/amavis"
+\layout Code
+
+[ -d $AVDIR -a -d $RAMDISK ] || exit 0
+\layout Code
+
+case "$1" in
+\layout Code
+
+start)
+\layout Code
+
+ mke2fs /dev/ram0 > /dev/null 2>&1
+\layout Code
+
+ mount /dev/ram0 $RAMDISK
+\layout Code
+
+ cp $AVDIR/* $RAMDISK
+\layout Code
+
+ if [ -S $AMAVISSOCK/amavis-milter.sock ]; then
+\layout Code
+
+ rm -rf $AMAVISSOCK/amavis-milter.sock
+\layout Code
+
+ fi
+\layout Code
+
+ if [ -S $AMAVISSOCK/amavisd.sock ]; then
+\layout Code
+
+ rm -rf $AMAVISSOCK/amavisd.sock
+\layout Code
+
+ fi
+\layout Code
+
+ nohup $AMAVISBIN/amavis-milter -p $AMAVISSOCK/amavis-milter.sock &
+\layout Code
+
+ $AMAVISBIN/amavisd
+\layout Code
+
+;;
+\layout Code
+
+stop)
+\layout Code
+
+ kill -9 `ps x | grep amavisd | grep -v grep | awk '{print $1}'`2> /dev/null
+\layout Code
+
+ kill -9 `ps x | grep amavis-milter | grep -v grep | awk '{print $1}'`
+ 2> /dev/null
+\layout Code
+
+ # I need to sleep for some reason :(
+\layout Code
+
+ sleep 2umount /dev/ram0
+\layout Code
+
+;;
+\layout Code
+
+*)
+\layout Code
+
+ echo "Usage: /etc/init.d/amavis-ramdisk {start|stop}"
+\layout Code
+
+ exit 1
+\layout Code
+
+;;
+\layout Code
+
+esac
+\layout Code
+
+exit 0
+\layout Standard
+
+Don't forget to update your antivirus data files regularly.
+
+\layout Quote
+
+Send all comments and corrections to <jps@maxlingua.com>.
+ Support free software!
+\the_end
diff --git a/debian/examples/amavis/amavis-doc-1.html b/debian/examples/amavis/amavis-doc-1.html
new file mode 100644
index 0000000..f893635
--- /dev/null
+++ b/debian/examples/amavis/amavis-doc-1.html
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.10">
+ <TITLE>How to Install Amavis-milter for Debian Sendmail: Software Dependencies</TITLE>
+ <LINK HREF="amavis-doc-2.html" REL=next>
+
+ <LINK HREF="amavis-doc.html#toc1" REL=contents>
+</HEAD>
+<BODY>
+<A HREF="amavis-doc-2.html">Next</A>
+Previous
+<A HREF="amavis-doc.html#toc1">Contents</A>
+<HR>
+<H2><A NAME="s1">1.</A> <A HREF="amavis-doc.html#toc1">Software Dependencies</A></H2>
+
+<P>
+<OL>
+<LI>At a minimum you need to be running the Debian 3.0 (Woody) distribution
+from
+<A HREF="http://www.debian.org/"></A>
+. Older versions of Debian do not provide an adequate sendmail
+package (they lack the libmilter API).</LI>
+<LI>Obviously, sendmail needs to be installed on your system.</LI>
+<LI>As mentioned in the abstract, you will have to obtain your own
+antiviral engine from an independent vendor.</LI>
+<LI>The "
+file"
+package.</LI>
+<LI>The "
+arc"
+utility. It is not available as a Debian package. You
+can obtain the source code for this program at
+<A HREF="ftp://metalab.unc.edu/pub/Linux/utils/compress/arc521.tar.Z"></A>
+. </LI>
+<LI>The "
+bzip2"
+package.</LI>
+<LI>The "
+lha"
+package.</LI>
+<LI>The "
+unarj"
+package.</LI>
+<LI>The "
+unrar"
+package.</LI>
+<LI>The "
+zoo"
+package.</LI>
+<LI>You may need to install a few perl modules. The required modules
+are</LI>
+</OL>
+</P>
+<P>
+<UL>
+<LI>IO-stringy</LI>
+<LI>Syslog</LI>
+<LI>MailTools</LI>
+<LI>MIME-Base64</LI>
+<LI>MIME-tools</LI>
+<LI>Convert-UUlib</LI>
+<LI>Convert-TNEF</LI>
+<LI>Compress-Zlib</LI>
+<LI>Archive-Tar</LI>
+<LI>Archive-Zip</LI>
+<LI>libnet</LI>
+</UL>
+</P>
+<HR>
+<A HREF="amavis-doc-2.html">Next</A>
+Previous
+<A HREF="amavis-doc.html#toc1">Contents</A>
+</BODY>
+</HTML>
diff --git a/debian/examples/amavis/amavis-doc-2.html b/debian/examples/amavis/amavis-doc-2.html
new file mode 100644
index 0000000..17d2694
--- /dev/null
+++ b/debian/examples/amavis/amavis-doc-2.html
@@ -0,0 +1,138 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.10">
+ <TITLE>How to Install Amavis-milter for Debian Sendmail: Installing the Software Dependencies</TITLE>
+ <LINK HREF="amavis-doc-3.html" REL=next>
+ <LINK HREF="amavis-doc-1.html" REL=previous>
+ <LINK HREF="amavis-doc.html#toc2" REL=contents>
+</HEAD>
+<BODY>
+<A HREF="amavis-doc-3.html">Next</A>
+<A HREF="amavis-doc-1.html">Previous</A>
+<A HREF="amavis-doc.html#toc2">Contents</A>
+<HR>
+<H2><A NAME="s2">2.</A> <A HREF="amavis-doc.html#toc2">Installing the Software Dependencies</A></H2>
+
+<P>Update your distribution files with the usual:</P>
+<P>
+<PRE>
+apt-get update
+</PRE>
+</P>
+<P>and install file, bzip2, lha, unarj, unrar, and zoo in one shot
+with:</P>
+<P>
+<PRE>
+apt-get install file bzip2 lha unarj unrar zoo
+</PRE>
+</P>
+<P>Install all the perl modules in one shot with:</P>
+<P>
+<PRE>
+apt-get install libio-stringy-perl libunix-syslog-perl libmailtools-perl libmime-base64-perl libmime-perl libconvert-uulib-perl libconvert-tnef-perl libcompress-zlib-perl libarchive-tar-perl libarchive-zip-perl libnet-perl
+</PRE>
+</P>
+<P>Installing the "
+arc"
+utility is much more of a hassle. Furthermore,
+it is an unmaintained old MS-DOS port with a non-free license. I
+will describe what I did to compile it on a Intel platform (suggestions
+on better ways to do this are appreciated). The next few steps assume
+that you have the GNU "
+make"
+and "
+gcc"
+packges installed on your
+system. If this is not the case then try:</P>
+<P>
+<PRE>
+apt-get install make gcc
+</PRE>
+</P>
+<P>Let's create a temporary directory somewhere so that we can make
+a mess in it. Since my login is "
+jps"
+, I made a directory named "
+/home/jps/tmp/"
+.
+Copy the arc521.tar.Z file into your new temporary diretory and type:</P>
+
+<P>
+<PRE>
+uncompress arc521.tar.Z; tar xf arc521.tar
+</PRE>
+</P>
+<P>or something equivalent to uncompress and untar the archive.
+This will create a bunch of files. We need to delete some lines from
+the file named "
+arcdos.c"
+. It is probably set to be read-only, so
+type:</P>
+<P>
+<PRE>
+chmod u+w arcdos.c
+</PRE>
+</P>
+<P>Open arcdos.c for editing and delete (or comment out) lines 35-38
+inclusive. (It is the definition of a structure that begins with
+"
+struct timeval"
+on line 35 and ends with "
+};"
+on line 38).
+We are done with that, so close the file. Now type:</P>
+<P>
+<PRE>
+make
+</PRE>
+</P>
+<P>This command WILL FAIL with a bunch of warnings and an error
+message complaining about "
+tmclock.o"
+, but it accomplished some necessary
+things anyway. Now open the file named "
+Makefile"
+for editing. Go
+to the line that says "
+System = -DBSD=1"
+. It should be on line 31.
+Change the line so that it says:</P>
+<P>
+<PRE>
+System = -DSYSV=1
+</PRE>
+</P>
+<P>Close the Makefile and run make again by typing:</P>
+<P>
+<PRE>
+make
+</PRE>
+</P>
+<P>That should compile the "
+arc"
+utility successfully. You can ignore
+the warnings about "
+mktemp"
+and "
+mkstemp"
+. There should now be an
+executable program with the name of "
+arc"
+in your temporary directory.
+As root, copy this file to "
+/usr/local/bin"
+or the usual place where
+you keep home-cooked binaries. Just make sure that it is in your
+path. Test this by typing "
+arc"
+and see if the arc usage guide scrolls
+up your terminal. You can delete all the files in your temporary
+directory now, but leave the directory itself because we will be
+using it later. Aren't .deb packages so much easier? </P>
+<HR>
+<A HREF="amavis-doc-3.html">Next</A>
+<A HREF="amavis-doc-1.html">Previous</A>
+<A HREF="amavis-doc.html#toc2">Contents</A>
+</BODY>
+</HTML>
diff --git a/debian/examples/amavis/amavis-doc-3.html b/debian/examples/amavis/amavis-doc-3.html
new file mode 100644
index 0000000..eeb89d1
--- /dev/null
+++ b/debian/examples/amavis/amavis-doc-3.html
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.10">
+ <TITLE>How to Install Amavis-milter for Debian Sendmail: Example Installation of an Antivirus Scanner</TITLE>
+ <LINK HREF="amavis-doc-4.html" REL=next>
+ <LINK HREF="amavis-doc-2.html" REL=previous>
+ <LINK HREF="amavis-doc.html#toc3" REL=contents>
+</HEAD>
+<BODY>
+<A HREF="amavis-doc-4.html">Next</A>
+<A HREF="amavis-doc-2.html">Previous</A>
+<A HREF="amavis-doc.html#toc3">Contents</A>
+<HR>
+<H2><A NAME="s3">3.</A> <A HREF="amavis-doc.html#toc3">Example Installation of an Antivirus Scanner</A></H2>
+
+<P>I am using a Linux commandline scanner from NAI Associates, Inc.
+You will have to avail yourself of the documentation at
+<A HREF="http://www.amavis.org/"></A>
+if you
+don't know where to obtain a scanner. For example, you could place
+your scanner binary along with its' data files in a directory named
+"
+/usr/local/share/av"
+. Then create a symlink to the binary in the
+"
+/usr/local/bin"
+directory. This way, the command to execute the
+scanner is in your path, and the Amavis configure script will find
+it. For a more advanced configuration (once you have the easy stuff
+out of the way), take a look at the example start-stop script at
+the end of this document.</P>
+<HR>
+<A HREF="amavis-doc-4.html">Next</A>
+<A HREF="amavis-doc-2.html">Previous</A>
+<A HREF="amavis-doc.html#toc3">Contents</A>
+</BODY>
+</HTML>
diff --git a/debian/examples/amavis/amavis-doc-4.html b/debian/examples/amavis/amavis-doc-4.html
new file mode 100644
index 0000000..c9e338e
--- /dev/null
+++ b/debian/examples/amavis/amavis-doc-4.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.10">
+ <TITLE>How to Install Amavis-milter for Debian Sendmail: Obtaining the Libmilter Sourcecode and Libraries</TITLE>
+ <LINK HREF="amavis-doc-5.html" REL=next>
+ <LINK HREF="amavis-doc-3.html" REL=previous>
+ <LINK HREF="amavis-doc.html#toc4" REL=contents>
+</HEAD>
+<BODY>
+<A HREF="amavis-doc-5.html">Next</A>
+<A HREF="amavis-doc-3.html">Previous</A>
+<A HREF="amavis-doc.html#toc4">Contents</A>
+<HR>
+<H2><A NAME="s4">4.</A> <A HREF="amavis-doc.html#toc4">Obtaining the Libmilter Sourcecode and Libraries</A></H2>
+
+<P>In order to be able to build Amavis with the libmilter interface,
+you need to have the Sendmail's libmilter sourcecode and libraries
+available. Don't worry, this is very easy with Debian. The following
+command will dowload everything required to your system:</P>
+<P>
+<PRE>
+apt-get install libmilter-dev
+</PRE>
+</P>
+<HR>
+<A HREF="amavis-doc-5.html">Next</A>
+<A HREF="amavis-doc-3.html">Previous</A>
+<A HREF="amavis-doc.html#toc4">Contents</A>
+</BODY>
+</HTML>
diff --git a/debian/examples/amavis/amavis-doc-5.html b/debian/examples/amavis/amavis-doc-5.html
new file mode 100644
index 0000000..7d5186c
--- /dev/null
+++ b/debian/examples/amavis/amavis-doc-5.html
@@ -0,0 +1,85 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.10">
+ <TITLE>How to Install Amavis-milter for Debian Sendmail: Obtaining the Amavis Sourcecode</TITLE>
+ <LINK HREF="amavis-doc-6.html" REL=next>
+ <LINK HREF="amavis-doc-4.html" REL=previous>
+ <LINK HREF="amavis-doc.html#toc5" REL=contents>
+</HEAD>
+<BODY>
+<A HREF="amavis-doc-6.html">Next</A>
+<A HREF="amavis-doc-4.html">Previous</A>
+<A HREF="amavis-doc.html#toc5">Contents</A>
+<HR>
+<H2><A NAME="s5">5.</A> <A HREF="amavis-doc.html#toc5">Obtaining the Amavis Sourcecode</A></H2>
+
+<H2><A NAME="ss5.1">5.1</A> <A HREF="amavis-doc.html#toc5.1">Checking the latest copy out of CVS</A>
+</H2>
+
+<P>
+<BLOCKQUOTE>As of October 23, 2001; the CVS copy might not compile. Skip
+to the next section if you don't want to fool around. </BLOCKQUOTE>
+Now that we have extracted the libmilter files, the next step
+is to obtain the latest copy of the Amavis sourcecode. We will retrieve
+this code from the Amavis CVS repository at
+<A HREF="http://sourceforge.net/"></A>
+. If you do not already
+have the CVS package installed on your system, you can obtain it
+with the command:</P>
+<P>
+<PRE>
+apt-get install cvs
+cvs -d:pserver:anonymous@cvs.amavis.sourceforge.net:/cvsroot/amavis login
+</PRE>
+</P>
+<P>You will be logging in anonymously, so just press enter at the
+password prompt. If CVS gives you a hard time about "
+$HOME/.cvspass"</P>
+<P>not existing, then simply type:</P>
+<P>
+<PRE>
+touch $HOME/.cvspass
+</PRE>
+</P>
+<P>and issue the command once more. With these preliminaries out
+of the way we can download the actual source with:</P>
+<P>
+<PRE>
+cvs -z3 -d:pserver:anonymous@cvs.amavis.sourceforge.net:/cvsroot/amavis co amavis
+</PRE>
+</P>
+<P>This will create a subdirectory named "
+amavis"
+in your temporary
+directory. Please skip to section titled "
+Building Amavis"
+.</P>
+<H2><A NAME="ss5.2">5.2</A> <A HREF="amavis-doc.html#toc5.2">If the CVS copy blows chunks</A>
+</H2>
+
+<P>If you are like me, and the CVS copy died hideously during "
+./configure"
+,
+then download the the "
+official"
+CVS snapshot from
+<A HREF="http://sourceforge.net/projects/amavis/"></A>
+. The available
+version at the time of this writing was "
+amavisd-snaphot-20010714"
+.
+You can dowload this as a tarball. Copy this file into your temporary
+directory and run:</P>
+<P>
+<PRE>
+tar zxf &lt;filename&gt;
+</PRE>
+</P>
+<P>That should give you a nice directory of sourcecode.</P>
+<HR>
+<A HREF="amavis-doc-6.html">Next</A>
+<A HREF="amavis-doc-4.html">Previous</A>
+<A HREF="amavis-doc.html#toc5">Contents</A>
+</BODY>
+</HTML>
diff --git a/debian/examples/amavis/amavis-doc-6.html b/debian/examples/amavis/amavis-doc-6.html
new file mode 100644
index 0000000..f3c2041
--- /dev/null
+++ b/debian/examples/amavis/amavis-doc-6.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.10">
+ <TITLE>How to Install Amavis-milter for Debian Sendmail: Building Amavis</TITLE>
+ <LINK HREF="amavis-doc-7.html" REL=next>
+ <LINK HREF="amavis-doc-5.html" REL=previous>
+ <LINK HREF="amavis-doc.html#toc6" REL=contents>
+</HEAD>
+<BODY>
+<A HREF="amavis-doc-7.html">Next</A>
+<A HREF="amavis-doc-5.html">Previous</A>
+<A HREF="amavis-doc.html#toc6">Contents</A>
+<HR>
+<H2><A NAME="s6">6.</A> <A HREF="amavis-doc.html#toc6">Building Amavis</A></H2>
+
+<P>Regardless of the method you used to obtain it, please change
+to your new amavis sourcecode directory and type the following command
+to build Amavis with libmilter:</P>
+<P>
+<PRE>
+LDFLAGS="
+-L/usr/lib/libmilter"
+ ./configure --with-amavisuser=amavis --prefix=/usr/local --with-runtime-dir=/var/local/amavis --enable-milter --with-sendmail-source=/usr/include/libmilter
+</PRE>
+</P>
+<P>Then simply run make by typing:</P>
+<P>
+<PRE>
+make
+</PRE>
+</P>
+<P>This will create, among other things, the amavisd perl script
+and the amavis-milter binary in your "
+&lt;amavis-sourcecode-directory&gt;/amavis/"</P>
+<P>directory. If the previous steps failed for any reason, go to the
+section titled "
+If the CVS copy blows chunks"
+and rerun the "
+Building
+Amavis"
+section from the beginning.</P>
+<HR>
+<A HREF="amavis-doc-7.html">Next</A>
+<A HREF="amavis-doc-5.html">Previous</A>
+<A HREF="amavis-doc.html#toc6">Contents</A>
+</BODY>
+</HTML>
diff --git a/debian/examples/amavis/amavis-doc-7.html b/debian/examples/amavis/amavis-doc-7.html
new file mode 100644
index 0000000..5997841
--- /dev/null
+++ b/debian/examples/amavis/amavis-doc-7.html
@@ -0,0 +1,96 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.10">
+ <TITLE>How to Install Amavis-milter for Debian Sendmail: Installing and Running Amavis</TITLE>
+ <LINK HREF="amavis-doc-8.html" REL=next>
+ <LINK HREF="amavis-doc-6.html" REL=previous>
+ <LINK HREF="amavis-doc.html#toc7" REL=contents>
+</HEAD>
+<BODY>
+<A HREF="amavis-doc-8.html">Next</A>
+<A HREF="amavis-doc-6.html">Previous</A>
+<A HREF="amavis-doc.html#toc7">Contents</A>
+<HR>
+<H2><A NAME="s7">7.</A> <A HREF="amavis-doc.html#toc7">Installing and Running Amavis</A></H2>
+
+<P>Hopefully we passed the correct options to the Amavis configure
+script so that when we install it, the Debian file system policy
+won't be violated. That would be bad karma. Create a user named "
+amavis"</P>
+<P>with:</P>
+<P>
+<PRE>
+useradd amavis
+</PRE>
+</P>
+<P>From the amavis-sourcecode-directory type:</P>
+<P>
+<PRE>
+make install
+</PRE>
+</P>
+<P>If everythiny worked, the install script should have</P>
+<P>
+<UL>
+<LI>copied the amavisd perl script to /usr/local/sbin</LI>
+<LI>copied the amavis-milter binary to /usr/local/sbin</LI>
+<LI>created the /var/local/amavis directory with owner amavis and
+mode 2700 or 0700</LI>
+<LI>created a file named /etc/amavisd.conf</LI>
+</UL>
+</P>
+<P>Now you will need to create an alias in /etc/aliases or /etc/mail/aliases
+(or wherever you keep your mail aliases) for the "
+virusalert"
+email
+address that Amavis will try and send virus reports to. Generally,
+this should be the system administrator.</P>
+<P>Don't forget to rebuild the aliases file by issuing:</P>
+<P>
+<PRE>
+newaliases
+</PRE>
+</P>
+<P>Finally, open up the /etc/mail/sendmail.mc file for editing and
+insert the following two lines anywhere after the line the begins
+with "
+## Custom configurations"
+(it is near the bottom):</P>
+<P>
+<PRE>
+define(`_FFR_MILTER', `1')dnl
+INPUT_MAIL_FILTER(`milter-amavis', `S=local:/var/local/amavis/amavis-milter.sock, T=S:10m;R:10m;E:10m')dnl
+</PRE>
+</P>
+<P>After you close the /etc/mail/sendmail.mc file, start-up amavis-milter
+and amavisd with the following three commands:</P>
+<P>
+<PRE>
+rm -rf /var/local/amavis/amavis-milter.sock
+nohup /usr/local/sbin/amavis-milter -p /var/local/amavis/amavis-milter.sock &amp;
+/usr/local/sbin/amavisd
+</PRE>
+</P>
+<P>Now that Amavis is ready and running, you can fire-up your new
+sendmail configuration with:</P>
+<P>
+<PRE>
+sendmailconfig
+</PRE>
+</P>
+<P>This command will recreate the /etc/mail/sendmail.cf file from
+the /etc/mail/sendmail.mc file and reload the sendmail daemon. An
+alternate approach is to delete the /etc/mail/sendmail.cf file, run
+"
+make"
+in the /etc/mail directory, and restart sendmail with "
+/etc/init.d/sendmail
+restart"
+(or whatever it is that you use).</P>
+<HR>
+<A HREF="amavis-doc-8.html">Next</A>
+<A HREF="amavis-doc-6.html">Previous</A>
+<A HREF="amavis-doc.html#toc7">Contents</A>
+</BODY>
+</HTML>
diff --git a/debian/examples/amavis/amavis-doc-8.html b/debian/examples/amavis/amavis-doc-8.html
new file mode 100644
index 0000000..6d36780
--- /dev/null
+++ b/debian/examples/amavis/amavis-doc-8.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.10">
+ <TITLE>How to Install Amavis-milter for Debian Sendmail: An Example Startup script</TITLE>
+ <LINK HREF="amavis-doc-7.html" REL=previous>
+ <LINK HREF="amavis-doc.html#toc8" REL=contents>
+</HEAD>
+<BODY>
+Next
+<A HREF="amavis-doc-7.html">Previous</A>
+<A HREF="amavis-doc.html#toc8">Contents</A>
+<HR>
+<H2><A NAME="s8">8.</A> <A HREF="amavis-doc.html#toc8">An Example Startup script</A></H2>
+
+<P>
+<HR>
+<PRE>
+#!/bin/sh
+# /etc/init.d/amavis-ramdisk
+# Script to run Amavis from a ram disk.
+
+# I keep my antiviral scanner and data files on a ramdisk for speed.
+AVDIR=&quot;/usr/local/share/av.original&quot;
+RAMDISK=&quot;/usr/local/share/av.ramdisk&quot;
+AMAVISBIN=&quot;/usr/local/sbin&quot;
+AMAVISSOCK=&quot;/var/local/amavis&quot;
+[ -d $AVDIR -a -d $RAMDISK ] || exit 0
+case &quot;$1&quot; in
+start)
+ mke2fs /dev/ram0 &gt; /dev/null 2&gt;&amp;1
+ mount /dev/ram0 $RAMDISK
+ cp $AVDIR/* $RAMDISK
+ if [ -S $AMAVISSOCK/amavis-milter.sock ]; then
+ rm -rf $AMAVISSOCK/amavis-milter.sock
+ fi
+ if [ -S $AMAVISSOCK/amavisd.sock ]; then
+ rm -rf $AMAVISSOCK/amavisd.sock
+ fi
+ nohup $AMAVISBIN/amavis-milter -p $AMAVISSOCK/amavis-milter.sock &amp;
+ $AMAVISBIN/amavisd
+;;
+stop)
+ kill -9 `ps x | grep amavisd | grep -v grep | awk '{print $1}'`2&gt; /dev/null
+ kill -9 `ps x | grep amavis-milter | grep -v grep | awk '{print $1}'` 2&gt; /dev/null
+ # I need to sleep for some reason :(
+ sleep 2umount /dev/ram0
+;;
+*)
+ echo &quot;Usage: /etc/init.d/amavis-ramdisk {start|stop}&quot;
+ exit 1
+;;
+esac
+exit 0
+</PRE>
+<HR>
+</P>
+<P>Don't forget to update your antivirus data files regularly. </P>
+<P>
+<BLOCKQUOTE>
+Send all comments and corrections to &lt;jps@maxlingua.com&gt;.
+Support free software!
+</BLOCKQUOTE>
+</P>
+
+
+<HR>
+Next
+<A HREF="amavis-doc-7.html">Previous</A>
+<A HREF="amavis-doc.html#toc8">Contents</A>
+</BODY>
+</HTML>
diff --git a/debian/examples/amavis/amavis-doc.html b/debian/examples/amavis/amavis-doc.html
new file mode 100644
index 0000000..181738d
--- /dev/null
+++ b/debian/examples/amavis/amavis-doc.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.10">
+ <TITLE>How to Install Amavis-milter for Debian Sendmail</TITLE>
+ <LINK HREF="amavis-doc-1.html" REL=next>
+
+
+</HEAD>
+<BODY>
+<A HREF="amavis-doc-1.html">Next</A>
+Previous
+Contents
+<HR>
+<H1>How to Install Amavis-milter for Debian Sendmail</H1>
+
+<H2>Jean-Paul Stewart &lt;jps@maxlingua.com&gt;</H2>23.10.2001
+<HR>
+<EM>This document provides a step-by-step guide to the installation
+ and configuration of the Amavis antivirus software available from
+
+<A HREF="http://www.amavis.org/"></A>
+ on the Debian GNU/Linux operating system. It has been adapted from
+ the documentation available there. Amavis supports many different
+ methods of implementation. I have chosen to implement Amavis-libmilter
+ as the interface between Amavis and Sendmail. Another option with
+ Amavis + Sendmail, which I am not describing here, involves employing
+ Amavis as a sort of intermediate local delivery agent. Please be
+ advised that this software requires an existing CLI antivirus scanning
+ engine and database. The selection and procurement of such software
+ is not discussed in this document. There is ample information available
+ at the amavis.org site. These installation examples make extensive
+ use of the outstanding Sendmail and libmilter-dev Debian packages
+ maintained by Richard "
+cowboy"
+ Nelson. Thanks Cowboy! Thank you Amavis
+ developers!</EM>
+<HR>
+<P>
+<H2><A NAME="toc1">1.</A> <A HREF="amavis-doc-1.html">Software Dependencies</A></H2>
+
+<P>
+<H2><A NAME="toc2">2.</A> <A HREF="amavis-doc-2.html">Installing the Software Dependencies</A></H2>
+
+<P>
+<H2><A NAME="toc3">3.</A> <A HREF="amavis-doc-3.html">Example Installation of an Antivirus Scanner</A></H2>
+
+<P>
+<H2><A NAME="toc4">4.</A> <A HREF="amavis-doc-4.html">Obtaining the Libmilter Sourcecode and Libraries</A></H2>
+
+<P>
+<H2><A NAME="toc5">5.</A> <A HREF="amavis-doc-5.html">Obtaining the Amavis Sourcecode</A></H2>
+
+<UL>
+<LI><A NAME="toc5.1">5.1</A> <A HREF="amavis-doc-5.html#ss5.1">Checking the latest copy out of CVS</A>
+<LI><A NAME="toc5.2">5.2</A> <A HREF="amavis-doc-5.html#ss5.2">If the CVS copy blows chunks</A>
+</UL>
+<P>
+<H2><A NAME="toc6">6.</A> <A HREF="amavis-doc-6.html">Building Amavis</A></H2>
+
+<P>
+<H2><A NAME="toc7">7.</A> <A HREF="amavis-doc-7.html">Installing and Running Amavis</A></H2>
+
+<P>
+<H2><A NAME="toc8">8.</A> <A HREF="amavis-doc-8.html">An Example Startup script</A></H2>
+
+<HR>
+<A HREF="amavis-doc-1.html">Next</A>
+Previous
+Contents
+</BODY>
+</HTML>
diff --git a/debian/examples/db/access b/debian/examples/db/access
new file mode 100644
index 0000000..9eea701
--- /dev/null
+++ b/debian/examples/db/access
@@ -0,0 +1,88 @@
+# /etc/mail/access
+# Copyright (c) 1998, Richard Nelson <cowboy@debian.org>.
+# Time-stamp: <1998/10/27 10:00:00 cowboy>
+# GPL'd config file, please feed any gripes, suggestions, etc. to me
+#
+# Function:
+# Access Control for this smtp server - determines:
+# * Who we accept mail from
+# * Who we accept relaying from
+# * Who we will not send to
+#
+# Usage:
+# FEATURE(access_db[, type [-o] /etc/mail/access])dnl
+# makemap hash access < access
+#
+# Format:
+# lhs:
+# email addr <user@[host.domain]>
+# domain name unless FEATURE(relay_hosts_only) is used,
+# then this is a fqdn - and relay-domains ($=R)
+# must also be fqdns.
+# network number must end on an octet boundary, or
+# you're stuck going the longwinded way ;-{
+# rhs:
+# OK accept mail even if other rules in the
+# running ruleset would reject it.
+# RELAY Allow domain to relay through your SMTP
+# server. RELAY also serves an implicit
+# OK for the other checks.
+# REJECT reject the sender/recipient with a general
+# purpose message that can be customized.
+# confREJECT_MSG [550 Access denied] will be issued
+# DISCARD discard the message completely using
+# the $#discard mailer.
+# ### any text where ### is an RFC 821 compliant error code
+# and "any text" is a message to return for
+# the command
+# Examples:
+# spammer@aol.com REJECT
+# FREE.STEALTH.MAILER@ 550 Spam not accepted
+#
+# Notes:
+# With FEATURE(blacklist_recipients) this is also possible:
+# badlocaluser 550 Mailbox disabled for this username
+# host.mydomain.com 550 That host does not accept mail
+# user@otherhost.mydomain.com 550 Mailbox disabled for this recipient
+#
+# Related:
+# define(`confREJECT_MSG', `550 Access denied')dnl
+# define(`confCR_FILE', `-o /etc/mail/relay-domains')dnl <<- $=R
+# FEATURE(relay_hosts_only)dnl
+# FEATURE(relay_entire_domain)dnl <<- relays any host in the $=m class
+# FEATURE(relay_based_on_MX)dnl <<- relaying for boxes MX'd to you
+# FEATURE(blacklist_recipients)dnl
+# FEATURE(rbl[,alternate server])dnl
+# FEATURE(orbs[,alternate server])dnl <<- Debian addition
+# FEATURE(orca[,alternate server])dnl <<- Debian addition
+# FEATURE(accept_unqualified_senders)dnl
+# FEATURE(accept_unresolvable_domains)dnl
+#
+# Local addresses 10.x.x.x, 127.x.x.x, 172.16-31.x.x 192.168.x.x can relay
+# Note Well! You *must* make sure these address can't be spoofed externally
+10 RELAY
+127 RELAY
+172.16 RELAY
+172.17 RELAY
+172.18 RELAY
+172.19 RELAY
+172.20 RELAY
+172.21 RELAY
+172.22 RELAY
+172.23 RELAY
+172.24 RELAY
+172.25 RELAY
+172.26 RELAY
+172.27 RELAY
+172.28 RELAY
+172.29 RELAY
+172.30 RELAY
+172.31 RELAY
+192.168 RELAY
+#
+# Hosts that are allowed to talk to me
+#
+#
+# Blacklisted users
+#
+reject@ REJECT
diff --git a/debian/examples/db/aliases b/debian/examples/db/aliases
new file mode 100644
index 0000000..8e99427
--- /dev/null
+++ b/debian/examples/db/aliases
@@ -0,0 +1,15 @@
+#
+# Mail aliases for sendmail
+#
+# You must run newaliases(1) after making changes to this file.
+#
+
+# Required aliases
+postmaster: root
+MAILER-DAEMON: postmaster
+
+# Common aliases
+abuse: postmaster
+spam: postmaster
+
+# Other aliases
diff --git a/debian/examples/db/domaintable b/debian/examples/db/domaintable
new file mode 100644
index 0000000..82b3ff7
--- /dev/null
+++ b/debian/examples/db/domaintable
@@ -0,0 +1,26 @@
+# /etc/mail/domaintable
+# Copyright (c) 1998, Richard Nelson <cowboy@debian.org>.
+# Time-stamp: <1998/10/27 10:00:00 cowboy>
+# GPL'd config file, please feed any gripes, suggestions, etc. to me
+#
+# Function:
+# Specify a mapping from old host name to new host name.
+# Commonly used to support old (or merged) domain names.
+# The host name in the lhs will be rewritten to that in the rhs
+#
+# Usage:
+# FEATURE(domaintable[, type [-o] /etc/mail/domaintable])dnl
+# makemap hash domaintable < domaintable
+#
+# Format:
+# old fqdn new fqdn
+#
+# Examples:
+# debian.com debian.org
+# .debian.com %0.debian.org
+#
+# Notes:
+#
+# Related:
+#
+#.cv.lexington.ibm.com %0.lexington.ibm.com
diff --git a/debian/examples/db/genericstable b/debian/examples/db/genericstable
new file mode 100644
index 0000000..44bf03c
--- /dev/null
+++ b/debian/examples/db/genericstable
@@ -0,0 +1,36 @@
+# /etc/mail/genericstable
+# Copyright (c) 1998, Richard Nelson <cowboy@debian.org>.
+# Time-stamp: <1998/10/27 10:00:00 cowboy>
+# GPL'd config file, please feed any gripes, suggestions, etc. to me
+#
+# Function:
+# Cause certain addresses originating locally (unqualified), or
+# from a domain in $=G to be rewritten based upon the map below.
+# This mapping may change both the user and domain name.
+#
+# Usage:
+# FEATURE(genericstable[, type [-o] /etc/mail/genericstable])dnl
+# makemap hash genericstable < genericstable
+#
+# Format:
+# localuser realuser@realdomain <<- implied $j or masq domain
+# user@host realuser@realhost <<- tried first
+# user[@host] realuser[@realhost]
+#
+# Examples:
+#
+# Notes:
+# * Masquerading is *required* for genericstable support!
+# * Then genericstable should only be enabled if needed as it
+# causes every sender to be looked up in the database
+# * Members of $=w are *not* automatically placed in $=G
+# * For local mail, FEATURE(always_add_domain) is necessary
+#
+# Related:
+# EXPOSED_USER(root uucp)dnl <<- these are exempt from masquerading
+# FEATURE(allmasquerade)dnl <<- rewrite recipient addrs too
+# FEATURE(always_add_domain)dnl <<- add domain to unqualified names
+# FEATURE(limited_masquerade)dnl <<- only masq domains in $=M
+# FEATURE(masquerade_envelope)dnl <<- rewrite envelope return address too
+# GENERICS_DOMAIN_FILE(`/etc/mail/sendmail.cG')dnl <<- masq From:
+#
diff --git a/debian/examples/db/mailertable b/debian/examples/db/mailertable
new file mode 100644
index 0000000..79d950f
--- /dev/null
+++ b/debian/examples/db/mailertable
@@ -0,0 +1,50 @@
+# /etc/mail/mailertable
+# Copyright (c) 1998, Richard Nelson <cowboy@debian.org>.
+# Time-stamp: <1998/10/27 10:00:00 cowboy>
+# GPL'd config file, please feed any gripes, suggestions, etc. to me
+#
+# Function:
+# Specify a mapping from old host name to new host name.
+# Commonly used to support old (or merged) domain names.
+# The host name in the lhs will be rewritten to that in the rhs
+#
+# Usage:
+# FEATURE(mailertable[, type [-o] /etc/mail/mailertable])dnl
+# makemap hash mailertable < mailertable
+#
+# Format:
+# Local recipients:
+# <address> local:user
+# <address> local: <<- will use same user
+# Error messages:
+# badhost error:nohost mail to %0 is prohibited
+# .baddomain error:nohost mail to %1%0 is prohibited
+#
+# Examples:
+# Local recipients:
+# <address> local:user
+# <address> local: <<- will use same user
+# Error messages:
+# badhost error:nohost mail to %0 is prohibited
+# .baddomain error:nohost mail to %1%0 is prohibited
+#
+# Notes:
+#
+# Related:
+#
+# Address rewrites for hosts *NOT IN* class $w
+# Direct delivery, %0 is left side
+# friend.dom smtp:[%0]:[some.smart.host]
+# Direct deliver of domain, smarthost as second choice
+# .friend.dom smtp:[%1%0]:[some.smart.host]
+# Default route, via smarthost
+# . smtp:[some.smart.host]
+#
+badhost error:nohost mail to %0 is prohibited
+.baddomain error:nohost mail to %1%0 is prohibited
+#
+# Sites we deliver directly to, bypassing SMARTHOST:
+#
+# Sites that use DUL: Dialup User Lists (or equivalent)
+#aol.com esmtp:[relay]
+#primenet.com esmtp:[relay]
diff --git a/debian/examples/db/relay-domains b/debian/examples/db/relay-domains
new file mode 100644
index 0000000..393f65d
--- /dev/null
+++ b/debian/examples/db/relay-domains
@@ -0,0 +1,34 @@
+# /etc/mail/relay-domains
+# Copyright (c) 1998, Richard Nelson <cowboy@debian.org>.
+# Time-stamp: <1998/10/27 10:00:00 cowboy>
+# GPL'd config file, please feed any gripes, suggestions, etc. to me
+#
+# Function:
+# Control what hosts are allowed to relay (or be a relay)
+#
+# Usage:
+# define(`confCR_FILE', `[-o ]/etc/mail/relay-domains')dnl
+#
+# Format:
+# lhs:
+#
+# Notes:
+# Class $=R
+# These are domains unless FEATURE(relay_hosts_only) is used,
+# then these names must be fully qualified host names!
+#
+# Related:
+# FEATURE(relay_hosts_only)dnl
+# FEATURE(relay_entire_domain)dnl <<- relays any host in the $=m class
+# FEATURE(relay_based_on_MX)dnl <<- relaying for boxes MX'd to you
+# FEATURE(access_db)dnl
+# EATURE(blacklist_recipients)dnl
+# FEATURE(rbl[,alternate server])dnl
+# FEATURE(orbs[,alternate server])dnl <<- Debian addition
+# FEATURE(accept_unqualified_senders)dnl
+# FEATURE(accept_unresolvable_domains)dnl
+#
+# Hosts that I will relay to:
+#
+# Hosts that can relay to me:
+#
diff --git a/debian/examples/db/sendmail.cM b/debian/examples/db/sendmail.cM
new file mode 100644
index 0000000..8806f3b
--- /dev/null
+++ b/debian/examples/db/sendmail.cM
@@ -0,0 +1,32 @@
+# /etc/mail/sendmail.cM
+# Copyright (c) 1998, Richard Nelson <cowboy@debian.org>.
+# Time-stamp: <1998/10/27 10:00:00 cowboy>
+# GPL'd config file, please feed any gripes, suggestions, etc. to me
+#
+# Function:
+# Specify mail domains, which when relayed, will be rewritten
+# to appear as the MASQUERADE_AS address
+#
+# Usage:
+# MASQUERADE_DOMAIN_FILE(`[-o ]/etc/mail/sendmail.cM')dnl
+#
+# Format:
+# fqdn
+#
+# Examples:
+# debian.org
+#
+# Notes:
+# Class=$M
+#
+# Related:
+# EXPOSED_USER(root uucp)dnl <<- these are exempt from masquerading
+# FEATURE(allmasquerade)dnl <<- rewrite recipient addrs too
+# FEATURE(always_add_domain)dnl <<- add domain to unqualified names
+# FEATURE(limited_masquerade)dnl <<- only masq domains in $=M
+# FEATURE(masquerade_entire_domain)dnl <<- masq all hosts under domain
+# FEATURE(masquerade_envelope)dnl <<- rewrite envelope return address too
+# GENERICS_DOMAIN_FILE(`/etc/mail/sendmail.cG')dnl <<- masq From:
+#
+# Local names
+#
diff --git a/debian/examples/db/virtusertable b/debian/examples/db/virtusertable
new file mode 100644
index 0000000..3512635
--- /dev/null
+++ b/debian/examples/db/virtusertable
@@ -0,0 +1,8 @@
+# Address rewrites for incomming mail
+# user@realdomain (must be in $w) localuser (may be an alias)
+# info@foo.com foo-info
+# info@bar.com bar-info
+# @baz.org jane@elsewhere.net
+# @foo.org %1@elsewhere.com
+# @bar.org error:nouser User unknown
+#
diff --git a/debian/examples/dialup/ip-down.d b/debian/examples/dialup/ip-down.d
new file mode 100644
index 0000000..88e719e
--- /dev/null
+++ b/debian/examples/dialup/ip-down.d
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# This script is called when ppp disconnects from the network.
+#
+# Here is where we'll stop sendmail if needed
+#
+# Written By Richard Nelson <cowboy@debian.org>
+#
+# NOTE: The following lines (without the #) must be in /etc/mail/sendmail.mc:
+# include(`/etc/mail/dialup.m4')dnl
+# include(`/etc/mail/provider.m4')dnl
+#
+# Exit by default, check for validity before commenting out the next line:
+exit 0;
+
+# Purge any latent host status that might cause us to *NOT* send mail
+AM='-Am';
+if [ ! -f /usr/share/sendmail/cf/feature/msp.m4 ]; then
+ AM='';
+ fi;
+sendmail $AM -bH -O Timeout.hoststatus=1s;
+
+# New mail will only be queued
+file="/etc/mail/dialup.m4";
+if [ -f "$file" ]; then
+ cat <<-EOT > $file;
+ LOCAL_CONFIG
+ #------------------------------------------------------------
+ #
+ # Dynamic updates from $0
+ #
+ # NOTE: the following line *MUST* be in /etc/mail/sendmail.mc
+ dnl include(\`/etc/mail/dialup.m4')dnl
+ #
+ # sendmail is to only queue messages until connected again
+ define(\`confDELIVERY_MODE', \`deferred')dnl
+ #
+ # Allow the queue to age without carping every four hours
+ define(\`confTO_QUEUEWARN',\`1d')dnl
+ #
+ # Don't keep host status while the network is down
+ define(\`confHOST_STATUS_DIRECTORY')dnl
+ #------------------------------------------------------------
+ EOT
+ fi;
+
+# Build a new sendmail.cf from sendmail.mc, including our address.
+# NOTE: The following line (without the #) must be in /etc/mail/sendmail.mc:
+# include(`/etc/mail/dialup.m4')
+m4 /etc/mail/sendmail.mc \
+ > /etc/mail/sendmail.cf.pnew;
+chmod 0644 /etc/mail/sendmail.cf.pnew;
+chown mail:mail /etc/mail/sendmail.cf.pnew;
+mv -f /etc/mail/sendmail.cf.pnew /etc/mail/sendmail.cf;
+
+# Stop/reload sendmail daemon as needed
+/etc/init.d/sendmail reload;
diff --git a/debian/examples/dialup/ip-up.d b/debian/examples/dialup/ip-up.d
new file mode 100644
index 0000000..cae3e1f
--- /dev/null
+++ b/debian/examples/dialup/ip-up.d
@@ -0,0 +1,130 @@
+#!/bin/sh
+#
+# This script is called when ppp connects to the network.
+#
+# Here is where we'll start sendmail if needed, and will
+# run the queue in either case.
+#
+# Written By Richard Nelson <cowboy@debian.org>
+#
+# NOTE: The following lines (without the #) must be in /etc/mail/sendmail.mc:
+# include(`/etc/mail/dialup.m4')dnl
+# include(`/etc/mail/provider.m4')dnl
+#
+# ALSO: make sure ipparam is specified somewhere in the ppp options;
+# it will be used as the name of a file in /etc/mail/peers
+#
+# Exit by default, check for validity before commenting out the next line:
+exit 0;
+
+# Define our domain name (from PPP) for sendmail.
+
+# These variables are for the use of the scripts run by run-parts
+#PPP_IFACE="$1";
+#PPP_TTY="$2";
+#PPP_SPEED="$3";
+#PPP_LOCAL="$4";
+#PPP_REMOTE="$5";
+#PPP_IPPARAM="$6";
+
+if [ ! -z "$PPP_LOCAL" ]; then
+ addr=$PPP_LOCAL;
+ provider=$PPP_IPPARAM;
+else
+ addr=$1;
+ provider=$2;
+ fi;
+
+# Determine our fqdn from our ISP
+maxloop=20;
+cntr=0;
+name="";
+until (test ! -z "$name"); do
+ cntr=$(($cntr+1));
+ rev=$(host $addr);
+ name=$(echo "$rev" | grep '^Name:' | awk '{print $2}');
+ if [ -z "$name" ]; then
+ name=${rev##*domain name pointer };
+ name=${name%.};
+ fi;
+ test=$(echo $name | cut -d ' ' -f 1);
+ if [ "$name" != "**" ]; then
+ break;
+ elif (($cntr > $maxloop)); then
+ name='';
+ break;
+ fi;
+ done;
+echo "addr=$addr, name=$name";
+
+file="/etc/mail/dialup.m4";
+#file="dialup.m4";
+if [ ! -z "$name" ]; then
+ cat <<-EOT > $file;
+ LOCAL_CONFIG
+ #------------------------------------------------------------
+ #
+ # Dynamic updates from $0
+ #
+ # NOTE: the following line *MUST* be in /etc/mail/sendmail.mc
+ dnl include(\`/etc/mail/dialup.m4')dnl
+ #
+ # Chose one of the following options:
+ # * Add our true hostname as a Virtual Host (we'll accept
+ # mail for it, but keep our local name for SMTP AUTH, etc)
+ dnl C{VirtHost}$name
+ # * Define our true hostname (from our ISP) becomes \$j
+ dnl define(\`confDOMAIN_NAME', \`$name')dnl
+ #
+ # Make sure we accept mail as this name (for bounces, etc)
+ Cw$name
+ # Add our hostname to class G for genericstable support
+ CG$name
+ #------------------------------------------------------------
+ EOT
+ fi;
+
+# Add smarthost information (if any)... But not if provider.m4 is a link !
+file="/etc/mail/provider.m4";
+#file="provider.m4";
+if [ -f /etc/mail/peers/$provider -a ! -L $file ]; then
+ cat <<-EOT > $file;
+ LOCAL_CONFIG
+ #------------------------------------------------------------
+ #
+ # Dynamic updates from $0
+ #
+ # NOTE: the following line *MUST* be in /etc/mail/sendmail.mc
+ dnl include(\`/etc/mail/provider.m4')dnl
+ #
+ # Provider information from /etc/mail/peers/$provider
+ EOT
+ cat /etc/mail/peers/$provider >> $file;
+ cat <<-EOT >> $file;
+ #------------------------------------------------------------
+ EOT
+ fi;
+#exit 0
+
+# Build a new sendmail.cf from sendmail.mc, including our address.
+# NOTE: The following lines (without the #) must be in /etc/mail/sendmail.mc:
+# include(`/etc/mail/dialup.m4')dnl
+# include(`/etc/mail/provider.m4')dnl
+m4 /etc/mail/sendmail.mc \
+ > /etc/mail/sendmail.cf.pnew;
+chmod 0644 /etc/mail/sendmail.cf.pnew;
+chown mail:mail /etc/mail/sendmail.cf.pnew;
+mv -f /etc/mail/sendmail.cf.pnew /etc/mail/sendmail.cf;
+
+# Purge any latent host status that might cause us to *NOT* send mail
+AM='-Am';
+if [ ! -f /usr/share/sendmail/cf/feature/msp.m4 ]; then
+ AM='';
+ fi;
+sendmail $AM -bH -O Timeout.hoststatus=1s;
+
+# Start/reload sendmail as needed
+/etc/init.d/sendmail reload; # may be up, or down
+
+# Process the sendmail queue (background so as to not defer other ip-up work)
+runq &
diff --git a/debian/examples/ldap/sendmail.schema.v1 b/debian/examples/ldap/sendmail.schema.v1
new file mode 100644
index 0000000..a1cf73e
--- /dev/null
+++ b/debian/examples/ldap/sendmail.schema.v1
@@ -0,0 +1,60 @@
+# Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
+# All rights reserved.
+#
+# By using this file, you agree to the terms and conditions set
+# forth in the LICENSE file which can be found at the top level of
+# the sendmail distribution.
+#
+# $Id: sendmail.schema,v 8.6 2001/02/14 05:03:22 gshapiro Exp $
+#
+# sendmail specific schemas
+#
+
+attribute sendmailMTAMapName cis
+attribute sendmailMTAMapHost cis
+attribute sendmailMTAMapDescription cis
+
+attribute sendmailMTAMapKey cis
+attribute sendmailMTAMapValue cis
+attribute sendmailMTAMapObjectDescription cis
+
+objectClass sendmailMTAMap
+ requires
+ objectClass,
+ sendmailMTAMapName,
+ sendmailMTAMapHost,
+ allows
+ sendmailMTAMapDescription
+
+objectClass sendmailMTAMapObject
+ requires
+ objectClass,
+ sendmailMTAMapKey,
+ sendmailMTAMapValue
+ allows
+ sendmailMTAMapObjectDescription
+
+#
+# The default aliases LDAP schema is used when the AliasFile option is set
+# to something like:
+#
+# O AliasFile=ldap:
+#
+# That schema is simply:
+#
+
+attribute sendmailMTAAliasHost cis
+attribute sendmailMTAAliasDescription cis
+
+attribute sendmailMTAAliasKey cis
+attribute sendmailMTAAliasValue cis
+
+objectClass sendmailMTAAlias
+ requires
+ objectClass,
+ sendmailMTAAliasHost,
+ sendmailMTAAliasKey,
+ sendmailMTAAliasValue
+ allows
+ sendmailMTAAliasDescription
+
diff --git a/debian/examples/ldap/sendmail.schema.v2 b/debian/examples/ldap/sendmail.schema.v2
new file mode 100644
index 0000000..bab47e8
--- /dev/null
+++ b/debian/examples/ldap/sendmail.schema.v2
@@ -0,0 +1,216 @@
+# Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
+# All rights reserved.
+#
+# By using this file, you agree to the terms and conditions set
+# forth in the LICENSE file which can be found at the top level of
+# the sendmail distribution.
+#
+# $Id: sendmail.schema,v 8.14 2001/08/31 17:18:18 gshapiro Exp $
+
+# Note that this schema is experimental at this point as it has had little
+# public review. Therefore, it may change in future versions. Feedback
+# via sendmail@sendmail.org is encouraged.
+
+# OID arcs for Sendmail
+# enterprise: 1.3.6.1.4.1
+# sendmail: enterprise.6152
+# sendmail-at: sendmail.3.1
+# sendmail-oc: sendmail.3.2
+
+###########################################################################
+#
+# The Sendmail MTA attributes and objectclass
+#
+###########################################################################
+
+# attribute sendmailMTACluster cis
+attributetype ( 1.3.6.1.4.1.6152.10.3.1.10
+ NAME 'sendmailMTACluster'
+ DESC 'cluster name associated with a set of MTAs'
+ EQUALITY caseIgnoreIA5Match
+ SUBSTR caseIgnoreIA5SubstringsMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
+
+# attribute sendmailMTAHost cis
+attributetype ( 1.3.6.1.4.1.6152.10.3.1.11
+ NAME 'sendmailMTAHost'
+ DESC 'host name associated with a MTA cluster'
+ EQUALITY caseIgnoreIA5Match
+ SUBSTR caseIgnoreIA5SubstringsMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
+
+#objectClass sendmailMTA
+# requires
+# objectClass
+# allows
+# sendmailMTACluster,
+# sendmailMTAHost,
+# Description
+
+objectclass ( 1.3.6.1.4.1.6152.10.3.2.10
+ NAME 'sendmailMTA'
+ SUP top STRUCTURAL
+ DESC 'Sendmail MTA definition'
+ MAY ( sendmailMTACluster $ sendmailMTAHost $ Description ) )
+
+###########################################################################
+#
+# The Sendmail MTA shared attributes
+#
+###########################################################################
+
+# attribute sendmailMTAKey cis
+attributetype ( 1.3.6.1.4.1.6152.10.3.1.13
+ NAME 'sendmailMTAKey'
+ DESC 'key (left hand side) of an aliases or map entry'
+ EQUALITY caseIgnoreMatch
+ SUBSTR caseIgnoreSubstringsMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+
+###########################################################################
+#
+# The Sendmail MTA Map attributes and objectclasses
+#
+###########################################################################
+
+# attribute sendmailMTAMapName cis
+attributetype ( 1.3.6.1.4.1.6152.10.3.1.14
+ NAME 'sendmailMTAMapName'
+ DESC 'identifier for the particular map'
+ EQUALITY caseIgnoreMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )
+
+# attribute sendmailMTAMapValue cis
+attributetype ( 1.3.6.1.4.1.6152.10.3.1.16
+ NAME 'sendmailMTAMapValue'
+ DESC 'value (right hand side) of a map entry'
+ EQUALITY caseIgnoreMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
+
+#objectClass sendmailMTAMap
+# requires
+# objectClass,
+# sendmailMTAMapName,
+# allows
+# sendmailMTACluster,
+# sendmailMTAHost,
+# Description
+
+objectclass ( 1.3.6.1.4.1.6152.10.3.2.11
+ NAME 'sendmailMTAMap'
+ SUP sendmailMTA STRUCTURAL
+ DESC 'Sendmail MTA map definition'
+ MUST sendmailMTAMapName
+ MAY ( sendmailMTACluster $ sendmailMTAHost $ Description ) )
+
+#objectClass sendmailMTAObject
+# requires
+# objectClass,
+# sendmailMTAMapName,
+# sendmailMTAKey,
+# sendmailMTAMapValue,
+# allows
+# sendmailMTACluster,
+# sendmailMTAHost,
+# Description
+
+objectclass ( 1.3.6.1.4.1.6152.10.3.2.12
+ NAME 'sendmailMTAMapObject'
+ SUP sendmailMTAMap STRUCTURAL
+ DESC 'Sendmail MTA map object'
+ MUST ( sendmailMTAMapName $ sendmailMTAKey $ sendmailMTAMapValue )
+ MAY ( sendmailMTACluster $ sendmailMTAHost $ Description ) )
+
+
+###########################################################################
+#
+# The Sendmail MTA Alias attributes and objectclasses
+#
+###########################################################################
+
+# attribute sendmailMTAAliasGrouping cis
+attributetype ( 1.3.6.1.4.1.6152.10.3.1.18
+ NAME 'sendmailMTAAliasGrouping'
+ DESC 'name that identifies a particular aliases grouping'
+ EQUALITY caseIgnoreMatch
+ SUBSTR caseIgnoreSubstringsMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
+
+# attribute sendmailMTAAliasValue cis
+attributetype ( 1.3.6.1.4.1.6152.10.3.1.20
+ NAME 'sendmailMTAAliasValue'
+ DESC 'value (right hand side) of an alias'
+ EQUALITY caseIgnoreMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+#objectClass sendmailMTAAlias
+# requires
+# objectClass,
+# allows
+# sendmailMTAAliasGrouping,
+# sendmailMTACluster,
+# sendmailMTAHost,
+# Description
+
+objectclass ( 1.3.6.1.4.1.6152.10.3.2.13
+ NAME 'sendmailMTAAlias'
+ SUP sendmailMTA STRUCTURAL
+ DESC 'Sendmail MTA alias definition'
+ MAY ( sendmailMTAAliasGrouping $
+ sendmailMTACluster $ sendmailMTAHost $ Description ) )
+
+#objectClass sendmailMTAAliasObject
+# requires
+# objectClass,
+# sendmailMTAKey,
+# sendmailMTAAliasValue,
+# allows
+# sendmailMTAAliasGrouping,
+# sendmailMTACluster,
+# sendmailMTAHost,
+# Description
+
+objectclass ( 1.3.6.1.4.1.6152.10.3.2.14
+ NAME 'sendmailMTAAliasObject'
+ SUP sendmailMTAAlias STRUCTURAL
+ DESC 'Sendmail MTA alias object'
+ MUST ( sendmailMTAKey $ sendmailMTAAliasValue )
+ MAY ( sendmailMTAAliasGrouping $
+ sendmailMTACluster $ sendmailMTAHost $ Description ) )
+
+###########################################################################
+#
+# The Sendmail MTA Class attributes and objectclass
+#
+###########################################################################
+
+# attribute sendmailMTAClassName cis
+attributetype ( 1.3.6.1.4.1.6152.10.3.1.22
+ NAME 'sendmailMTAClassName'
+ DESC 'identifier for the class'
+ EQUALITY caseIgnoreMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )
+
+# attribute sendmailMTAClassValue cis
+attributetype ( 1.3.6.1.4.1.6152.10.3.1.23
+ NAME 'sendmailMTAClassValue'
+ DESC 'member of a class'
+ EQUALITY caseIgnoreMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+#objectClass sendmailMTAClass
+# requires
+# objectClass,
+# sendmailMTAClassName,
+# sendmailMTAClassValue,
+# allows
+# sendmailMTACluster,
+# sendmailMTAHost,
+# Description
+
+objectclass ( 1.3.6.1.4.1.6152.10.3.2.15
+ NAME 'sendmailMTAClass'
+ SUP sendmailMTA STRUCTURAL
+ DESC 'Sendmail MTA class definition'
+ MUST ( sendmailMTAClassName $ sendmailMTAClassValue )
+ MAY ( sendmailMTACluster $ sendmailMTAHost $ Description ) )
diff --git a/debian/examples/logcheck/ignore.d.paranoid/sendmail b/debian/examples/logcheck/ignore.d.paranoid/sendmail
new file mode 100644
index 0000000..e0781dd
--- /dev/null
+++ b/debian/examples/logcheck/ignore.d.paranoid/sendmail
@@ -0,0 +1,21 @@
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: starting daemon
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: restarting
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: rejecting connections on daemon
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: accepting connections again for daemon
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* User unknown
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: alias database .* rebuilt
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* aliases, longest
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: from=
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: split:
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* lost input channel
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* message-id=
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* return to sender
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* stat=
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* timeout waiting
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: Milter add:
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: Milter: data, discard
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: discarded
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: AUTH=
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: (PLAIN|CRAM-MD5|DIGEST-MD5) set secret
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: DIGEST-MD5: failed .* later in exchange
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: STARTTLS=(server|client), .* verify=(OK|NO)
diff --git a/debian/examples/logcheck/ignore.d.server/sendmail b/debian/examples/logcheck/ignore.d.server/sendmail
new file mode 100644
index 0000000..dfc4984
--- /dev/null
+++ b/debian/examples/logcheck/ignore.d.server/sendmail
@@ -0,0 +1,21 @@
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: starting daemon
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: restarting
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: rejecting connections on daemon
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: accepting connections again for daemon
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* User unknown
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: alias database .* rebuilt
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* aliases, longest
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: from=
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: split:
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* lost input channel
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* message-id=
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* return to sender
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* stat=
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* timeout waiting
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: Milter add:
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: Milter: data, discard
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: discarded
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: AUTH=
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: (PLAIN|CRAM-MD5|DIGEST-MD5) set secret
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: DIGEST-MD5: failed .* later in exchange
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: STARTTLS=(server|client), .* verify=(OK|NO)
diff --git a/debian/examples/logcheck/ignore.d.workstation/sendmail b/debian/examples/logcheck/ignore.d.workstation/sendmail
new file mode 100644
index 0000000..2374b71
--- /dev/null
+++ b/debian/examples/logcheck/ignore.d.workstation/sendmail
@@ -0,0 +1,21 @@
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: starting daemon
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: restarting
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: rejecting connections on daemon
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: accepting connections again for daemon
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* User unknown
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: alias database .* rebuilt
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* aliases, longest
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: from=
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: split:
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* lost input channel
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* message-id=
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* return to sender
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* stat=
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .* timeout waiting
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: Milter add:
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: Milter: data, discard
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*: discarded
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: AUTH=
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: (PLAIN|CRAM-MD5|DIGEST-MD5) set secret
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: DIGEST-MD5: failed .* later in exchange
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: STARTTLS=
diff --git a/debian/examples/logcheck/violations.ignore.d/logcheck-sendmail b/debian/examples/logcheck/violations.ignore.d/logcheck-sendmail
new file mode 100644
index 0000000..9518e7d
--- /dev/null
+++ b/debian/examples/logcheck/violations.ignore.d/logcheck-sendmail
@@ -0,0 +1,12 @@
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: alias database .* rebuilt
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*stat=(Refused|Deferred)
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: gethostbyaddr\(.*\) failed:
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: rejecting connections on daemon
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: DIGEST-MD5: failed .* later in exchange
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=450 4\.7\.1 <[^>]+>... Relaying temporarily denied. Cannot resolve PTR record for [0-9\.]+$
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=451 4\.1\.8 Domain of sender address [^ ]+ does not resolve$
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=550 5\.7\.1 Access denied$
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=550 5\.7\.1 <[^>]+>... Relaying denied. Proper authentication required.$
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=550 5\.7\.1 <[^>]+>... Relaying denied. IP name lookup failed \[[0-9\.]+\]$
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=550 5\.7\.1 <[^>]+>... Relaying denied. IP name lookup possibly forged \[[0-9\.]+\]$
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=553 5\.1\.8 <[^>]+>... Relaying temporarily denied. Cannot resolve PTR record for [0-9\.]+$
diff --git a/debian/examples/logcheck/violations.ignore.d/sendmail b/debian/examples/logcheck/violations.ignore.d/sendmail
new file mode 100644
index 0000000..9518e7d
--- /dev/null
+++ b/debian/examples/logcheck/violations.ignore.d/sendmail
@@ -0,0 +1,12 @@
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: alias database .* rebuilt
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*stat=(Refused|Deferred)
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: gethostbyaddr\(.*\) failed:
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: rejecting connections on daemon
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: DIGEST-MD5: failed .* later in exchange
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=450 4\.7\.1 <[^>]+>... Relaying temporarily denied. Cannot resolve PTR record for [0-9\.]+$
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=451 4\.1\.8 Domain of sender address [^ ]+ does not resolve$
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=550 5\.7\.1 Access denied$
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=550 5\.7\.1 <[^>]+>... Relaying denied. Proper authentication required.$
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=550 5\.7\.1 <[^>]+>... Relaying denied. IP name lookup failed \[[0-9\.]+\]$
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=550 5\.7\.1 <[^>]+>... Relaying denied. IP name lookup possibly forged \[[0-9\.]+\]$
+(sendmail|sm-(mta|msp|que))\[[0-9]+\]: .*reject=553 5\.1\.8 <[^>]+>... Relaying temporarily denied. Cannot resolve PTR record for [0-9\.]+$
diff --git a/debian/examples/milter/Makefile b/debian/examples/milter/Makefile
new file mode 100644
index 0000000..69f5e93
--- /dev/null
+++ b/debian/examples/milter/Makefile
@@ -0,0 +1,25 @@
+#!/usr/bin/make -f
+SHELL= /bin/sh
+
+# Define standard compile/install flags
+CC = gcc
+CFLAGS = -O2 -Wall
+INSTALL = install
+INCLS = -I.
+DEFS =
+CFLAGS += $(DEFS) $(INCLS)
+LDFLAGS =
+LIBS = /usr/lib/libmilter/libmilter.a \
+ /usr/lib/libmilter/libsm.a \
+ -lldap -llber \
+ -lbind \
+ -pthread
+
+all: sample
+
+sample: sample.c
+ @rm -f $@
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $? $(LIBS)
+
+clean:
+ rm -rf sample *~
diff --git a/debian/examples/milter/sample.c b/debian/examples/milter/sample.c
new file mode 100644
index 0000000..4e063ad
--- /dev/null
+++ b/debian/examples/milter/sample.c
@@ -0,0 +1,236 @@
+
+/* A trivial filter that logs all email to a file. */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysexits.h>
+#include <unistd.h>
+
+#include "libmilter/mfapi.h"
+#include "strl.h" /*RAN*/
+
+typedef int bool;
+
+#ifndef FALSE
+# define FALSE 0
+#endif /* ! FALSE*/
+#ifndef TRUE
+# define TRUE 1
+#endif /* ! TRUE*/
+
+struct mlfiPriv
+{
+ char *mlfi_fname;
+ FILE *mlfi_fp;
+};
+
+#define MLFIPRIV ((struct mlfiPriv *) smfi_getpriv(ctx))
+
+extern sfsistat mlfi_cleanup(SMFICTX *, bool);
+
+sfsistat
+mlfi_envfrom(ctx, envfrom)
+ SMFICTX *ctx;
+ char **envfrom;
+{
+ struct mlfiPriv *priv;
+ int fd;
+
+ /* allocate some private memory */
+ priv = malloc(sizeof *priv);
+ if (priv == NULL)
+ {
+ /* can't accept this message right now */
+ return SMFIS_TEMPFAIL;
+ }
+ memset(priv, '\0', sizeof *priv);
+
+ /* open a file to store this message */
+ priv->mlfi_fname = strdup("/tmp/msg.XXXXXXXX");
+ if (priv->mlfi_fname == NULL)
+ {
+ free(priv);
+ return SMFIS_TEMPFAIL;
+ }
+ if ((fd = mkstemp(priv->mlfi_fname)) < 0 ||
+ (priv->mlfi_fp = fdopen(fd, "w+")) == NULL)
+ {
+ free(priv->mlfi_fname);
+ free(priv);
+ return SMFIS_TEMPFAIL;
+ }
+
+ /* save the private data */
+ smfi_setpriv(ctx, priv);
+
+ /* continue processing */
+ return SMFIS_CONTINUE;
+}
+
+sfsistat
+mlfi_header(ctx, headerf, headerv)
+ SMFICTX *ctx;
+ char *headerf;
+ char *headerv;
+{
+ /* write the header to the log file */
+ fprintf(MLFIPRIV->mlfi_fp, "%s: %s\r\n", headerf, headerv);
+
+ /* continue processing */
+ return SMFIS_CONTINUE;
+}
+
+sfsistat
+mlfi_eoh(ctx)
+ SMFICTX *ctx;
+{
+ /* output the blank line between the header and the body */
+ fprintf(MLFIPRIV->mlfi_fp, "\r\n");
+
+ /* continue processing */
+ return SMFIS_CONTINUE;
+}
+
+sfsistat
+mlfi_body(ctx, bodyp, bodylen)
+ SMFICTX *ctx;
+ u_char *bodyp;
+ size_t bodylen;
+{
+ /* output body block to log file */
+ if (fwrite(bodyp, bodylen, 1, MLFIPRIV->mlfi_fp) <= 0)
+ {
+ /* write failed */
+ (void) mlfi_cleanup(ctx, FALSE);
+ return SMFIS_TEMPFAIL;
+ }
+
+ /* continue processing */
+ return SMFIS_CONTINUE;
+}
+
+sfsistat
+mlfi_eom(ctx)
+ SMFICTX *ctx;
+{
+ return mlfi_cleanup(ctx, TRUE);
+}
+
+sfsistat
+mlfi_close(ctx)
+ SMFICTX *ctx;
+{
+ return SMFIS_ACCEPT;
+}
+
+sfsistat
+mlfi_abort(ctx)
+ SMFICTX *ctx;
+{
+ return mlfi_cleanup(ctx, FALSE);
+}
+
+sfsistat
+mlfi_cleanup(ctx, ok)
+ SMFICTX *ctx;
+ bool ok;
+{
+ sfsistat rstat = SMFIS_CONTINUE;
+ struct mlfiPriv *priv = MLFIPRIV;
+ char *p;
+ char host[512];
+ char hbuf[1024];
+
+ if (priv == NULL)
+ return rstat;
+
+ /* close the archive file */
+ if (priv->mlfi_fp != NULL && fclose(priv->mlfi_fp) == EOF)
+ {
+ /* failed; we have to wait until later */
+ rstat = SMFIS_TEMPFAIL;
+ (void) unlink(priv->mlfi_fname);
+ }
+ else if (ok)
+ {
+ /* add a header to the message announcing our presence */
+ if (gethostname(host, sizeof host) < 0)
+ strlcpy(host, "localhost", sizeof host);
+ p = strrchr(priv->mlfi_fname, '/');
+ if (p == NULL)
+ p = priv->mlfi_fname;
+ else
+ p++;
+ snprintf(hbuf, sizeof hbuf, "%s@%s", p, host);
+ smfi_addheader(ctx, "X-Archived", hbuf);
+ }
+ else
+ {
+ /* message was aborted -- delete the archive file */
+ (void) unlink(priv->mlfi_fname);
+ }
+
+ /* release private memory */
+ free(priv->mlfi_fname);
+ free(priv);
+ smfi_setpriv(ctx, NULL);
+
+ /* return status */
+ return rstat;
+}
+
+struct smfiDesc smfilter =
+{
+ "SampleFilter", /* filter name */
+ SMFI_VERSION, /* version code -- do not change */
+ SMFIF_ADDHDRS, /* flags */
+ NULL, /* connection info filter */
+ NULL, /* SMTP HELO command filter */
+ mlfi_envfrom, /* envelope sender filter */
+ NULL, /* envelope recipient filter */
+ mlfi_header, /* header filter */
+ mlfi_eoh, /* end of header */
+ mlfi_body, /* body block filter */
+ mlfi_eom, /* end of message */
+ mlfi_abort, /* message aborted */
+ mlfi_close /* connection cleanup */
+};
+
+
+int
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int c;
+ const char *args = "p:";
+
+ /* Process command line options */
+ while ((c = getopt(argc, argv, args)) != -1)
+ {
+ switch (c)
+ {
+ case 'p':
+ if (optarg == NULL || *optarg == '\0')
+ {
+ (void) fprintf(stderr, "Illegal conn: %s\n",
+ optarg);
+ exit(EX_USAGE);
+ }
+ (void) smfi_setconn(optarg);
+ break;
+
+ }
+ }
+ if (smfi_register(smfilter) == MI_FAILURE)
+ {
+ fprintf(stderr, "smfi_register failed\n");
+ exit(EX_UNAVAILABLE);
+ }
+ return smfi_main();
+}
+
+/* eof */
+
diff --git a/debian/examples/milter/strl.h b/debian/examples/milter/strl.h
new file mode 100644
index 0000000..f3c8cdb
--- /dev/null
+++ b/debian/examples/milter/strl.h
@@ -0,0 +1,17 @@
+/*-------------------------------------------------------------------*/
+/* strl.h: include file for functions in strl.c */
+/* buried in the bottom of include/sendmail/sendmail.h */
+/* extracted and placed herein. */
+/* */
+/* referenced by: ./sample.c */
+/* defined by: /usr/lib/libmilter/libsm.a */
+/* */
+/* Richard Nelson <cowboy@debian.org> */
+/*-------------------------------------------------------------------*/
+
+#define strlcpy sm_strlcpy
+#define strlcat sm_strlcat
+
+extern size_t sm_strlcpy __P((char *, const char *, size_t));
+extern size_t sm_strlcat __P((char *, const char *, size_t));
+
diff --git a/debian/examples/pam/smtp b/debian/examples/pam/smtp
new file mode 100644
index 0000000..645535c
--- /dev/null
+++ b/debian/examples/pam/smtp
@@ -0,0 +1,14 @@
+#%PAM-1.0
+#------------------------------------------------------------------------
+#
+# /etc/pam.d/smtp
+#
+# Copyright (c) 2000-2001 Richard Nelson. All Rights Reserved.
+# Version: 2.0.0
+# Time-stamp: <2001/05/29 12:00:00 cowboy>
+#
+# PAM configuration file used by SASL to authenticate a PLAIN password.
+#
+#------------------------------------------------------------------------
+#auth sufficient pam_ldap.so
+auth required pam_unix.so nullok try_first_pass
diff --git a/debian/examples/sasl/Sendmail.conf b/debian/examples/sasl/Sendmail.conf
new file mode 100644
index 0000000..b41887b
--- /dev/null
+++ b/debian/examples/sasl/Sendmail.conf
@@ -0,0 +1,18 @@
+#Currently configurable parameters:
+#- srvtab (for KERBEROS_V4): [/etc/srvtab] path
+# where to find the srvtab
+#
+#- pwcheck_method: [PAM] one of {PAM, kerberos_v4, passwd, shadow, sasldb}
+# how to check plaintext passwords.
+#
+#- auto_transition: [false]
+# if true, automatically add secrets to the secret database when
+# PLAIN or check_password is used, so in the future the user can
+# use the more secure mechanisms.
+#
+#*** For a more detailed guide on configuring SASL, please look at
+#doc/sysadmin.html.
+#
+#pwcheck_method: sasldb
+pwcheck_method: PAM
+auto_transition: true
diff --git a/debian/examples/sasl/saslpasswd.conf b/debian/examples/sasl/saslpasswd.conf
new file mode 100644
index 0000000..dfcc7b7
--- /dev/null
+++ b/debian/examples/sasl/saslpasswd.conf
@@ -0,0 +1,17 @@
+#Currently configurable parameters:
+#- srvtab (for KERBEROS_V4): [/etc/srvtab] path
+# where to find the srvtab
+#
+#- pwcheck_method: [PAM] one of {PAM, kerberos_v4, passwd, shadow, sasldb}
+# how to check plaintext passwords.
+#
+#- auto_transition: [false]
+# if true, automatically add secrets to the secret database when
+# PLAIN or check_password is used, so in the future the user can
+# use the more secure mechanisms.
+#
+#*** For a more detailed guide on configuring SASL, please look at
+#doc/sysadmin.html.
+#
+pwcheck_method: sasldb
+auto_transition: true
diff --git a/debian/faq.txt b/debian/faq.txt
new file mode 100644
index 0000000..7907d48
--- /dev/null
+++ b/debian/faq.txt
@@ -0,0 +1,3634 @@
+
+ sendmail.org
+
+Sendmail
+Frequently Asked Questions (FAQ)
+
+ Last updated March 3, 2003
+
+ Comments and questions on this FAQ should be directed to
+ sendmail+faq@sendmail.org.
+ General questions about sendmail should be directed to
+ sendmail-questions@sendmail.org.
+ Bug reports should be directed to sendmail-bugs@sendmail.org.
+
+ If you post a message to comp.mail.sendmail and send it to one of the
+ above addresses, please clearly indicate so at the top of your
+ message.
+ _________________________________________________________________
+
+Top 5 - the most frequently asked questions about sendmail
+
+ 1. Local config error: see 4.5
+ 2. Relaying denied: see 3.27
+ 3. Directory permissions: see 3.33
+ 4. Virtual hosting: see 3.7 & 3.28
+ 5. POP / IMAP: see 4.19
+ _________________________________________________________________
+
+Table of Contents
+
+ * 0. Plain-text version now available.
+ * 1. COPYRIGHT NOTICE / REDISTRIBUTION REQUIREMENTS
+ * 2. INTRODUCTION / MISCELLANEOUS
+ + 2.1 What is this newsgroup?
+ + 2.2 What is the scope of this FAQ?
+ + 2.3 Where can I find the latest version of this FAQ?
+ + 2.4 How do I access comp.mail.sendmail by email?
+ + 2.5 Where can I ask email-related DNS questions?
+ + 2.6 How can I subscribe to these newsgroups?
+ + 2.7 Which version of sendmail should I run?
+ + 2.8 What is the latest release of sendmail?
+ + 2.9 Where can I find it?
+ + 2.10 What are the differences between Version 8 and other
+ versions?
+ + 2.11 What's the best platform for running sendmail?
+ + 2.12 What is BIND and where can I get the latest version?
+ + 2.13 What is smrsh and where can I get it?
+ + 2.14 What is smap and where can I get it?
+ + 2.15 What is TCP-Wrappers and where can I get it?
+ + 2.16 Why won't db 1.85 build on my machine?
+ + 2.17 What is makemap and where can I get it?
+ * 3. VERSION 8 SPECIFIC ISSUES
+ + 3.1 How do I make all my addresses appear to be from a single
+ host?
+ + 3.2 How do I rewrite my "From:" lines to read
+ ``First_Last@My.Domain'' or ``Different_Name@My.Domain''?
+ + 3.3 But what about fully-qualified addresses, such as those
+ from Pine or FEATURE(always_add_domain)?
+ + 3.4 So what was the user database feature intended for?
+ + 3.5 Why the hostility toward using full names for email
+ addresses?
+ + 3.6 deprecated
+ + 3.7 How do I manage several (virtual) domains?
+ + 3.8 There are four UUCP mailers listed in the configuration
+ files. Which one should I use?
+ + 3.9 How do I fix "undefined symbol inet_aton" and "undefined
+ symbol _strerror" messages?
+ + 3.10 How do I solve "collect: I/O error on connection" or
+ "reply: read error from host.name" errors?
+ + 3.11 Why can't my users forward their mail to a program?
+ + 3.12 Why do connections to the SMTP port take such a long
+ time?
+ + 3.13 Why do I get "unknown mailer error 5 -- mail: options
+ MUST PRECEDE recipients" errors?
+ + 3.14 Why does version 8 sendmail panic my SunOS box?
+ + 3.15 Why does the Unix From line get mysteriously munged when
+ I send to an alias?
+ + 3.16 Why doesn't MASQUERADE_AS (or the user database) work
+ for envelope addresses as well as header addresses?
+ + 3.17 How do I run version 8 sendmail and support the MAIL11V3
+ protocol?
+ + 3.18 Why do messages disappear from my queue unsent?
+ + 3.19 When is sendmail going to support RFC 2047 MIME header
+ encoding?
+ + 3.20 Why can't I get mail to some places, but instead always
+ get the error "reply: read error from name.of.remote.host"?
+ + 3.21 Why doesn't "FEATURE(xxx)" work?
+ + 3.22 How do I configure sendmail not to use DNS?
+ + 3.23 How do I get all my queued mail delivered to my Unix box
+ from my ISP?
+ + 3.24 Why do I get the error message unable to write
+ /etc/mail/sendmail.pid?
+ + 3.25 Why can't I compile sendmail with Berkeley DB 2.X?
+ + 3.26 What operating systems has Berkeley sendmail been ported
+ to?
+ + 3.27 How do I prevent Relaying Denied errors for my clients?
+ + 3.28 Why isn't virtual hosting working, even after I added a
+ Kvirtuser line to sendmail.cf ?
+ + 3.29 How can I add a header specifying the actual recipient
+ when having multiple users in a virtual domain go to a single
+ mailbox?
+ + 3.30 What do I do when Build fails because groff was not
+ found?
+ + 3.31 What does "class hash not available" mean?
+ + 3.32 How do I configure majordomo with sendmail 8.9 without
+ relaxing the DontBlameSendmail option?
+ + 3.33 How do I configure my system in general with sendmail
+ 8.9?
+ + 3.34 What does "foo not available for sendmail programs"
+ mean?
+ + 3.35 How do I add a footer/signature to all (outgoing) e-mail
+ messages?
+ + 3.36 What does "Cannot open hash database ... Invalid
+ argument" mean?
+ + 3.37 What does "parse error before `NDBM'" mean?
+ + 3.38 What does "may be forged" mean?
+ + 3.39 How do I send using an alternate port?
+ + 3.40 Why can't I use BerkeleyDB 4.1.x?
+ + 3.41 How do I use CIDR notation in the access map (or other
+ places)?
+ + 3.42 Why isn't CIDR notation directly supported by sendmail?
+ + 3.43 What does "Need to recompile with -DNEWDB for hash
+ support" mean?
+ + 3.44 I disabled sendmail on some machines which don't receive
+ mail, but since upgrading to 8.12 they can't send mail
+ either; why?
+ * 4. GENERAL SENDMAIL ISSUES
+ + 4.1 Should I use a wildcard MX for my domain?
+ + 4.2 How can I set up an auto-responder?
+ + 4.3 How can I get sendmail to deliver local mail to
+ $HOME/.mail instead of into /usr/spool/mail (or /usr/mail)?
+ + 4.4 Why does it deliver the mail interactively when I'm
+ trying to get it to go into queue only mode?
+ + 4.5 How can I solve "MX list for hostname points back to
+ hostname" and "config error: mail loops back to myself"
+ messages?
+ + 4.6 Why does my sendmail process sometimes hang when
+ connecting over a SLIP/PPP link?
+ + 4.7 How can I summarize the statistics generated by sendmail
+ in the syslog?
+ + 4.8 How can I check my sendmail.cf to ensure that it's
+ re-writing addresses correctly?
+ + 4.9 What is procmail, and where can I get it?
+ + 4.10 How can I solve "cannot alias non-local names" errors?
+ + 4.11 Is sendmail Year 2000 (Y2K) compliant?
+ + 4.12 How can I batch remote mail to be sent using my ISP
+ while delivering local mail immediately?
+ + 4.13 What does "unknown mailer error 1" mean?
+ + 4.14 How do I queue mail for another domain?
+ + 4.15 How do I create attachments with sendmail?
+ + 4.16 How do I find sendmail's version number?
+ + 4.17 How do I handle user names with upper-case characters?
+ + 4.18 What does "NOQUEUE: Null connection from ..." mean?
+ + 4.19 How do I configure sendmail for POP/IMAP/... ?
+ + 4.20 How can I automatically copy messages based on sender or
+ recipient addresses?
+ + 4.21 How can I send mail to all users?
+ + 4.22 Why can't I receive external mail?
+ * 5. VENDOR/OS SPECIFIC SENDMAIL ISSUES
+ + 5.1 Sun Microsystems SunOS/Solaris 1.x/2.x
+ o 5.1.1 How can I solve "line 273: replacement $3 out of
+ bounds" errors?
+ o 5.1.2 How can I solve "line 445: bad ruleset 96 (50
+ max)" errors?
+ o 5.1.3 Why does version 8 sendmail (< 8.7.5) sometimes
+ hang under Solaris 2.5?
+ o 5.1.4 Why can't I use SunOS/Solaris to get email to
+ certain large sites?
+ o 5.1.5 Why do I have trouble compiling on Solaris?
+ o 5.1.6 How does 8.X compare to 8.X+Sun?
+ + 5.2 IBM AIX
+ o 5.2.1 The system resource controller always reports
+ sendmail as "inoperative". What's wrong?
+ o 5.2.2 Why can't I use AIX to get email to some sites?
+ o 5.2.3 Why can't I get sendmail 8.7.1 to use MX records
+ with AIX 3.2.5?
+ + 5.3 Linux
+ o 5.3.1 Red Hat
+ # 5.3.1.1 Why do I have so many sendmail problems
+ after configuring sendmail with linuxconf?
+ # 5.3.1.2 I built sendmail.cf from sendmail.mc and it
+ works until the next reboot of the machine. What is
+ going on?
+ # 5.3.1.3 Why can't I receive mail with Red Hat 7.1
+ and later?
+ o 5.3.2 SuSE
+ # 5.3.2.1 Where is the sendmail.mc file on SuSE
+ Linux?
+ * 6. ADDITIONAL INFORMATION SOURCES (RFC 1807 bibliography format)
+ + 6.1 Reference material devoted exclusively to sendmail
+ + 6.2 Reference material with chapters or sections on sendmail
+ + 6.3 Reference material on subjects related to sendmail
+ + 6.4 World-wide web index pages on sendmail
+ + 6.5 World-wide web index pages Internet email in general
+ + 6.6 Online tutorials for sendmail
+ + 6.7 Online archives of mailing lists and Usenet newsgroups,
+ relating to Internet email
+ * 7. THANKS!
+
+ home
+
+ sendmail.org 1. COPYRIGHT NOTICE / REDISTRIBUTION REQUIREMENTS
+
+ The entire contents of this document are copyright 1997 - 2000 by the
+ Sendmail Consortium, all rights reserved.
+
+ This document may be freely distributed for non-profit purposes
+ (including, but not limited to: posting to mailing lists, Usenet
+ newsgroups, and world-wide-web pages; inclusion on CD-ROM or other
+ distribution media; and insertion into text retrieval systems), so
+ long as it is the latest version available at the time, all parts are
+ distributed together, and it is kept completely intact without
+ editing, changes, deletions, or additions. Non-profit redistribution
+ in accordance with these guidelines does not require contact with or
+ approval from the copyright holder.
+
+ Redistribution of this document for profit without express prior
+ permission is not allowed. At the very least, expect to provide the
+ copyright holder a free copy of the product (exactly as it would be
+ sold to customers, all distribution media intact), or a percentage of
+ the gross revenue from said product and sufficient proof that the
+ integrity and completeness requirements set for non-profit
+ distribution will be met.
+
+ In the event that the copyright holder discovers a redistributed
+ version that is not in compliance with the above requirements, he will
+ make a good-faith effort to get it corrected or removed, and failing
+ that, at least note its deprecated status in a new version. Legal
+ action will likely be taken against redistribution for profit that is
+ not in compliance with the above requirements.
+
+
+ sendmail.org
+
+ 2. INTRODUCTION / MISCELLANEOUS
+
+ * 2.1 What is this newsgroup?
+ * 2.2 What is the scope of this FAQ?
+ * 2.3 Where can I find the latest version of this FAQ?
+ * 2.4 How do I access comp.mail.sendmail by email?
+ * 2.5 Where can I ask email-related DNS questions?
+ * 2.6 How can I subscribe to these newsgroups?
+ * 2.7 Which version of sendmail should I run?
+ * 2.8 What is the latest release of sendmail?
+ * 2.9 Where can I find it?
+ * 2.10 What are the differences between Version 8 and other
+ versions?
+ * 2.11 What's the best platform for running sendmail?
+ * 2.12 What is BIND and where can I get the latest version?
+ * 2.13 What is smrsh and where can I get it?
+ * 2.14 What is smap and where can I get it?
+ * 2.15 What is TCP-Wrappers and where can I get it?
+ * 2.16 Why won't db 1.85 build on my machine?
+ * 2.17 What is makemap and where can I get it?
+ _________________________________________________________________
+
+Q2.1 -- What is this newsgroup?
+
+ Date: May 28, 1996
+
+ The Usenet newsgroup comp.mail.sendmail is dedicated to the discussion
+ of the program named "sendmail" in all its various forms. It is most
+ commonly found on computers running a flavor of the Operating System
+ known as Unix, or derived from Unix.
+
+ This program has been ported to other OSes, but those versions have
+ typically been ported by a particular vendor and are considered
+ proprietary. There are many versions of sendmail, but the original
+ author (Eric Allman) is continuing development on a particular version
+ typically referred to as "Version Eight" or sometimes just "V8". This
+ is considered by many to be the One True Version. This is also the
+ version that this FAQ is centered around.
+
+ If you have a question that amounts to "How do I send mail to my
+ friend?", then you're in the wrong newsgroup. You should first check
+ with your System or E-Mail Administrator(s), BBS SysOp(s), etc...
+ before you post your question publicly, since the answer will likely
+ be very highly dependent on what software and hardware you have. You
+ also don't want to embarrass yourself publicly, nor do you want to
+ annoy the kinds of people who are likely to be the counterparts of
+ your System or E-Mail Administrator(s), BBS SysOp(s), etc.... If
+ asking them doesn't do you any good, make sure you read this FAQ and
+ the other mail-related FAQs at the archive sites listed below.
+
+ If you have a question about another program similar to sendmail
+ (technically referred to as an "SMTP MTA"), an SMTP Gateway package,
+ or a LAN email package, then you should see if there is another group
+ in the comp.mail hierarchy that more closely matches the particular
+ program you want to ask a question about. For example, the SMTP MTA
+ known as Smail has comp.mail.smail dedicated to it. The Mail User
+ Agent (MUA) Eudora has two newsgroups dedicated to it
+ (comp.mail.eudora.mac and comp.mail.eudora.ms-windows), depending on
+ which hardware platform you use. If there isn't a more appropriate
+ newsgroup, try comp.mail.misc. Again, make sure your question isn't
+ already addressed in one of the mail-related FAQs or other available
+ documentation. See the IMC website (more info below) for a good list
+ of mail-related FAQs.
+
+ If you have a question about an older or vendor-proprietary version of
+ sendmail, be prepared for a lot of answers that amount to "Get V8".
+ Version 8 isn't a panacea, but it does solve many problems known to
+ plague previous versions, as well as having many new features that
+ make it much easier to administer large or complex sites. In many
+ cases, it makes at least possible what was previously virtually
+ impossible, and relatively easy the previously difficult.
+
+ There are, of course, many alternative programs that have sprung up in
+ an attempt to answer one or another weakness or perceived fault of
+ sendmail, but so far, none of them have had the kind of success it
+ would require to unseat it as the de facto standard program for
+ sending Internet mail. Obviously, this forum should not be used to
+ discuss the merits of any of the alternative programs versus sendmail.
+ These kinds of discussions should be taken to comp.mail.misc, or you
+ should agitate to get a new newsgroup or newsgroup hierarchy created
+ where that sort of thing is acceptable (or even the norm, such as a
+ comp.mail.advocacy or news:comp.mail.mta.advocacy newsgroup).
+ _________________________________________________________________
+
+Subject: Q2.2 -- What is the scope of this FAQ?
+
+ Date: April 9, 1997
+
+ This FAQ is strongly centered around version 8 sendmail, for many
+ reasons. First and foremost, this is the area of most interest on the
+ part of the maintainers of this FAQ. Secondly, version 8 is where most
+ of the additional development is being concentrated. Version 8
+ sendmail is also the best documented of all SMTP MTAs, by virtue of
+ the book by Bryan Costales (see entry
+ sendmail-faq//book/ISBN/1-56592-222-0 in Q6.1).
+
+ Other versions of sendmail get mentioned in passing, and some
+ interesting interactions between version 8 and various OSes is also
+ covered.
+
+ This FAQ is aimed primarily at the experienced Unix System
+ Administrator/Postmaster/DNS Domain Administrator. If you're looking
+ for introductory texts, see the references in Q6.1.
+ _________________________________________________________________
+
+Q2.3 -- Where can I find the latest version of this FAQ?
+
+ Date: February 20, 1998
+
+ We post changes as they occur to the sendmail FAQ support page at
+ http://www.sendmail.org/faq/.
+ _________________________________________________________________
+
+Q2.4 -- How do I access comp.mail.sendmail by email?
+
+ Date: November 24, 1996
+
+ Send email to mxt@dl.ac.uk with the command "sub
+ comp-news.comp.mail.sendmail full-US-ordered-email-address" as the
+ body of the message (with your correct address in place of the
+ "full-US-ordered-email-address", and omitting the double quotes in all
+ cases of this example).
+
+ E-mail you want posted on comp.mail.sendmail should be sent to
+ comp-mail-sendmail@dl.ac.uk
+ _________________________________________________________________
+
+Q2.5 -- Where can I ask email-related DNS questions?
+
+ Date: March 23, 1996
+
+ 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
+ Usenet newsgroup comp.protocols.tcp-ip.domains (DNS in general) or to
+ the Info-BIND mailing list (if the question is specific to that
+ program).
+ _________________________________________________________________
+
+Q2.6 -- How can I subscribe to these?
+
+ Date: June 19, 1997
+
+ For comp.protocols.tcp-ip.domains, you have to be on Usenet. They
+ don't have a news-to-mail gateway yet (I'm working on this), but they
+ do have a FAQ.
+
+ Questions from all levels of experience can be found on this newsgroup
+ (as well as people to answer them), so don't be shy about asking a
+ question you think may be too simple.
+
+ Some more information from the BIND 8.1 src/README file:
+
+ CAPTION: Kits, Questions, Comments, and Bug Reports
+
+ URL Purpose
+ ftp.isc.org/isc/bind/src/cur current non-test release
+ ftp.isc.org/isc/bind/src/testing latest public test kit
+ _________________________________________________________________
+
+ comp.protocols.dns.bind using BIND
+ comp.protocols.dns.ops DNS operations in general
+ comp.protocols.dns.std DNS standards in general
+ _________________________________________________________________
+
+ bind-users-request@vix.com gw'd to c.p.d.bind
+ namedroppers-request@internic.net gw'd to c.p.d.std
+ bind-workers-request@vix.com code warriors only please
+ _________________________________________________________________
+
+ www.isc.org/bind.html the BIND home page
+ bind-bugs@isc.org bug reports
+ _________________________________________________________________
+
+Q2.7 -- Which version of sendmail should I run?
+
+ Date: April 8, 1997
+ Updated: March 7, 2000
+
+ If you're concerned at all about the security of your machines, you
+ should make sure you're at least running a recent release of version 8
+ sendmail (either from your vendor or the public version detailed in
+ Q2.8).
+
+ Check the CERT Alerts and Summaries to make sure that you're running a
+ version that is free of known security holes. Just because the
+ sendmail program provided by your vendor isn't listed doesn't mean
+ that you're not vulnerable, however. If your particular vendor or
+ version isn't listed, check with your vendor and on the appropriate
+ Internet mailing lists and Usenet newsgroups to verify.
+
+ If nothing else, the most recent public version is usually a pretty
+ good bet, although you should check comp.mail.sendmail to see if
+ anyone has posted recent comments that haven't yet been folded into a
+ new release.
+
+ That said, you need to look at what the primary function is for the
+ machine. If its primary function is to run some CAD/CAM package on the
+ desk of an engineer, then there's probably not much sense in replacing
+ the vendor-supplied version of sendmail (assuming it's secure,
+ according to the CERT Alerts and Summaries). Just set the machine up
+ to forward all outbound mail to a central mail relay, and then worry
+ about making that central mail relay the best it can be. Also arrange
+ to have all their inbound mail pass through a central Mail eXchanger
+ (probably the same machine as the central Mail Relay), for the same
+ reasons.
+
+ If the primary function for a machine is to act as that central Mail
+ Relay/Mail eXchanger, then we *strongly* recommend the best version of
+ sendmail you can get, and in our opinion that is the latest release of
+ version 8. IDA sendmail is also pretty good, but virtually everything
+ it does, version 8 does better, and version 8 has the additional
+ advantage of having continued development as well.
+
+ If fighting spam is a concern, then by all means upgrade to 8.10.X .
+ 8.9.X has good anti-spam features, but 8.10.X has even more features,
+ and the anti-spam ones are more flexible than those in 8.9.X .
+
+ However, keep in mind that version 8 still hasn't been ported (so far
+ as we know) to some of the older (and perhaps more esoteric)
+ platforms, and if you're stuck using one of them, you may not have
+ much choice.
+
+ Some vendors have started shipping (or announced that they will soon
+ ship) version 8 sendmail pre-configured for their machines.
+ Unfortunately, in most cases this means you get a pre-compiled binary
+ and a sendmail.cf file (that may need a bit of tweaking), but not much
+ else of the "standard" version 8 sendmail installation kit. Silicon
+ Graphics (SGI) and Hewlett-Packard are known to already be shipping
+ version 8 sendmail in this fashion.
+
+ Sun Microsystems did the same with SunOS 5.5, 5.5.1 and 5.6, shipping
+ a version based on 8.6 with their own proprietary config files. Recent
+ patches for 5.5.1 and 5.6, however, upgrade to a version based on
+ 8.8.8 with a sendmail.cf that is only slightly tweaked. More
+ importantly, a cf hierarchy is available under /usr/lib/mail/. More
+ details are available at the Sun migration page.
+ _________________________________________________________________
+
+Q2.8 -- What is the latest release of sendmail?
+
+ Date: October 24, 1997
+ Updated: March 3, 2003
+
+ For version 8 sendmail, there are four release trees.
+
+ For those people who, for whatever reason, are unable or unwilling to
+ upgrade to version 8.12.x, releases of versions 8.11, 8.10 and 8.9
+ sendmail are still available but are not being updated. The last
+ release of version 8.9 sendmail was 8.9.3; the last release of 8.10
+ was 8.10.2; the last release of 8.11 was 8.11.6 .
+
+ Version 8.12.8 was released on March 3, 2003.
+ Version 8.12.7 was released on December 29, 2002.
+ Version 8.12.6 was released on August 26, 2002.
+ Version 8.12.5 was released on June 25, 2002.
+ Version 8.12.4 was released on June 3, 2002.
+ Version 8.12.3 was released on April 5, 2002.
+ Version 8.12.2 was released on January 13, 2002.
+ Version 8.12.1 was released on October 1, 2001.
+ Version 8.12.0 was released on September 8, 2001.
+ Version 8.11.6 was released on August 20, 2001.
+ Version 8.11.5 was released on July 31, 2001.
+ Version 8.11.4 was released on May 28, 2001.
+ Version 8.11.3 was released on February 27, 2001.
+ Version 8.11.2 was released on December 29, 2000.
+ Version 8.11.1 was released on September 28, 2000.
+ Version 8.11.0 was released on July 19, 2000.
+ Version 8.10.2 was released on June 7, 2000.
+ Version 8.10.1 was released on April 7, 2000.
+ Version 8.10.0 was released on March 7, 2000.
+ Version 8.9.3 was released on February 4, 1999.
+ Version 8.9.2 was released on December 31, 1998.
+ Version 8.9.1 was released on July 2, 1998.
+ Version 8.9.0 was released on May 20, 1998.
+
+ On machines exposed directly to the Internet, you should either
+ already be running sendmail 8.12.8 or plan on upgrading in the
+ immediate future. 8.12.8 is considered "stable", has fixes included
+ that will not be found in any previous release, and therefore
+ supercedes all previous releases.
+
+ There is no further support for previous releases of sendmail.
+ _________________________________________________________________
+
+Q2.9 -- Where can I find it?
+
+ Date: January 21, 1997
+ Updated: March 7, 2000
+
+ By anonymous FTP from ftp.sendmail.org in /pub/sendmail, or (in URL
+ form) via ftp://ftp.sendmail.org/pub/sendmail/. If you care, there
+ should be files in this directory that end with the extension ".sig"
+ which you can check with PGP to make sure that corresponding archives
+ haven't been modified. You'll need to have the PGP signing key of
+ Sendmail.ORG on your public keyring to be able to verify these
+ archives with their associated .sig files.
+
+ There are no other known official version 8 sendmail mirrors.
+
+ Check the sendmail home page at http://www.sendmail.org/ for
+ late-breaking updates and other useful information.
+
+ If you want to be notified regarding future updates to sendmail and
+ other items of potential interest, you may want to subscribe to the
+ sendmail-announce mailing list. Address your subscription requests to
+ "majordomo@lists.sendmail.org" with "subscribe sendmail-announce" as
+ the body of the message.
+ _________________________________________________________________
+
+Q2.10 -- What are the differences between Version 8 and other versions?
+
+ Date: March 23, 1996
+
+ See doc/changes/changes.{me,ps} in the distribution. See also
+ RELEASE_NOTES at the top level.
+ _________________________________________________________________
+
+Q2.11 -- What's the best platform for running sendmail?
+
+ Date: April 8, 1997
+
+ Generally speaking, I adhere to the old axiom that you should choose
+ what software you want to run first, then choose the platform
+ (hardware and OS) that best runs this software. By this token, if
+ sendmail is the software, then a recent version of BSD Unix would
+ probably be best, since sendmail was developed at UC Berkeley on BSD
+ Unix. FreeBSD and BSD/OS are two known implementations of BSD Unix for
+ Intel-based PC's (among other hardware platforms), and this would make
+ them the most "native" OSes for sendmail. FreeBSD is freely available
+ by anonymous ftp or on CD-ROM, and BSD/OS is a commercial product.
+
+ However, not everyone has this kind of "luxury". If you're on a
+ homogeneous network (i.e., completely composed of only one type of
+ hardware and OS), then you should probably be running the same OS as
+ the rest of the machines on the network, regardless of the axiom
+ stated above. You may have other problems, but you should at least be
+ able to get some local support on the OS for your machine.
+
+ Either way, if the primary function of the machine is to handle
+ "large" quantities of mail (for whatever value you define "large" to
+ be), I strongly recommend getting the latest stable release of version
+ 8 sendmail.
+
+ You may be surprised to find that it is easier for you to support only
+ one version of sendmail across all the various platforms than it is to
+ try to support multiple versions of sendmail, each unique for their
+ particular platform. In that case, the easy solution is to put version
+ 8 sendmail everywhere, and not have to worry about vendor-specific
+ problems with older versions.
+
+ For more information on BSD Unix in general, see the Usenet newsgroups
+ under comp.unix.bsd, comp.bugs.4bsd, comp.os.386bsd. For more
+ information on BSD/OS, see the BSD newsgroups mentioned above, or the
+ BSD/OS Home Page at http://www.bsdi.com/. For more information on
+ FreeBSD, see the Usenet newsgroups under news:comp.unix.bsd.freebsd,
+ or the FreeBSD Home Page at http://www.freebsd.org/.
+ _________________________________________________________________
+
+Q2.12 -- What is BIND and where can I get the latest version?
+
+ Date: June 24, 1997
+
+ BIND stands for "Berkeley Internet Name Daemon", and is the Internet
+ de-facto standard program for turning host names into IP addresses.
+
+ The BIND Home Page is at http://www.isc.org/bind.html, which provides
+ pointers to the most recent release of BIND. In May of 1997, the first
+ production version of BIND-8 was released. The ISC has deprecated
+ BIND-4 other than for security related patches. No new features or
+ portability changes will be added to BIND-4. You should be using
+ BIND-8.
+
+ Note that there are bugs in older resolver libraries, which can cause
+ problems getting to large sites (that list more than five IP addresses
+ for a particular name), or represent a huge security hole as they do
+ not check the returned data to see if it will fit in the amount of
+ space pre-allocated for it.
+
+ If at all possible, you should get the most recent "release" version
+ of BIND and make a serious attempt to integrate it into your
+ configuration, since virtually all vendor-provided resolver libraries
+ are woefully out of date.
+
+ Note that since the release of BIND version 8.1, many people building
+ sendmail have experienced problems compiling and linking with the new
+ BIND include files and libraries under /usr/local/. A section in our
+ Compiling Sendmail page explains this.
+ _________________________________________________________________
+
+Q2.13 -- What is smrsh and where can I get it?
+
+ Date: July 9, 1996
+ Updated: July 1, 2000
+
+ smrsh is a restricted shell utility that provides the ability to
+ specify, through a configuration, an explicit list of executable
+ programs. When used in conjunction with sendmail, smrsh effectively
+ limits sendmail's scope of program execution to only those programs
+ specified in smrsh's configuration.
+
+ smrsh has been written with portability in mind, and uses traditional
+ Unix library utilities. As such, smrsh should compile on most Unix C
+ compilers.
+
+ The purpose for restricting the list of programs that can be executed
+ in this manner is to keep mail messages (either through an alias or
+ the .forward file in a user's home directory) from being sent to
+ arbitrary programs which are not necessarily known to be sufficiently
+ paranoid in checking their input, and can therefore be easily
+ subverted (this is related to, but different from, the /etc/shells
+ feature discussed in Q3.11).
+
+ More information regarding the CERT-CC can be found at their web site,
+ http://www.cert.org. For more information on CERT Alerts and CERT
+ Summaries, see their advisories and summaries, respectively.
+
+ You can find smrsh in the most recent sendmail source archive. Other
+ very useful programs can be found in
+ http://www.cert.org/other_sources/tool_sources.html.
+ _________________________________________________________________
+
+Q2.14 -- What is smap and where can I get it?
+
+ Date: July 5, 1996
+
+ Smap (and smapd) are tools out of the Trusted Information Systems
+ (TIS) Firewall Toolkit (fwtk). They were originally written by
+ firewall expert Marcus Ranum under contract to TIS, and TIS is
+ continuing what maintenance there is. Here is a link to the toolkit.
+ Support questions regarding the toolkit may be sent to
+ fwall-support@tis.com, while you may join their mailing list
+ fwall-users@tis.com by sending electronic mail to
+ fwall-users-request@tis.com.
+
+ The concept of smap and smapd is that sendmail is a huge, monolithic
+ setuid root program that is virtually impossible to verify as being
+ "correct" and free from bugs (historically, sendmail has been rather
+ buggy and an easy mark for system crackers to exploit, although with
+ the advent of version 8 sendmail, this becomes much more difficult).
+ In contrast, smap and smapd are very small (only a few hundred lines
+ long), and relatively easy to verify as being correct and functioning
+ as designed (however, as you will see later, we can question their
+ design). According to the theory, it is therefore safer and "better"
+ to run smap and smapd as "wrappers" around sendmail, which would no
+ longer need to be run setuid root.
+
+ Unfortunately, smap and smapd have a few problems of their own, and
+ don't appear to have been updated since late March 1996. There have
+ been conflicting reports of incompatibilities between smapd and
+ sendmail 8.7.y (both cannot be run on the same machine, although if
+ you're running sendmail 8.6.x and smap/smapd on the local machine,
+ people on the outside can still use sendmail 8.7.y to talk to you).
+
+ For further information on smap and smapd, see the documentation that
+ comes with the TIS Firewall Toolkit.
+
+ For more information on firewalls, see the Firewalls FAQ at
+ http://www.interhack.net/pubs/fwfaq/
+ _________________________________________________________________
+
+Q2.15 -- What is TCP-Wrappers and where can I get it?
+
+ Date: April 8, 1997
+ Updated: April 2, 2001
+
+ TCP-Wrappers is another security enhancement package. The theory is
+ that you take programs being run under inetd (see /etc/inetd.conf) and
+ before you run the program to do the real work (ftpd, telnetd,
+ etc...), you first run the connection attempt through a package that
+ checks to see if the IP address of the source packet is coming from a
+ host known to be either good or bad (you may filter connection
+ attempts by source host name, domain name, raw IP address, port they
+ are attempting to connect to; and either allow known good connections
+ through thus refusing unknown connections, or accept all connections
+ except those known to be bad).
+
+ The practice of TCP-Wrappers actually follows the theory quite well.
+ It is a very useful and important tool in the System Administrator's
+ Bag of Things To Help You Secure Your Machine From Crackers, Spammers,
+ Junkmailers, and Other Undesirables. However, it only works for
+ programs that communicate via TCP packets (not UDP, such as NFS)
+ started up out of inetd. It does not work for RPC-based services, and
+ programs that start up a daemon outside of inetd and just leave it
+ running obviously don't benefit beyond the initial connection that
+ gets the daemon started (however, see the FTP URL below for other
+ packages that can help secure RPC and portmapper-based services).
+
+ However, most sendmail installations tend to start up a daemon and
+ leave it running at all times. If you did run sendmail out of inetd,
+ you'd lose the benefit of the load average checking code that is
+ executed only in daemon mode, and for systems that handle a lot of
+ mail, this is vitally important.
+
+ You can get TCP-Wrappers from ftp://ftp.porcupine.org/pub/security/, a
+ site that has a whole host of other useful security tools, such as
+ securelib, portmap, satan, cops, crack, etc... You can also find
+ pointers to many other useful security tools at
+ http://ciac.llnl.gov/ciac/SecurityTools.html, and the COAST Archive at
+ http://www.cerias.purdue.edu/coast/ is a veritable cornucopia of all
+ things security related.
+
+ For the adventurous, you can get a source patch for version 8 sendmail
+ (created for 8.7.6, but, with work, applicable to older releases) that
+ will take the core TCP-Wrappers code and integrate it into the daemon,
+ so that you get the best of both worlds. However, this isn't as
+ smoothly integrated as it should be, is not for the faint-of-heart,
+ and is certainly not officially supported by the original author of
+ sendmail (Eric Allman). This functionality is integrated in a
+ different fashion into version 8.8.5 sendmail.
+
+ You should be able to find the unsupported patch at
+ ftp://ftp.porcupine.org/pub/security/sendmail-tcpd.patch.
+ _________________________________________________________________
+
+Q2.16 -- Why won't db 1.85 build on my machine?
+
+ Date: April 8, 1997
+ Updated: May 20, 1997
+ URL Updated: July 27, 1999
+
+ As of release 8.9.X of sendmail, db 1.85 is no longer needed, as
+ support for db 2.X is included (starting with 2.3.16). More details
+ are given at Q3.25. The rest of this answer only applies if you have
+ not yet upgraded to 8.9.X .
+
+ The db 1.85 package as available from
+ http://www.sleepycat.com/register.html provides Irix support up to
+ Irix 4.05F, but 5.{2,3} need a slightly patched version, as does HP-UX
+ 10.20. Some vendors also provide db standard with their OS (DEC Unix
+ 4.0, for example).
+
+ A tarball incorporating these changes for Irix 5.x is available at
+ ftp://ftp.his.com/pub/brad/sendmail/irix5.tar.gz. This will extract
+ into ./db.1.85/PORT/irix.5.2, with a symbolic link created from
+ ./db.1.85/PORT/irix.5.3 to this same directory. Make sure you extract
+ this archive into the same directory where you extracted the db 1.85
+ archive as available from ftp.cs.berkeley.edu. (see Q3.5 for more
+ information on getting the db 1.85 package). An ASCII context diff of
+ this same patch is at
+ ftp://ftp.his.com/pub/brad/sendmail/irix4-5.diff.
+
+ A version of db 1.85 that has supposedly been patched to compile under
+ Irix 6.2 has been made available at
+ http://reality.sgi.com/ariel/freeware/#db, but I haven't had a chance
+ to download and check it out yet.
+
+ The context diffs required to get db 1.85 working under HP-UX 10.20
+ are available at ftp://ftp.his.com/pub/brad/sendmail/hpux.10.20.diff.
+ A tarball incorporating these changes is available at
+ ftp://ftp.his.com/pub/brad/sendmail/hp-ux.10.20.tar.gz. This will
+ extract into ./db.1.85/PORT/hpux.10.20, so make sure you extract this
+ archive into the same directory where you extracted the db 1.85
+ archive as available from ftp.cs.berkeley.edu.
+ _________________________________________________________________
+
+Q2.17 -- What is makemap and where can I get it?
+
+ Date: August 30, 1996
+
+ The program "makemap" is used to build the databases used by version 8
+ sendmail, for things like the UserDB, mailertables, etc....
+
+ It is distributed as part of the basic operating system from some
+ vendors, but source code for it is also included at the root level of
+ the sendmail archive (at least, it is for sendmail 8.6.12 and 8.7.5,
+ and presumably will continue to be as newer releases come out).
+ However, it is not considered a "supported" part of version 8
+ sendmail. Just like the other source provided in the archive, the
+ Makefile will likely need some tweaking for your specific site.
+
+ It turns out that Irix 5.3 doesn't appear to have the dbm or ndbm
+ libraries, but to compile makemap.c, you need to have -DNDBM on the
+ "DBMDEF=" line (some necessary things are defined only in
+ /usr/include/ndbm.h). Try just leaving off "-lndbm" from the "LIBS="
+ line in the Makefile for makemap.
+
+ If you plan on using makemap with db 1.85 on an SGI machine running a
+ version of Irix later than 4.x, see Q2.16 for some additional steps to
+ get db 1.85 compiled on your machine.
+
+
+ sendmail.org
+
+ 3. VERSION 8 SPECIFIC ISSUES
+
+ * 3.1 How do I make all my addresses appear to be from a single
+ host?
+ * 3.2 How do I rewrite my "From:" lines to read
+ ``First_Last@My.Domain'' or ``Different_Name@My.Domain''?
+ * 3.3 But what about fully-qualified addresses, such as those from
+ Pine or FEATURE(always_add_domain)?
+ * 3.4 So what was the user database feature intended for?
+ * 3.5 Why the hostility toward using full names for email addresses?
+ * 3.6 (deprecated)
+ * 3.7 How do I manage several (virtual) domains?
+ * 3.8 There are four UUCP mailers listed in the configuration files.
+ Which one should I use?
+ * 3.9 How do I fix "undefined symbol inet_aton" and "undefined
+ symbol _strerror" messages?
+ * 3.10 How do I solve "collect: I/O error on connection" or "reply:
+ read error from host.name" errors?
+ * 3.11 Why can't my users forward their mail to a program?
+ * 3.12 Why do connections to the SMTP port take such a long time?
+ * 3.13 Why do I get "unknown mailer error 5 -- mail: options MUST
+ PRECEDE recipients" errors?
+ * 3.14 Why does version 8 sendmail panic my SunOS box?
+ * 3.15 Why does the Unix From line get mysteriously munged when I
+ send to an alias?
+ * 3.16 Why doesn't MASQUERADE_AS (or the user database) work for
+ envelope addresses as well as header addresses?
+ * 3.17 How do I run version 8 sendmail and support the MAIL11V3
+ protocol?
+ * 3.18 Why do messages disappear from my queue unsent?
+ * 3.19 When is sendmail going to support RFC 2047 MIME header
+ encoding?
+ * 3.20 Why can't I get mail to some places, but instead always get
+ the error "reply: read error from name.of.remote.host"?
+ * 3.21 Why doesn't "FEATURE(xxx)" work?
+ * 3.22 How do I configure sendmail not to use DNS?
+ * 3.23 How do I get all my queued mail delivered to my Unix box from
+ my ISP?
+ * 3.24 Why do I get the error message unable to write
+ /etc/mail/sendmail.pid on Solaris 2.x?
+ * 3.25 Why can't I compile sendmail with Berkeley DB 2.X?
+ * 3.26 What operating systems has Berkeley sendmail been ported to?
+ * 3.27 How do I prevent Relaying Denied errors for my clients?
+ * 3.28 Why isn't virtual hosting working, even after I added a
+ Kvirtuser line to sendmail.cf ?
+ * 3.29 How can I add a header specifying the actual recipient when
+ having multiple users in a virtual domain go to a single mailbox?
+ * 3.30 What do I do when Build fails because groff was not found?
+ * 3.31 What does "class hash not available" mean?
+ * 3.32 How do I configure majordomo with sendmail 8.9 without
+ relaxing the DontBlameSendmail option?
+ * 3.33 How do I configure my system in general with sendmail 8.9?
+ * 3.34 What does "foo not available for sendmail programs" mean?
+ * 3.35 How do I add a footer/signature to all (outgoing) e-mail
+ messages?
+ * 3.36 What does "Cannot open hash database ... Invalid argument"
+ mean?
+ * 3.37 What does "parse error before `NDBM'" mean?
+ * 3.38 What does "may be forged" mean?
+ * 3.39 How do I send using an alternate port?
+ * 3.40 Why can't I use BerkeleyDB 4.1.x?
+ * 3.41 How do I use CIDR notation in the access map (or other
+ places)?
+ * 3.42 Why isn't CIDR notation directly supported by sendmail?
+ * 3.43 What does "Need to recompile with -DNEWDB for hash support"
+ mean?
+ * 3.44 I disabled sendmail on some machines which don't receive
+ mail, but since upgrading to 8.12 they can't send mail either;
+ why?
+ _________________________________________________________________
+
+Q3.1 -- How do I make all my addresses appear to be from a single host?
+
+ This question is answered in detail at the configuration Masquerading
+ and Relaying page.
+ _________________________________________________________________
+
+Q3.2 -- How do I rewrite my From: lines to read ``First_Last@My.Domain''' or
+``Different_Name@My.Domain''?
+
+ Date: September 23, 1997
+ Updated: November 8, 1999
+
+ Use the generics table, as described in steps 6 and 7 of the Virtual
+ Hosting page.
+ _________________________________________________________________
+
+Q3.3 -- But what about fully-qualified addresses, such as those from Pine or
+FEATURE(always_add_domain)?
+
+ Date: July 19, 1996
+ Updated: November 8, 1999
+ Updated: January 25, 2000
+
+ Note: this question used to be "How do I get the user database to work
+ with Pine or with FEATURE(always_add_domain)?" But the user database
+ is no longer the recommended solution for this problem, so the
+ question has been clarified appropriately.
+
+ The proper solution is to use the generics table, as described in
+ steps 6 and 7 of the Virtual Hosting page. The important thing to note
+ is that the host/domain part of the fully-qualified address must be
+ specified via GENERICS_DOMAIN() or GENERICS_DOMAIN_FILE().
+ _________________________________________________________________
+
+Q3.4 -- So what was the user database feature intended for?
+
+ Date: May 12, 1997
+
+ 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.
+
+ UC Berkeley is (was) in the process of setting up their 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.
+ _________________________________________________________________
+
+Q3.5 -- Why the hostility toward using full names for email addresses?
+
+ Date: May 12, 1997
+
+ Because full names are not unique. For example, the computer community
+ has 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 email.
+
+ 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).
+
+ The problem is even worse outside of America, where non-ASCII
+ characters (e.g., characters with umlauts or the Norwegian Ø) are used
+ in names. Since non-ASCII characters cannot be used in the SMTP
+ envelope or e-mail headers, the full names are mangled anyway.
+
+ Even worse is fuzzy matching in email -- 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.
+
+ Directory services should be as fuzzy as possible (within reason, of
+ course). Mail services should be unique.
+ _________________________________________________________________
+
+Q3.6 -- has been deprecated.
+ _________________________________________________________________
+
+Q3.7 -- How do I manage several (virtual) domains?
+
+ This question is answered in detail at the Virtual Hosting page.
+ _________________________________________________________________
+
+Q3.8 -- There are four UUCP mailers listed in the configuration files. Which
+one should I use?
+
+ This question is answered in detail at the configuration Using UUCP
+ Mailers page.
+ _________________________________________________________________
+
+Q3.9 -- How do I fix "undefined symbol inet_aton" and "undefined symbol
+_strerror" messages?
+
+ This question is answered in detail within the Compiling Sendmail
+ page.
+ _________________________________________________________________
+
+Q3.10 -- How do I solve "collect: I/O error on connection" or "reply: read
+error from host.name" errors?
+
+ Date: April 8, 1997
+ Updated: May 9, 2000
+ Updated: June 8, 2002
+ Updated: March 2, 2003
+
+ If you are just getting occasional such messages, they're probably due
+ to a temporary network problem, or the remote host crashing or
+ otherwise abruptly terminating the connection. If you are getting a
+ lot of these from a single host, there is probably some
+ incompatibility between 8.x and that host (see Q3.12 and Q3.20). If
+ you get a lot of them in general, you may have network problems that
+ are causing connections to get reset.
+
+ Note that this problem is sometimes caused by incompatible values of
+ the MTU (Maximum Transmission Unit) size on a SLIP or PPP connection.
+ Be sure that your MTU size is configured to be the same value as what
+ your ISP has configured for your connection. If you are still having
+ problems, then have your ISP configure your MTU size for 1500 (the
+ maximum value), and you configure your MTU size similarly.
+
+ Another possibility is that you have a router/firewall filtering out
+ all incoming ICMP messages, while your OS is doing "Path MTU
+ discovery" (e.g. modern TCP/IP stacks do this by default). Path MTU
+ discovery relies on certain ICMP messages being allowed through back
+ to the host originating the traffic - see our tip on Path MTU
+ Discovery and RFC 1191 for the details.
+
+ Lastly, here is part of a post from comp.mail.sendmail about a SCO
+ 7.1.0 specific bug which may produce similar problems.
+
+ Subject: Re: Recipient mail server times out sendmail connection
+ Date: 5 Jun 2002 21:37:02 -0700
+ From: maillist@screamingplants.com (ike)
+
+ I ran a packet sniffer on mail traffic that was causing problems
+ and found that the tcp checksums for large packets were all off by
+ 14. I found out later that there is a network bug in the OS (SCO
+ 7.1.0). After applying a few patches, the problem appears to have
+ been resolved.
+ _________________________________________________________________
+
+Q3.11 -- Why can't my users forward their mail to a program?
+
+ Date: July 9, 1996
+ Updated: November 19, 1999
+
+ I just upgraded to version 8 sendmail and now when my users try to
+ forward their mail to a program they get an "illegal shell" or "cannot
+ mail to programs" 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, version 8 sendmail 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.
+
+ IBM AIX does not use /etc/shells -- a list of allowable login shells
+ is contained, along with many other login parameters, in
+ /etc/security/login.cfg. You can copy the information in the "shells="
+ stanza into a /etc/shells on your system so sendmail will have
+ something to use. Do NOT add "/usr/lib/uucp/uucico" or any other
+ non-login shell into /etc/shells.
+
+ Also note that there are some weird things that AFS throws into the
+ mix, and these can keep a program from running or running correctly
+ out of .forward files or the system-wide aliases.
+
+ See also "smrsh" in Q2.13 and Q3.34, and "directory permissions" in
+ Q3.33.
+ _________________________________________________________________
+
+Q3.12 -- Why do connections to the SMTP port take such a long time?
+
+ Date: November 24, 1996
+ Updated: August 29, 2001
+
+ I just upgraded to version 8 sendmail 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 version 8 sendmail 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 (pre-8.7.y sendmail), set the IDENT timeout to zero
+ using:
+
+ define(`confREAD_TIMEOUT',`Ident=0')dnl
+
+ in the .mc file used by m4 to generate your sendmail.cf file.
+ Alternatively, if you don't use m4, you can put ``OrIdent=0'' in the
+ configuration file (we recommend the m4 solution, since that makes
+ maintenance much easier for people who don't understand sendmail
+ re-write rules, or after you've been away from it for a while). Either
+ way, this will completely disable all use of the IDENT protocol.
+
+ For version 8.7.y sendmail (and above), you should instead use:
+
+ define(`confTO_IDENT',`0s')dnl
+
+ 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 are up to date (this file is usually called something
+ like "/var/namedb/root.cache"; see your /etc/named.boot file to get
+ your value). Either of these can cause long delays.
+
+ You may also wish to check out our tips on how to set up DNS for your
+ private address space.
+ _________________________________________________________________
+
+Q3.13 -- Why do I get "unknown mailer error 5 -- mail: options MUST PRECEDE
+recipients" errors?
+
+ Date: March 23, 1996
+
+ I just upgraded to version 8 sendmail 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, where "systype" is set
+ correctly for your hardware & OS combination -- otherwise the
+ configurations use a default that probably disagrees with your local
+ mail system. See the configuration OSTYPE page for details.
+
+ If this is on a Sun workstation, you might also want to take a look at
+ the local mailer flags in the Sun-supplied sendmail.cf and compare
+ them to the local mailer flags generated for your version 8
+ sendmail.cf. If they differ, you might try changing the V8 flags to
+ match the Sun flags.
+ _________________________________________________________________
+
+Q3.14 -- Why does version 8 sendmail panic my SunOS box?
+
+ Date: March 24, 1996
+ Updated: November 4, 1997
+
+ Sendmail 8.7.y panics SunOS 4.1.3_U1 (at least for 1 <= y <= 3) and
+ SunOS 4.1.3, and sendmail 8.6.x seems fine on both machines (at least
+ for 9 <= x <= 12).
+
+ The problem is that a kernel patch is missing, specifically 100584-08
+ (4.1.3), 102010-05 (4.1.3_U1), or 102517 (4.1.4). This should be
+ available from your hardware vendor through your support contract or
+ their online support facilities (including being available on the
+ SunSolve CD).
+ _________________________________________________________________
+
+Q3.15 -- Why does the Unix From line get mysteriously munged when I send to an
+alias?
+
+ Date: December 3, 1997
+
+ ``It's not a bug, it's a feature.'' This happens when you have an
+ owner-list alias and you send to list. V8 propagates the owner
+ information into the SMTP envelope sender field (which appears as the
+ Unix From line [sometimes incorrectly referred to as the From-space
+ "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".
+ _________________________________________________________________
+
+Q3.16 -- Why doesn't MASQUERADE_AS (or the user database) work for envelope
+addresses as well as header addresses?
+
+ Date: November 24, 1996
+
+ Believe it or not, this is intentional. The interpretation of the
+ standards by the version 8 sendmail 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.
+
+ If you're using version 8.7.y sendmail (or later), you can use
+ FEATURE(masquerade_envelope)
+
+ in your sendmail.mc file to change this behavior. This is discussed in
+ greater detail at the configuration Masquerading and Relaying page.
+ _________________________________________________________________
+
+Q3.17 -- How do I run version 8 sendmail and support the MAIL11V3 protocol?
+
+ Date: March 23, 1996
+ URL updated: November 15, 2002
+
+ Get the reimplementation of the mail11 protocol by Keith Moore from
+ ftp://gatekeeper.dec.com/pub/misc/vixie/ (with contributions from Paul
+ Vixie).
+ _________________________________________________________________
+
+Q3.18 -- Why do messages disappear from my queue unsent?
+
+ Date: March 23, 1996
+
+ When I look in the queue directory I see that qf* files have been
+ renamed to Qf*, and sendmail doesn't see these. What's wrong?
+
+ 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.
+
+ 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.
+ _________________________________________________________________
+
+Q3.19 -- When is sendmail going to support RFC 2047 MIME header encoding?
+
+ Date: March 23, 1996
+ Updated: September 5, 1999
+
+ This is considered to be a MUA issue rather than an MTA issue.
+
+ Quoth Eric Allman:
+
+ The primary reason is that the information necessary to do the
+ encoding (that is, 8->7 bit) is unknown to the MTA. In specific,
+ the character set used to encode names in headers is _NOT_
+ necessarily the same as used to encode the body (which is already
+ encoded in MIME in the charset parameter of the Content-Type:
+ header). Furthermore, it is perfectly reasonable for, say, a Swede
+ to be living and working in Korea, or a Russian living and working
+ in Germany, and want their name to be encoded in their native
+ character set; it could even be that the sender was Japanese, the
+ recipient Russian, and the body encoded in ISO 8859-1. If all I
+ have are 8-bit characters, I can't choose the charset properly.
+
+ Similarly, when doing 7->8 bit conversions, I don't want to throw
+ away this information, as it is necessary for proper presentation
+ to the end user.
+ _________________________________________________________________
+
+Q3.20 -- Why can't I get mail to some places, but instead always get the error
+"reply: read error from name.of.remote.host"?
+
+ Date: January 17, 1997
+
+ This is usually caused by a bug in the remote host's mail server, or
+ Mail Transport Agent (MTA). The "EHLO" command of ESMTP causes the
+ remote server to drop the SMTP connection. There are several MTAs that
+ have this problem, but one of the most common server implementations
+ can be identified by the "220 All set, fire away" greeting it gives
+ when you telnet to its SMTP port.
+
+ To work around this problem, you can configure sendmail to use a
+ mailertable with an entry telling sendmail to use plain SMTP when
+ talking to that host:
+
+ name.of.remote.host smtp:name.of.remote.host
+
+ Sites which must run a host with this broken SMTP implementation
+ should do so by having a site running sendmail or some other reliable
+ (and reasonably modern) SMTP MTA act as an MX server for the problem
+ host.
+
+ There is also a problem wherein some TCP/IP implementations are
+ broken, and if any connection attempt to a remote end gets a
+ "connection refused", then *all* connections to that site will get
+ closed. Of course, if you try to use the IDENT protocol across a
+ firewall (at either end), this is highly likely to result in the same
+ apparent kind of "read error".
+
+ The fix is simple -- on those machines with broken TCP/IP
+ implementations, do not attempt to use IDENT. When compiling newer
+ releases of version 8 sendmail, the compiler should automatically
+ detect whether you're on a machine that is known to have this kind of
+ TCP/IP networking problem, and make sure that sendmail does not
+ attempt to use IDENT. If you've since patched your machine so that it
+ no longer has this problem, you'll need to go back in and explicitly
+ configure sendmail for support of IDENT, if you want that feature.
+ _________________________________________________________________
+
+Q3.21 -- Why doesn't "FEATURE(xxx)" work?
+
+ Date: January 17, 1996
+
+ When creating m4 Master Config (".mc") files for version 8 sendmail,
+ many FEATURE() macros simply change the definition of internal
+ variables that are referenced in the MAILER() definitions.
+
+ To make sure that everything works as desired, you need to make sure
+ that OSTYPE() macros are put at the very beginning of the file,
+ followed by FEATURE() and HACK() macros, local definitions, and at the
+ very bottom, the MAILER() definitions. See the configuration
+ Introduction and Example page for more details.
+ _________________________________________________________________
+
+Q3.22 -- How do I configure sendmail not to use DNS?
+
+ Date: March 24, 1997
+ Updated: April 6, 2000
+ Updated: June 4, 2002
+
+ In situations where you're behind a firewall, or across a dial-up
+ line, there are times when you need to make sure that programs (such
+ as sendmail) do not use the DNS at all.
+
+ With older releases of version 8 sendmail (8.7 and earlier), you
+ needed to recompile the binary and make sure that "NAMED_BIND" was
+ turned off in src/conf.h.
+
+ With versions 8.8 and later, you change the service switch file to
+ omit "DNS" and use only NIS, files, and other map types as
+ appropriate. More information about the service switch file can be
+ found under the ServiceSwitchFile option in §5.6 (Options) of the
+ Installation and Operation Guide and all of §4.9 (Name Server Access).
+
+ And note that you'll need to forward all your outbound mail to another
+ machine as a "relay" (one that does use DNS, and understands how to
+ properly use MX records, etc...), otherwise you won't be able to get
+ mail to any site(s) other than the one(s) you configure in your
+ /etc/hosts file (or whatever). The use of a smart host is one way to
+ do this; the following in your .mc will do:
+define(`SMART_HOST', `name.of.smart.host')dnl
+
+ Also, starting with 8.9, it may help to include the following in your
+ .mc file:
+FEATURE(`accept_unresolvable_domains')dnl
+FEATURE(`accept_unqualified_senders')dnl
+ _________________________________________________________________
+
+Q3.23 -- How do I get all my queued mail delivered to my Unix box from my ISP?
+
+ Date: June 6, 1997
+ Updated: October 8, 1998
+
+ In the contrib directory of the sendmail distribution is a Perl script
+ called etrn.pl. Assuming you're running sendmail or some other SMTP
+ MTA on some sort of a Unix host, and your ISP uses version 8.8
+ sendmail and they queue all mail for your domain (as opposed to
+ stuffing it all in one file that you need to download via POP3 or some
+ such), the command
+ etrn.pl mail.myisp.com mydomain.com
+
+ will do the trick. You can learn about Perl at the Perl Language Home
+ Page. The O'Reilly book is also very helpful.
+
+ If you don't have Perl, something like the following script should do
+ the trick:
+ #!/bin/sh
+ telnet mail.myisp.com. 25 << __EOF__
+ EHLO me.mydomain.com
+ ETRN mydomain.com
+ QUIT
+ __EOF__
+
+ Note that this is indented for readability, and the real script would
+ have column position #1 of the file be the first printable character
+ in each line.
+
+ Of course, you'll have to fill in the appropriate details for
+ "mail.myisp.com", "mydomain.com", etc....
+
+ If your ISP doesn't use version 8.8 sendmail, you may have to cobble
+ together alternative solutions. They may have a "ppplogin" script that
+ is executed every time your machines dials them up, and if so, you may
+ be able to have them modified this script so as to put a "sendmail
+ -qRmydomain.com" in it (which is effectively what the "ETRN" command
+ does, but in a safer fashion).
+
+ Alternatively, they may have a hacked finger daemon, so that you'd put
+ "finger mydomain.com@theirhost.theirdomain.com" in your script. Or,
+ they may have some other solution for you. However, only they would be
+ able to answer what solutions they have available to them.
+
+ Obviously, the easiest and most "standard" solution is to have them
+ upgrade their system to the most recent stable release of version 8
+ sendmail. See Q2.8 to find out what exact version this is.
+ _________________________________________________________________
+
+Q3.24 -- Why do I get the error message unable to write /etc/mail/sendmail.pid?
+
+ Date: August 6, 1997
+
+ sendmail checks if it has write access to the directory in which it
+ wants to create a file without granting special privileges to 'root'.
+ To have sendmail run properly, the directories /etc, /etc/mail, and/or
+ /var/run should be owned by root and be writable by its owner.
+ _________________________________________________________________
+
+Q3.25 -- Why can't I compile sendmail with Berkeley DB 2.X?
+
+ Date: August 12, 1997
+ Updated: May 20, 1998
+
+ sendmail 8.8 only supports Berkeley DB 1.85. It will not work with
+ newer Berkeley DB versions, even in compatibility mode
+
+ Sendmail 8.9, however, does include support for Berkeley DB 2.X,
+ starting with 2.3.16 .
+ _________________________________________________________________
+
+Q3.26 -- What operating systems has Berkeley sendmail been ported to?
+
+ Date: December 18, 1997
+ Updated: September 9, 1999
+
+ Berkeley sendmail 8.9.3 supports most known flavors of UNIX,
+ including:
+386BSD A-UX AIX Altos
+BSD-OS BSD43 CLIX CSOS
+ConvexOS Dell DomainOS Dynix
+EWS-UX_V FreeBSD HP-UX IRIX
+ISC KSR LUNA Linux
+Mach386 NCR.MP-RAS NEWS-OS NeXT
+NetBSD NonStop-UX OSF1 OpenBSD
+PTX Paragon PowerUX RISCos
+SCO SINIX SMP_DC.OSx.NILE Solaris
+SVR4 SunOS Titan ULTRIX
+UMAX UNICOS UNIX_SV.4.x.i386
+UX4800 UXPDS Utah dgux
+maxion uts.systemV
+
+ Also, a Windows NT version is available from Sendmail, Inc..
+ _________________________________________________________________
+
+Q3.27 -- How do I prevent Relaying Denied errors for my clients?
+
+ Date: April 12, 1998
+ Last updated: June 19, 2000
+
+ You need to add the fully-qualified host name and/or IP address of
+ each client to class R, the set of relay-allowed domains. For version
+ 8.8.X, this is typically defined by the file /etc/sendmail.cR ; for
+ 8.9.X, it is typically /etc/mail/relay-domains . Note: if your DNS is
+ problematic, you should list the IP address (e.g., 1.2.3.4); in
+ general, however, this should not be necessary.
+
+ Once you've updated the appropriate file, SIGHUP your sendmail daemon
+ and you should be OK.
+
+ Further details are available on our Allowing controlled SMTP relaying
+ in Sendmail 8.9 page.
+ _________________________________________________________________
+
+Q3.28 -- Why isn't virtual hosting working, even after I added a Kvirtuser line
+to sendmail.cf?
+
+ Date: April 12, 1998
+
+ Just adding the proper Kvirtuser line to sendmail.cf is not enough to
+ enable the virtual user table feature, a key ingredient for virtual
+ hosting. You need to use the m4 technique FEATURE(virtusertable);
+ detailed instructions are provided at our Virtual Hosting with
+ Sendmail page.
+ _________________________________________________________________
+
+Q3.29 -- How can I add a header specifying the actual recipient when having
+multiple users in a virtual domain go to a single mailbox?
+
+ Date: July 2, 1998
+ Updated: June 21, 2002
+
+ Stuffing multiple user's mail into a single mail box is not a good
+ method of distributing user mail but if you must do this, the
+ following solution should allow a tool like fetchmail to separate the
+ messages for individual users.
+ 1. Use FEATURE(local_procmail) in your .mc file so procmail (which
+ you must install separately) will deliver mail to the mailbox.
+ 2. Use FEATURE(virtusertable) to create a virtual user table entry
+ for the domain as follows:
+@domain.com domuser+%1
+ where domuser is the username of the mailbox you will be using.
+ Note that "domuser" must be an actual username, *not* an alias.
+ It may be necessary to append "@localhost", as follows
+@domain.com domuser+%1@localhost
+ 3. Put this in the respective domuser's $HOME/.procmailrc:
+DOMAIN=domain.com
+ENV_TO=$1
+
+:0f
+* ENV_TO ?? .
+| formail -i "X-Envelope-To: "$ENV_TO@$DOMAIN
+
+:0fE
+| formail -i "X-Envelope-To: UNKNOWN"
+ This will insert an X-Envelope-To header with the original
+ envelope recipient address when the message is delivered the
+ normal way via the virtusertable, and UNKNOWN if for some reason
+ it was sent directly to domuser.
+ You may be tempted to eliminate variable ENV_TO and use $1
+ directly. It won't work, so don't bother.
+ FEATURE(local_procmail) causes sendmail to deliver email to
+ procmail directly. A .forward file is not only unnecessary, it
+ would prevent procmail from setting $1 with the necessary text, so
+ don't use one.
+ You may need to replace formail with /usr/local/bin/formail or
+ some such, depending on whether procmail can find it or not.
+
+ Another possible solution from Andrzej Filip.
+ _________________________________________________________________
+
+Q3.30 -- What do I do when Build fails because groff was not found?
+
+ Date: September 24, 1998
+
+ You can get groff from ftp://ftp.gnu.org/pub/gnu/. But it's not a big
+ deal, because:
+ 1. You've already successfully built the sendmail binary to get this
+ far.
+ 2. You can just use the preformatted man pages anyway:
+% cp *.0 obj*
+ _________________________________________________________________
+
+Q3.31 -- What does "class hash not available" mean?
+
+ Date: September 24, 1998
+
+ You've built sendmail and/or makemap without NEWDB specified in your
+ DBMDEF configuration, but you specified the class hash in sendmail.cf
+ or on a makemap command. The class hash requires NEWDB support, for
+ which you need the Berkeley database. Please refer to the Database
+ Definitions section of our Compiling Sendmail web page.
+ _________________________________________________________________
+
+Q3.32 -- How do I configure majordomo with sendmail 8.9 without relaxing the
+DontBlameSendmail option?
+
+ Date: January 26, 1999
+ Updated: October 30, 2001
+
+ We have had some queries about this, as majordomo apparently suggests
+ some configuration values which sendmail 8.9 does not like. Here is
+ what one expert suggests:
+
+ The sendmail.cf contains:
+O AliasFile=/etc/aliases, /etc/majordomo.aliases
+O DontBlameSendmail=Safe
+
+ /etc/aliases contains the general majordomo aliases:
+# Majordomo
+majordomo: "|/usr/local/lib/majordomo/wrapper majordomo"
+owner-majordomo: postmaster
+majordomo-owner: postmaster
+
+ /etc/majordomo.aliases contains the majordomo lists of the form:
+wookie: "|/usr/local/lib/majordomo/wrapper resend -l wookie wookie-list"
+wookie-list: :include:/usr/local/lib/majordomo/lists/wookie
+owner-wookie: head-wookie
+wookie-approval: owner-wookie
+wookie-request: "|/usr/local/lib/majordomo/wrapper majordomo -l wookie"
+
+ The various directory owners/groups/permissions:
+drwxr-xr-x 20 root root 1024 Dec 1 15:20 /
+drwxr-xr-x 25 root root 3072 Jan 26 01:26 /etc
+drwxr-xr-x 20 root root 1024 Feb 4 1998 /usr
+drwxr-xr-x 18 root root 1024 Jan 16 18:40 /usr/local
+drwxr-xr-x 5 root root 1024 Feb 6 1996 /usr/local/lib
+lrwxrwxrwx 1 root root 16 Dec 1 10:01 /usr/local/lib/majordomo
+ -> majordomo-1.94.4
+drwxr-x--x 5 majordom majordom 1024 Jan 25 23:12 /usr/local/lib/majordomo
+-1.94.4
+drwxr-xr-x 2 majordom majordom 32768 Jan 26 00:49 /usr/local/lib/majordomo
+-1.94.4/lists
+-rw-rw-r-- 1 majordom majordom 655 Nov 3 17:03 /usr/local/lib/majordomo
+-1.94.4/lists/wookie
+-rw-rw---- 1 majordom majordom 14588 Jan 19 10:28 /usr/local/lib/majordomo
+-1.94.4/lists/wookie.config
+-rw-rw-r-- 1 majordom majordom 23 Jan 14 1997 /usr/local/lib/majordomo
+-1.94.4/lists/wookie.info
+
+ Now the differences that make this work that may not be the same as
+ instructed by the majordomo instructions:
+ 1. Put the majordomo.aliases file in /etc, not in the majordomo
+ install directory (/usr/local/lib/majordomo). If you can't move
+ the aliases file out of the majordomo directory, you'll need to
+ create the database backing file by hand the first time as root:
+ # touch /usr/local/lib/majordomo/aliases
+ # newaliases -OAliasFile=/usr/local/lib/majordomo/aliases
+
+ 2. Make the permissions on /usr/local/lib/majordomo 0751, not 0775.
+ 3. Make the permissions on /usr/local/lib/majordomo/Log 0664, owned
+ by majordom, group majordom.
+ 4. /usr/local/lib/majordomo/lists is mode 0755, owner majordom, group
+ majordom.
+ 5. The permissions/owners for the lists should be as shown above.
+ These permissions/ownership allow majordom to continue to manage
+ the lists.
+ _________________________________________________________________
+
+Q3.33 -- How do I configure my system in general with sendmail 8.9?
+
+ Date: May 24, 1999
+
+ The following is taken directly from the DIRECTORY PERMISSIONS section
+ of the top-level README file in the sendmail distribution.
+
+ Sendmail often gets blamed for many problems that are actually the
+ result of other problems, such as overly permissive modes on
+ directories. For this reason, sendmail checks the modes on system
+ directories and files to determine if can have been trusted. For
+ sendmail to run without complaining, you MUST execute the following
+ command:
+ chmod go-w / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue
+ chown root / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue
+
+ You will probably have to tweak this for your environment (for
+ example, some systems put the spool directory into /usr/spool instead
+ of /var/spool and use /etc/mail for aliases file instead of /etc). If
+ you set the RunAsUser option in your sendmail.cf, the
+ /var/spool/mqueue directory will have to be owned by the RunAsUser
+ user. As a general rule, after you have compiled sendmail, run the
+ command
+ sendmail -v -bi
+
+ to initialize the alias database. If it gives messages such as
+ WARNING: writable directory /etc
+ WARNING: writable directory /usr/spool/mqueue
+
+ then the directories listed have inappropriate write permissions and
+ should be secured to avoid various possible security attacks.
+
+ Beginning with sendmail 8.9, these checks have become more strict to
+ prevent users from being able to access files they would normally not
+ be able to read. In particular, .forward and :include: files in unsafe
+ directory paths (directory paths which are group or world writable)
+ will no longer be allowed. This would mean that if user joe's home
+ directory was writable by group staff, sendmail would not use his
+ .forward file. This behavior can be altered, at the expense of system
+ security, by setting the DontBlameSendmail option. For example, to
+ allow .forward files in group writable directories:
+ O DontBlameSendmail=forwardfileingroupwritabledirpath
+
+ Or to allow them in both group and world writable directories:
+ O DontBlameSendmail=forwardfileinunsafedirpath
+
+ Items from these unsafe .forward and :include: files will be marked as
+ unsafe addresses -- the items can not be deliveries to files or
+ programs. This behavior can also be altered via DontBlameSendmail:
+ O DontBlameSendmail=forwardfileinunsafedirpath,
+ forwardfileinunsafedirpathsafe
+
+ The first flag allows the .forward file to be read, the second allows
+ the items in the file to be marked as safe for file and program
+ delivery.
+
+ Other files affected by this strengthened security include class files
+ (i.e. Fw /etc/sendmail.cw), persistent host status files, and the
+ files specified by the ErrorHeader and HelpFile options. Similar
+ DontBlameSendmail flags are available for the class, ErrorHeader, and
+ HelpFile files.
+
+ If you have an unsafe configuration of .forward and :include: files,
+ you can make it safe by finding all such files, and doing a "chmod
+ go-w $FILE" on each. Also, do a "chmod go-w $DIR" for each directory
+ in the file's path.
+ _________________________________________________________________
+
+Q3.34 -- What does "foo not available for sendmail programs" mean?
+
+ Date: September 24, 1999
+
+ It means that you are using smrsh, the sendmail restricted shell; see
+ Q2.13 for details on this. To fix this problem, you need to create a
+ sym-link from smrsh's directory for restricted programs to the program
+ foo. The default location of this directory for restricted programs is
+ /usr/adm/sm.bin in the Open Source version, but vendor versions
+ differ. For example, RedHat Linux 6.0 uses /etc/smrsh, and Solaris 8
+ uses /var/adm/sm.bin . If you don't know the directory for your OS,
+ first check the smrsh man page, then if that fails, try:
+ % strings /path/to/smrsh | grep ^/
+
+ where /path/to/smrsh is the P= argument on the Mprog line in
+ sendmail.cf .
+
+ So for example:
+ % cd /usr/adm/sm.bin
+ % ln -s /usr/bin/vacation
+
+ would allow the vacation program to be run from a user's .forward file
+ or an alias which uses the "|program" syntax.
+
+ Finally, if you want to disable use of smrsh, remove the
+ FEATURE(`smrsh') line from the .mc file used to build sendmail.cf; see
+ cf/README for details on this.
+ _________________________________________________________________
+
+Q3.35 -- How do I add a footer/signature to all (outgoing) e-mail messages?
+
+ Date: October 9, 2000
+ Updated: August 1, 2001
+ Updated: May 16, 2002
+ Updated: February 22, 2003
+
+ This is quite complicated. At first sight it might be simple: just
+ "cat" some text (taken from a file or whatever) to the end of an
+ e-mail message passing through sendmail. However, there is a big
+ problem: what about structured e-mail messages, i.e., MIME messages?
+ These can be arbitrarily complex and just "cat"ting a footer to the
+ end of the body can break the MIME structure. (A MIME aware MUA will
+ just not show such a footer, so it's pretty useless in any case.) But
+ signed messages (think: PGP) will break. Another problem is the
+ character set used by the mime part to which the disclaimer is added
+ needs to match the actual character set of the disclaimer itself.
+ Hence, there is no easy solution to this problem!
+
+ If you know enough about MIME and some C programming, then take a look
+ at sendmail 8.11 (or later) and libmilter/README. It now offers the
+ functionality to achieve this goal.
+
+ Some open source milters are capable of adding footers, e.g.
+ MIMEDefang.
+ _________________________________________________________________
+
+Q3.36 -- What does "Cannot open hash database ... Invalid argument" mean?
+
+ Date: January 3, 2001
+ Updated: February 8, 2001
+
+ It's an error returned from the Berkeley DB library. It normally means
+ that the db file was built with a different version of Berkeley DB
+ than the one sendmail is currently using. You need to recompile
+ makemap with the same version of Berkeley DB that sendmail was
+ compiled with, and re-make your maps with that new version of makemap.
+
+ From a typical Unix 'errno' man page:
+
+ 22 EINVAL Invalid argument. Some invalid argument was supplied.
+
+ From the Berkeley DB 2.x 'db_open' man page (1.x 'dbopen' is similar):
+
+EINVAL
+ ...
+
+ There is a mismatch between the version number of file and the
+ software.
+
+ Berkeley DB 3.x uses a special errno value for this - from its
+ 'db_open' man page:
+
+DB_OLD_VERSION
+ The database cannot be opened without being first upgraded.
+
+ Unfortunately this isn't specifically handled by sendmail upto and
+ including 8.11.2, resulting in an error message that says something
+ like "Error -30990" instead of "Invalid argument".
+
+ Here is a table mapping versions of Berkeley DB with the corresponding
+ sendmail versions in which they are supported:
+
+ Berkeley DB Sendmail
+ 0.X - 1.4 (OLD_NEWDB) 8.1 - 8.8.8
+ 1.5 and later 1.X 8.1 and later
+ 2.0.0-2.6.3 8.9.0 and later
+ 2.6.4 and later 2.X 8.9.2 and later
+ 3.0 and later 3.X 8.10.0 and later
+ _________________________________________________________________
+
+Q3.37 -- What does "parse error before `NDBM'" mean?
+
+ Date: April 21, 2001
+
+ This error is generally accompanied by a message indicating which file
+ it occurred in, and which line number of that file, usually:
+ERROR NDBM or NEWDB must be defined.
+
+ You are supposed to read that line, and do something about it.
+
+ Normally, on Linux and the various BSDs, NEWDB is used, whereas on the
+ "commercial" Unix variants (Solaris, HP-UX, possibly others), NDBM is
+ used. Perhaps you failed to install the required libraries when you
+ installed your system.
+
+ Please refer to 3.31 and the Database Definitions section of our
+ Compiling Sendmail web page for further details.
+ _________________________________________________________________
+
+Q3.38 -- What does "may be forged" mean?
+
+ Date: November 12, 2001
+
+ After sendmail does a hostname look-up on the IP address of the
+ connecting client, the IP addresses of that hostname are looked up. If
+ the client IP address does not appear in that list, then the may be
+ forged tag is added.
+ _________________________________________________________________
+
+Q3.39 -- How do I send using an alternate port?
+
+ Date: May 5, 2002
+
+ You can have Sendmail use port 2525 when sending to your domain.
+ define(`SMTP_MAILER_ARGS', `TCP $h 2525')
+
+ or editing .cf directly,
+ A=TCP $h 2525
+
+ will force sendmail to use port 2525. But, this will be for all SMTP
+ connections. To do it only for your domain, use /etc/mail/mailertable,
+ yourdomain.com mysmtp:mail.yourdomain.com
+
+ where 'mysmtp' is an exact duplicate of the 'esmtp' mailer definition,
+ except for the port number in 'A=...'. Of course, change 2525 to
+ whatever alternate port number you wish to use.
+ _________________________________________________________________
+
+Q3.40 -- Why can't I use BerkeleyDB 4.1.x?
+
+ Date: November 15, 2002
+ Updated: December 29, 2002
+
+ SleepyCat changed the API from Berkeley DB 4.0 to 4.1. Hence it is not
+ supported in sendmail 8.12.6. Moreover, the semantics of the open()
+ call have been changed, hence sendmail doesn't work with DB 4.1.x (x
+ <= 24), even if the "obvious" API changes are made.
+
+ However, with the release of Berkeley DB 4.1.25 and sendmail 8.12.7,
+ things should work again with these versions (or greater, when the
+ time comes).
+ _________________________________________________________________
+
+Q3.41 -- How do I use CIDR notation in the access map (or other places)?
+
+ Date: December 3, 2002
+
+ Use contrib/cidrexpand to pre-process the data into a format that is
+ supported by sendmail. For example:
+cidrexpand < access | makemap hash access
+ _________________________________________________________________
+
+Q3.42 -- Why isn't CIDR notation directly supported by sendmail?
+
+ Date: December 3, 2002
+
+ Because it is in general very expensive to do this. Here's an
+ explanation from Per Hedeland:
+
+ And not just more complex, it would have to do many more
+ (comparatively expensive) lookups - there's no way, given (e.g.)
+ the IP address 66.205.192.123, to find the matching
+ "66.205.192.0/19" with a single lookup in a general key/value
+ hashed map. The code would have to look for "66.205.192.123",
+ "66.205.192.122/31", "66.205.192.120/30", "66.205.192.120/29", etc,
+ etc - 14 lookups to find a /19, 32 to establish a non-match.
+
+ which is 8 times more than the available octet boundary lookup.
+
+ I haven't done any measurements, but I wouldn't be surprised if
+ even in the absolute worst case, that your map is 128 times bigger
+ than it "needs" to be, the time for a single lookup won't even
+ double - i.e. you'll lose already on the second lookup.
+ _________________________________________________________________
+
+Q3.43 -- What does "Need to recompile with -DNEWDB for hash support" mean?
+
+ Date: December 24, 2002
+
+ See Q3.31. This is the newer form of the same error message, updated
+ to be more informative and clueful. The actual line of code contains:
+ "%s: Need to recompile with -D%s for %s support\n"
+
+ where the first %s gets replaced by the name of the program (generally
+ makemap), the second %s gets replaced by the name of the macro which
+ needs to be defined (see the Database Definitions section of our
+ Compiling Sendmail web page for the full list), and the third %s gets
+ replaced by the argument to makemap which could not be handled.
+ _________________________________________________________________
+
+Q3.44 -- I disabled sendmail on some machines which don't receive mail, but
+since upgrading to 8.12 they can't send mail either; why?
+
+ Date: January 13, 2003
+
+ 8.12 uses a new paradigm: the binary is no longer setuid-root; to make
+ this work, there are now two queues, a "main" queue and a client-only
+ queue. To match these, there are two config files: one for the main
+ queue (sendmail.cf) and one for the client-only queue (submit.cf).
+ There are also two sendmail processes which need to run: a daemon and
+ a client queue runner. In the default configuration of sendmail, the
+ client queue runner must be able to submit mail to the daemon on the
+ local SMTP port. If the daemon is not listening on the SMTP port, the
+ mail remains in the client-only queue. If you don't want to accept
+ mail from other machines, you should add one or both of the following
+ lines to your .mc file:
+DAEMON_OPTIONS(`NAME=NoMTA4, Family=inet, Addr=127.0.0.1')dnl
+DAEMON_OPTIONS(`NAME=NoMTA6, Family=inet6, Addr=::1')dnl
+
+ If your machine has IPv4 addresses configured, use the first line;
+ likewise, use the second line if it has IPv6 addresses configured, and
+ both if both types of addresses are configured. Then build a new .cf
+ file from your .mc file, install it as /etc/mail/sendmail.cf and start
+ sendmail.
+
+ In some cases, however, it might be better instead to modify
+ submit.mc, to use
+FEATURE(`msp', `smart_host')dnl
+
+ instead of the default
+FEATURE(`msp', `[127.0.0.1]')dnl
+
+ This has the advantage that you don't have to run a daemon on the
+ local host, but a disadvantage of introducing a dependency on the
+ smart_host machine. Which of the two solutions is better for you
+ depends on whether or not your network architecture has such a
+ smart_host, how reliable you deem that smart_host to be, and how
+ inconvenient running a daemon locally would be.
+
+
+ sendmail.org
+
+ 4. GENERAL SENDMAIL ISSUES
+
+ * 4.1 Should I use a wildcard MX for my domain?
+ * 4.2 How can I set up an auto-responder?
+ * 4.3 How can I get sendmail to deliver local mail to $HOME/.mail
+ instead of into /usr/spool/mail (or /usr/mail)?
+ * 4.4 Why does it deliver the mail interactively when I'm trying to
+ get it to go into queue only mode?
+ * 4.5 How can I solve "MX list for hostname points back to hostname"
+ and "config error: mail loops back to myself" messages?
+ * 4.6 Why does my sendmail process sometimes hang when connecting
+ over a SLIP/PPP link?
+ * 4.7 How can I summarize the statistics generated by sendmail in
+ the syslog?
+ * 4.8 How can I check my sendmail.cf to ensure that it's re-writing
+ addresses correctly?
+ * 4.9 What is procmail, and where can I get it?
+ * 4.10 How can I solve "cannot alias non-local names" errors?
+ * 4.11 Is sendmail Year-2000 (Y2K) compliant?
+ * 4.12 How can I batch remote mail to be sent using my ISP while
+ delivering local mail immediately?
+ * 4.13 What does "unknown mailer error 1" mean?
+ * 4.14 How do I queue mail for another domain?
+ * 4.15 How do create attachments with sendmail?
+ * 4.16 How do I find sendmail's version number?
+ * 4.17 How do I handle user names with upper-case characters?
+ * 4.18 What does "NOQUEUE: Null connection from ..." mean?
+ * 4.19 How do I configure sendmail for POP/IMAP/... ?
+ * 4.20 How can I automatically copy messages based on sender or
+ recipient addresses?
+ * 4.21 How can I send mail to all users?
+ * 4.22 Why can't I receive external mail?
+ _________________________________________________________________
+
+Q4.1 -- Should I use a wildcard MX for my domain?
+
+ Date: July 9, 1996
+ Updated: November 5, 1997
+
+ 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 "MX list for
+ hostname points back to hostname" or "config error: mail loops back to
+ myself".
+
+ See RFCs 1535, 1536, and 1912 (updates RFC 1537) for more detail and
+ other related (or common) problems. See also _DNS and BIND_ by Albitz
+ and Liu.
+
+ They can also cause your system to add your domain to outgoing FQDNs
+ in a desperate attempt to get the mail to where it's supposed to go,
+ but because *.your.domain is valid due to the wildcard MX, delivery to
+ not.real.domain.your.domain will get dumped on you, and you may even
+ find yourself in a loop as the domain keeps getting tacked on time
+ after time after time (the "config error: mail loops back to myself"
+ problem).
+
+ Wildcard MX records are just a bad idea, plain and simple. They don't
+ work the way you'd expect, and virtually no one gets them right. Avoid
+ them at all costs.
+ _________________________________________________________________
+
+Q4.2 -- How can I set up an auto-responder?
+
+ Date: March 23, 1996
+ Updated: February 16, 1999
+ Updated: July 30, 2002
+
+ This is a local mailer issue, not a sendmail issue. Depending on what
+ you're doing, look at procmail (see Q4.9), ftpmail, Majordomo or of
+ course vacation, which is part of the sendmail (8.10.0 and later)
+ distribution.
+
+ The latest version of Majordomo can be found at
+ ftp://ftp.greatcircle.com/pub/majordomo/. It is written in Perl and
+ requires either Perl 4.036, and appears to run with only minor tweaks
+ under 5.001a or later. Make sure to check out the web interface for
+ Majordomo called LWGate at
+ http://www.netspace.org/users/dwb/lwgate.html. The latest versions of
+ Perl (both 4.x and 5.x) can be found in
+ http://www.metronet.com/perlinfo/src/. More information about Perl can
+ be found at http://www.metronet.com/perlinfo/perl5.html
+
+ The latest version of ftpmail can be found at
+ ftp://src.doc.ic.ac.uk/packages/ftpmail or any comp.sources.misc
+ archive (volume 37).
+ _________________________________________________________________
+
+Subject: Q4.3 -- How can I get sendmail to deliver local mail to $HOME/.mail
+instead of into /usr/spool/mail (or /usr/mail)?
+
+ Date: July 9, 1996
+ Updated: January 7, 1999
+
+ 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 (see Q4.9), although there are probably many
+ others as well.
+ _________________________________________________________________
+
+Subject: Q4.4 -- Why does it deliver the mail interactively when I'm trying to
+get it to go into queue only mode?
+
+ Date: March 23, 1996
+ Updated: August 14, 2000
+
+ 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
+ "HoldExpensive" (whose old one-character name was "c") -- otherwise it
+ ignores the mailer flag.
+ _________________________________________________________________
+
+Subject: Q4.5 -- How can I solve "MX list for hostname points back to hostname"
+and "config error: mail loops back to myself" messages?
+
+ Date: January 17, 1997
+ Updated: May 8, 2000
+ Updated: January 24, 2002
+
+ I'm getting these error messages:
+ 553 MX list for domain.net points back to relay.domain.net
+ 554 <user@domain.net>... Local configuration error
+
+ How can I solve this problem?
+
+ You have asked mail to a 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/mail/local-host-names [known as
+ /etc/sendmail.cw prior to version 8.10] (if you are using
+ FEATURE(`use_cw_file')) or add "Cw domain.net" to your configuration
+ file.
+
+ There are a couple of additional cases where you don't actually want
+ local delivery, and thus adding domain.net to class w is not the right
+ fix:
+ * When relay.domain.net should just be acting as a forwarder, e.g. a
+ firewall/gateway box. The proper fix could be to set up a
+ mailertable entry for domain.net.
+ * When relay.domain.net is a secondary (etc.) MX, and the MX
+ mistakenly points to a CNAME or other "non-canonical" name [this
+ gives "config error: mail loops back to me (MX problem?)"]. The
+ proper fix is to point the MX at the actual name, a "work-around"
+ to add the MX target to class w.
+
+ IMPORTANT: When making changes to your configuration file, be sure you
+ kill and restart the sendmail daemon (for any change in the
+ configuration, not just this one):
+ kill -HUP `head -1 /var/run/sendmail.pid`
+
+ Note: You can also get this error message (MX loops ...) when two
+ sendmail systems talk to each other, and both have the same value of
+ $j . The best solution is "don't do that."
+ _________________________________________________________________
+
+Subject: Q4.6 -- Why does my sendmail process sometimes hang when connecting
+over a SLIP/PPP link?
+
+ Date: March 23, 1996
+
+ 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.
+ _________________________________________________________________
+
+Subject: Q4.7 -- How can I summarize the statistics generated by sendmail in
+the syslog?
+
+ Date: April 9, 1997
+ Updated: January 4, 1999
+ Updated: March 27, 2000
+ Updated: July 13, 2000
+ Updated: May, 2001
+ Updated: August, 2001
+ Updated: November, 2001
+
+ This question is addressed on pages 445-449 of _sendmail, 2nd Ed_ (see
+ page 319 of first edition) by Bryan Costales (see entry
+ sendmail-faq//book/ISBN/1-56592-222-0 in Q6.1).
+
+ To see what else is available today, check the Comprehensive Perl
+ Archive Network. For more information, see the comp.lang.perl.* FAQs
+ at ftp://rtfm.mit.edu/pub/usenet-by-hierarchy/comp/lang/perl/.
+
+ If you're interested in using these kinds of tools to help you do some
+ near real-time monitoring of your system, you might be interested in
+ MEWS (Mail Early Warning System). From the README:
+ If you've ever written a perl script to parse sendmail
+ log files looking for errors, MEWS might be of interest to
+ you. If you've ever thought about writing a perl script to
+ munge sendmail log files, cringed a little and hurriedly
+ came up with an excuse not to do it, read on.
+
+ If you don't have a Solaris 2.5 machine, you can probably
+ stop reading here.
+
+ The Mail Early Warning System (MEWS) gives postmasters
+ immediate notification of trouble spots on your mail
+ backbone. It only works with sendmail.
+
+ To explain it in a nutshell, whenever sendmail returns a
+ 4xx or 5xx SMTP code, with the MEWS modifications, it also
+ sends the code over UDP to a daemon which then replays the
+ error message to interested parties. The man pages go into
+ a little bit more detail.
+
+ If this sounds like something you might be interested in getting more
+ details about, you can find the MEWS archive at
+ ftp://ftp.qualcomm.com/pub/people/eamonn/mews.tar.Z.
+
+ Here's an update from Stephane Lentz on June 29, 2000:
+ * anteater - written in C++ (+ STL lib), fast, really promising (you
+ can add modules)
+ * mreport - written in C, works fine on small logs but not with big
+ hubs' log (all data are stored into memory)
+
+ See also John Oliver's sendmail tools page for pointers to several
+ related scripts. (May 25, 2001)
+
+ Brad Knowles's links for popstats, smtpstats and syslog_stats have
+ been revived at a new location. (May 29, 2001)
+
+ Two new links (November 12, 2001):
+ * Counterpane: Log Analysis Resources
+ * LogReport
+ _________________________________________________________________
+
+Subject: Q4.8 -- How can I check my sendmail.cf to ensure that it's re-writing
+addresses correctly?
+
+ Date: June 3, 2002
+
+ Sendmail's test mode is best for this. See the Sendmail Installation
+ and Operation Guide, § 3.8 (Testing Configuration files); here is a
+ short sample:
+% sendmail -bt -C /path/to/test/sendmail.cf
+ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
+Enter <ruleset> <address>
+> /tryflags hs
+> /try esmtp user@domain.com
+Trying header sender address user@domain.com for mailer esmtp
+...
+> /quit
+%
+ _________________________________________________________________
+
+Subject: Q4.9 -- What is procmail, and where can I get it?
+
+ Date: April 8, 1997
+ Updated: February 28, 1999
+
+ The program "procmail" is a replacement for the local mailer
+ (variously called /bin/mail, /usr/bin/mail, mail.local, rmail,
+ etc...). It has been ported to run on virtually every Unix-like OS
+ you're likely to run into, and has a whole host of features. It is
+ typically about 30% faster performing the job of the local mailer than
+ programs such as /bin/mail or /usr/bin/mail, it has been hammered on
+ widely to make it extremely secure (much more so than most local
+ mailers) and very robust. Procmail is also capable of helping you put
+ a quota on a user's mailbox through the standard Unix quota mechanism
+ (see Q4.3).
+
+ In short, whatever you've got, you're almost guaranteed that procmail
+ is better (if nothing else, the author has been able to focus lots of
+ time and energy into making it the best and fastest tool available,
+ while most system vendors just throw something together as fast as
+ they can and move on to the whole rest of the OS).
+
+ However, this only begins to scratch the surface of what procmail is
+ capable of. It's most important feature is the fact that it gives you
+ a standard way to create rules (procmail calls them "recipes") to
+ process your mail before the messages get put into your mailbox, and
+ for that feature alone, it is one of the most important tools any
+ administrator can have in their repertoire. By filtering out or
+ automatically dealing with 80% of your daily cruft, it lets you spend
+ more time on the hard 20%.
+
+ Note that recent releases of version 8 sendmail natively support using
+ procmail as an alternate local mailer (see "FEATURE(local_procmail)"
+ for version 8.7 and above). They also support procmail as an
+ additional local mailer, if you're concerned about flat-out replacing
+ your current local mailer with procmail (see "MAILER(procmail)" in
+ version 8.7 and above).
+
+ You can also install procmail as a user and run it out of your
+ .forward file, although this tends to be a bit slower and less
+ efficient.
+
+ More information about procmail can be found at
+ http://www.procmail.org/ and the latest version can be found at
+ ftp://ftp.procmail.org/pub/procmail/.
+
+ Procmail is also the core to a mailing list management package called
+ "SmartList", so if you've already got procmail, adding SmartList may
+ be a good option. Some listowners prefer Majordomo, Listserv, or one
+ of those other programs, but SmartList has more than a few adherents
+ as well. Your personal tastes will dictate whether you swear by
+ SmartList or at it.
+ _________________________________________________________________
+
+Subject: Q4.10 -- How can I solve "cannot alias non-local names" errors?
+
+ Date: March 24, 1997
+
+ I upgraded from my vendor's sendmail to the latest version and now I'm
+ getting these error messages when I run "newaliases":
+/etc/aliases: line 13: MAILER-DAEMON... cannot alias non-local names
+/etc/aliases: line 14: postmaster... cannot alias non-local names
+
+ How can I solve this problem?
+
+ Your local mailer doesn't have the "A" flag specified. Edit the Mlocal
+ line in sendmail.cf and add "A" to the flags listed after "F=".
+
+ Better yet, if you're running a recent version of sendmail that uses
+ m4 to generate .cf files from .mc files, regenerate your sendmail.cf
+ and see if that fixes the problem. Remember to install the new
+ sendmail.cf and restart the sendmail daemon.
+ _________________________________________________________________
+
+Subject: Q4.11 -- Is sendmail Year-2000 (Y2K) compliant?
+
+ Date: April 24, 1997
+ Updated: July 7, 1999
+
+ Please refer to the Sendmail Year 2000 Readiness Disclosure page.
+ _________________________________________________________________
+
+Subject: Q4.12 -- How can I batch remote mail to be sent using my ISP while
+delivering local mail immediately?
+
+ Date: October 14, 1997
+ Updated: February 9, 1999
+
+ First, you need to get sendmail not to use DNS on your local machine
+ so your host doesn't trying to connect to your ISP for a DNS query.
+ See Q3.22 for more information.
+
+ You also need to designate a "smart host" or external relay to handle
+ all mail that you can't deliver locally (this would be your ISP's
+ mailhost).
+
+ You need to configure it so that the smtp mailer is considered
+ "expensive" by adding the F=e mailer flag and tell sendmail not to
+ connect to expensive mailers by default by setting the HoldExpensive
+ option to True.
+
+ You need to add mydomain.com to the sendmail.cw file or the Cw line in
+ the sendmail.cf. See Q4.5.
+
+ Finally, you need to run a program periodically to check in with your
+ ISP and get them to deliver any mail they may have queued for you. See
+ Q3.23.
+ _________________________________________________________________
+
+Subject: Q4.13 -- What does "unknown mailer error 1" mean?
+
+ Date: September 24, 1998
+
+ In general, sendmail does not perform final delivery of messages, but
+ relies on a local delivery agent instead. Such an agent, mail.local,
+ is provided with the sendmail distribution. Any such agent that
+ sendmail invokes for message delivery, as specified on an M line in
+ sendmail.cf, must exit with code 0 (success), or one of the failure
+ codes noted in src/sysexits.h. These generally run in the range 64 -
+ 78, so 1 would be out of range, and lead to sendmail generating the
+ above error.
+ _________________________________________________________________
+
+Subject: Q4.14 -- How do I queue mail for another domain?
+
+ Date: April 28, 1999
+ Updated: December 21, 2000
+
+ Situation: Your system mailserver.my.domain should act as a backup
+ mailserver for mailserver.destination.domain. The client wants to
+ receive mail for the address user@destination.domain. This requires:
+ 1. MX Records:
+destination.domain. IN MX 10 mailserver.destination.domain.
+destination.domain. IN MX 20 mailserver.my.domain.
+mailserver.destination.domain. IN MX 10 mailserver.destination.domain.
+mailserver.destination.domain. IN MX 20 mailserver.my.domain.
+ The last two records are there "just in case" (someone forgot
+ masquerading).
+ Make sure you use the real names of all systems.
+ mailserver.my.domain must know its own name, otherwise you'll get
+ the famous mail loops back to myself error.
+ Instead of using MX records that point to
+ mailserver.destination.domain, you can use the
+ FEATURE(mailertable) on mailserver.my.domain as explained in
+ cf/README for routing e-mails.
+ 2. On your system: do nothing unless you have anti-relay rules
+ installed (which you really should have!). In this case, add
+ destination.domain to the required files (8.9) (or for 8.8). Don't
+ add destination.domain or mailserver.destination.domain to class w
+ on your system!
+ 3. sendmail on your system will try to deliver mail during queue
+ runs, however, the client may trigger delivery by using the ETRN
+ command.
+ _________________________________________________________________
+
+Subject: Q4.15 -- How do I create attachments with sendmail?
+
+ Date: May 26, 1999
+
+ You don't. Sendmail is a mail transfer agent (MTA). Creating e-mail
+ messages, including adding attachments or signatures, is the function
+ of a mail user agent (MUA). Some popular MUAs include mutt, elm, exmh,
+ Netscape, Eudora and Pine. Some specialized packages (metamail, some
+ Perl modules, etc.) can also be used to create messages with
+ attachments.
+ _________________________________________________________________
+
+Subject: Q4.16 -- How do I find sendmail's version number?
+
+ Date: August 2, 1999
+ Updated: July 19, 2000
+ Updated: December 28, 2001
+
+ To find out which version is actually running, from without, telnet to
+ the SMTP port (port 25). The daemon usually announces its name and
+ version number, as in
+thishost% telnet that.host 25
+Trying IP_addr...
+Connected to that.host.
+Escape character is '^]'.
+220 that.host ESMTP Sendmail 8.12.1/8.12.1; Fri, 28 Dec 2001 11:39:34 -0800
+QUIT
+
+ To query a binary on your local host, the following command should
+ display its version number, along with some extra configuration
+ information, possibly including the configuration version number:
+% echo \$Z | /usr/sbin/sendmail -bt -d0
+Version 8.12.1
+ Compiled with: MAP_REGEX LOG MATCHGECOS MIME7TO8 MIME8TO7 NAMED_BIND
+ NETINET NETUNIX NEWDB NIS QUEUE SCANF SMTP USERDB XDEBUG
+
+============ SYSTEM IDENTITY (after readcf) ============
+ (short domain name) $w = knecht
+ (canonical domain name) $j = knecht.Sendmail.ORG
+ (subdomain name) $m = Sendmail.ORG
+ (node name) $k = knecht.Sendmail.ORG
+========================================================
+
+ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
+Enter <ruleset> <address>
+> 8.12.1
+%
+
+ Adjust the pathname as needed; /usr/lib and /usr/sbin are the most
+ common locations.
+ _________________________________________________________________
+
+Subject: Q4.17 -- How do I handle user names with upper-case characters?
+
+ Date: November 18, 1999
+ Updated: August 8, 2001
+
+ You really shouldn't, because upper case characters in user names are
+ contrary to the Unix tradition. If you do, then e-mail addresses will
+ be case sensitive, so that mail to <USER@your.host> will bounce
+ instead of being delivered to <user@your.host>. As this is contrary to
+ the expectations of many, it is not recommended.
+
+ But if you insist on doing so anyway, and you have version 8.10, put
+ the following in your .mc file:
+MODIFY_MAILER_FLAGS(`LOCAL', `+u')dnl
+
+ If you don't have 8.10, you will need to redefine the
+ LOCAL_MAILER_FLAGS m4 variable, but the initial value varies from OS
+ to OS, so this is yet another reason not to mess with this flag.
+
+ Another hack is the creation of aliases for Uppercase local users in
+ the form:
+# lowercase version to real one
+uppercase: Uppercase
+
+ It will make sendmail deliver messages to uppercase local recipients
+ in a case insensitive manner.
+ _________________________________________________________________
+
+Subject: Q4.18 -- What does "NOQUEUE: Null connection from ..." mean?
+
+ Date: February 24, 2000
+ Updated: March 12, 2000
+
+ An entry like:
+NOQUEUE: Null connection from host.domain [IP.AD.DD.RESS]
+
+ in the logfile means that host.domain connected to your MTA but
+ neither initiated transmission of a message (by issuing the MAIL
+ command), nor used any of the commands that are logged separately
+ (EXPN/VRFY/ETRN). Unless this happens very often, you can ignore this.
+ If it happens very often, it's either someone playing around or it's a
+ network problem.
+
+ Note 1: The significant part of the message isn't the NOQUEUE, but the
+ "Null connection from ...". In particular, NOQUEUE isn't an error
+ indication, but just a "place-holder" when no queue ID has been
+ assigned, typically because message collection hasn't started (yet).
+ It can occur in other messages too, and there too the significant part
+ is what comes after the NOQUEUE.
+
+ Note 2: In 8.10, the text which led to the confusion has been changed
+ to: "... did not issue MAIL/EXPN/VRFY/ETRN during connection to ...".
+ _________________________________________________________________
+
+Subject: Q4.19 -- How do I configure sendmail for POP/IMAP/... ?
+
+ Date: March 12, 2000
+
+ You don't. Sendmail is a mail transfer agent whose primary purpose is
+ to send and receive e-mail (primarily via SMTP). Sendmail does not
+ implement any remote access protocols such as POP or IMAP. But if you
+ want to learn more about these and other (non-sendmail) e-mail related
+ things, please refer to our Other (Non-Sendmail) E-Mail Related Links
+ page.
+ _________________________________________________________________
+
+Subject: Q4.20 -- How can I automatically copy messages based on sender or
+recipient addresses?
+
+ Date: June 30, 2000
+ Updated: February 27, 2001
+ Updated: June 5, 2001
+ Updated: February 13, 2003
+
+ It would require custom programming. You could either write a mail
+ filter using the new Milter API in sendmail 8.10 and later (see
+ libmilter/README) or you could look at some of these other unsupported
+ hints:
+ * Axel Reinhold's logall.c module
+ * Message-Id: <33AA593A.4B701C3F@syntegra.nl>
+ * the procmailrc man page
+
+ Note that no such feature has been added to sendmail. When asked about
+ this one of the sendmail developers said it was "because we still
+ believe a bit in privacy."
+ _________________________________________________________________
+
+Subject: Q4.21 -- How can I send mail to all users?
+
+ Date: December 12, 2000
+
+ There is no magic short-cut for this. But it is not hard to set up:
+ create an aliases entry
+alluser: :include:/etc/mail/allusers
+
+ Don't forget to run 'newaliases'. Then list your users, one per line,
+ in the file '/etc/mail/allusers'. You might be able to do that with
+ awk -F: '$3 > 100 { print $1 }' /etc/passwd > /etc/mail/allusers
+ _________________________________________________________________
+
+Subject: Q4.22 -- Why can't I receive external mail?
+
+ Date: December 4, 2002
+
+ Several vendors have changed the way that sendmail is run. They
+ decided that most people need a client-only version of sendmail. So it
+ is listening only on the localhost interface. Check the system
+ documentation on how to change your .mc file. Here is a partial table
+ of where some vendors ship their sendmail configuration hierarchy:
+
+ sendmail distribution ./cf
+ Solaris /usr/lib/mail
+ Red Hat 6.2 /usr/lib/sendmail-cf
+ Red Hat 7 /usr/share/sendmail-cf
+ Slackware 7.1 /usr/src/sendmail/cf
+
+ But you should check for yourself on your own system. When in doubt,
+ do a find for "proto.m4", then go up the tree one level. When you find
+ the .mc file, look for the string "DAEMON_OPTIONS" and for the comment
+ lines near that string.
+
+ See also 5.3.1.3 for discussion about this problem as it relates
+ specifically to Red Hat 7.1 and later.
+
+
+ sendmail.org
+
+ 5. VENDOR/OS SPECIFIC SENDMAIL ISSUES
+
+ * 5.1 Sun Microsystems SunOS/Solaris 1.x/2.x
+ + 5.1.1 How can I solve "line 273: replacement $3 out of
+ bounds" errors?
+ + 5.1.2 How can I solve "line 445: bad ruleset 96 (50 max)"
+ errors?
+ + 5.1.3 Why does version 8 sendmail (< 8.7.5) sometimes hang
+ under Solaris 2.5?
+ + 5.1.4 Why can't I use SunOS/Solaris to get email to certain
+ large sites?
+ + 5.1.5 Why do I have trouble compiling on Solaris?
+ + 5.1.6 How does 8.X compare to 8.X+Sun?
+ * 5.2 IBM AIX
+ + 5.2.1 The system resource controller always reports sendmail
+ as "inoperative". What's wrong?
+ + 5.2.2 Why can't I use AIX to get email to some sites?
+ + 5.2.3 Why can't I get sendmail 8.7.1 to use MX records with
+ AIX 3.2.5?
+ * 5.3 Linux
+ + 5.3.1 Red Hat
+ o 5.3.1.1 Why do I have so many sendmail problems after
+ configuring sendmail with linuxconf?
+ o 5.3.1.2 I built sendmail.cf from sendmail.mc and it
+ works until the next reboot of the machine. What is
+ going on?
+ o 5.3.1.3 Why can't I receive mail with Red Hat 7.1 and
+ later?
+ + 5.3.2 SuSE
+ o 5.3.2.1 Where is the sendmail.cf file on SuSe Linux?
+ _________________________________________________________________
+
+5.1 -- Sun Microsystems SunOS/Solaris 1.x/2.x
+ _________________________________________________________________
+
+ Q5.1.1 -- How can I solve "line 273: replacement $3 out of bounds" errors?
+
+ Date: March 23, 1996
+
+ 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") in the latest version 8 sendmail
+ distribution for a full discussion of how to do this.
+ _________________________________________________________________
+
+ Q5.1.2 -- How can I solve "line 445: bad ruleset 96 (50 max)" errors?
+
+ Date: March 23, 1996
+
+ 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 version 8 sendmail 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 (make sure you're logged in as root):
+ 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, of course, that you have installed sendmail V8 in
+ /usr/local/lib/sendmail.v8.
+ _________________________________________________________________
+
+ Q5.1.3 -- Why does version 8 sendmail (< 8.7.5) sometimes hang under Solaris
+ 2.5?
+
+ Date: May 23, 1996
+
+ In moving from Solaris 2.4 to Solaris 2.5, the kernel changed its name
+ and is now in /kernel/genunix instead of /kernel/unix, so _PATH_UNIX
+ in conf.h is pointing to the wrong place.
+
+ If you can't upgrade to the latest release of sendmail 8.8.z, the next
+ best thing to do is change _PATH_UNIX in conf.h (in the solaris2 part)
+ to point to the generic interface /dev/ksyms, like so:
+ # define _PATH_UNIX "/dev/ksyms"
+ _________________________________________________________________
+
+ Q5.1.4 -- Why can't I use SunOS/Solaris to get email to certain large sites?
+
+ Date: November 24, 1996
+
+ This is most likely a problem in your resolver libraries (DNS,
+ /etc/hosts, NIS, etc...). Older Sun (and Solaris?) resolver libraries
+ allocated enough room for only five IP addresses for each host name,
+ and if any program ever ran across a name with more than five IP
+ addresses for it, the program would crash.
+
+ For example, this would keep you from getting mail to CompuServe,
+ since (at the time of this writing) they list eleven IP addresses for
+ mx1.compuserve.com (one of the named MXes for compuserve.com).
+
+ This will affect you even if you use version 8 sendmail, since it's a
+ problem in the resolver libraries, and not in sendmail itself.
+
+ You should either get patches to the resolver libraries from Sun, or
+ the latest version of BIND (see Q2.12) and install their resolver
+ library routines. Between the two, installing BIND is a bit more work,
+ but it typically gives you much more up-to-date code to help you
+ resist attacks to your systems, more capable programs to be used for
+ serving the DNS (including support for IPv6 and several other
+ features), and some very useful utility programs.
+ _________________________________________________________________
+
+ Q5.1.5 -- Why do I have trouble compiling on Solaris?
+
+ Date: October 20, 1997
+
+ Many people have experienced compilation problems on Solaris, with the
+ compiler typically complaining about tm_zone or TopFrame. The Solaris
+ section of our Compiling Sendmail page explains these.
+ _________________________________________________________________
+
+ Q5.1.6 -- How does 8.X compare to 8.X+Sun?
+
+ Date: August 29, 1998
+
+ With a Vn/Berkeley config file, they're identical. There are a few
+ minor differences between 8.X with a Vn/Berkeley config file and
+ 8.X+Sun with the same config file, but the V line changed to Vn/Sun.
+ But most differences are the backwards compatibility hacks needed for
+ 8.X+Sun to support old V1/Sun config files.
+
+ There are three web pages which discuss these in detail: Berkeley
+ migration (from SMI-8.6 to 8.X), Sun migration (from SMI-8.6 to
+ 8.X+Sun), and Differences (5 sections comparing and contrasting config
+ files and binaries).
+ _________________________________________________________________
+
+5.2 -- IBM AIX
+ _________________________________________________________________
+
+ Q5.2.1 -- The system resource controller always reports sendmail as
+ "inoperative". What's wrong?
+
+ Date: July 5, 1996
+ Updated: January 30, 2002
+
+ When I use version 8 sendmail on an IBM RS/6000 running AIX, the
+ system resource controller always reports sendmail as "inoperative",
+ even though it's actually running. What's wrong?
+
+ When running as a daemon, sendmail detaches from its parent process,
+ fooling the SRC into thinking that sendmail has exited. To fix this,
+ issue the commands:
+ kill `head -1 /etc/sendmail.pid`
+ chssys -s sendmail -f 9 -n 15 -S -a "-bD"
+ startsrc -s sendmail -a "-bd -q30m"
+ # your sendmail args may vary
+
+ Now the SRC should report the correct status of sendmail.
+
+ For more information, read up on the System Resource Controller, the
+ lssrc command and the chssys command in the online AIX documentation.
+ _________________________________________________________________
+
+ Q5.2.2 -- Why can't I use AIX to get email to some sites?
+
+ Date: April 8, 1997
+
+ When I use IBM's sendmail on an IBM RS/6000 running AIX trying to get
+ to certain sites, it seems that I can get to some of them and not
+ others. What's wrong?
+
+ There are two possible problems here:
+
+ 1) Your version of sendmail is not configured to recognize MX records
+ in the DNS. Search through your sendmail.cf looking for "OK MX" or "OK
+ ALL". Older configurations had this line commented out, and this will
+ cause mail from you to some sites to fail (because those sites have MX
+ records, but no A records in their DNS for the specific Fully
+ Qualified Domain Name you're trying to mail to).
+
+ For more information, see the comp.unix.aix FAQ
+ ftp://rtfm.mit.edu/pub/usenet/news.answers/aix-faq/.
+
+ 2) There is a negative caching bug in AIX 3.2.5 with /usr/sbin/named
+ executables that are less than 103000 bytes long. Ask your IBM
+ representative to give you PMP 3251, or the most recent patch that
+ fixes this problem for your particular configuration and version of
+ the OS.
+ _________________________________________________________________
+
+ Q5.2.3 -- Why can't I get sendmail 8.7.1 to use MX records with AIX 3.2.5?
+
+ Date: July 5, 1996
+
+ IBM, in their infinite wisdom, provided a header file that would
+ easily mis-compile. This resulted in the struct{} for the DNS query to
+ be mis-allocated, and MX processing would barf.
+
+ Fix 1) upgrade to 8.7.5 - this has a code fix for this problem.
+
+ Fix 2) Install the BIND 4.9.4 libraries and include files and tweak
+ the Makefile.AIX to use them - I *think* these Get It Right (if not,
+ at least it'll die during compile rather than failing weirdly at
+ runtime).
+
+ Fix 3) Hack Makefile.AIX to pass a -DBIT_ZERO_ON_LEFT to cause the
+ headers to use the right #ifdefs.
+ _________________________________________________________________
+
+5.3 -- Linux
+ _________________________________________________________________
+
+ 5.3.1 -- Red Hat
+ _________________________________________________________________
+
+ 5.3.1.1 -- Why do I have so many sendmail problems after configuring
+ sendmail with linuxconf?
+
+ Date: June 15, 2000
+ Updated: September 27, 2000
+
+ Do not edit sendmail.cf with linuxconf. This tool and its module
+ "mailconf" are broken and based on very old rulesets from 8.8.7 . You
+ will have many troubles if you do this. First make sure that the
+ sendmail-cf RPM is installed. Then create your own myhost.mc file in
+ /usr/lib/sendmail-cf/cf:
+ % cd /usr/lib/sendmail-cf/cf
+ % cp redhat.mc myhost.mc
+ (Edit myhost.mc)
+ % m4 ../m4/cf.m4 myhost.mc > myhost.cf
+ (Test this new myhost.cf; once it's known good, install it:)
+ (If 8.9.x or earlier:)
+ % cp myhost.cf /etc/sendmail.cf
+ % chown root /etc/sendmail.cf
+ (If 8.10.x or later:)
+ % cp myhost.cf /etc/mail/sendmail.cf
+ % chown root /etc/mail/sendmail.cf
+
+ See /usr/doc/sendmail/README.cf (or just README) for features and
+ detailed instructions how to do this.
+ _________________________________________________________________
+
+ 5.3.1.2 -- I built sendmail.cf from sendmail.mc and it works until the next
+ reboot of the machine. What is going on?
+
+ Date: June 15, 2000
+
+ If you have used linuxconf's module "mailconf" just once, it will
+ rewrite your sendmail.cf on every reboot if it sees that sendmail.cf
+ is changed from linuxconf. The solution is to remove the mailconf
+ module from linuxconf. Turn on linuxconf and go to item
+ Control files and systems > Configure Linuxconf modules
+
+ Scroll down to "Module path -> mailconf" and turn off the button "this
+ module is active", then click "Accept" and "quit" to quit linuxconf.
+
+ This will disable linuxconf's control of sendmail. Build sendmail.cf
+ again from sendmail.mc (see 5.3.1), and restart sendmail.
+ _________________________________________________________________
+
+ 5.3.1.3 -- Why can't I receive mail with Red Hat 7.1 and later?
+
+ Date: May 3, 2001
+ Updated: June 11, 2001
+ Updated: December 4, 2002
+
+ Red Hat, like some other vendors, changed the way that sendmail is
+ run. (See 4.22 for a more general discussion of this problem.) They
+ decided that most people need a client-only version of sendmail. So it
+ is listening only on the localhost interface. Check the RH
+ documentation on how to change that:
+
+ Make sure that you have installed the "sendmail-cf" package on your
+ system -- it should be on your install media.
+
+ Then check the file "sendmail.mc" (probably in "/etc/mail"). Look for
+ the string "DAEMON_OPTIONS" and for the comment lines near that
+ string.
+
+ Also note that Red Hat 7.1 and later build sendmail with tcpwrapper
+ support, and provide a hosts.deny file that rejects all external mail.
+ The sendmail:ALL addition to hosts.allow fixes this.
+ _________________________________________________________________
+
+ 5.3.2 -- SuSE
+ _________________________________________________________________
+
+ 5.3.2.1 -- Where is the sendmail.mc file on SuSE Linux?
+
+ Date: May 5, 2002
+
+ On SuSE Linux systems there is no real sendmail.mc file. This file is
+ generated 'on the fly' by SuSEconfig using several variables in
+ /etc/rc.config and /etc/rc.config.d/sendmail.rc.config (SuSE <= 7.3)
+ or /etc/sysconfig/sendmail (SuSE >= 8.0).
+
+ SuSEconfig executes the script /sbin/conf.d/SuSEconfig.sendmail to a)
+ build a temorary .mc file b) execute m4 to generate /etc/sendmail.cf
+ and c) delete the temporary .mc file afterwards.
+
+ To make customisations you cannot achieve by modifying the variables
+ in the configuration files mentioned above (using YaST or YaST2), you
+ have two options:
+ 1. Use /etc/mail/linux.mc (or /etc/mail/linux.nullclient.mc) as a
+ starting point. Both files contain several helpful comments.
+ 2. To get a .mc file based on your current configuration, modify
+ /sbin/conf.d/SuSEconfig.sendmail to keep the temporary .mc file
+ and execute SuSEconfig afterwards. Then use that copy as starting
+ point.
+
+ In both cases you have to build your /etc/sendmail.cf (note: SuSE
+ still uses /etc not /etc/mail as suggested in the manual) using the m4
+ macroprocessor:
+m4 your.mc.file > /etc/sendmail.cf
+
+ Then reload sendmail with "rcsendmail reload".
+
+ To prevent SuSEconfig from overiding your new sendmail.cf in future
+ runs, set the variable "SENDMAIL_TYPE" in
+ /etc/rc.config.d/sendmail.rc.config to "no" (SuSE Linux <= 7.3). On
+ systems >= 8.0 you probably will have to set an "exit" command atop of
+ the file /sbin/conf.d/SuSEconfig.sendmail to do the same. SuSE 8.0
+ does not know the SENDMAIL_TYPE variable.
+
+
+ sendmail.org
+
+ 6. ADDITIONAL INFORMATION SOURCES (RFC 1807 bibliography format)
+
+ * 6.1 Reference material devoted exclusively to sendmail
+ * 6.2 Reference material with chapters or sections on sendmail
+ * 6.3 Reference material on subjects related to sendmail
+ * 6.4 World-wide web index pages on sendmail
+ * 6.5 World-wide web index pages Internet email in general
+ * 6.6 Online tutorials for sendmail
+ * 6.7 Online archives of mailing lists and Usenet newsgroups,
+ relating to Internet email
+ _________________________________________________________________
+
+Q6 -- Additional information sources
+
+ Date: April 8, 1997
+ Updated: July 20, 2002
+
+ This probably isn't in strict RFC 1807 format, but I'm getting closer.
+ Unfortunately, the format detailed in RFC 1807 was never intended to
+ be used in this fashion, so I'm doing a bit of square-peg fitting into
+ round holes.
+
+ Note that the publisher ids that I've assigned should not be
+ misconstrued to imply that I have actually published all these
+ documents, it's just that I need some sort of reasonable entry for the
+ RFC 1807 "ID" field, and in lieu of information to the contrary
+ indicating what the actual publishers have registered, I have assigned
+ my own, independent, "third-party" IDs. Hopefully, the bibliographic
+ entries below make it obvious who the real publishers of the various
+ documents are.
+ _________________________________________________________________
+
+6.1 Reference material devoted exclusively to sendmail
+
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/reference/1
+ ENTRY:: March 23, 1996
+ TYPE:: Reference manual, available online in printable format
+ REVISION:: July 19, 2002
+ TITLE:: Sendmail Installation and Operation Guide
+ AUTHOR:: Allman, Eric
+ AUTHOR:: Shapiro, Gregory
+ AUTHOR:: Aßmann, Claus
+ CONTACT:: <sendmail-questions@Sendmail.ORG>
+ DATE:: July 20, 2002
+ PAGES:: 100
+ RETRIEVAL:: Contents of manual is in doc/op/op.ps of sendmail source
+ archive
+ KEYWORD:: version 8.12.5 sendmail
+ LANGUAGE:: English
+ NOTES:: {g|n}roff "me" macro format version is in doc/op/op.me
+ See: URL:http://www.sendmail.org/
+
+ ABSTRACT::
+
+ The documentation written by Eric Allman himself, comes with the
+ sendmail distribution. It is absolutely necessary to have this guide
+ at hand at all times. Section one tells how to do an installation.
+ Section two explains day to day information you should know to run a
+ mail system. Tuning, queue management and features for access control
+ are all documented in this guide. The file in doc/op/op.me (nroff "me"
+ macro format) may have a different number of pages depending on the
+ type of device it is printed on, etc....
+
+ Check the sendmail home page for late-breaking updates and other
+ useful information.
+
+ If you want to be notified regarding future updates to sendmail and
+ other items of potential interest, you may want to subscribe to the
+ sendmail-announce mailing list. Address your subscription requests to
+ "majordomo@lists.sendmail.org" with "subscribe sendmail-announce" as
+ the body of the message.
+
+ END:: sendmail-faq//online/reference/1
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//book/ISBN/1-56592-222-0
+ ENTRY:: March 23, 1996
+ REVISION:: April 8, 1997; Updated entire entry re: 2nd Ed.
+ TYPE:: Reference book, hardcopy
+ TITLE:: sendmail
+ AUTHOR:: Costales, Bryan
+ AUTHOR:: Allman, Eric
+ CONTACT:: Bryan Costales <bcx@BCX.COM>
+ O'Reilly & Associates, Inc.
+ 103 Morris Street, Suite A
+ Sebastapol, CA 95472
+ Order by phone: 800-998-9938 (US/Canada inquiries)
+ 800-889-8969 (US/Canada credit card orders)
+ 707-829-0515 (local/overseas)
+ DATE:: January, 1997
+ PAGES:: 1021
+ COPYRIGHT:: Copyright (c) 1997 O'Reilly & Associates, Inc. All rights
+ reserved.
+ LANGUAGE:: English
+ NOTES:: See: URL:http://www.ora.com/catalog/sendmail2/
+
+ ABSTRACT::
+
+ The definitive reference for version 8 sendmail (specifically, version
+ 8.8). If you can have only one book on the subject of sendmail, this
+ one is it.
+
+ Bryan provides his consulting to the world in the form of his book,
+ unless you're willing to compensate him for his services as well. Like
+ Eric, you should make sure you've exhausted all other courses of
+ action before you spend any of his valuable time.
+
+ END:: sendmail-faq//book/ISBN/1-56592-222-0
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//book/ISBN/1-55558-127-7
+ ENTRY:: March 23, 1996
+ TYPE:: Reference book, hardcopy
+ REVISION:: Sep 9, 1996; fixed typo
+ TITLE:: Sendmail: Theory and Practice
+ AUTHOR:: Avolio, Frederick M.
+ AUTHOR:: Vixie, Paul A.
+ CONTACT:: Fred Avolio <fma@al.org>, Paul Vixie <vix@al.org>
+ Digital Press
+ 225 Wildwood Avenue
+ Woburn, MA 01801, USA
+ Ordering Info: voice 1 800 366 2665
+ fax 1 800 446 6520
+ DATE:: 1994
+ PAGES:: 262
+ COPYRIGHT:: Copyright (c) by 1995 Butterworth-Heinemann
+ LANGUAGE:: English
+ NOTES:: See: URL:http://www.vix.com/vix/smtap/
+
+ ABSTRACT::
+
+ Centers more on IDA sendmail (at least partly because version 8 didn't
+ exist when they began the book). Written more like a college Sophomore
+ or Junior level textbook.
+
+ While you'll probably never let the Costales book out of your grubby
+ little hands (especially if you do much work with version 8 sendmail),
+ this is a book you'll probably read once or maybe twice, learn some
+ very valuable things, but then likely put on a shelf and not read or
+ reference again (unless you have to write up a bibliographic entry for
+ it). Makes a better introduction to sendmail for management types,
+ especially if you don't want them getting their hands on too much
+ "dangerous" technical information. Also a *lot* smaller and less
+ imposing.
+
+ If possible, I recommend getting both, but if you can only get one,
+ get Costales unless you're going to be working exclusively with IDA
+ sendmail, in which case Avolio & Vixie will probably be more useful.
+
+ Note that Paul Vixie is extremely busy working on further development
+ of BIND, the Internet de facto standard program for serving the DNS,
+ upon which all Internet services depend, mail being only one of them.
+ Like Eric and Bryan, he's also very busy. Unless you're willing to
+ compensate him for his services, please let him get real work done.
+
+ END:: sendmail-faq//book/ISBN/1-55558-127-7
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//book/ISBN/1-56592-278-6
+ ENTRY:: April 14, 1999
+ REVISION::
+ TYPE:: Pocket size reference, hardcopy
+ TITLE:: sendmail Desktop Reference
+ AUTHOR:: Costales, Bryan
+ AUTHOR:: Allman, Eric
+ CONTACT:: Bryan Costales <bcx@BCX.COM>
+ O'Reilly & Associates, Inc.
+ 103 Morris Street, Suite A
+ Sebastapol, CA 95472
+ Order by phone: 800-998-9938 (US/Canada inquiries)
+ 800-889-8969 (US/Canada credit card orders)
+ 707-829-0515 (local/overseas)
+ DATE:: June, 1997
+ PAGES:: 68
+ COPYRIGHT:: Copyright (c) 1997 O'Reilly & Associates, Inc. All rights
+ reserved.
+ LANGUAGE:: English
+ NOTES:: See: URL:http://www.ora.com/catalog/sendmailqr/
+
+ ABSTRACT::
+
+ A companion to the sendmail book. This small guide fits in pocket and
+ saves you having to carry the thousand page book in your briefcase.
+ For detail or tutorial information, see the full sendmail book. There
+ are sections on the config file, databases and configuring with m4.
+ There are extensive cross-references to the full sendmail book.
+
+ END:: sendmail-faq//book/ISBN/1-56592-278-6
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//book/ISBN/0-7821-2737-1
+ ENTRY:: July 19, 2002
+ TYPE:: Reference book, hardcopy
+ TITLE:: Linux Sendmail Administration
+ AUTHOR:: Hunt, Craig
+ CONTACT:: SYBEX, Inc.
+ 1151 Marina Village Parkway
+ Alameda, CA 94501
+ Order on-line: www.sybex.com
+ also: Bookpool.com (www.bookpoolcom)
+ DATE:: February 2001
+ PAGES:: 457
+ LANGUAGE:: English
+
+ ABSTRACT::
+
+ This book is useful whether you run Linux or some other Unix version.
+ It attempts to simplify sendmail by covering only configuration
+ options usually needed, which reduces some complexity for new sendmail
+ administrators. Covered are: using the m4 language to build a sendmail
+ configuration, using sendmail databases such as access maps, testing
+ and debugging and using sendmail authentication techniques. Covers
+ some things not in the Costales book (the "Bat Book") which was last
+ updated for sendmail 8.8.
+
+ END:: sendmail-faq//book/ISBN/0-7821-2737-1
+ END:: sendmail-faq//book/ISBN/0-321-11570-8
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//book/ISBN/0-321-11570-8
+ ENTRY:: October 12, 2002
+ REVISION::
+ TYPE:: Reference book, hardcopy
+ TITLE:: sendmail Performance Tuning
+ AUTHOR:: Christenson, Nick
+ CONTACT:: Nick Christenson <npc@acm.org>
+ Addison-Wesley Professional
+ 75 Arlington St., Suite 300
+ Boston, MA 02116 USA
+ Order on the web at:
+ http://www.pearsonptg.com/book_detail/0,3771,0321115708,00.html
+ DATE:: September, 2002
+ PAGES:: 256
+ COPYRIGHT:: Copyright (c) 2003 by Pearson Eduction, Inc., All rights
+ reserved.
+ LANGUAGE:: English
+ NOTES:: See: URL:http://www.jetcafe.org/~npc/book/sendmail/
+
+ ABSTRACT::
+
+ As email traffic continues to increase, system administrators must be
+ able to guarantee that their email servers can deliver reliable
+ performance today and bear larger loads tomorrow. "sendmail
+ Performance Tuning" is a practical guide to building, tuning, and
+ testing email servers based on sendmail to function more efficiently,
+ handle more messages, and resist both accidental and malicious
+ load-related incidents.
+
+ END:: sendmail-faq//book/ISBN/0-321-11570-8
+ _________________________________________________________________
+
+6.2 Reference material with chapters or sections on sendmail
+
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//book/ISBN/0-13-151051-7
+ ENTRY:: March 23, 1996
+ TYPE:: Reference book, hardcopy
+ REVISION:: May 23, 1996; Updated abstract.
+ TITLE:: Unix System Administration Handbook, Second Edition
+ AUTHOR:: Nemeth, Evi
+ AUTHOR:: Snyder, Garth
+ AUTHOR:: Seebass, Scott
+ AUTHOR:: Hein, Trent R.
+ CONTACT:: <sa-book@admin.com>
+ Prentice-Hall, Inc.
+ Upper Saddle River, New Jersey 07458
+ DATE:: January, 1995
+ PAGES:: 780
+ COPYRIGHT:: Copyright (c) 1995 by Prentice Hall PTR
+ LANGUAGE:: English
+ NOTES:: See: URL:http://www.admin.com/
+
+ ABSTRACT::
+
+ Still the best hands-on Unix System Administration book around. Covers
+ far more than just sendmail, but the sixty-four pages (pages 455-518
+ in the third printing) it does devote are very well written and quite
+ useful. Also provides a version of Rob Kolstad's checksendmail script
+ on the accompanying CD-ROM.
+
+ Note that Eric Allman and Marshall Kirk McKusick wrote the Foreword
+ for the Second Edition. This should give you at least an inkling as to
+ how essential this book is, even for experienced Unix administrators.
+
+ END:: sendmail-faq//book/ISBN/0-13-151051-7
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//book/ISBN/0-201-58629=0
+ ENTRY:: March 23, 1996
+ TYPE:: Reference book, hardcopy
+ REVISION:: March 27, 1996; Changed ID format to include ISBN,
+ moved URL to NOTES field from OTHER_ACCESS field,
+ also updated ABSTRACT
+ REVISION:: March 29, 1996; Updated ID, PAGES, COPYRIGHT, and ABSTRACT
+ TITLE:: Practical Internetworking With TCP/IP and UNIX
+ AUTHOR:: Carl-Mitchell, Smoot
+ AUTHOR:: Quarterman, John S.
+ CONTACT:: <tic@tic.com>
+ Addison Wesley Publishing Company
+ Computer Science & Engineering Division
+ One Jacob Way
+ Reading, MA 01867
+ USA
+ Orders: voice://800-822-6339 (USA)
+ fax://617-942-1117
+ DATE:: 1993
+ PAGES:: 476
+ COPYRIGHT:: Copyright (c) 1993 by Addison-Wesley Publishing
+ Company, Inc.
+ LANGUAGE:: English
+ NOTES:: See URL:http://heg-school.aw.com/cseng/authors/mitchell/
+ practical/practical.html
+
+ ABSTRACT::
+
+ Devotes 50 pages (most of chapter 8) to discussion of sendmail. As far
+ as TCP/IP networking books go that also happen to discuss sendmail, it
+ seems well-written and clear (better than I recall Hunt's book being),
+ but rather dated in the face of books devoted to the topic and all the
+ recent development activity in the sendmail community. Forget about
+ the references, though. The newest sendmail-related reference listed
+ is dated 1983, ten years before the date on this book and most
+ certainly wildly out-of-date now.
+
+ There are other books written on the subject of Internetworking with
+ TCP/IP (most notably Comer), but this particular book seems to have a
+ unique mix of theory (if perhaps a bit dated) and practical advice.
+ Other books tend to have lots of one or the other, or split their
+ theory and nitty-gritty details into separate books in a series (like
+ Comer).
+
+ Assuming that an update will be coming out soon, it probably deserves
+ a place on the shelf of most System or Network Administrators, right
+ next to _Internetworking with TCP/IP_ by Comer, _Managing Internet
+ Information Services_ by Liu, et. al., _DNS and BIND_ by Albitz and
+ Liu, _Unix System Administration_ by Nemeth, et. al., and last, but
+ certainly not least, _sendmail_ by Costales. However, it deserves this
+ place more because of the non-sendmail related material, as opposed to
+ what sendmail-related material there is.
+
+ END:: sendmail-faq//book/ISBN/0-201-58629-0
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//book/ISBN/1-56592-322-7
+ ENTRY:: April 14, 1999
+ TYPE:: Reference book, hardcopy
+ REVISION:: July 20, 2002
+ TITLE:: TCP/IP Network Administration 3rd Edition
+ AUTHOR:: Hunt, Craig
+ CONTACT:: O'Reilly & Associates, Inc.
+ 1005 Gravenstein Highway North
+ Sebastapol, CA 95472
+ Bookstores Carrying O'Reilly Books:
+ www.oreilly.com/sales/bookstores
+ also: Bookpool.com (www.bookpool.com)
+ DATE:: April, 2002
+ PAGES:: 725
+ LANGUAGE:: English
+ NOTES:: See: URL:http://www.ora.com/catalog/tcp3/
+
+ ABSTRACT::
+
+ Chapter 10 consists of 50 pages devoted to sendmail. Appendix E is a
+ 60 page sendmail reference which covers compiling sendmail, m4
+ compiler options, sendmail command line arguments, and sendmail
+ configuration. A very good treatment of sendmail, less daunting and
+ more current than the 2nd edition Costales book. The introductary
+ chapters of the book are also helpful in understanding the big picture
+ of network services.
+
+ END:: sendmail-faq//book/ISBN/1-56592-322-7
+ _________________________________________________________________
+
+6.3 Reference material on subjects related to sendmail
+
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//book/ISBN/1-56592-512-2
+ ENTRY:: April 14, 1999
+ TYPE:: Reference book, hardcopy
+ REVISION:: April 14, 1999; Updated entire entry for 3rd Ed.
+ TITLE:: DNS and BIND 3rd Edition
+ AUTHOR:: Albitz, Paul
+ AUTHOR:: Liu, Cricket
+ CONTACT:: O'Reilly & Associates, Inc.
+ 103 Morris Street, Suite A
+ Order by phone: 800-998-9938 (US/Canada inquiries)
+ 800-889-8969 (US/Canada credit card orders)
+ 707-829-0515 (local/overseas)
+ DATE:: September, 1998
+ PAGES:: 502
+ COPYRIGHT:: Copyright (c) 1998 O'Reilly & Associates, Inc. All rights
+ reserved.
+ LANGUAGE:: English
+ NOTES:: See: URL:http://www.ora.com/catalog/dns3/
+
+ ABSTRACT::
+
+ As definitive as Costales is on sendmail, this book is on the subject
+ of the Domain Name System (DNS) and the most common server software
+ for the DNS, namely BIND.
+
+ The third edition deals with the new 8.1.2 version of BIND as well as
+ the older 4.9 versions. Wherever there is a difference in behavior of
+ the versions, the book points out which version does what. Anyone
+ still using the first edition should strongly consider replacing it
+ now since the new features will be the basis for the next generation
+ of name servers.
+
+ Since the sending of Internet mail is so very heavily dependent on the
+ DNS, it obviously also belongs on the shelf of any Postmaster or
+ System Administrator whose site does Internet email. That means
+ virtually every administrator of every site on the Internet.
+
+ END:: sendmail-faq//book/ISBN/1-56592-512-2
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//book/ISBN/1-56592-153-4
+ ENTRY:: April 8, 1997
+ TYPE:: Reference book, hardcopy
+ TITLE:: Using & Managing UUCP
+ AUTHOR:: Ravin, Ed
+ AUTHOR:: O'Reilly, Tim
+ AUTHOR:: Dougherty, Dale
+ AUTHOR:: Todino, Grace
+ CONTACT:: O'Reilly & Associates, Inc.
+ 103 Morris Street, Suite A
+ Order by phone: 800-998-9938 (US/Canada inquiries)
+ 800-889-8969 (US/Canada credit card orders)
+ 707-829-0515 (local/overseas)
+ DATE:: September, 1996
+ PAGES:: 424
+ LANGUAGE:: English
+ NOTES:: See: URL:http://www.ora.com/catalog/umuucp/
+
+ ABSTRACT::
+
+ Replaces _Managing UUCP and Usenet_ by Todino and O'Reilly as the
+ definitive book for using, installing, and managing UUCP.
+
+ The general assumption with version 8 sendmail is that virtually no
+ one uses UUCP to send email anymore, but if that assumption isn't true
+ for you, then you probably need this book.
+
+ END:: sendmail-faq//book/ISBN/1-56592-153-4
+ _________________________________________________________________
+
+6.4 World-wide web index/resource pages on sendmail
+
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/index/10
+ ENTRY:: March 23, 1996
+ TYPE:: Online sendmail index
+ REVISION:: April 14, 1999; updated to sendmail.org address
+ TITLE:: sendmail FAQ Support Page
+ AUTHOR:: Beck, John
+ CONTACT:: John Beck <sendmail+faq@sendmail.org>
+OTHER_ACCESS:: URL:http://www.sendmail.org/faq/
+ LANGUAGE:: English
+
+ ABSTRACT::
+
+ Support Page for this FAQ.
+
+ END:: sendmail-faq//online/index/10
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/index/17
+ ENTRY:: March 25, 1996
+ TYPE:: Online sendmail index
+ REVISION:: April 14, 1999; updated to sendmail.org address
+ TITLE:: comp.mail.sendmail Most Frequently Asked Questions Support Page
+ AUTHOR:: Aßmann, Claus
+ CONTACT:: Claus Aßmann <ca@sendmail.org>
+OTHER_ACCESS:: URL:http://www.sendmail.org/~ca/email/english.html
+ LANGUAGE:: English
+
+ ABSTRACT::
+
+ Most Frequently Asked Questions on comp.mail.sendmail and their
+ answers. Also has some links to a few other resources.
+
+ END:: sendmail-faq//online/index/17
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/resources/22
+ ENTRY:: November 24, 1996
+ TITLE:: IICONS Sendmail Resources
+ AUTHOR:: Caloca, Paul
+ CONTACT:: Paul Caloca <pcaloca@iicons.com>
+ COPYRIGHT:: Copyright (c) 1996 Paul Caloca. All Rights Reserved.
+OTHER_ACCESS:: URL:http://www.iicons.com/sendmail/index.html
+ LANGUAGE:: English
+
+ ABSTRACT::
+
+ Provides information on how to compile Sendmail and the NEWDB db.1.85
+ for Solaris 2. Also has a section on which Sun patches update Solaris
+ 2 to BIND 4.9.3.
+
+ Has pointers to some non-Sun/Solaris sendmail resources, especially
+ including CERT Advisories related to sendmail.
+
+ END:: sendmail-faq//online/index/22
+ _________________________________________________________________
+
+6.5 World-wide web index pages and other reference on Internet email in general
+
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/index/12
+ ENTRY:: March 23, 1996
+ TYPE:: Online general Internet email index
+ REVISION:: March 27, 1996; moved URL from RETRIEVAL field to
+ OTHER_ACCESS field.
+ TITLE:: Internet Mail Consortium web site
+ CORP-AUTHOR:: Internet Mail Consortium
+ CONTACT:: <info@imc.org>
+OTHER_ACCESS:: URL:http://www.imc.org/
+ LANGUAGE:: English
+
+ ABSTRACT::
+
+ If it has to do with Internet email, you'll probably find it here or a
+ link to it from here.
+
+ They have or have information on email-related Usenet FAQs, RFCs,
+ Internet Drafts (documents that are in the process of becoming RFCs),
+ IETF Working Groups, security standards, and are running a few
+ email-related mailing lists.
+
+ Tends to be focussed on the standards issues.
+
+ If you care about Internet email, you should make it your duty in life
+ to check this site frequently.
+
+ END:: sendmail-faq//online/index/12
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/index/13
+ ENTRY:: March 23, 1996
+ TYPE:: Online general Internet email index
+ REVISION:: August 20, 1996; Updated URL.
+ TITLE:: Email References
+ AUTHOR:: Wohler, Bill
+ CONTACT:: Bill Wohler <wohler@worldtalk.com>
+OTHER_ACCESS:: URL:http://www.worldtalk.com/html/msg_resources/email_ref.html
+ LANGUAGE:: English
+
+ ABSTRACT::
+
+ The most exhaustive index site I know of for Internet email related
+ documents outside of the Internet Mail Consortium.
+
+ Also has pointers to other organizations that relate to Internet
+ email, such as the Electronic Messaging Association and the European
+ Electronic Messaging Association.
+
+ Tends to be focussed on the server and standards issues.
+
+ END:: sendmail-faq//online/index/13
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/index/14
+ ENTRY:: March 23, 1996
+ TYPE:: Online general Internet email index
+ REVISION:: June 28, 1996; Added acronym for SMTPRD
+ TITLE:: SMTP Resources Directory (SMTPRD)
+ AUTHOR:: Salamon, Andras
+ AUTHOR:: Knowles, Brad
+ CONTACT:: Andras Salamon <smtprd@dns.net>
+OTHER_ACCESS:: URL:http://www.dns.net/smtprd/
+ LANGUAGE:: English
+
+ ABSTRACT::
+
+ Another good index site, but still very much in the early phases of
+ gestation. Based very heavily on the DNS Resources Directory, also by
+ Andras Salamon.
+
+ A well-rounded site, for the amount of material it covers so far.
+
+ END:: sendmail-faq//online/index/14
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/index/15
+ ENTRY:: March 23, 1996
+ TYPE:: Online general Internet email index
+ REVISION:: March 27, 1996; moved URL from RETRIEVAL field to
+ OTHER_ACCESS field.
+ TITLE:: E-Mail Web Resources
+ AUTHOR:: Wall, Matt
+ CONTACT:: Matt Wall <wall+@cmu.edu>
+OTHER_ACCESS:: URL:http://andrew2.andrew.cmu.edu/cyrus/email/email.html
+ LANGUAGE:: English
+
+ ABSTRACT::
+
+ Another good index site, tends to be more focussed on client side and
+ LAN email packages. Also lists some email services, which no one else
+ that I've seen appears to have taken the time to catalog.
+
+ Excellent side-by-side feature comparison of various MUAs and their
+ compliance with various Internet protocols.
+
+ END:: sendmail-faq//online/index/15
+ _________________________________________________________________
+
+6.6 Online tutorials for sendmail
+
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/tutorial/9
+ ENTRY:: March 23, 1996
+ TYPE:: Online sendmail tutorial
+ REVISION:: March 27, 1996; moved URL from RETRIEVAL field to
+ OTHER_ACCESS field.
+ REVISION:: August 29, 1998; updated URL.
+ TITLE:: Sendmail V8: A (Smoother) Engine Powers Network Email
+ AUTHOR:: Reich, Richard
+ CONTACT:: Richard Reich <richard@reich.com>
+ DATE:: February 8, 1996
+ COPYRIGHT:: Copyright (c) 1995 The McGraw-Hill Companies, Inc.
+ All Rights Reserved.
+OTHER_ACCESS:: URL:http://www.networkcomputing.com/unixworld/tutorial/
+ 008/008.txt.html
+ LANGUAGE:: English
+ NOTES:: UnixWorld Online: Tutorial: Article No. 008
+
+ ABSTRACT::
+
+ Good technical introduction. Some useful references. Notably does not
+ reference this FAQ as a place to get more information.
+
+ END:: sendmail-faq//online/article/9
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/tutorial/16
+ ENTRY:: March 23, 1996
+ TYPE:: Online sendmail tutorial
+ REVISION:: March 27, 1996; moved URL from RETRIEVAL field to
+ OTHER_ACCESS field.
+ TITLE:: Sendmail -- Care and Feeding
+ AUTHOR:: Quinton, Reg
+ CONTACT:: Reg Quinton <reggers@julian.uwo.ca>
+ Computing and Communications Services
+ The University of Western Ontario
+ London, Ontario N6A 5B7
+ Canada
+ DATE:: March 24, 1992
+OTHER_ACCESS:: URL:ftp://ftp.sterling.com/mail/sendmail/uwo-course/
+ sendmail.txt.Z
+ LANGUAGE:: English
+ NOTES:: Postscript version also available. See ftp://ftp.sterling.com/
+ mail/sendmail/uwo-course/sendmail.ps.Z
+
+ ABSTRACT::
+
+ Dated. Only here until I find better.
+
+ END:: sendmail-faq//online/tutorial/16
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/tutorial/21
+ ENTRY:: March 27, 1996
+ TYPE:: Online sendmail tutorial
+ REVISION:: August 29, 1998; updated URL.
+ TITLE:: Explosion in a Punctuation Factory
+ AUTHOR:: Bryan Costales
+ CONTACT:: Becca Thomas <editor@unixworld.com>
+ DATE:: January 1994
+ COPYRIGHT:: Copyright (c) 1995 The McGraw-Hill Companies, Inc.
+ All Rights Reserved.
+OTHER_ACCESS:: URL:http://www.networkcomputing.com/unixworld/tutorial/
+ 01/01.txt.html
+ LANGUAGE:: English
+
+ ABSTRACT::
+
+ Good introduction on how sendmail re-write rules work.
+
+ END:: sendmail-faq//online/article/21
+ _________________________________________________________________
+
+6.7 Online archives of mailing lists and Usenet newsgroups, relating to
+Internet email
+
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/archive/18
+ ENTRY:: March 25, 1996
+ TYPE:: Online Usenet newgroup archive
+ REVISION:: March 27, 1996; moved URL from RETRIEVAL field to
+ OTHER_ACCESS field.
+ TITLE:: DejaNews
+OTHER_ACCESS:: URL:http://www.dejanews.com
+ LANGUAGE:: English
+ NOTES:: Archives/indexes only Usenet news.
+
+ ABSTRACT::
+
+ The first, and still most focussed, Usenet news archive/index site.
+ Others archive/index news as well as other things, but none that I've
+ seen do it better.
+
+ Go to "Power Search" then "Query Filter" if you wish to restrict the
+ newsgroups you search on to something like just comp.mail.sendmail and
+ not all newsgroups.
+
+ END:: sendmail-faq//online/archive/18
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/archive/19
+ ENTRY:: March 25, 1996
+ TYPE:: Online Usenet newgroup archive
+ REVISION:: March 27, 1996; moved URL from RETRIEVAL field to
+ OTHER_ACCESS field.
+ TITLE:: AltaVista
+OTHER_ACCESS:: URL:http://www.altavista.digital.com
+ LANGUAGE:: English
+ NOTES:: Archives/indexes Usenet news and World-wide web pages.
+
+ ABSTRACT::
+
+ One of the leading indexes of world-wide web pages, and their
+ archive/index of Usenet news is obviously secondary.
+
+ END:: sendmail-faq//online/archive/19
+ BIB-VERSION:: CS-TR-v2.1
+ ID:: sendmail-faq//online/archive/20
+ ENTRY:: March 16, 2001
+ TYPE:: Online Usenet newgroup archive
+ REVISION::
+ TITLE:: Google Advance Search
+OTHER_ACCESS:: URL:http://www.google.com/advanced_search
+ LANGUAGE:: English
+
+ ABSTRACT::
+
+ Google has acquired DejaNews. This is the search tool for news
+ archive. It works very well and you can see a whole thread in one web
+ screen which makes it quick and easy to read responses which follow
+ any question.
+
+ END:: sendmail-faq//online/archive/20
+
+
+ sendmail.org 7. THANKS!
+
+ Special thanks to:
+
+ Eric Allman The core of the material here comes from his FAQ for
+ version 8.6.9 sendmail. I couldn't even have gotten started were it
+ not for him. And if he hadn't written sendmail, there obviously
+ wouldn't even be a FAQ. Heck, there might not even be an Internet.
+ Paul Southworth Provides FAQ posting services, useful comments on
+ various sections, and the mailclient-faq. I couldn't have kept doing
+ this were it not for his help.
+ Ed Ravin Virtually all the material regarding the use of sendmail on
+ AIX is his, and most of it has been carried over verbatim.
+
+ Thanks also to:
+
+ Neil Hoggarth, Andras Salamon, Johan Svensson, Christopher X.
+ Candreva, Bill Wohler, Matthew Wall, Henry W. Farkas, Claus Assmann,
+ Curt Sampson, Rebecca Lasher, Jim Davis, David Keegel, Betty Lee,
+ Alain Durand, Walter Schweizer, Christophe Wolfhugel, Al Gilman,
+ Valdis Kletnieks, John Gardiner Myers, Paul DuBois, Adam Bentley, Dave
+ Sill, Dave Wreski, Paul Caloca, Eamonn Coleman, Michael Fuhr, Betty
+ Lee, Derrell Lipman, Era Eriksson, Richard Troxel, and the readers and
+ posters of comp.mail.sendmail.
+
diff --git a/debian/libmilter-dev.dirs.in b/debian/libmilter-dev.dirs.in
new file mode 100644
index 0000000..2a5f027
--- /dev/null
+++ b/debian/libmilter-dev.dirs.in
@@ -0,0 +1,3 @@
+@includedir@/libmilter
+@libdir@/libmilter
+@docdir@/libmilter-dev
diff --git a/debian/libmilter-dev.postinst b/debian/libmilter-dev.postinst
new file mode 100644
index 0000000..bf0ac2a
--- /dev/null
+++ b/debian/libmilter-dev.postinst
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+#
+# Debian post installation script
+#
+# Install of already installed package:
+# 1) old-prerm upgrade new-version
+# *) new-prerm failed-upgrade old-version
+# *) old-postinst abort-upgrade new-version
+#
+# If a `conflicting' package is being removed at the same time:
+# 1) forall packages depending on conflicting package and --auto-deconfigure
+# deconfigured's-prerm deconfigure \
+# in-favour package-being-installed version \
+# removing conflicting-package version
+# *) deconfigured's-postinst abort-deconfigure \
+# in-favour package-being-installed-but-failed version \
+# removing conflicting-package version
+# 2) To prepare for removal of the conflicting package
+# conflictor's-prerm remove \
+# in-favour package new-version
+# *) conflictor's-postinst abort-remove \
+# in-favour package new-version
+#
+# Configuration of package:
+# postinst configure most-recently-configured-version
+#
+set -e;
+
+PACKAGE=`echo "$(basename $0)" | sed -e 's/\.postinst$//'`;
+
+case "$1" in
+ configure)
+ # continue below
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ exit 0;
+ ;;
+
+ *)
+ echo "$PACKAGE postinst called with unknown argument \`$1'" >&2;
+ exit 1;
+ ;;
+ esac;
+
+#DEBHELPER#
+exit 0;
diff --git a/debian/libmilter-dev.postrm.in b/debian/libmilter-dev.postrm.in
new file mode 100644
index 0000000..eafb8f2
--- /dev/null
+++ b/debian/libmilter-dev.postrm.in
@@ -0,0 +1,53 @@
+#!/bin/sh -e
+#
+# Debian post removal script
+#
+# Install of already installed package:
+# 1) Upgrade of package:
+# new-preinst upgrade old-version
+# *) new-postrm abort-upgrade old-version
+# 2) package had some configuration files from a previous version installed
+# new-preinst install old-version
+# *) new-postrm abort-install old-version
+# 3) Otherwise (i.e., the package was completely purged)
+# new-preinst install
+# *) new-postrm abort-install
+#
+# Removal of a package:
+# 1) prerm remove
+# 2) The package's files are removed (except conffiles).
+# 3) postrm remove
+# 4) All the maintainer scripts except the postrm are removed.
+# 5) The conffiles and any backup files
+# (~-files, #*# files, %-files, .dpkg-{old,new,tmp}, etc.) are removed.
+# 6) postrm purge
+# 7) The package's file list is removed
+#
+set -e;
+
+PACKAGE=`echo "$(basename $0)" | sed -e 's/\.postrm$//'`;
+
+case "$1" in
+ remove)
+ # /usr/share/doc/libmilter-dev is a symlink to /usr/share/doc/sendmail
+ rm -f @docdir@/libmilter-dev 2>/dev/null || true;
+ rmdir @docdir@/sendmail 2>/dev/null || true;
+ ;;
+
+ purge)
+ ;;
+
+ upgrade)
+ ;;
+
+ failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "$PACKAGE postrm called with unknown argument \`$1'" >&2;
+ exit 1;
+ ;;
+ esac;
+
+#DEBHELPER#
+exit 0;
diff --git a/debian/libmilter-dev.preinst.in b/debian/libmilter-dev.preinst.in
new file mode 100644
index 0000000..eda0c38
--- /dev/null
+++ b/debian/libmilter-dev.preinst.in
@@ -0,0 +1,55 @@
+#!/bin/sh -e
+#
+# Debian pre install script
+#
+# Install of already installed package:
+# 1) Upgrade of package:
+# new-preinst upgrade old-version
+# *) new-postrm abort-upgrade old-version
+# 2) package had some configuration files from a previous version installed
+# new-preinst install old-version
+# *) new-postrm abort-install old-version
+# 3) Otherwise (i.e., the package was completely purged)
+# new-preinst install
+# *) new-postrm abort-install
+#
+set -e;
+
+PACKAGE=`echo "$(basename $0)" | sed -e 's/\.preinst$//'`;
+
+case "$1" in
+ install)
+ # DPKG doesn't overwrite directories with symlinks...
+ if [ -d @docdir@/libmilter-dev ]; then
+ rm -rf @docdir@/libmilter-dev;
+ fi;
+ if [ ! -d @docdir@/sendmail ]; then
+ mkdir -p @docdir@/sendmail;
+ chmod a+rx @docdir@/sendmail;
+ fi;
+ ln -sf sendmail @docdir@/libmilter-dev;
+ ;;
+
+ upgrade)
+ # DPKG doesn't overwrite directories with symlinks...
+ if [ -d @docdir@/libmilter-dev ]; then
+ rm -rf @docdir@/libmilter-dev;
+ fi;
+ if [ ! -d @docdir@/sendmail ]; then
+ mkdir -p @docdir@/sendmail;
+ chmod a+rx @docdir@/sendmail;
+ fi;
+ ln -sf sendmail @docdir@/libmilter-dev;
+ ;;
+
+ abort-upgrade)
+ ;;
+
+ *)
+ echo "$PACKAGE preinst called with unknown argument \`$1'" >&2;
+ exit 1;
+ ;;
+ esac;
+
+#DEBHELPER#
+exit 0;
diff --git a/debian/libmilter-dev.prerm b/debian/libmilter-dev.prerm
new file mode 100644
index 0000000..966dfdd
--- /dev/null
+++ b/debian/libmilter-dev.prerm
@@ -0,0 +1,54 @@
+#!/bin/sh -e
+#
+# Debian pre removal script
+#
+# Install of already installed package:
+# 1) old-prerm upgrade new-version
+# *) new-prerm failed-upgrade old-version
+# *) old-postinst abort-upgrade new-version
+#
+# If a `conflicting' package is being removed at the same time:
+# 1) forall packages depending on conflicting package and --auto-deconfigure
+# deconfigured's-prerm deconfigure \
+# in-favour package-being-installed version \
+# removing conflicting-package version
+# *) deconfigured's-postinst abort-deconfigure \
+# in-favour package-being-installed-but-failed version \
+# removing conflicting-package version
+# 2) To prepare for removal of the conflicting package
+# conflictor's-prerm remove \
+# in-favour package new-version
+# *) conflictor's-postinst abort-remove \
+# in-favour package new-version
+#
+# Removal of a package:
+# 1) prerm remove
+# 2) The package's files are removed (except conffiles).
+# 3) postrm remove
+# 4) All the maintainer scripts except the postrm are removed.
+#
+set -e;
+
+PACKAGE=`echo "$(basename $0)" | sed -e 's/\.prerm$//'`;
+
+case "$1" in
+ remove)
+ ;;
+
+ upgrade)
+ ;;
+
+ failed-upgrade)
+ ;;
+
+ deconfigure)
+ ;;
+
+ *)
+ echo "$PACKAGE prerm called with unknown argument \`$1'" >&2;
+ exit 1;
+ ;;
+ esac;
+
+#DEBHELPER#
+exit 0;
diff --git a/debian/local/Makefile.in b/debian/local/Makefile.in
new file mode 100644
index 0000000..be8f93f
--- /dev/null
+++ b/debian/local/Makefile.in
@@ -0,0 +1,143 @@
+#!/usr/bin/make -f
+#------------------------------------------------------------------------------
+# vim: syntax=make
+#
+# $Sendmail: Makefile,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# Rules file for Sendmail @sm_version@@sm_revision@(@sm_version_math@)
+# on @sm_dist_name@ @sm_dist_vers@
+# via Debhelper V@DEBIAN_DH@
+#
+# Note: the .in file supports Sendmail @SM_MINVERS@ - @SM_MAXVERS@
+# on Debian slink, potato, woody, testing, sid, ...
+# but the generated file is customized to the version noted above.
+#
+# Richard Nelson <cowboy@debian.org> @sm_date@ @sm_time@ (@sm_utc@)
+#------------------------------------------------------------------------------
+#SHELL=/bin/sh -x
+
+# Include Debian Autoconf settings
+-include ../build/autoconf.mk
+
+SCRIPTS := \
+ parse_mc \
+ Parse_mc.pm \
+ sendmailconfig \
+ sendmail \
+ update_auth \
+ update_conf \
+ update_db \
+ update_mc \
+ update_ldap \
+ update_mk \
+ update_notices \
+ update_sendmail \
+ update_smrsh \
+ update_sys \
+ update_tcpd \
+ update_tls \
+
+all: ;
+
+clean:
+ rm -rf core *~ qtool.new;
+
+setup:
+ for file in $${SCRIPTS}; do \
+ chmod ug+x $$file; \
+ done;
+
+build-indep: setup
+build-arch: setup
+
+install-indep: build-indep
+install-arch: build-arch
+ #
+ # Debian Local additions / changes
+ #
+ # ${sysconfdir}/mail - unconditional
+ #
+ $(INSTALL) -d -o mail -g mail ${sysconfdir}/mail/peers;
+ $(INSTALL_DATA) -o mail -g mail provider \
+ ${sysconfdir}/mail/peers/provider;
+ $(INSTALL_DATA) -o mail -g mail service.switch* ${sysconfdir}/mail/;
+ #
+ # ${bindir} - unconditional
+ #
+ $(INSTALL) -d ${bindir};
+ ln -sf ../share/sendmail/sendmail ${bindir}/mailq;
+ #
+ # ${sbindir} - unconditional
+ #
+ $(INSTALL) -d ${sbindir};
+ $(INSTALL) -d ${mandir}/man8;
+ ln -sf ../share/sendmail/sendmail ${sbindir}/mailstats;
+ ln -sf ../share/sendmail/sendmail ${sbindir}/purgestat;
+ ln -sf ../share/sendmail/sendmail ${sbindir}/runq;
+ $(INSTALL_DATA) runq.8 ${mandir}/man8;
+ $(INSTALL_SCRIPT) sendmailconfig ${sbindir};
+ $(INSTALL_DATA) sendmailconfig.8 ${mandir}/man8;
+ #
+ # ${datadir} - conditional
+ #
+ if (grep -qEe "^#LDAP:[[:space:]]*yes" ../build/site.config.m4); then \
+ $(INSTALL_SCRIPT) update_ldap ${datadir}/sendmail; \
+ fi;
+ if (grep -qEe "^#AUTH:[[:space:]]*yes" ../build/site.config.m4); then \
+ $(INSTALL_SCRIPT) update_auth ${datadir}/sendmail; \
+ fi;
+ if (grep -qEe "^#TLS:[[:space:]]*yes" ../build/site.config.m4); then \
+ $(INSTALL_SCRIPT) update_tls ${datadir}/sendmail; \
+ fi;
+ #
+ # ${datadir}/sendmail - unconditional
+ #
+ $(INSTALL) -d ${datadir}/sendmail;
+ $(INSTALL_SCRIPT) parse_mc ${datadir}/sendmail;
+ $(INSTALL_SCRIPT) Parse_mc.pm ${datadir}/sendmail;
+ $(INSTALL_SCRIPT) sendmail ${datadir}/sendmail;
+ $(INSTALL_SCRIPT) update_conf ${datadir}/sendmail;
+ $(INSTALL_SCRIPT) update_db ${datadir}/sendmail;
+ $(INSTALL_SCRIPT) update_mc ${datadir}/sendmail;
+ $(INSTALL_SCRIPT) update_mk ${datadir}/sendmail;
+ $(INSTALL_SCRIPT) update_notices ${datadir}/sendmail;
+ $(INSTALL_SCRIPT) update_sendmail ${datadir}/sendmail;
+ $(INSTALL_SCRIPT) update_smrsh ${datadir}/sendmail;
+ $(INSTALL_SCRIPT) update_sys ${datadir}/sendmail;
+ $(INSTALL_SCRIPT) update_tcpd ${datadir}/sendmail;
+ #
+ # ${datadir}/sendmail - conditional
+ #
+ $(INSTALL) -d ${datadir}/sendmail;
+ if [ ! -f ${datadir}/sendmail/qtool.pl ]; then \
+ sed -e 's?/usr/bin/env perl?/usr/bin/perl?g' \
+ qtool.pl > qtool.new; \
+ $(INSTALL_SCRIPT) qtool.new ${datadir}/sendmail/qtool.pl; \
+ $(INSTALL_DATA) qtool.8 ${mandir}/man8; \
+ fi;
+ #
+ # ${datadir}/sendmail/cf/feature - conditional
+ #
+ $(INSTALL) -d ${datadir}/sendmail/cf/feature;
+ if [ ! -e ${datadir}/sendmail/cf/feature/local_no_masquerade.m4 ]; then \
+ $(INSTALL_DATA) local_no_masquerade.m4 \
+ ${datadir}/sendmail/cf/feature; \
+ fi;
+
+#-------------
+# Below here is fairly generic really
+
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+build: build-indep build-arch
+install: install-indep install-arch
+.PHONY: all
+.PHONY: setup
+.PHONY: clean build build-indep build-arch
+.PHONY: install install-indep install-arch
+.PHONY: source diff
diff --git a/debian/local/Parse_mc.pm.in b/debian/local/Parse_mc.pm.in
new file mode 100644
index 0000000..a80b754
--- /dev/null
+++ b/debian/local/Parse_mc.pm.in
@@ -0,0 +1,933 @@
+#!/usr/bin/perl -w
+#------------------------------------------------------------------------
+#
+# $Sendmail: Parse_mc.pm,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Parse Sendmail config for databases
+#
+# Copyright (c) 2001-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# Notes (to all):
+# * for "define(xxx,...)"; "define(xxx," must be on same line, but the
+# rest may be split across multiple lines
+# * assumes makemap dbtype /etc/mail/database < /etc/mail/database
+#
+# Notes (to self):
+# * changes made herein *must* be reflected in
+# parse_mc,update_mk,update_db,debian.m4
+# * userdb can also have multiple databases and then a forward!
+# * Cert support
+# * undefine support
+# * include support (also for OSTYPE, DOMAIN, SITE, etc)
+# * F and K lines
+#
+#------------------------------------------------------------------------
+#
+# Package/Module declaration
+package Parse_mc;
+require Exporter;
+@ISA = qw(Exporter);
+#@EXPORT = qw(read_mc write_dbs read_dbs);
+@EXPORT_OK = qw(read_mc write_dbs read_dbs
+ names_dbs restart_dbs entry_dbs);
+$VERSION = '2.0002';
+#
+# Initialization of the perl environment
+use strict; # be kosher
+#use warnings; # Not needed here
+use Cwd; # provide cwd()
+use Env; # A few environmental references
+use integer; # Peformance
+use Sys::Hostname; # make sure we have a valid hostname
+use Getopt::Long; # parameter handling
+use FileHandle; # I/O
+
+# Version of this program
+#($main::MYNAME = $main::0) =~ s|.*/||;
+#$main::Author = "Richard Nelson";
+#$main::AuthorMail = "cowboy\@debian.org";
+#$main::Version = '$Revision: 2.00 $ ';
+$Parse_mc::program_name = 'Parse_mc.pm';
+$Parse_mc::program_version = '@sm_version@';
+$Parse_mc::program_date = '@sm_date@ @sm_time@ cowboy';
+
+my $interp_pgm = "$^X";
+my $interp_vrm = $];
+$interp_vrm = ("$^V" | '000') if (defined $^V);
+my $current_time = scalar localtime;
+my $user = getlogin || (getpwuid($<))[$[] || "Unknown!!";
+my $hostname = hostname();
+my $directory = getcwd();
+
+$Parse_mc::input_files = "@sysconfdir@/mail/sendmail.mc";
+$Parse_mc::database_file = "@sysconfdir@/mail/databases";
+
+my $debug;
+
+#
+# List of FEATURE()s, and their default file names (in path ${smdb_loc})
+my %smdb_features = (
+ access_db => 'access'
+ ,authinfo => 'authinfo'
+ ,bitdomain => 'bitdomain'
+ ,domaintable => 'domaintable'
+ ,genericstable => 'genericstable'
+ ,mailertable => 'mailertable'
+ ,use_cw_file => 'use_cw_file'
+ ,use_ct_file => 'use_ct_file'
+ ,uucpdomain => 'uudomain'
+ ,virtusertable => 'virtusertable'
+ );
+
+# List of classes, and a flag to note if it is reasonable to parse it
+my %smdb_classes = (
+ '' => 1 # Default, no class
+ ,'-' => 1 # ditto
+ ,bestmx => 0 # Lookup best MX record for host
+ ,btree => 1 # NEWDB
+ ,dbm => 1 # NDBM
+ ,dequote => 0 # Remove quotes
+ ,dnsmap => 0 # DNSMAP
+ ,hash => 1 # NEWDB
+ ,hesiod => 1 # HESIOD
+ ,host => 0 # Internal hostname lookup
+ ,implicit => 0 # Search for alias database
+ ,ldap => 0 # LDAPMAP
+ ,nis => 1 # NIS
+ ,nisplus => 1 # NISPLUS
+ ,null => 0 # Always returns false
+ ,program => 1 # Run an external program
+ ,sequence => 0 # Search a series of maps
+ ,stab => 0 # Internal alias
+ ,switch => 0 # Internal alias auto-build
+ ,text => 1 # Lookup in flat text file
+ ,userdb => 1 # Lookup in userdb
+ ,user => 1 # lookup passwd
+ ,newaliases => 1 # for internal usage (of this script)
+ );
+
+#
+#------------------------------------------------------------------------------
+# Prefill entries based upon Sendmail/Debian defaults
+# Yeah, this is long winded, but it needs to be said...
+#------------------------------------------------------------------------------
+my $smdb_loc = "@sysconfdir@/mail/";
+my $smdb_type = 'hash';
+my %smdb_hash = (
+ 'MAIL_SETTINGS_DIR' =>
+ ['-','-',["${smdb_loc}"],'-']
+ ,'DATABASE_MAP_TYPE' =>
+ ["${smdb_type}",'-',['-'],'-']
+ ,'sendmail.cf' =>
+ ['m4','-',["${smdb_loc}sendmail.mc"],'-']
+
+ ,'ALIAS_FILE' =>
+ ['newaliases','-',["${smdb_loc}aliases"],'-']
+# ,'CANONIFY_DOMAIN_FILE' =>
+# ['-','-',["${smdb_loc}canonify_domains"],'%[^\\#]']
+# ,'EXPOSED_USER_FILE' =>
+# ['-','-',["${smdb_loc}exposed_users"],'%[^\\#]']
+ ,'HELP_FILE' =>
+ ['-','-',["${smdb_loc}helpfile"],'-']
+# ,'GENERICS_DOMAIN_FILE' =>
+# ['-','-',["${smdb_loc}generic-domains"],'%[^\\#]']
+# ,'MASQUERADE_DOMAIN_FILE' =>
+# ['-,'-',["${smdb_loc}masquerade-domains"],'%[^\\#]']
+ ,'MSP_STATUS_FILE' =>
+ ['-','-',["@localstatedir@/lib/sendmail/sm-client.st"],'-']
+ ,'MSP_QUEUE_DIR' =>
+ ['-','-',["@localstatedir@/spool/mqueue-client"],'-']
+ ,'QUEUE_DIR' =>
+ ['-','-',["@localstatedir@/spool/mqueue"],'-']
+# ,'RELAY_DOMAIN_FILE' =>
+# ['-','-',["${smdb_loc}relay-domains"],'%[^\\#]']
+ ,'STATUS_FILE' =>
+ ['-','-',["@localstatedir@/lib/sendmail/sendmail.st"],'-']
+# ,'VIRTUSER_DOMAIN_FILE' =>
+# ['-','-',["${smdb_loc}virtual-domains"],'%[^\\#]']
+
+ ,'confCONTROL_SOCKET_NAME' =>
+ ['-','-',["@localstatedir@/run/sendmail/smcontrol"],'-']
+ ,'confCR_FILE' =>
+ ['-','-o',["${smdb_loc}relay-domains"],'%[^\\#]']
+ ,'confCT_FILE' =>
+ ['-','-',["${smdb_loc}trusted-users"],'%[^\\#]']
+ ,'confCW_FILE' =>
+ ['-','-',["${smdb_loc}local-host-names"],'%[^\\#]']
+ ,'confDEAD_LETTER_DROP' =>
+ ['-','-',["@localstatedir@/lib/sendmail/dead.letter"],'-']
+# ,'confDEF_AUTH_INFO' => # Deprecated, use authinfo rules instead
+# ['-','-',["${smdb_loc}default-auth-info"],'-']
+ ,'confEBINDIR' =>
+ ['-','-',["@libexecdir@"],'-']
+# ,'confERROR_MESSAGE' => # No default
+# ['-','-',["${smdb_loc}error-header"],'-']
+ ,'confHOSTS_FILE' =>
+ ['-','-',["@sysconfdir@/hosts"],'-']
+ ,'confHOST_STATUS_DIRECTORY' =>
+ ['-','-',["@localstatedir@/lib/sendmail/host_status"],'-']
+ ,'confPID_FILE' =>
+ ['-','-',["@localstatedir@/run/sendmail/mta/sendmail.pid"],'-']
+ ,'confSERVICE_SWITCH_FILE' =>
+ ['-','-',["${smdb_loc}service.switch"],'-']
+# ,'confUSERDB_SPEC' =>
+# ['btree','-o',["${smdb_loc}userdb"],'-']
+ );
+#
+#
+# Private entries
+$smdb_hash{'databases'} = ['parse_mc','-',["${smdb_loc}sendmail.mc"],'-'];
+$smdb_hash{'Makefile'} = ['update_mk','-',["${smdb_loc}databases"],'-'];
+$smdb_hash{'crontab'} = ['update_conf','-',["${smdb_loc}sendmail.conf"],'-'];
+#
+# Conditional entries
+if ( -s "${smdb_loc}submit.mc" ) {
+ $smdb_hash{'submit.cf'} = ['m4','-',["${smdb_loc}submit.mc"],'-'];
+ };
+
+#
+# Databases/files that require a sendmail restart when modified:
+my %smdb_restart = (
+ 'EXPOSED_USER_FILE' => 1
+ ,'LOCAL_USER_FILE' => 1
+ ,'CANONIFY_DOMAIN_FILE' => 1
+ ,'GENERICS_DOMAIN_FILE' => 1
+ ,'RELAY_DOMAIN_FILE' => 1
+ ,'VIRTUSER_DOMAIN_FILE' => 1
+ ,'LDAPROUTE_DOMAIN_FILE' => 1
+ ,'LDAPROUTE_EQUIVALENT_FILE' => 1
+ ,'MASQUERADE_DOMAIN_FILE' => 1
+ ,'MASQUERADE_EXCEPTION_FILE' => 1
+ ,'confCR_FILE' => 1
+ ,'use_ct_file' => 1
+ ,'use_cw_file' => 1
+ );
+
+$smdb_restart{'sendmail.cf'} = 1;
+if ( -s "${smdb_loc}submit.mc" ) {
+ $smdb_restart{'submit.cf'} = 1; };
+
+# Variables used in parsing lines
+my $smdb_state_looking = 0;
+my $smdb_state_start = 1;
+my $smdb_state_done = 2;
+my $smdb_state = $smdb_state_looking;
+my $smdb_string = '';
+my @smdb_entry = ();
+my $smdb_name = '';
+my $smdb_class = '';
+my @smdb_file = ();
+my $smdb_flags = '';
+my $smdb_options = '';
+my $smdb_default = '';
+
+#------------------------------------------------------------------------------
+# Finally, some code (almost)
+#------------------------------------------------------------------------------
+1; # return (true);
+
+#
+#------------------------------------------------------------------------------
+# Read *.mc/*.m4 files
+#------------------------------------------------------------------------------
+sub read_mc {
+ my ($input_files) = @_;
+ @ARGV = split(' ', $input_files);
+ if ($#ARGV == -1) {
+ my @files = (
+ '/usr/share/sendmail/cf/ostype/linux.m4'
+ ,'/usr/share/sendmail/cf/ostype/debian.m4'
+ ,'/usr/share/sendmail/cf/domain/debian-mta.m4'
+ ,"@sysconfdir@/mail/sendmail.mc"
+ );
+ foreach my $file ( @files ) {
+ push @ARGV, $file if ( -s $file );
+ };
+ };
+ $input_files = join(' ', @ARGV);
+ $Parse_mc::input_files = $input_files;
+ die "No input files" if ($#ARGV == -1);
+ $debug = $main::debug || '';
+
+ #------------------------------------------------------------------
+ # Main loop, iterate over all input lines
+ #------------------------------------------------------------------
+ line: while (<ARGV>) {
+ next line if /^#/; # skip comments
+ next line if /^$/; # skip empty lines
+ chomp; # drop tailing \n
+ if (s/\\$//) {
+ $_ .= <>;
+ redo unless eof();
+ };
+
+ #--------------------------------------------------------------
+ # Look for default database location
+ # define(MAIL_SETTINGS_DIR, @sysconfdir@/mail/)dnl # comment
+ #--------------------------------------------------------------
+ if (/^\s*`?define\(\s*`?MAIL_SETTINGS_DIR/ ..
+ /[^\)]*\)/) {
+ &parse_string($_, 'define');
+ next line if ($smdb_state != $smdb_state_done);
+
+ &get_flags_name_opts;
+ $smdb_loc = $smdb_file[$[];
+ $smdb_class = '-';
+
+ &put_entry($ARGV, 'define');
+ }
+
+ #--------------------------------------------------------------
+ # Look for default database type
+ # define(DATABASE_MAP_TYPE, hash)dnl # comment
+ #--------------------------------------------------------------
+ elsif (/^\s*define\(\s*`?DATABASE_MAP_TYPE/ ..
+ /[^\)]*\)/) {
+ &parse_string($_, 'define');
+ next line if ($smdb_state != $smdb_state_done);
+
+ &get_flags_name_opts;
+ $smdb_type = $smdb_file[$[];
+ @smdb_file = ( $smdb_loc );
+ $smdb_class = $smdb_type;
+
+ &put_entry($ARGV, 'define');
+ }
+
+ #
+ #--------------------------------------------------------------
+ # Look for define(confUSERDB specifications
+ # define(confUSERDB_SPEC, @sysconfdir@/mail/users.db)dnl # comment
+ #--------------------------------------------------------------
+ elsif (/^\s*`?define\(\s*`?confUSERDB_SPEC/ ..
+ /[^\)]*\)/) {
+ &parse_string($_, 'define');
+ next line if ($smdb_state != $smdb_state_done);
+
+ &get_flags_name_opts;
+ $smdb_flags = '-o';
+ $smdb_class = 'btree';
+
+ &put_entry($ARGV, 'define');
+ }
+
+ #--------------------------------------------------------------
+ # Look for all define(confC._FILE specifications
+ # define(confCR_FILE, -o /etc/mail/relay-domains %[^\#])dnl
+ # define(confCT_FILE, -o /etc/mail/sendmail.ct %[^\#])dnl
+ # define(confCW_FILE, -o /etc/mail/sendmail.cw %[^\#])dnl
+ #--------------------------------------------------------------
+ elsif (/^\s*`?define\(\s*`?confC[RTW]_FILE/ ..
+ /[^\)]*\)/) {
+ &parse_string($_, 'define');
+ next line if ($smdb_state != $smdb_state_done);
+
+ &get_flags_name_opts;
+
+ &put_entry($ARGV, 'define');
+ }
+
+ #--------------------------------------------------------------
+ # Look for all *_FILE( specifications
+ # EXPOSED_USER_FILE(/etc/mail/exposed-users %[^\#])dnl
+ # LOCAL_USER_FILE
+ # CANONIFY_DOMAIN_FILE
+ # GENERICS_DOMAIN_FILE(/etc/mail/generic-domains %[^\#])dnl
+ # RELAY_DOMAIN_FILE(/etc/mail/relay-domains %[^\#])dnl
+ # VIRTUSER_DOMAIN_FILE(/etc/mail/virtual-domains %[^\#])dnl
+ # LDAPROUTE_DOMAIN_FILE
+ # LDAPROUTE_EQUIVALENT_FILE
+ # MASQUERADE_DOMAIN_FILE(/etc/mail/masquerade-domains %[^\#])dnl
+ # MASQUERADE_EXCEPTION_FILE
+ #--------------------------------------------------------------
+ elsif (/^\s*`?((EXPOSED|LOCAL)_USER|(CANONIFY|GENERICS|RELAY|VIRTUSER)_DOMAIN|LDAPROUTE_(DOMAIN|EQUIVALENT)|MASQUERADE_(DOMAIN|EXCEPTION))_FILE\(/ ..
+ /[^\)]*\)/) {
+ &parse_string($_, '(');
+ next line if ($smdb_state != $smdb_state_done);
+
+ &get_flags_name_opts;
+
+ &put_entry($ARGV, '');
+ }
+
+ #
+ #--------------------------------------------------------------
+ # Look for all define(conf* specifications
+ # define(confCONTROL_SOCKET_NAME,/var/run/sendmail/smcontrol)dnl
+ # define(confERROR_MESSAGE, MAIL_SETTINGS_DIRerror-header)dnl
+ # define(confSERVICE_SWITCH_FILE,/etc/mail/service.switch)dnl
+ # define(confPID_FILE, /var/run/sendmail/sendmail.pid)dnl
+ # define(confHOSTS_FILE, /etc/hosts)dnl
+ # define(confDEF_AUTH_INFO, /etc/mail/auth-info)dnl
+ # define(confDEAD_LETTER_DROP,/var/lib/sendmail/dead.letter)dnl
+ # define(confHOST_STATUS_DIRECTORY,/var/lib/sendmail/host_status)dnl
+ #--------------------------------------------------------------
+ elsif (/^\s*`?define\(\s*`?conf(CONTROL_SOCKET_NAME|ERROR_MESSAGE|(SERVICE_SWITCH|PID|HOSTS)_FILE|DEF_AUTH_INFO|DEAD_LETTER_DROP|HOST_STATUS_DIRECTORY)/ ..
+ /[^\)]*\)/) {
+ &parse_string($_, 'define');
+ next line if ($smdb_state != $smdb_state_done);
+
+ &get_flags_name_opts;
+
+ &put_entry($ARGV, 'define');
+ }
+
+ #--------------------------------------------------------------
+ # Look for all define(*_FILE specifications (No options here)
+ # define(ALIAS_FILE, @sysconfdir@/mail/aliases.private,...)dnl
+ # define(HELP_FILE, /etc/mail/helpfile)dnl
+ # define(STATUS_FILE, /var/lib/sendmail/sendmail.st)dnl
+ # define(QUEUE_DIR, /var/spool/mqueue/main*)dnl
+ # define(MSP_QUEUE_DIR, /var/spool/mqueue-client)dnl
+ #--------------------------------------------------------------
+ elsif (/^\s*`?define\(\s*`?((ALIAS|HELP|STATUS)_FILE)|(MSP_)?QUEUE_DIR/ ..
+ /[^\)]*\)/) {
+ &parse_string($_, 'define');
+ next line if ($smdb_state != $smdb_state_done);
+
+ &get_flags_name_opts;
+
+ &put_entry($ARGV, 'define');
+ }
+
+ #--------------------------------------------------------------
+ # Look for all queue definition specifications
+ # define(QUEUE_GROUP, ...)dnl
+ #--------------------------------------------------------------
+ elsif (/^\s*`?QUEUE_GROUP\(/ .. /[^\)]*\)/) {
+ &parse_string($_, '(');
+ next line if ($smdb_state != $smdb_state_done);
+
+ $smdb_string =~ /\s*([\w_]+).*P[^=]*=([^\*,\)]*).*/;
+ $smdb_name = 'QUEUE_GROUP';
+ $smdb_class = '-'; # $1
+ $smdb_flags = '-';
+ @smdb_file = ($2);
+ $smdb_options = '-'; # Pull out other options?
+
+ &put_entry($ARGV, '', 1);
+ }
+
+ #
+ #--------------------------------------------------------------
+ # Locate all non-commented FEATURE macros
+ # FEATURE(name[, [type [flags] file][, ...]...])dnl #comment
+ #--------------------------------------------------------------
+ elsif (/^\s*`?FEATURE\(/ .. /[^\)]*\)/) {
+ &parse_string($_, 'FEATURE');
+ next line if ($smdb_state != $smdb_state_done);
+
+ # ignore non-db features
+ next line if ( ! exists($smdb_features{$smdb_name}) );
+
+ &get_flags_name_opts;
+
+ if ($smdb_name eq 'use_ct_file') {
+ &get_entry('confCT_FILE');
+ }
+ elsif ($smdb_name eq 'use_cw_file') {
+ &get_entry('confCW_FILE');
+ }
+ else {
+ @smdb_file =
+ ("${smdb_loc}$smdb_features{$smdb_name}")
+ if ($smdb_file[$[] eq '-'
+ and $smdb_class ne 'ldap');
+ $smdb_class = $smdb_type
+ if ($smdb_class eq '-');
+ };
+
+ &put_entry($ARGV, 'FEATURE');
+ };
+ };
+ };
+
+#
+#------------------------------------------------------------------------------
+# Write out the accumulated information to a flat database file
+#------------------------------------------------------------------------------
+sub write_dbs {
+ my ($database_file, $input_files) = @_;
+ my $ofh = new FileHandle;
+
+ $database_file = $database_file || $Parse_mc::database_file;
+ $Parse_mc::database_file = $database_file;
+ my $caller = "$main::program_name" if ($main::program_name);
+ $caller .= " $main::program_version" if ($main::program_version);
+ $caller .= " $main::program_date" if ($main::program_date);
+ $debug = $main::debug || '';
+
+ $database_file = '&STDOUT' if ($database_file eq '-');
+ unless ( open($ofh, ">$database_file") ) {
+ warn("Could not open $database_file($!), using STDOUT.\n");
+ open($ofh, ">&STDOUT");
+ };
+ $database_file = '-' if ($database_file eq '&STDOUT');
+
+ print $ofh <<"EOT";
+####################################################################
+##### This file is automatically generated -- edit at your own risk
+#####
+##### Copyright (c) 2000-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#####
+##### file: ${database_file}
+##### generated via: (${interp_pgm} ${interp_vrm})
+##### ${caller}
+##### ${Parse_mc::program_name} ${Parse_mc::program_version} ${Parse_mc::program_date}
+##### by: ${user}\@${hostname}
+##### on: ${current_time}
+##### in: ${directory}
+##### input files:
+EOT
+ foreach my $file ( split(' ', $Parse_mc::input_files) ) {
+ print $ofh <<"EOT";
+##### ${file}
+EOT
+ }
+ print $ofh <<"EOT";
+#####
+##### Used by:
+##### update_{db,mk}
+#####
+##### The following databases are used by Debian Sendmail
+#####
+##### Format:
+##### <df>:<map>:<flags>:<file>:<opts>:
+##### Where:
+##### <df> = define or FEATURE name
+##### <map> = map type (-,text,btree,hash, etc.)
+##### <flags> = map flags (-o for optional, etc.)
+##### <file> = file name
+##### <opts> = map options (%[^\\#] for sprintf, etc.)
+#####
+####################################################################
+EOT
+
+ #
+ # delete unneeded elements
+ #delete $smdb_hash{"MAIL_SETTINGS_DIR"};
+ #delete $smdb_hash{"DATABASE_MAP_TYPE"};
+ #delete $smdb_hash{"confCT_FILE"};
+ #delete $smdb_hash{"confCW_FILE"};
+
+ # print define(/FEATURE(/xxx( items
+ foreach $smdb_name (sort keys %smdb_hash) {
+ &get_entry($smdb_name);
+ foreach my $file ( @smdb_file ) {
+ print $ofh join(':',
+ $smdb_name
+ ,$smdb_class
+ ,$smdb_flags
+ ,$file
+ ,$smdb_options
+ ,''
+ ), "\n";
+ };
+ };
+
+ close($ofh);
+ if ($database_file eq "@sysconfdir@/mail/databases") {
+ chown '0', '0', "$database_file";
+ chmod 0644, "$database_file";
+ };
+ };
+
+#
+#------------------------------------------------------------------------------
+# Read in the accumulated information from a flat database file
+#------------------------------------------------------------------------------
+sub read_dbs {
+ my ($database_file, $input_files) = @_;
+ my $ifh = new FileHandle;
+ my $name = '';
+ my @entry;
+
+ $database_file = $database_file || $Parse_mc::database_file;
+ $Parse_mc::database_file = $database_file;
+ $debug = $main::debug || '';
+
+ unless ( open($ifh, "<$database_file") ) {
+ warn("Could not open $database_file($!), creating it.\n");
+ &read_mc($input_files);
+ &write_dbs($database_file, $input_files);
+ # At this point, we have the data, don't need to re-read it...
+ return;
+ };
+
+ #------------------------------------------------------------------
+ # Main loop, iterate over all input lines
+ #------------------------------------------------------------------
+ line: while (<$ifh>) {
+ next line if /^#/; # skip comments
+ next line if /^$/; # skip empty lines
+ chomp; # drop tailing \n
+
+ @entry = split(':', $_);
+
+ # Accumulate file names and enter when complete
+ if ($name eq $entry[$[]) {
+ push @smdb_file, $entry[3];
+ }
+ else {
+ if ($name ne '') {
+ &put_entry('', '');
+ };
+ $name = $entry[$[];
+ $smdb_name = $entry[$[];
+ $smdb_class = $entry[1];
+ $smdb_flags = $entry[2];
+ @smdb_file = $entry[3];
+ $smdb_options = $entry[4];
+ };
+ };
+
+ # enter any remaining data
+ if ($name ne '') {
+ &put_entry('', '');
+ };
+
+ close($ifh);
+ };
+
+#
+#------------------------------------------------------------------------------
+# Obtain the list of names in smdb_hash (in an ordered manor)
+#------------------------------------------------------------------------------
+sub names_dbs {
+
+ # We need a partial ordering here (psuedo dependancies)
+ my @names;
+ my %dbs = ();
+ foreach my $entry ('databases', 'Makefile', 'crontab', 'QUEUE_GROUP',
+ 'sendmail.cf', 'submit.cf') {
+ if (exists($smdb_hash{$entry})) {
+ $dbs{$entry} = '';
+ push @names, $entry;
+ };
+ };
+
+ # Now, add any remaining databases to the list (except aliases)
+ foreach my $entry (sort keys %smdb_hash) {
+ next if ($entry eq 'ALIAS_FILE');
+ push @names, $entry
+ if (! exists($dbs{$entry}));
+ $dbs{$entry} = '';
+ };
+
+ # Finally, add aliases...
+ my $entry = 'ALIAS_FILE';
+ if (exists($smdb_hash{$entry})) {
+ push @names, $entry
+ if (! exists($dbs{$entry}));
+ $dbs{$entry} = '';
+ };
+
+ return(@names);
+ };
+
+#------------------------------------------------------------------------------
+# Obtain the list of names that require a sendmail restart
+#------------------------------------------------------------------------------
+sub restart_dbs {
+ return(keys %smdb_restart);
+ };
+
+#------------------------------------------------------------------------------
+# Obtain an individual database entry (returning a copy)
+#------------------------------------------------------------------------------
+sub entry_dbs {
+ my ($name) = @_;
+ $smdb_name = $name;
+ &get_entry($smdb_name);
+
+ # Return a local copy - so they can't change *MY* data...
+ my @entry = @smdb_entry;
+ return (@entry);
+ };
+
+#
+#------------------------------------------------------------------------------
+# Save the results of the database entry and reset the state
+#------------------------------------------------------------------------------
+sub put_entry {
+ my ($file, $type, $multi_file) = @_;
+
+ # Create entry record from data pieces/parts
+ if ($multi_file and exists($smdb_hash{$smdb_name})) {
+ @smdb_entry = @{$smdb_hash{$smdb_name}};
+ }
+ else {
+ @smdb_entry = ('-', '-', [], '-');
+ };
+ $smdb_entry[$[] = $smdb_class;
+ $smdb_entry[1] = $smdb_flags;
+ push @{$smdb_entry[2]}, @smdb_file;
+ $smdb_entry[3] = $smdb_options;
+
+ # Save lastmost entry
+ @{$smdb_hash{$smdb_name}} = @smdb_entry;
+
+ # Minimal debugging
+ if ($debug) {
+ print STDERR "PUT: ";
+ if ($type ne '') { print STDERR "$type($smdb_name)" }
+ else { print STDERR "$smdb_name()" };
+ print STDERR " => ", join(':'
+ , $smdb_class
+ , join(',', @{$smdb_entry[2]})
+ , $smdb_options
+ , ''
+ ), "\n";
+ };
+
+ # reset state
+ $smdb_state = $smdb_state_looking;
+ };
+
+#
+#------------------------------------------------------------------------------
+# Retrieve a database entry
+#------------------------------------------------------------------------------
+sub get_entry {
+ my ($name) = @_;
+
+ if (exists($smdb_hash{$name}) ) {
+ @smdb_entry = @{$smdb_hash{$name}};
+ }
+ else {
+ @smdb_entry = ('-', '-', ['-'], '-');
+ };
+
+ $smdb_class = $smdb_entry[$[];
+ $smdb_flags = $smdb_entry[1];
+ @smdb_file = @{$smdb_entry[2]};
+ $smdb_options = $smdb_entry[3];
+
+ # Minimal debugging
+ if ($debug) {
+ print STDERR "GET: ",
+ "$name",
+ " => ", join(':'
+ , $smdb_class
+ , join(',', @{$smdb_entry[2]})
+ , $smdb_options
+ , ''
+ ), "\n";
+ };
+
+ };
+
+#
+#------------------------------------------------------------------------------
+# This function does most of the work in parsing a series of lines to
+# construct a database entry - it manages the state machine and assorted
+# global variables
+#------------------------------------------------------------------------------
+sub parse_string {
+ my ($str, $type) = @_;
+ my $count = -1;
+ my @entry = '';
+ my $pending_state = 0;
+
+ # Strip trailing '?\)(dnl)?.*$ from string
+ if ($str =~ /\s*'?\s*\)/) {
+ $str =~ s/\s*'?\s*\)\s*(dnl)?.*$//;
+ $pending_state = $smdb_state_done;
+ };
+
+ # Strip trailing 'dnl .*' from string
+ if ($str =~ /dnl(\s+.*)?$/) {
+ $str =~ s/dnl(\s+.*)?$//;
+ };
+
+ # Strip leading `?define\(\s*`? from string
+ if (($type eq 'define') and
+ ($str =~ /^\s*`?define\(/)) {
+ $str =~ s/^\s*`?define\(\s*`?//;
+ $str =~ s/,/ /;
+ $smdb_state = $pending_state || $smdb_state_start;
+ $smdb_string = '';
+ $count = (@entry = split(' ', $str));
+ ($smdb_name = $entry[$[]) =~ tr/'//d;
+ shift(@entry);
+ $str = join(' ', @entry);
+ }
+
+ # Strip leading `?FEATURE\(\s*`? from string
+ elsif (($type eq 'FEATURE') and
+ ($str =~ /^\s*`?FEATURE\(/)) {
+ $str =~ s/^\s*`?FEATURE\(\s*`?//;
+ $str =~ s/,/ /;
+ $smdb_state = $pending_state || $smdb_state_start;
+ $smdb_string = '';
+ $count = (@entry = split(' ', $str));
+ ($smdb_name = $entry[$[]) =~ tr/'//d;
+ shift(@entry);
+ $str = join(' ', @entry);
+ }
+
+ # Strip leading `?[\w_]+\(\s*`? from string
+ elsif (($type eq '(') and
+ ($str =~ /^\s*`?[\w_]+\(/)) {
+ $str =~ s/\(/ /;
+ $smdb_state = $pending_state || $smdb_state_start;
+ $smdb_string = '';
+ $count = (@entry = split(' ', $str));
+ ($smdb_name = $entry[$[]) =~ tr/'//d;
+ shift(@entry);
+ $str = join(' ', @entry);
+ }
+ else {
+ $smdb_state = $pending_state || $smdb_state;
+ };
+
+ #
+ # Strip quotes (` and ') from string
+ $str =~ tr/`'//d;
+
+ # FEATURE( is the only one allowed to have only one argument
+ if ($type ne 'FEATURE' and $count == 1) {
+ $str = '';
+ };
+
+ # Change imbedded MAIL_SETTINGS_DIR to $smdb_loc
+ if ($smdb_name ne 'MAIL_SETTINGS_DIR') {
+ $str =~ s/MAIL_SETTINGS_DIR/$smdb_loc/g
+ };
+
+ # Change imbedded DATABASE_MAP_TYPE to $smdb_type
+ if ($smdb_name ne 'DATABASE_MAP_TYPE') {
+ $str =~ s/DATABASE_MAP_TYPE/$smdb_type/g
+ };
+
+ # concatentate this string with any prior information
+ $smdb_string .= ' ' . $str unless($smdb_state == $smdb_state_looking);
+
+ # Return
+ return;
+ };
+
+#
+#------------------------------------------------------------------------------
+# This function parses a line into flags (-o, etc.), name, options
+#------------------------------------------------------------------------------
+sub get_flags_name_opts {
+ my @entry;
+ my $class = '';
+ my $rest = '';
+ my $multi_names = 0;
+
+ $smdb_class = '';
+ $smdb_flags = '';
+ @smdb_file = ();
+ $smdb_options = '';
+
+ @entry = split(' ', $smdb_string);
+
+ # Pull off any leading flags (including database type/class)
+ # Class specification: "[mapkey]@mapclass:mapspec"
+ # RELAY_DOMAIN_FILE(`@LDAP')dnl
+ # VIRTUSER_DOMAIN_FILE(`@ldap:-k
+ # (&(objectClass=virtHosts)(host=*)) -v host')dnl
+ # FEATURE(`genericstable', `LDAP')dnl
+ # FEATURE(`genericstable', `nis:realnames.by2mail')dnl
+ # define(`ALIAS_FILE', `ldap:')dnl
+ # define(`ALIAS_FILE', `ldap:-k
+ # (&(objectClass=mailGroup)(mail=%0)) -v mgrpRFC822MailMember')dnl
+ # but only if there are flags *and* a name...
+ if (@entry) {
+ ($class = lc($entry[$[])) =~ s/:.*//;
+ ($rest = $entry[$[]) =~ s/.*://;
+ $rest = '' if (lc($rest) eq 'ldap');
+ if ($class =~ /^.*@/) {
+ $class =~ s/^.*@//;
+ if (exists($smdb_classes{$class})) {
+ $smdb_class = $class;
+ shift (@entry);
+ };
+ }
+ elsif (exists($smdb_classes{$class})) {
+ $smdb_class = $class;
+ $rest = '' if ($rest eq $class);
+ shift (@entry);
+ @entry = split(' ', join(' ',$rest,@entry) );
+ $#entry = -1 if ($smdb_class eq 'ldap');
+ };
+ FLAG_LOOP: while (@entry) {
+ if (substr($entry[$[], 0, 1) eq '-') {
+ if ($smdb_flags eq '') {
+ $smdb_flags = $entry[$[];
+ }
+ else {
+ $smdb_flags .= ' ' . $entry[$[];
+ };
+ shift (@entry);
+ }
+ else {
+ last FLAG_LOOP;
+ };
+ };
+ };
+#print STDERR "$class($rest) ::= ",scalar @entry,join(' ','',@entry,''),"\n";
+ $smdb_flags = $smdb_flags || '-';
+ $smdb_class = $smdb_class || '-';
+
+ #
+ # A few special cases...
+ if ($smdb_name eq 'ALIAS_FILE' and $smdb_class eq '-') {
+ $smdb_class = 'newaliases';
+ @entry = (join('',@entry));
+ $multi_names = 1;
+ }
+ elsif ($smdb_name eq 'confUSERDB_SPEC') {
+ @entry = (join('',@entry));
+ $multi_names = 1;
+ };
+
+ # Handle multi-files specially
+ if ( $multi_names == 1 ) {
+ @smdb_file = split(',', $entry[$[]);
+ $smdb_options = '-';
+ }
+ else {
+ # Whats left should be a filename (or somesuch) and options
+ if (@entry >= 1) { # file name, possible options if /,/
+ if ($smdb_classes{$smdb_class} != 1) {
+ @smdb_file = '-';
+ }
+ else {
+ @smdb_file = $entry[$[];
+ shift(@entry);
+ };
+ if (@entry >= 1) {
+ $entry[$[] =~ s/^,//;
+ foreach my $ndx ($[ .. $#entry) {
+ $smdb_options .= ' '
+ if ($ndx != 0
+ and substr($entry[$ndx], 0, 1) ne ',');
+ $smdb_options .= $entry[$ndx];
+ }
+ }
+ $#entry = -1;
+ };
+
+ # Check for possible options caught in the filename slot
+ if (@smdb_file >= 1 and index($smdb_file[$[], ',') != -1) {
+ @entry = split(/,/, $smdb_file[$[]);
+ @smdb_file = ( $entry[$[] );
+ if (@entry >= 2) {
+ $smdb_options = join('', @entry[1..$#entry],
+ $smdb_options);
+ $#entry = -1;
+ };
+ };
+ $smdb_file[$[] = $smdb_file[$[] || '-';
+ $smdb_file[$[] =~ s/\.db//;
+ $smdb_options = $smdb_options || '-';
+ };
+
+ # Return
+ return;
+ };
+
+__END__
diff --git a/debian/local/local_no_masquerade.m4 b/debian/local/local_no_masquerade.m4
new file mode 100644
index 0000000..5c8a693
--- /dev/null
+++ b/debian/local/local_no_masquerade.m4
@@ -0,0 +1,25 @@
+divert(-1)
+#-----------------------------------------------------------------------------
+# $Sendmail: ./local_no_masquerade,v 8.9.3 1999/10/20 12:00:00 cowboy Exp $
+#
+# Copyright (c) 1999-2001 Richard Nelson. All Rights Reserved.
+#
+# feature(local_no_masquerade) config file for building Sendmail
+#
+# Prevent masquerading of local senders when sending to local recipients
+# used by: mailer/local.m4
+#
+# Note: I originally called this `dont_masquerade_local', but have since
+# changed the name to correspond with what Sendmail 8.12.0 supports.
+# The local patches to cf/mailer/local.m4 remain unaltered.
+#
+#-----------------------------------------------------------------------------
+#
+divert(0)
+VERSIONID(`@(#)local_no_masquerade.m4 1.0 (Debian) 1999-10-20')
+divert(-1)
+
+ifdef(`_MAILER_local_',
+ `errprint(`*** FEATURE(local_no_masquerade) must occur before MAILER(local)')')dnl
+
+define(`_DONT_MASQUERADE_LOCAL_', 1)dnl
diff --git a/debian/local/parse_mc.in b/debian/local/parse_mc.in
new file mode 100644
index 0000000..569e355
--- /dev/null
+++ b/debian/local/parse_mc.in
@@ -0,0 +1,86 @@
+#!/usr/bin/perl -w
+#------------------------------------------------------------------------
+#
+# $Sendmail: parse_mc,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Parse Sendmail config for databases
+#
+# Copyright 2000-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# Notes (to all):
+# * for "define(xxx,...)"; "define(xxx," must be on same line, but the
+# rest may be split across multiple lines
+# * assumes makemap dbtype /etc/mail/database < /etc/mail/database
+#
+# Notes (to self):
+# *
+#
+#------------------------------------------------------------------------
+# My first perl program (from my first awk program ;-})
+#
+# Initialization of the perl environment
+use strict; # be kosher
+use Env; # A few environmental references
+use integer; # Peformance
+use Getopt::Long; # parameter handling
+
+# Local libraries - for Debian Sendmail Perl helper functions
+# BEGIN { $main::my_path = substr($0,$[,rindex($0,'/')) };
+use lib ('.', substr($0,$[,rindex($0,'/')), "@datadir@/sendmail");
+require Parse_mc;
+
+# Version of this program
+#($main::MYNAME = $main::0) =~ s|.*/||;
+#$main::Author = "Richard Nelson";
+#$main::AuthorMail = "cowboy\@debian.org";
+#$main::Version = '$Revision: 2.00 $ ';
+$main::program_name = $0;
+$main::program_version = '@sm_version@';
+$main::program_date = '@sm_date@ @sm_time@ cowboy';
+$main::debug = 0;
+
+#
+#------------------------------------------------------------------------------
+# Finally, some code (almost)
+#------------------------------------------------------------------------------
+#
+# Argument handling...
+$main::opt_help='';
+$main::opt_output_file='';
+$main::opt_input_file='';
+$main::opt_debug='';
+my @options = qw(
+ help|h
+ output-file|output_file|o:s
+ input-file|input_file|i:s@
+ debug!
+ );
+my $result = GetOptions(@options);
+if ( ! $result ) {
+ die "Terminating due to parameter error";
+ };
+if ( $main::opt_help ) {
+ warn "$main::program_name $main::program_version $main::program_date\n";
+ warn "$0 \n";
+ warn " -help\n" if $main::opt_help;
+ warn " -debug\n" if $main::opt_debug;
+ warn " -o $main::opt_output_file\n" if $main::opt_output_file;
+ warn " -i $main::opt_input_file\n" if $main::opt_input_file;
+ exit 0;
+ };
+
+${Parse_mc::database_file} = $main::opt_output_file
+ if $main::opt_output_file;
+my $input_files = join(' ', @main::opt_input_file);
+# $main::debug is used in parse_mc !
+$main::debug = $main::opt_debug || $main::debug;
+
+# Let them know wtf is going on...
+print STDOUT "Creating ${Parse_mc::database_file}...\n";
+
+# Read the mc/m4 files
+&Parse_mc::read_mc($input_files);
+
+# Write out the textual representation
+&Parse_mc::write_dbs('', $input_files);
+
diff --git a/debian/local/provider b/debian/local/provider
new file mode 100644
index 0000000..b9bc496
--- /dev/null
+++ b/debian/local/provider
@@ -0,0 +1,10 @@
+#/etc/mail/peers/provider
+#
+# Sample provider file for sendmail
+# used to provide ISP information (masquerade_as, smarthost, etc.)
+#
+# This is what I use when connecting to mindspring.com:
+# remove the leading dnl to activate
+LOCAL_CONFIG
+dnl define(`SMART_HOST', `mail.mindspring.com.')dnl
+dnl MASQUERADE_AS(mindspring.com)dnl
diff --git a/debian/local/qtool.8 b/debian/local/qtool.8
new file mode 100644
index 0000000..e40644d
--- /dev/null
+++ b/debian/local/qtool.8
@@ -0,0 +1,213 @@
+.\" Copyright (c) 1999 Sendmail, Inc. and its suppliers.
+.\" All rights reserved.
+.\"
+.\" By using this file, you agree to the terms and conditions set
+.\" forth in the LICENSE file which can be found at the top level of
+.\" the sendmail distribution.
+.\"
+.\"
+.\" $Id: qtool.8,v 8.12 2000/12/15 19:53:35 gshapiro Exp $
+.\"
+.TH QTOOL 8 "$Date: 2000/12/15 19:53:35 $"
+.SH NAME
+qtool
+\- manipulate sendmail queues
+.SH SYNOPSIS
+.B qtool.pl
+.RB [options]
+target_directory source [source ...]
+.PP
+.B qtool.pl [-d|-b]
+.RB [options]
+source [source ...]
+.SH DESCRIPTION
+.B Qtool
+moves the queue files used by sendmail between queues. It uses the same
+locking mechanism as sendmail so can be safely used while sendmail is
+running.
+.PP
+With no options,
+.B qtool
+will move any queue files as specified by \fIsource\fP into
+\fItarget_directory\fP. \fISource\fP can be either an individual
+queue control file, a queue file id, or a queue directory.
+.PP
+If the -d option is specified, qtool will delete the messages specified by
+source instead of moving them.
+.PP
+If the -b option is specified, the selected messages will be bounced by
+running sendmail with the -OTimeout.queuereturn=now option.
+.SS Options
+.TP
+\fB\-b\fP
+Bounce all of the messages specified by source. The messages will be bounced
+immediately. No attempt will be made to deliver the messages.
+.TP
+\fB\-C\fP configfile
+Specify the sendmail config file.
+Defaults to /etc/mail/sendmail.cf.
+.TP
+\fB\-d\fP
+Delete all of the messages specified by source.
+.TP
+\fB\-e\fP \fIperl_expression\fP
+Evalute \fIperl_expression\fP for each queue file as specified
+by \fIsource\fP. If \fIperl_expression\fP evaluates to true, then that
+queue file is moved. See below for more detail on \fIperl_expression\fP.
+.TP
+\fB\-s\fP \fIseconds\fP
+Move only the queue files specified by \fIsource\fP that have a
+modification time older than \fIseconds\fP.
+.SS Perl Expressions
+You can use any valid perl expression. Inside the expression you have
+access to a hash that contains many of the fields in the control file as
+well as some other data about that queued message. The hash is called
+\fI%msg\fP. If a field has multiple values (e.g. 'Recipient'), it will be
+returned as an array, otherwise it will be returned as a scalar. Through
+\fI%msg\fP, you can access the following variables:
+.TP
+\fBauth\fP
+AUTH= parameter.
+.TP
+\fBbody_type\fP
+Body type (\fB8BITMIME\fP, \fB7BIT\fP, or undefined).
+.TP
+\fBbody_last_mod_time\fP
+The last time the body was modified since the epoch in seconds.
+.TP
+\fBbody_size\fP
+The size of the body file in bytes.
+.TP
+\fBcharset\fP
+Character set (for future use).
+.TP
+\fBcontent-length\fP
+Content-Length: header value (Solaris sendmail only).
+.TP
+\fBcontrolling_user\fP
+The controlling user.
+.TP
+\fBcontrol_last_mod_time\fP
+The last time the body was modified since the epoch in seconds.
+.TP
+\fBcontrol_size\fP
+The size of the control file in bytes.
+.TP
+\fBcreation_time\fP
+The time when the control file was created.
+.TP
+\fBdata_file_name\fP
+The data file name (deprecated).
+.TP
+\fBenvid\fP
+Original envelope id form ESMTP.
+.TP
+\fBerror_recipient\fP
+The error recipient (deprecated).
+.TP
+\fBflags\fP
+Array of characters that can be the following values:
+.PD 0
+.RS +8
+.TP 8
+w
+warning message has been sent
+.TP 8
+r
+This is an error respone or DSN
+.TP 8
+8
+has 8 bit data in body
+.TP 8
+b
+delete Bcc: headers
+.TP 8
+d
+envelope has DSN RET= parameter
+.TP 8
+n
+don't return body
+.PD
+.RE
+.TP
+\fBheaders\fP
+This is a Perl hash where the keys are rfc822 field names and the values
+are rfc822 field values. If a field has only one value it will be returned
+as a string. If a field has more than one value (e.g. 'Received') it will
+be returned as a list of strings.
+.TP
+\fBinode_number\fP
+The inode number for the data (body) file.
+.TP
+\fBnext_delivery_time\fP
+Earliest time of next delivery attempt.
+.TP
+\fBnum_delivery_attempts\fP
+Number of delivery attempts that have been made.
+.TP
+\fBmacro\fP
+Defined macro.
+.TP
+\fBmessage\fP
+Envelope status message.
+.TP
+\fBoriginal_recipient\fP
+Original recipient (ORCPT= parameter).
+.TP
+\fBpriority\fP
+Adjusted priority of message.
+.TP
+\fBrecipient\fP
+Array of character flags followed by colon and recipient name. Flags:
+.PD 0
+.RS +8
+.TP 8
+N
+Has NOTIFY= parameter.
+.TP 8
+S
+Success DSN requested.
+.TP 8
+F
+Failure DSN requested.
+.TP 8
+D
+Delay DSN requested.
+.TP 8
+P
+Primary address (not the result of alias/forward expansion).
+.PD
+.RE
+.TP
+\fBsender\fP
+Sender
+.TP
+\fBversion\fP
+Version of control file.
+.SH EXAMPLES
+.TP
+\fBqtool.pl q2 q1\fP
+Moves all of the queue files in queue q1 to queue q2.
+.TP
+\fBqtool.pl q2 q1/d6CLQh100847\fP
+Moves the message with id d6CLQh100847 in queue q1 to queue q2.
+.TP
+\fBqtool.pl q2 q1/qfd6CLQh100847\fP
+Moves the message with id d6CLQh100847 in queue q1 to queue q2.
+.TP
+\fBqtool.pl -e '$msg{num_delivery_attempts} == 3' /q2 /q1\fP
+Moves all of the queue files that have had three attempted deliveries from
+queue q1 to queue q2.
+.SH BUGS
+In sendmail 8.12, it is possible for a message's qf and df files
+to be stored in different queues.
+In this situation, you must give qtool the pathname of the qf file,
+not of the df file.
+To be safe, never feed qtool the pathname of a df file.
+.SH SEE ALSO
+sendmail(8)
+.SH HISTORY
+The
+.B qtool
+command appeared in
+sendmail 8.10.
diff --git a/debian/local/qtool.pl b/debian/local/qtool.pl
new file mode 100644
index 0000000..aa25fb2
--- /dev/null
+++ b/debian/local/qtool.pl
@@ -0,0 +1,1234 @@
+#!/usr/bin/env perl
+##
+## Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+## All rights reserved.
+##
+## $Id: qtool.pl,v 8.20 2000/12/05 16:10:07 dmoen Exp $
+##
+use strict;
+use File::Basename;
+use File::Copy;
+use File::Spec;
+use Fcntl qw(:flock :DEFAULT);
+use Getopt::Std;
+
+##
+## QTOOL
+## This program is for moving files between sendmail queues. It is
+## pretty similar to just moving the files manually, but it locks the files
+## the same way sendmail does to prevent problems.
+##
+## The syntax is the reverse of mv (ie. the target argument comes
+## first). This lets you pick the files you want to move using find and
+## xargs.
+##
+## Since you cannot delete queues while sendmail is running, QTOOL
+## assumes that when you specify a directory as a source, you mean that you
+## want all of the queue files within that directory moved, not the
+## directory itself.
+##
+## There is a mechanism for adding conditionals for moving the files.
+## Just create an Object with a check_move(source, dest) method and add it
+## to the $conditions object. See the handling of the '-s' option for an
+## example.
+##
+
+##
+## OPTION NOTES
+##
+## The -e option:
+## The -e option takes any valid perl expression and evaluates it
+## using the eval() function. Inside the expression the variable
+## '$msg' is bound to the ControlFile object for the current source
+## queue message. This lets you check for any value in the message
+## headers or the control file. Here's an example:
+##
+## ./qtool.pl -e '$msg->{num_delivery_attempts} >= 2' /q1 /q2
+##
+## This would move any queue files whose number of delivery attempts
+## is greater than or equal to 2 from the queue 'q2' to the queue 'q1'.
+##
+## See the function ControlFile::parse for a list of available
+## variables.
+##
+
+my %opts;
+my %sources;
+my $dst_name;
+my $destination;
+my $source_name;
+my $source;
+my $result;
+my $action;
+my $new_condition;
+my $conditions = new Compound();
+
+Getopt::Std::getopts('bC:de:s:', \%opts);
+
+sub move_action
+{
+ my $source = shift;
+ my $destination = shift;
+
+ $result = $destination->add($source);
+ if ($result)
+ {
+ print("$result.\n");
+ }
+}
+
+sub delete_action
+{
+ my $source = shift;
+
+ return $source->delete();
+}
+
+sub bounce_action
+{
+ my $source = shift;
+
+ return $source->bounce();
+}
+
+$action = \&move_action;
+if (defined $opts{d})
+{
+ $action = \&delete_action;
+}
+elsif (defined $opts{b})
+{
+ $action = \&bounce_action;
+}
+
+if (defined $opts{s})
+{
+ $new_condition = new OlderThan($opts{s});
+ $conditions->add($new_condition);
+}
+
+if (defined $opts{e})
+{
+ $new_condition = new Eval($opts{e});
+ $conditions->add($new_condition);
+}
+
+if ($action == \&move_action)
+{
+ $dst_name = shift(@ARGV);
+ if (!-d $dst_name)
+ {
+ print("The destination '$dst_name' must be an existing " .
+ "directory.\n");
+ usage();
+ exit;
+ }
+ $destination = new Queue($dst_name);
+}
+
+# determine queue_root by reading config file
+my $queue_root;
+{
+ my $config_file = "/etc/mail/sendmail.cf";
+ if (defined $opts{C})
+ {
+ $config_file = $opts{C};
+ }
+
+ my $line;
+ open(CONFIG_FILE, $config_file) or die "$config_file: $!";
+ while ($line = <CONFIG_FILE>)
+ {
+ chomp $line;
+ if ($line =~ m/^O QueueDirectory=(.*)/)
+ {
+ $queue_root = $1;
+ if ($queue_root =~ m/(.*)\/[^\/]+\*$/)
+ {
+ $queue_root = $1;
+ }
+ last;
+ }
+ }
+ close(CONFIG_FILE);
+ if (!defined $queue_root)
+ {
+ die "QueueDirectory option not defined in $config_file";
+ }
+}
+
+while (@ARGV)
+{
+ $source_name = shift(@ARGV);
+ $result = add_source(\%sources, $source_name);
+ if ($result)
+ {
+ print("$result.\n");
+ exit;
+ }
+}
+
+if (keys(%sources) == 0)
+{
+ exit;
+}
+
+while (($source_name, $source) = each(%sources))
+{
+ $result = $conditions->check_move($source, $destination);
+ if ($result)
+ {
+ $result = &{$action}($source, $destination);
+ if ($result)
+ {
+ print("$result\n");
+ }
+ }
+}
+
+sub usage
+{
+ print("Usage: $0 [options] directory source ...\n");
+ print(" $0 [-d|-b] source ...\n");
+ print("options:\n");
+ print(" -b Bounce the messages specified by source.\n");
+ print(" -C configfile Specify sendmail config file.\n");
+ print(" -d Delete the messages specified by source.\n");
+ print(" -e [perl expression] Move only messages for which perl expression returns true.\n");
+ print(" -s [seconds] Move only messages whose qf file is older than seconds.\n");
+}
+
+##
+## ADD_SOURCE -- Adds a source to the source hash.
+##
+## Determines whether source is a file, directory, or id. Then it
+## creates a QueuedMessage or Queue for that source and adds it to the
+## list.
+##
+## Parameters:
+## sources -- A hash that contains all of the sources.
+## source_name -- The name of the source to add
+##
+## Returns:
+## error_string -- Undef if ok. Error string otherwise.
+##
+## Notes:
+## If a new source comes in with the same ID as a previous
+## source, the previous source gets overwritten in the sources
+## hash. This lets the user specify things like * and it still
+## works nicely.
+##
+
+sub add_source
+{
+ my $sources = shift;
+ my $source_name = shift;
+ my $source_base_name;
+ my $source_dir_name;
+ my $data_dir_name;
+ my $source_id;
+ my $source_prefix;
+ my $queued_message;
+ my $queue;
+ my $result;
+
+ ($source_base_name, $source_dir_name) = File::Basename::fileparse($source_name);
+ $data_dir_name = $source_dir_name;
+
+ $source_prefix = substr($source_base_name, 0, 2);
+ if (!-d $source_name && $source_prefix ne 'qf' &&
+ $source_prefix ne 'df')
+ {
+ $source_base_name = "qf$source_base_name";
+ $source_name = File::Spec->catfile("$source_dir_name",
+ "$source_base_name");
+ }
+ $source_id = substr($source_base_name, 2);
+
+ if (!-e $source_name)
+ {
+ $source_name = File::Spec->catfile("$source_dir_name", "qf",
+ "qf$source_id");
+ if (!-e $source_name)
+ {
+ return "'$source_name' does not exist";
+ }
+ $data_dir_name = File::Spec->catfile("$source_dir_name", "df");
+ if (!-d $data_dir_name)
+ {
+ $data_dir_name = $source_dir_name;
+ }
+ $source_dir_name = File::Spec->catfile("$source_dir_name",
+ "qf");
+ }
+
+ if (-f $source_name)
+ {
+ $queued_message = new QueuedMessage($source_dir_name,
+ $source_id,
+ $data_dir_name);
+ $sources->{$source_id} = $queued_message;
+ return undef;
+ }
+
+ if (!-d $source_name)
+ {
+ return "'$source_name' is not a plain file or a directory";
+ }
+
+ $queue = new Queue($source_name);
+ $result = $queue->read();
+ if ($result)
+ {
+ return $result;
+ }
+
+ while (($source_id, $queued_message) = each(%{$queue->{files}}))
+ {
+ $sources->{$source_id} = $queued_message;
+ }
+
+ return undef;
+}
+
+##
+## LOCK_FILE -- Opens and then locks a file.
+##
+## Opens a file for read/write and uses flock to obtain a lock on the
+## file. The flock is Perl's flock which defaults to flock on systems
+## that support it. On systems without flock it falls back to fcntl
+## locking.
+##
+## Parameters:
+## file_name -- The name of the file to open and lock.
+##
+## Returns:
+## (file_handle, error_string) -- If everything works then
+## file_handle is a reference to a file handle and
+## error_string is undef. If there is a problem then
+## file_handle is undef and error_string is a string
+## explaining the problem.
+##
+
+sub lock_file
+{
+ my $file_name = shift;
+ my $result;
+
+ $result = sysopen(FILE_TO_LOCK, $file_name, Fcntl::O_RDWR);
+ if (!$result)
+ {
+ return (undef, "Unable to open '$file_name': $!");
+ }
+
+ $result = flock(FILE_TO_LOCK, Fcntl::LOCK_EX | Fcntl::LOCK_NB);
+ if (!$result)
+ {
+ return (undef, "Could not obtain lock on '$file_name': $!");
+ }
+
+ return (\*FILE_TO_LOCK, undef);
+}
+
+##
+## UNLOCK_FILE -- Unlocks a file.
+##
+## Unlocks a file using Perl's flock.
+##
+## Parameters:
+## file -- A file handle.
+##
+## Returns:
+## error_string -- If undef then no problem. Otherwise it is a
+## string that explains problem.
+##
+
+sub unlock_file
+{
+ my $file = shift;
+ my $result;
+
+ $result = flock($file, Fcntl::LOCK_UN);
+ if (!$result)
+ {
+ return "Unlock failed on '$result': $!";
+ }
+
+ return undef;
+}
+
+##
+## MOVE_FILE -- Moves a file.
+##
+## Moves a file.
+##
+## Parameters:
+## src_name -- The name of the file to be move.
+## dst_nome -- The name of the place to move it to.
+##
+## Returns:
+## error_string -- If undef then no problem. Otherwise it is a
+## string that explains problem.
+##
+
+sub move_file
+{
+ my $src_name = shift;
+ my $dst_name = shift;
+ my $result;
+
+ $result = File::Copy::move($src_name, $dst_name);
+ if (!$result)
+ {
+ return "File move from '$src_name' to '$dst_name' failed: $!";
+ }
+
+ return undef;
+}
+
+
+##
+## CONTROL_FILE - Represents a sendmail queue control file.
+##
+## This object represents represents a sendmail queue control file.
+## It can parse and lock its file.
+##
+
+
+package ControlFile;
+
+sub new
+{
+ my $this = shift;
+ my $class = ref($this) || $this;
+ my $self = {};
+ bless $self, $class;
+ $self->initialize(@_);
+ return $self;
+}
+
+sub initialize
+{
+ my $self = shift;
+ my $queue_dir = shift;
+ $self->{id} = shift;
+
+ $self->{file_name} = $queue_dir . '/qf' . $self->{id};
+ $self->{headers} = {};
+}
+
+##
+## PARSE - Parses the control file.
+##
+## Parses the control file. It just sticks each entry into a hash.
+## If a key has more than one entry, then it points to a list of
+## entries.
+##
+
+sub parse
+{
+ my $self = shift;
+ if ($self->{parsed})
+ {
+ return;
+ }
+ my %parse_table =
+ (
+ 'A' => 'auth',
+ 'B' => 'body_type',
+ 'C' => 'controlling_user',
+ 'D' => 'data_file_name',
+ 'd' => 'data_file_directory',
+ 'E' => 'error_recipient',
+ 'F' => 'flags',
+ 'H' => 'parse_header',
+ 'I' => 'inode_number',
+ 'K' => 'next_delivery_time',
+ 'L' => 'content-length',
+ 'M' => 'message',
+ 'N' => 'num_delivery_attempts',
+ 'P' => 'priority',
+ 'Q' => 'original_recipient',
+ 'R' => 'recipient',
+ 'S' => 'sender',
+ 'T' => 'creation_time',
+ 'V' => 'version',
+ 'X' => 'charset',
+ 'Z' => 'envid',
+ '$' => 'macro'
+ );
+ my $line;
+ my $line_type;
+ my $line_value;
+ my $member_name;
+ my $member;
+ my $last_type;
+
+ open(CONTROL_FILE, "$self->{file_name}");
+ while ($line = <CONTROL_FILE>)
+ {
+ $line_type = substr($line, 0, 1);
+ if ($line_type eq "\t" && $last_type eq 'H')
+ {
+ $line_type = 'H';
+ $line_value = $line;
+ }
+ else
+ {
+ $line_value = substr($line, 1);
+ }
+ $member_name = $parse_table{$line_type};
+ $last_type = $line_type;
+ if (!$member_name)
+ {
+ $member_name = 'unknown';
+ }
+ if ($self->can($member_name))
+ {
+ $self->$member_name($line_value);
+ }
+ $member = $self->{$member_name};
+ if (!$member)
+ {
+ $self->{$member_name} = $line_value;
+ next;
+ }
+ if (ref($member) eq 'ARRAY')
+ {
+ push(@{$member}, $line_value);
+ next;
+ }
+ $self->{$member_name} = [$member, $line_value];
+ }
+ close(CONTROL_FILE);
+
+ $self->{parsed} = 1;
+}
+
+sub parse_header
+{
+ my $self = shift;
+ my $line = shift;
+ my $headers = $self->{headers};
+ my $last_header = $self->{last_header};
+ my $header_name;
+ my $header_value;
+ my $first_char;
+
+ $first_char = substr($line, 0, 1);
+ if ($first_char eq "?")
+ {
+ $line = substr($line, 3);
+ }
+ elsif ($first_char eq "\t")
+ {
+ if (ref($headers->{$last_header}) eq 'ARRAY')
+ {
+ $headers->{$last_header}[-1] =
+ $headers->{$last_header}[-1] . $line;
+ }
+ else
+ {
+ $headers->{$last_header} = $headers->{$last_header} .
+ $line;
+ }
+ return;
+ }
+ ($header_name, $header_value) = split(/:/, $line, 2);
+ $self->{last_header} = $header_name;
+ if (exists $headers->{$header_name})
+ {
+ $headers->{$header_name} = [$headers->{$header_name},
+ $header_value];
+ }
+ else
+ {
+ $headers->{$header_name} = $header_value;
+ }
+}
+
+sub is_locked
+{
+ my $self = shift;
+
+ return (defined $self->{lock_handle});
+}
+
+sub lock
+{
+ my $self = shift;
+ my $lock_handle;
+ my $result;
+
+ if ($self->is_locked())
+ {
+ # Already locked
+ return undef;
+ }
+
+ ($lock_handle, $result) = ::lock_file($self->{file_name});
+ if (!$lock_handle)
+ {
+ return $result;
+ }
+
+ $self->{lock_handle} = $lock_handle;
+
+ return undef;
+}
+
+sub unlock
+{
+ my $self = shift;
+ my $result;
+
+ if (!$self->is_locked())
+ {
+ # Not locked
+ return undef;
+ }
+
+ $result = ::unlock_file($self->{lock_handle});
+
+ $self->{lock_handle} = undef;
+
+ return $result;
+}
+
+sub do_stat
+{
+ my $self = shift;
+ my $result;
+ my @result;
+
+ $result = open(QUEUE_FILE, $self->{file_name});
+ if (!$result)
+ {
+ return "Unable to open '$self->{file_name}': $!";
+ }
+ @result = stat(QUEUE_FILE);
+ if (!@result)
+ {
+ return "Unable to stat '$self->{file_name}': $!";
+ }
+ $self->{control_size} = $result[7];
+ $self->{control_last_mod_time} = $result[9];
+}
+
+sub DESTROY
+{
+ my $self = shift;
+
+ $self->unlock();
+}
+
+sub delete
+{
+ my $self = shift;
+ my $result;
+
+ $result = unlink($self->{file_name});
+ if (!$result)
+ {
+ return "Unable to delete $self->{file_name}: $!";
+ }
+ return undef;
+}
+
+
+##
+## DATA_FILE - Represents a sendmail queue data file.
+##
+## This object represents represents a sendmail queue data file.
+## It is really just a place-holder.
+##
+
+package DataFile;
+
+sub new
+{
+ my $this = shift;
+ my $class = ref($this) || $this;
+ my $self = {};
+ bless $self, $class;
+ $self->initialize(@_);
+ return $self;
+}
+
+sub initialize
+{
+ my $self = shift;
+ my $data_dir = shift;
+ $self->{id} = shift;
+ my $control_file = shift;
+
+ $self->{file_name} = $data_dir . '/df' . $self->{id};
+ return if -e $self->{file_name};
+ $control_file->parse();
+ return if !defined $control_file->{data_file_directory};
+ $data_dir = $queue_root . '/' . $control_file->{data_file_directory};
+ chomp $data_dir;
+ if (-d ($data_dir . '/df'))
+ {
+ $data_dir .= '/df';
+ }
+ $self->{file_name} = $data_dir . '/df' . $self->{id};
+}
+
+sub do_stat
+{
+ my $self = shift;
+ my $result;
+ my @result;
+
+ $result = open(QUEUE_FILE, $self->{file_name});
+ if (!$result)
+ {
+ return "Unable to open '$self->{file_name}': $!";
+ }
+ @result = stat(QUEUE_FILE);
+ if (!@result)
+ {
+ return "Unable to stat '$self->{file_name}': $!";
+ }
+ $self->{body_size} = $result[7];
+ $self->{body_last_mod_time} = $result[9];
+}
+
+sub delete
+{
+ my $self = shift;
+ my $result;
+
+ $result = unlink($self->{file_name});
+ if (!$result)
+ {
+ return "Unable to delete $self->{file_name}: $!";
+ }
+ return undef;
+}
+
+
+##
+## QUEUED_MESSAGE - Represents a queued sendmail message.
+##
+## This keeps track of the files that make up a queued sendmail
+## message.
+## Currently it has 'control_file' and 'data_file' as members.
+##
+## You can tie it to a fetch only hash using tie. You need to
+## pass a reference to a QueuedMessage as the third argument
+## to tie.
+##
+
+package QueuedMessage;
+
+sub new
+{
+ my $this = shift;
+ my $class = ref($this) || $this;
+ my $self = {};
+ bless $self, $class;
+ $self->initialize(@_);
+ return $self;
+}
+
+sub initialize
+{
+ my $self = shift;
+ my $queue_dir = shift;
+ my $id = shift;
+ my $data_dir = shift;
+
+ $self->{id} = $id;
+ $self->{control_file} = new ControlFile($queue_dir, $id);
+ if (!$data_dir)
+ {
+ $data_dir = $queue_dir;
+ }
+ $self->{data_file} = new DataFile($data_dir, $id, $self->{control_file});
+}
+
+sub last_modified_time
+{
+ my $self = shift;
+ my @result;
+ @result = stat($self->{data_file}->{file_name});
+ return $result[9];
+}
+
+sub TIEHASH
+{
+ my $this = shift;
+ my $class = ref($this) || $this;
+ my $self = shift;
+ return $self;
+}
+
+sub FETCH
+{
+ my $self = shift;
+ my $key = shift;
+
+ if (exists $self->{control_file}->{$key})
+ {
+ return $self->{control_file}->{$key};
+ }
+ if (exists $self->{data_file}->{$key})
+ {
+ return $self->{data_file}->{$key};
+ }
+
+ return undef;
+}
+
+sub lock
+{
+ my $self = shift;
+
+ return $self->{control_file}->lock();
+}
+
+sub unlock
+{
+ my $self = shift;
+
+ return $self->{control_file}->unlock();
+}
+
+sub move
+{
+ my $self = shift;
+ my $destination = shift;
+ my $df_dest;
+ my $qf_dest;
+ my $result;
+
+ $result = $self->lock();
+ if ($result)
+ {
+ return $result;
+ }
+
+ $qf_dest = File::Spec->catfile($destination, "qf");
+ if (-d $qf_dest)
+ {
+ $df_dest = File::Spec->catfile($destination, "df");
+ if (!-d $df_dest)
+ {
+ $df_dest = $destination;
+ }
+ }
+ else
+ {
+ $qf_dest = $destination;
+ $df_dest = $destination;
+ }
+
+ if (-e File::Spec->catfile($qf_dest, "qf$self->{id}"))
+ {
+ $result = "There is already a queued message with id '$self->{id}' in '$destination'";
+ }
+
+ if (!$result)
+ {
+ $result = ::move_file($self->{data_file}->{file_name},
+ $df_dest);
+ }
+
+ if (!$result)
+ {
+ $result = ::move_file($self->{control_file}->{file_name},
+ $qf_dest);
+ }
+
+ $self->unlock();
+
+ return $result;
+}
+
+sub parse
+{
+ my $self = shift;
+
+ return $self->{control_file}->parse();
+}
+
+sub do_stat
+{
+ my $self = shift;
+
+ $self->{control_file}->do_stat();
+ $self->{data_file}->do_stat();
+}
+
+sub setup_vars
+{
+ my $self = shift;
+
+ $self->parse();
+ $self->do_stat();
+}
+
+sub delete
+{
+ my $self = shift;
+ my $result;
+
+ $result = $self->{control_file}->delete();
+ if ($result)
+ {
+ return $result;
+ }
+ $result = $self->{data_file}->delete();
+ if ($result)
+ {
+ return $result;
+ }
+
+ return undef;
+}
+
+sub bounce
+{
+ my $self = shift;
+ my $command;
+
+ $command = "sendmail -qI$self->{id} -O Timeout.queuereturn=now";
+# print("$command\n");
+ system($command);
+}
+
+##
+## QUEUE - Represents a queued sendmail queue.
+##
+## This manages all of the messages in a queue.
+##
+
+package Queue;
+
+sub new
+{
+ my $this = shift;
+ my $class = ref($this) || $this;
+ my $self = {};
+ bless $self, $class;
+ $self->initialize(@_);
+ return $self;
+}
+
+sub initialize
+{
+ my $self = shift;
+
+ $self->{queue_dir} = shift;
+ $self->{files} = {};
+}
+
+##
+## READ - Loads the queue with all of the objects that reside in it.
+##
+## This reads the queue's directory and creates QueuedMessage objects
+## for every file in the queue that starts with 'qf'.
+##
+
+sub read
+{
+ my $self = shift;
+ my @control_files;
+ my $queued_message;
+ my $file_name;
+ my $id;
+ my $result;
+ my $control_dir;
+ my $data_dir;
+
+ $control_dir = File::Spec->catfile($self->{queue_dir}, 'qf');
+
+ if (-e $control_dir)
+ {
+ $data_dir = File::Spec->catfile($self->{queue_dir}, 'df');
+ if (!-e $data_dir)
+ {
+ $data_dir = $self->{queue_dir};
+ }
+ }
+ else
+ {
+ $data_dir = $self->{queue_dir};
+ $control_dir = $self->{queue_dir};
+ }
+
+ $result = opendir(QUEUE_DIR, $control_dir);
+ if (!$result)
+ {
+ return "Unable to open directory '$control_dir'";
+ }
+
+ @control_files = grep { /^qf.*/ && -f "$control_dir/$_" } readdir(QUEUE_DIR);
+ closedir(QUEUE_DIR);
+ foreach $file_name (@control_files)
+ {
+ $id = substr($file_name, 2);
+ $queued_message = new QueuedMessage($control_dir, $id,
+ $data_dir);
+ $self->{files}->{$id} = $queued_message;
+ }
+
+ return undef;
+}
+
+
+##
+## ADD_QUEUED_MESSAGE - Adds a QueuedMessage to this Queue.
+##
+## Adds the QueuedMessage object to the hash and moves the files
+## associated with the QueuedMessage to this Queue's directory.
+##
+
+sub add_queued_message
+{
+ my $self = shift;
+ my $queued_message = shift;
+ my $result;
+
+ $result = $queued_message->move($self->{queue_dir});
+ if ($result)
+ {
+ return $result;
+ }
+
+ $self->{files}->{$queued_message->{id}} = $queued_message;
+
+ return $result;
+}
+
+##
+## ADD_QUEUE - Adds another Queue's QueuedMessages to this Queue.
+##
+## Adds all of the QueuedMessage objects in the passed in queue
+## to this queue.
+##
+
+sub add_queue
+{
+ my $self = shift;
+ my $queue = shift;
+ my $id;
+ my $queued_message;
+ my $result;
+
+ while (($id, $queued_message) = each %{$queue->{files}})
+ {
+ $result = $self->add_queued_message($queued_message);
+ if ($result)
+ {
+ print("$result.\n");
+ }
+ }
+}
+
+##
+## ADD - Adds an item to this queue.
+##
+## Adds either a Queue or a QueuedMessage to this Queue.
+##
+
+sub add
+{
+ my $self = shift;
+ my $source = shift;
+ my $type_name;
+ my $result;
+
+ $type_name = ref($source);
+
+ if ($type_name eq "QueuedMessage")
+ {
+ return $self->add_queued_message($source);
+ }
+
+ if ($type_name eq "Queue")
+ {
+ return $self->add_queue($source);
+ }
+
+ return "Queue does not know how to add a '$type_name'"
+}
+
+sub delete
+{
+ my $self = shift;
+ my $id;
+ my $queued_message;
+
+ while (($id, $queued_message) = each %{$self->{files}})
+ {
+ $result = $queued_message->delete();
+ if ($result)
+ {
+ print("$result.\n");
+ }
+ }
+}
+
+sub bounce
+{
+ my $self = shift;
+ my $id;
+ my $queued_message;
+
+ while (($id, $queued_message) = each %{$self->{files}})
+ {
+ $result = $queued_message->bounce();
+ if ($result)
+ {
+ print("$result.\n");
+ }
+ }
+}
+
+##
+## Condition Class
+##
+## This next section is for any class that has an interface called
+## check_move(source, dest). Each class represents some condition to
+## check for to determine whether we should move the file from
+## source to dest.
+##
+
+
+##
+## OlderThan
+##
+## This Condition Class checks the modification time of the
+## source file and returns true if the file's modification time is
+## older than the number of seconds the class was initialzed with.
+##
+
+package OlderThan;
+
+sub new
+{
+ my $this = shift;
+ my $class = ref($this) || $this;
+ my $self = {};
+ bless $self, $class;
+ $self->initialize(@_);
+ return $self;
+}
+
+sub initialize
+{
+ my $self = shift;
+
+ $self->{age_in_seconds} = shift;
+}
+
+sub check_move
+{
+ my $self = shift;
+ my $source = shift;
+
+ if ((time() - $source->last_modified_time()) > $self->{age_in_seconds})
+ {
+ return 1;
+ }
+
+ return 0;
+}
+
+##
+## Compound
+##
+## Takes a list of Move Condition Classes. Check_move returns true
+## if every Condition Class in the list's check_move function returns
+## true.
+##
+
+package Compound;
+
+sub new
+{
+ my $this = shift;
+ my $class = ref($this) || $this;
+ my $self = {};
+ bless $self, $class;
+ $self->initialize(@_);
+ return $self;
+}
+
+sub initialize
+{
+ my $self = shift;
+
+ $self->{condition_list} = [];
+}
+
+sub add
+{
+ my $self = shift;
+ my $new_condition = shift;
+
+ push(@{$self->{condition_list}}, $new_condition);
+}
+
+sub check_move
+{
+ my $self = shift;
+ my $source = shift;
+ my $dest = shift;
+ my $condition;
+ my $result;
+
+ foreach $condition (@{$self->{condition_list}})
+ {
+ if (!$condition->check_move($source, $dest))
+ {
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+##
+## Eval
+##
+## Takes a perl expression and evaluates it. The ControlFile object
+## for the source QueuedMessage is avaliable through the name '$msg'.
+##
+
+package Eval;
+
+sub new
+{
+ my $this = shift;
+ my $class = ref($this) || $this;
+ my $self = {};
+ bless $self, $class;
+ $self->initialize(@_);
+ return $self;
+}
+
+sub initialize
+{
+ my $self = shift;
+
+ $self->{expression} = shift;
+}
+
+sub check_move
+{
+ my $self = shift;
+ my $source = shift;
+ my $dest = shift;
+ my $result;
+ my %msg;
+
+ $source->setup_vars();
+ tie(%msg, 'QueuedMessage', $source);
+ $result = eval($self->{expression});
+
+ return $result;
+}
diff --git a/debian/local/runq.8 b/debian/local/runq.8
new file mode 100644
index 0000000..2e639e4
--- /dev/null
+++ b/debian/local/runq.8
@@ -0,0 +1,31 @@
+.TH RUNQ 8 "2000 August 29" "Debian Distribution" \" -*- nroff -*-
+.SH NAME
+runq \- run the sendmail queue
+.SH SYNOPSIS
+.B runq
+.br
+.B runq
+.I sendmail options
+.br
+.B runq
+{ \-\-help, \-\-version }
+.SH DESCRIPTION
+This
+.B runq
+command is a wrapper around sendmail which tells it to run the mail
+queue in the background.
+.SH OPTIONS
+When called with exactly one argument, the following options are
+handled internally:
+.TP
+.I "\-\-help"
+Print a usage message on standard output and exit successfully.
+.TP
+.I "\-\-version"
+Print version information on standard output then exit successfully.
+.P
+In other cases, the options are simply passed on to
+.B sendmail -q.
+.SH "SEE ALSO"
+.LP
+.BR sendmail (8).
diff --git a/debian/local/sendmail.in b/debian/local/sendmail.in
new file mode 100644
index 0000000..f1dcb61
--- /dev/null
+++ b/debian/local/sendmail.in
@@ -0,0 +1,1121 @@
+#!/bin/sh -e
+#-----------------------------------------------------------------------------
+# $Sendmail: sm_helper.sh,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# Debian helper function script for Debian Sendmail
+# Note: this file supports @SM_MINVERS@ - @SM_MAXVERS@
+#
+# Notes (to all):
+# *
+#
+# Notes (to self):
+# * clean_queues fubar, esp wrt MSP
+#
+#-----------------------------------------------------------------------------
+#
+set -e;
+
+#------------------------------------------------------------------------------
+# Parameters for the sendmail daemon
+# Do *NOT* touch these lines, instead, edit /etc/mail/sendmail.conf
+# The _PARMS lines are listed in precedence order
+#------------------------------------------------------------------------------
+Get_Parameters () {
+
+ # Main configuration parameters in /etc/mail/sendmail.conf
+ DAEMON_MODE='Daemon';
+ DAEMON_PARMS='';
+ QUEUE_MODE="$DAEMON_MODE";
+ QUEUE_INTERVAL='10';
+ QUEUE_PARMS='';
+ MSP_MODE="$QUEUE_MODE";
+ MSP_INTERVAL="$QUEUE_INTERVAL";
+ MSP_PARMS="$QUEUE_PARMS";
+ MISC_PARMS='';
+ CRON_PARMS='';
+
+ # Secondary (non-documented) parameters in /etc/mail/sendmail.conf
+ # Caveat Emptor: change these at your own risk - they impact several
+ # disjoint pieces parts...
+ SENDMAIL_ROOT='@localstatedir@/run/sendmail';
+ MTA_DAEMON='@sbindir@/sendmail';
+ MTA_COMMAND='@sbindir@/sendmail';
+ MTA_A='-Am';
+ MTAL_L='-L sm-mta';
+ MTAL_L_QUEUE='-L sm-mta-queue';
+ MTAL_L_RUNQ='-L sm-mta-runq';
+ MTA_ROOT="${SENDMAIL_ROOT}/mta";
+ MTAL_PIDFILE="${MTA_ROOT}/sendmail.pid";
+ MTAQ_L='-L sm-que';
+ MTAQ_L_RUNQ='-L sm-que-runq';
+ MTAQ_PIDFILE="${MTA_ROOT}/queue.pid";
+ MSP_DAEMON='@sbindir@/sendmail';
+ MSP_COMMAND='@sbindir@/sendmail';
+ MSP_A='-Ac';
+ MSP_L='-L sm-msp';
+ MSP_L_QUEUE='-L sm-msp-queue';
+ MSP_ROOT="${SENDMAIL_ROOT}/msp";
+ MSP_PIDFILE="${MSP_ROOT}/sendmail.pid";
+
+ # Pull in any user modified variables
+ if [ -f @sysconfdir@/mail/sendmail.conf ]; then
+ . @sysconfdir@/mail/sendmail.conf;
+ fi;
+
+ # Sanitize some keyword entries
+ DAEMON_MODE=$(echo "$DAEMON_MODE" | tr '[:upper:]' '[:lower:]');
+ QUEUE_MODE=$(echo "$QUEUE_MODE" | tr '[:upper:]' '[:lower:]');
+ MSP_MODE=$(echo "$MSP_MODE" | tr '[:upper:]' '[:lower:]');
+
+ # These can't be user customized
+ SM_Get_Parameters='yes';
+ PATH='/bin:/usr/bin:/sbin:/usr/sbin';
+ STAMP_DIR="${SENDMAIL_ROOT}/stampdir";
+ START_MTAL_CMD="start-stop-daemon \
+ --pidfile $MTAL_PIDFILE \
+ --exec $MTA_DAEMON \
+ --startas $MTA_COMMAND \
+ --start";
+ STOP_MTAL_CMD="start-stop-daemon \
+ --pidfile $MTAL_PIDFILE \
+ --stop";
+ SIGNAL_MTAL_CMD="start-stop-daemon \
+ --pidfile $MTAL_PIDFILE \
+ --stop";
+ START_MTAQ_CMD="start-stop-daemon \
+ --pidfile $MTAQ_PIDFILE \
+ --make-pidfile \
+ --exec $MTA_DAEMON \
+ --startas $MTA_COMMAND \
+ --start";
+ STOP_MTAQ_CMD="start-stop-daemon \
+ --pidfile $MTAQ_PIDFILE \
+ --stop";
+ SIGNAL_MTAQ_CMD="start-stop-daemon \
+ --pidfile $MTAQ_PIDFILE \
+ --stop";
+ START_MSP_CMD="start-stop-daemon \
+ --pidfile $MSP_PIDFILE \
+ --make-pidfile \
+ --exec $MSP_DAEMON \
+ --startas $MSP_COMMAND \
+ --chuid smmsp \
+ --start";
+ STOP_MSP_CMD="start-stop-daemon \
+ --pidfile $MSP_PIDFILE \
+ --stop";
+ SIGNAL_MSP_CMD="start-stop-daemon \
+ --pidfile $MSP_PIDFILE \
+ --stop";
+ NAME='sendmail';
+ FLAGS='defaults 50';
+
+ # Support for coexistance with smtpd package
+ SMTPD='/usr/sbin/smtpd';
+
+ # See if we can share the listener and queue-runner daemon:
+ # * Both must be in daemon mode
+ # * They must have the same (possibly empty) parameters
+ if [ "$DAEMON_MODE" = "daemon" \
+ -a "$QUEUE_MODE" = "daemon" \
+ -a "$DAEMON_PARMS" = "$QUEUE_PARMS" ]; then
+ SPLIT_DAEMON=0;
+ else
+ SPLIT_DAEMON=1;
+ fi;
+
+ # Version dependant support:
+ # 8.12.0+ M{TA,MSP}_A
+ if [ ! -f @datadir@/sendmail/cf/feature/msp.m4 ]; then
+ MTA_A='';
+ MTAL_L='';
+ MTAL_L_QUEUE='';
+ MSP_A='';
+ MSP_L='';
+ MSP_L_QUEUE='';
+ fi;
+ };
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# enhanced sendmail startup
+#------------------------------------------------------------------------------
+start_mta () {
+ #
+ # Make sure @localstatedir@/run/sendmail/ exists
+ check_dirs;
+ #
+ # If already running, don't start it...
+ if is_running mta; then
+ echo 'MTA is already running.';
+ return;
+ fi;
+ #
+ # Check if we're going to run a daemon (and how many):
+ daemon_check;
+ #
+ # Mark restarted for communication betwixt here and /etc/mail/Makefile
+ touch $STAMP_DIR/reload;
+ #
+ # Allow Unix (local) connections betwixt MSP/MTA:
+ touch $MTA_ROOT/smsocket;
+ #
+ # We can only afford to clean the MTA queues if running daemon mode,
+ # otherwise, there is a chance that a cronjob might still be using
+ # the queue... Thats also why we don't clean the MSP queues herein.
+ clean_queues;
+ #
+ # cd to a safe place to stash core files...
+ cd $MTA_ROOT;
+ $START_MTAL_CMD -- $MTAL_PARMS &
+ #
+ # Update permissions on smsocket
+ sleep 2;
+ chown root:root $MTA_ROOT/smsocket;
+ chmod 0666 $MTA_ROOT/smsocket;
+ #
+ # Check for split daemon mode (separate listener/queue runner)
+ if [ "$SPLIT_DAEMON" -eq 1 ]; then
+ $START_MTAQ_CMD -- $MTAQ_PARMS &
+ fi;
+ #
+ # if running split service, run the client queues (just to make sure)
+ if check_msp; then
+ $MSP_COMMAND -q $MSP_A $MSP_L_QUEUE $MSP_PARMS $MISC_PARMS;
+ fi;
+ };
+
+start_msp () {
+ #
+ # Make sure @localstatedir@/run/sendmail/ exists
+ check_dirs;
+ #
+ # If already running, don't start it...
+ if is_running msp; then
+ echo 'MSP is already running.';
+ return;
+ fi;
+ #
+ # Check to see if MSP mode is indeed available
+ if ! check_msp; then
+ return;
+ fi;
+ #
+ # Check if we're going to run a daemon:
+ if [ "$MSP_MODE" != 'daemon' ]; then
+ return;
+ fi;
+ #
+ # We can only afford to clean the MSP queues if running daemon mode,
+ # otherwise, there is a chance that a cronjob might still be using
+ # the queue... Thats also why we don't clean the MTA queues herein.
+ #clean_queues /var/spool/mqueue-client;
+ #
+ # cd to a safe place to stash core files...
+ cd $MSP_ROOT;
+ $START_MSP_CMD -- \
+ $MSP_A $MSP_L -q${MSP_INTERVAL}m $MSP_PARMS $MISC_PARMS &
+ };
+
+start_sendmail () {
+ start_mta;
+ if check_msp; then
+ start_msp;
+ fi;
+ };
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# enhanced sendmail reload
+#------------------------------------------------------------------------------
+reload_mta () {
+ #
+ # Make sure @localstatedir@/run/sendmail/ exists
+ check_dirs;
+ #
+ # reload (signal -HUP) is *much* better/faster than stop/start
+ #
+ # Mark restarted for communication betwixt here and /etc/mail/Makefile
+ touch $STAMP_DIR/reload;
+ #
+ # If not running, just start it...
+ if ! is_running mta; then
+ start_mta;
+ fi;
+ #
+ # Is running, must signal it...
+ $SIGNAL_MTAL_CMD --signal HUP --oknodo --quiet || true;
+ sleep 2;
+ chown root:root $MTA_ROOT/smsocket;
+ chmod 0666 $MTA_ROOT/smsocket;
+ #
+ # Check for split daemon mode (separate listener/queue runner)
+ if [ "$SPLIT_DAEMON" -eq 1 ]; then
+ $SIGNAL_MTAQ_CMD --signal HUP --oknodo --quiet || true;
+ fi;
+ };
+
+reload_msp () {
+ #
+ # Make sure @localstatedir@/run/sendmail/ exists
+ check_dirs;
+ #
+ # reload (signal -HUP) is *much* better/faster than stop/start
+ #
+ # If not running, just start it...
+ if ! is_running msp; then
+ start_msp;
+ fi;
+ #
+ # Is running, must signal it...
+ $SIGNAL_MSP_CMD --signal HUP --oknodo --quiet || true;
+ };
+
+reload_sendmail () {
+ reload_mta;
+ if check_msp; then
+ reload_msp;
+ fi;
+ };
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# enhanced sendmail shutdown
+#------------------------------------------------------------------------------
+stop_mta () {
+ local cnt;
+ stopped=0;
+ #
+ # Make sure @localstatedir@/run/sendmail/ exists
+ check_dirs;
+ #
+ # If not running, don't stop it...
+ if ! is_running mta; then
+ return;
+ fi;
+ #
+ # Is running, must stop it...
+ $STOP_MTAL_CMD --signal TERM --quiet --oknodo > /dev/null;
+ #
+ # Now we have to wait until sendmail has _really_ stopped.
+ #
+ sleep 2;
+ if $STOP_MTAL_CMD --signal TERM --quiet > /dev/null; then
+ echo -n 'Waiting .';
+ cnt=0;
+ while $STOP_MTAL_CMD --signal TERM --quiet > /dev/null; do
+ cnt=`expr $cnt + 1`;
+ if [ $cnt -gt 60 ]; then
+ #
+ # Waited 120 seconds now. Fail.
+ #
+ echo -n ' Failed ';
+ stopped=1;
+ break;
+ fi;
+ sleep 2;
+ echo -n '.';
+ done;
+ echo -n ' Done ';
+ fi;
+ # Remove pidfile iff stopped
+ if ! $STOP_MTAL_CMD --signal TERM --quiet > /dev/null; then
+ rm -f "$MTAL_PIDFILE";
+ fi
+ };
+
+stop_queue () {
+ local cnt;
+ stopped=0;
+ #
+ # Make sure @localstatedir@/run/sendmail/ exists
+ check_dirs;
+ #
+ # If not running, don't stop it...
+ if ! is_running queue; then
+ return;
+ fi;
+ #
+ # Is running, must stop it...
+ $STOP_MTAQ_CMD --signal TERM --quiet --oknodo > /dev/null;
+ #
+ # Now we have to wait until sendmail has _really_ stopped.
+ #
+ sleep 2;
+ if $STOP_MTAQ_CMD --signal TERM --quiet > /dev/null; then
+ echo -n 'Waiting .';
+ cnt=0;
+ while $STOP_MTAQ_CMD --signal TERM --quiet > /dev/null; do
+ cnt=`expr $cnt + 1`;
+ if [ $cnt -gt 60 ]; then
+ #
+ # Waited 120 seconds now. Fail.
+ #
+ echo -n ' Failed ';
+ stopped=1;
+ break;
+ fi;
+ sleep 2;
+ echo -n '.';
+ done;
+ echo -n ' Done ';
+ fi;
+ # Remove pidfile iff stopped
+ if ! $STOP_MTAQ_CMD --signal TERM --quiet > /dev/null; then
+ rm -f "$MTAQ_PIDFILE";
+ fi
+ };
+
+stop_msp () {
+ local cnt;
+ stopped=0;
+ #
+ # Make sure @localstatedir@/run/sendmail/ exists
+ check_dirs;
+ #
+ # If not running, don't stop it...
+ if ! is_running msp; then
+ return;
+ fi;
+ #
+ # Is running, must stop it...
+ $STOP_MSP_CMD --signal TERM --quiet --oknodo > /dev/null;
+ #
+ # Now we have to wait until sendmail has _really_ stopped.
+ #
+ sleep 2;
+ if $STOP_MSP_CMD --signal TERM --quiet > /dev/null; then
+ echo -n 'Waiting .';
+ cnt=0;
+ while $STOP_MSP_CMD --signal TERM --quiet > /dev/null; do
+ cnt=`expr $cnt + 1`;
+ if [ $cnt -gt 60 ]; then
+ #
+ # Waited 120 seconds now. Fail.
+ #
+ echo -n ' Failed ';
+ stopped=1;
+ break;
+ fi;
+ sleep 2;
+ echo -n '.';
+ done;
+ echo -n ' Done ';
+ fi;
+ # Remove pidfile iff stopped
+ if ! $STOP_MSP_CMD --signal TERM --quiet > /dev/null; then
+ rm -f "$MSP_PIDFILE";
+ fi;
+ };
+
+stop_sendmail () {
+ if check_msp; then
+ stop_msp;
+ fi;
+ stop_mta;
+ stop_queue;
+ };
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# Check to see if sendmail is running
+#------------------------------------------------------------------------------
+is_running () {
+ local result;
+ result=1;
+ #
+ # Make sure @localstatedir@/run/sendmail/ exists
+ check_dirs;
+ #
+ # Determine proper pidfile to check
+ PIDFILE=$(echo "$1" | tr '[:upper:]' '[:lower:]');
+ case $PIDFILE in
+ mta)
+ PIDFILE="$MTAL_PIDFILE";
+ ;;
+ queue)
+ PIDFILE="$MTAQ_PIDFILE";
+ ;;
+ msp)
+ PIDFILE="$MSP_PIDFILE";
+ ;;
+ *)
+ PIDFILE="$1";
+ ;;
+ esac;
+ #
+ # If no pidfile, not running
+ # Extract pid/command and see if still running
+ # Remove pidfile if app didn't
+ if [ -s $PIDFILE ]; then
+ PID=`head -n 1 $PIDFILE 2>/dev/null`;
+ COMMAND=`tail -n 1 $PIDFILE`;
+ if [ ! -z "`ps --no-heading $PID`" ]; then
+ result=0;
+ else
+ rm -f $PIDFILE;
+ fi;
+ fi;
+ return $result;
+ };
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# Check to see if running split service (MTA, MSP)
+# Must be at 8.12.0+ for this support
+#------------------------------------------------------------------------------
+check_msp () {
+ local result;
+ result=1;
+ if [ ! -f @datadir@/sendmail/cf/feature/msp.m4 ]; then
+ result=1;
+ elif [ -s @sysconfdir@/mail/submit.cf \
+ -a -s @sysconfdir@/mail/submit.mc ]; then
+ if grep -qEe "^[[:space:]]*\`?FEATURE\([[:space:]]*\`?msp" \
+ @sysconfdir@/mail/submit.mc; then
+ result=0;
+ fi;
+ fi;
+ return $result;
+ };
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# Miscellaneous sendmail command support for MSP/MTA split
+# mailstats, mailq, runq
+#------------------------------------------------------------------------------
+newaliases () {
+ #
+ # Obtain parameters IFF needed
+ if [ -z "$SM_Get_Parameters" ]; then
+ Get_Parameters;
+ fi;
+ #
+ $MTA_COMMAND $MTA_A -bi $*;
+ };
+
+hoststat () {
+ #
+ # Obtain parameters IFF needed
+ if [ -z "$SM_Get_Parameters" ]; then
+ Get_Parameters;
+ fi;
+ #
+ $MTA_COMMAND $MTA_A -bh $*;
+ };
+
+purgestat () {
+ local parms;
+ parms=$(echo "$1" | tr '[:upper:]' '[:lower:]');
+ case $parms in
+ n*) # Now
+ parms='-O Timeout.hoststatus=1s';
+ shift;
+ ;;
+ *)
+ parms='';
+ ;;
+ esac;
+ #
+ # Obtain parameters IFF needed
+ if [ -z "$SM_Get_Parameters" ]; then
+ Get_Parameters;
+ fi;
+ #
+ $MTA_COMMAND $MTA_A -bH $parms $*;
+ };
+
+mailstats () {
+ #
+ # Obtain parameters IFF needed
+ if [ -z "$SM_Get_Parameters" ]; then
+ Get_Parameters;
+ fi;
+ #
+ #if running split service, show the client status first
+ if check_msp; then
+ echo 'MSP statistics...';
+ #check if we have a status file for the MSP
+ statusfile=$(grep -Ee '^O StatusFile=/.*' \
+ @sysconfdir@/mail/submit.cf | cut -d= -f2);
+ if [ -n $statusfile ]; then
+ @libexecdir@/mailstats -C \
+ @sysconfdir@/mail/submit.cf $* || true;
+ fi;
+ echo 'MTA statistics...';
+ fi;
+ #check if we have a status file for the MTA
+ statusfile=$(grep -Ee '^O StatusFile=/.*' \
+ @sysconfdir@/mail/sendmail.cf | cut -d= -f2);
+ if [ -n $statusfile ]; then
+ @libexecdir@/mailstats $* || true;
+ fi;
+ };
+
+mailq () {
+ #
+ # Obtain parameters IFF needed
+ if [ -z "$SM_Get_Parameters" ]; then
+ Get_Parameters;
+ fi;
+ #
+ # if running split service, show the client queues first
+ if check_msp; then
+ echo 'MSP Queue status...';
+ #
+ # Check to see if shared memory is in use (8.12.0+)
+ if grep -qEe "^[[:space:]]*\`?define\(\`?confSHAREDMEMORYKEY'?[[:space:]]*,[[:space:]]*\`?0*[1-9]+[0-9]*'?[[:space:]]*\)" \
+ @sysconfdir@/mail/submit.mc; then
+ $MSP_COMMAND -bP || true;
+ fi;
+ $MSP_COMMAND -bp $MSP_A $MISC_PARMS $* || true;
+ echo 'MTA Queue status...';
+ fi;
+ #
+ # Check to see if shared memory is in use (8.12.0+)
+ if grep -qEe "^[[:space:]]*\`?define\(\`?confSHAREDMEMORYKEY'?[[:space:]]*,[[:space:]]*\`?0*[1-9]+[0-9]*'?[[:space:]]*\)" \
+ @sysconfdir@/mail/sendmail.mc; then
+ $MTA_COMMAND -bP || true;
+ fi;
+ $MTA_COMMAND -bp $MTA_A $MISC_PARMS $* || true;
+ };
+
+runq () {
+ #
+ # Obtain parameters IFF needed
+ if [ -z "$SM_Get_Parameters" ]; then
+ Get_Parameters;
+ fi;
+ #
+ # if running split service, run the client queues first
+ if check_msp; then
+ echo 'Running the MSP queue...';
+ $MSP_COMMAND -q $MSP_A \
+ $MSP_L_QUEUE $MSP_PARMS $MISC_PARMS $* || true;
+ echo 'Running the MTA queues...';
+ fi;
+ if [ "$SPLIT_DAEMON" -eq 0 ]; then
+ $MTA_COMMAND -q $MTA_A \
+ $MTAL_L_RUNQ $QUEUE_PARMS $MISC_PARMS $* || true;
+ else
+ $MTA_COMMAND -q $MTA_A \
+ $MTAQ_L_RUNQ $QUEUE_PARMS $MISC_PARMS $* || true;
+ fi;
+ };
+
+control () {
+ #
+ # Obtain parameters IFF needed
+ if [ -z "$SM_Get_Parameters" ]; then
+ Get_Parameters;
+ fi;
+ local parms;
+ parms="$*";
+ if [ -z "$parms" ]; then
+ parms='help';
+ fi;
+ if is_running mta; then
+ @datadir@/sendmail/smcontrol.pl $parms;
+ else
+ echo 'MTA: is not running';
+ fi;
+ };
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# Print status of running job(s)
+#------------------------------------------------------------------------------
+status () {
+ #
+ # Make sure @localstatedir@/run/sendmail/ exists
+ check_dirs;
+ #
+ # Obtain parameters IFF needed
+ if [ -z "$SM_Get_Parameters" ]; then
+ Get_Parameters;
+ fi;
+ #
+ # if running split service, check the client status first
+ if check_msp; then
+ if is_running msp; then
+ echo "MSP: $PID $COMMAND";
+ ps -fwp $PID;
+ if [ -S ${MSP_ROOT}/smcontrol ]; then
+ @datadir@/sendmail/smcontrol.pl \
+ -f ${MSP_ROOT}/smcontrol status;
+ fi;
+ elif [ $MSP_MODE = 'cron' ]; then
+ echo 'MSP: is run via cron';
+ elif [ $MSP_MODE = 'none' ]; then
+ echo 'MSP: is disabled';
+ else
+ echo 'MSP: is not running';
+ fi;
+ fi;
+ #
+ # Check MTA listener
+ if is_running mta; then
+ echo "MTA: $PID $COMMAND";
+ ps -fwp $PID;
+ if [ -S ${MTA_ROOT}/smcontrol ]; then
+ @datadir@/sendmail/smcontrol.pl status;
+ fi;
+ elif [ $DAEMON_MODE = 'inetd' ]; then
+ echo 'MTA: is run via inetd';
+ elif [ $DAEMON_MODE = 'none' ]; then
+ echo 'MTA: is disabled';
+ else
+ echo 'MTA: is not running';
+ fi;
+ #
+ # Check for split daemon mode (separate listener/queue runner)
+ if [ "$SPLIT_DAEMON" -eq 0 ]; then
+ echo "QUE: Same as MTA";
+ elif is_running queue; then
+ echo "QUE: $PID $COMMAND";
+ ps -fwp $PID;
+ elif [ $QUEUE_MODE = 'cron' ]; then
+ echo 'QUE: is run via cron';
+ elif [ $QUEUE_MODE = 'none' ]; then
+ echo 'QUE: is disabled';
+ else
+ echo 'QUE: is not running';
+ fi;
+ };
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# Cronjob handling
+#------------------------------------------------------------------------------
+cron_mta () {
+ #
+ # Make sure @localstatedir@/run/sendmail/ exists
+ check_dirs;
+ #
+ # Obtain parameters IFF needed
+ if [ -z "$SM_Get_Parameters" ]; then
+ Get_Parameters;
+ fi;
+ #
+ # If cron not needed, don't do queue running (though it wouldn't hurt)
+ if [ $QUEUE_MODE = 'cron' ]; then
+ #
+ # If running a split (MTA/MSP) setup, we need to make sure that
+ # messages not immediately accepted by the MTA get delivered.
+ # Only run the MSP queue if MSP_MODE=none
+ if check_msp; then
+ if [ $MSP_MODE = 'none' ]; then
+ # Make sure only *ONE* cronjob at a time
+ if [ ! -f $STAMP_DIR/cron_msp ]; then
+ touch $STAMP_DIR/cron_msp;
+ #clean_queues /var/spool/mqueue-client;
+ $MSP_COMMAND -q $MSP_A $MSP_L_QUEUE \
+ $MSP_PARMS $MISC_PARMS \
+ $CRON_PARMS || true;
+ rm -f $STAMP_DIR/cron_msp;
+ fi;
+ fi;
+ fi;
+
+ # Make sure only *ONE* cronjob at a time
+ if [ ! -f $STAMP_DIR/cron_mta ]; then
+ touch $STAMP_DIR/cron_mta;
+ $MTA_COMMAND -q $MTA_A $MTAL_L_QUEUE \
+ $QUEUE_PARMS $MISC_PARMS $CRON_PARMS || true;
+ rm -f $STAMP_DIR/cron_mta;
+ fi;
+ fi;
+ };
+
+cron_msp () {
+ #
+ # Make sure @localstatedir@/run/sendmail/ exists
+ check_dirs;
+ #
+ # Obtain parameters IFF needed
+ if [ -z "$SM_Get_Parameters" ]; then
+ Get_Parameters;
+ fi;
+ #
+ # If cron not needed, don't do queue running (though it wouldn't hurt)
+ if [ $MSP_MODE = 'cron' ]; then
+ #
+ # If running a split (MTA/MSP) setup, we need to make sure that
+ # messages not immediately accepted by the MTA get delivered.
+ if check_msp; then
+ # Make sure only *ONE* cronjob at a time
+ if [ ! -f $STAMP_DIR/cron_msp ]; then
+ touch $STAMP_DIR/cron_msp;
+ #clean_queues /var/spool/mqueue-client;
+ $MSP_COMMAND -q $MSP_A $MSP_L_QUEUE \
+ $MSP_PARMS $MISC_PARMS \
+ $CRON_PARMS || true;
+ rm -f $STAMP_DIR/cron_msp;
+ fi;
+ fi;
+ fi;
+ };
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# Determine how to run sendmail mta daemon
+# * No daemon
+# * As listener
+# * As queue runner
+# * As both listener and queue runner
+#------------------------------------------------------------------------------
+daemon_check () {
+ local run_daemon;
+ #
+ # Skip daemon run for the following:
+ # * sendmail hasn't been configured
+ # * smptd, a firewall frontend for sendmail, is installed
+ # * DAEMON_MODE = (none | inet) & QUEUE_MODE = (none | cron)
+ if [ ! -s @sysconfdir@/mail/sendmail.cf ] || \
+ [ ! -s @sysconfdir@/mail/sendmail.mc ]; then
+ echo 'sendmail has not been configured, not started.';
+ echo 'To configure sendmail, type sendmailconfig';
+ exit 1;
+ elif [ -x $SMTPD ]; then
+ echo 'sendmail mta daemon not needed, not started.';
+ exit 0;
+ fi;
+
+ MTAL_PARMS="$MTA_A $MTAL_L";
+ MTAQ_PARMS="$MTA_A $MTAQ_L";
+ run_daemon=3;
+
+ case "$DAEMON_MODE" in
+ none* | \
+ inetd*)
+ run_daemon=`expr $run_daemon - 1`;
+ ;;
+
+ daemon* | \
+ *)
+ MTAL_PARMS="$MTAL_PARMS -bd $DAEMON_PARMS";
+ ;;
+ esac;
+
+ case "$QUEUE_MODE" in
+ none* | \
+ cron*)
+ run_daemon=`expr $run_daemon - 1`;
+ ;;
+
+ daemon* | \
+ *)
+ # Check for split daemon mode (separate listener/queue runner)
+ if [ $SPLIT_DAEMON -eq 0 ]; then
+ MTAL_PARMS="$MTAL_PARMS -q${QUEUE_INTERVAL}m";
+ MTAL_PARMS="$MTAL_PARMS $QUEUE_PARMS";
+ else
+ MTAQ_PARMS="$MTAQ_PARMS -q${QUEUE_INTERVAL}m";
+ MTAQ_PARMS="$MTAQ_PARMS $QUEUE_PARMS";
+ fi;
+ ;;
+ esac;
+
+ # Add any miscellanous (ie debugging) parameters
+ MTAL_PARMS="$MTAL_PARMS $MISC_PARMS";
+ MTAQ_PARMS="$MTAQ_PARMS $MISC_PARMS";
+
+ # Add PidFile override for MTA queue runner
+ MTAQ_PARMS="$MTAQ_PARMS -O PidFile=$MTAQ_PIDFILE";
+
+ if [ $run_daemon -lt 2 ]; then
+ echo 'sendmail listen/queue daemon not desired.';
+ exit 0;
+ fi;
+ };
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# Clean sendmail queues (somewhat): does *not* support split qf/df/xf dirs.
+# NOTE: This whole thing sucks with queue-groups, need to redo it!!!
+# NOTE: Check for race conditions betwixt this code and queue-runners
+#------------------------------------------------------------------------------
+clean_queues () {
+ local QUEUE_ROOT QUEUE QUIET
+ # Obtain queue root directory
+ if [ -z "$1" ]; then
+ QUEUE_ROOT=/var/spool/mqueue
+ QUEUE=/var/spool/mqueue
+ QUIET=''
+ else
+ QUEUE_ROOT="$1"
+ QUEUE="$1"
+ QUIET='1'
+ fi
+ # remove lock files left because of kill/crash
+ # rm -f $QUEUE/[lnx]f* doesn't work with a plethora of files ;-(
+ for i in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
+ a b c d e f g h i j k l m n o p q r s t u v w x y z; do
+ rm -f $QUEUE/[lnx]f${i}*
+ done
+ # remove zero length qf files
+ #for qffile in $QUEUE/qf*; do
+ for qffile in $(find $QUEUE_ROOT -type f -name 'qf*'); do
+ if [ -r "$qffile" -a ! -s "$qffile" ]; then
+ if [ ! -z "$QUIET" ]; then
+ echo -n "<zero: $qffile> "; fi
+ rm -f "$qffile"
+ fi
+ done
+ # rename tf files to be qf if the qf does not exist
+ for tffile in $QUEUE/tf*; do
+ qffile=`echo "$tffile" | sed 's/t/q/'`
+ if [ -r "$tffile" -a ! -f "$qffile" ]; then
+ if [ ! -z "$QUIET" ]; then
+ echo -n "<recovering: $tffile> "; fi
+ mv "$tffile" "$qffile"
+ elif [ -f "$tffile" ]; then
+ echo -n "<extra: $tffile> "
+ rm -f "$tffile"
+ fi
+ done
+ # remove df files with no corresponding qf files
+ for dffile in $QUEUE/df*; do
+ qffile=`echo "$dffile" | sed 's/d/q/'`
+ if [ -r "$dffile" -a ! -f "$qffile" ]; then
+ if [ ! -s "$dffile" ]; then
+ rm -f "$dffile"
+ else
+ if [ ! -z "$QUIET" ]; then
+ echo -n "<incomplete: $dffile> "; fi
+ mv "$dffile" `echo $dffile | sed 's/d/D/'`
+ fi
+ fi
+ done
+ # announce files that have been saved during disaster recovery
+ for xffile in $QUEUE/[A-Z]f*; do
+ if [ -f "$xffile" ]; then
+ if [ ! -z "$QUIET" ]; then
+ echo -n "<panic: $xffile> "; fi
+ fi
+ done
+ }
+#------------------------------------------------------------------------------
+
+#------------------------------------------------------------------------------
+# check_dirs: Make sure @localstatedir@/run/sendmail/{mta,msp,stampdir} exist
+#------------------------------------------------------------------------------
+check_dirs () {
+ if [ ! -d "${SENDMAIL_ROOT}" ]; then
+ mkdir -p "${SENDMAIL_ROOT}";
+ chown root:smmsp "${SENDMAIL_ROOT}";
+ chmod 02750 "${SENDMAIL_ROOT}";
+ fi;
+ if [ ! -d "${MTA_ROOT}" ]; then
+ mkdir -p "${MTA_ROOT}";
+ chown root:smmsp "${MTA_ROOT}";
+ chmod 02750 "${MTA_ROOT}";
+ fi;
+ if [ ! -d "${MSP_ROOT}" ]; then
+ mkdir -p "${MSP_ROOT}";
+ chown smmsp:smmsp "${MSP_ROOT}";
+ chmod 02770 "${MSP_ROOT}";
+ fi;
+ if [ ! -d "${STAMP_DIR}" ]; then
+ mkdir -p "${STAMP_DIR}";
+ chown root:smmsp "${STAMP_DIR}";
+ chmod 02770 "${STAMP_DIR}";
+ fi;
+ }
+
+
+#------------------------------------------------------------------------------
+# Handle being called via an alias
+#------------------------------------------------------------------------------
+case $(basename $0) in
+ newaliases)
+ newaliases $*;
+ exit $?;
+ ;;
+ hoststat)
+ hoststat $*;
+ exit $?;
+ ;;
+ purgestat)
+ purgestat $*;
+ exit $?;
+ ;;
+ mailstats)
+ mailstats $*;
+ exit $?;
+ ;;
+ mailq)
+ mailq $*;
+ exit $?;
+ ;;
+ runq)
+ runq $*;
+ exit $?;
+ ;;
+ control|smcontrol)
+ control $*;
+ exit $?;
+ ;;
+ *)
+ ;;
+ esac;
+
+#------------------------------------------------------------------------------
+# Handle being called via /etc/init.d/sendmail or directly
+#------------------------------------------------------------------------------
+
+# Some requisite initialization
+Get_Parameters;
+
+# Ok, why are we here...
+case "$1" in
+
+ #-----------------------------------------------------------------------
+ # Debian required/optional targets:
+ #-----------------------------------------------------------------------
+ start)
+ echo -n 'Starting Mail Transport Agent: sendmail';
+ start_sendmail;
+ echo '.'
+ ;;
+
+ stop|force-stop)
+ echo -n 'Stopping Mail Transport Agent: sendmail';
+ stop_sendmail;
+ echo '.'
+ ;;
+
+ restart)
+ echo -n 'Restarting Transport Agent: sendmail';
+ # reload is equivalent (but faster) than stop/start !
+ reload_sendmail;
+ echo '.';
+ ;;
+
+ restart-if-running)
+ if ! is_running mta && ! is_running msp; then
+ echo 'Mail Transport Agent: sendmail is not running';
+ else
+ $0 restart;
+ fi;
+ ;;
+
+ reload|force-reload)
+ echo -n 'Reloading Mail Transport Agent configuration: sendmail';
+ reload_sendmail;
+ echo '.';
+ ;;
+
+ #-----------------------------------------------------------------------
+ # Local targets (sendmail commands/aliases) for MSP/MTA split support
+ # These targets will pass along any provided parameters
+ #-----------------------------------------------------------------------
+ newaliases)
+ shift;
+ newaliases $*;
+ ;;
+
+ hoststat)
+ shift;
+ hoststat $*;
+ ;;
+
+ purgestat)
+ shift;
+ purgestat $*;
+ ;;
+
+ mailstats)
+ shift;
+ mailstats $*;
+ ;;
+
+ mailq)
+ shift;
+ mailq $*;
+ ;;
+
+ runq)
+ shift;
+ runq $*;
+ ;;
+
+ control|smcontrol)
+ shift;
+ control $*;
+ ;;
+
+ #-----------------------------------------------------------------------
+ # Local targets for extended support/debugging
+ #-----------------------------------------------------------------------
+ status)
+ shift;
+ status $*;
+ ;;
+
+ debug)
+ #
+ # If not running, can't debug
+ if is_running msp; then
+ echo -n 'Dumping MSP state...';
+ $SIGNAL_MSP_CMD --signal USR1;
+ echo 'done.';
+ fi;
+ if is_running mta; then
+ echo -n 'Dumping MTA state...';
+ $SIGNAL_MTAL_CMD --signal USR1;
+ echo 'done.';
+ fi;
+ ;;
+
+ clean|clean_que*|clean-que*)
+ #
+ # If running, don't clean the queues...
+ if is_running mta; then
+ echo 'MTA is running, queue cleaning ill advised...';
+ else
+ echo -n 'Cleaning up the queues...';
+ clean_queues;
+ echo 'done.';
+ fi;
+ ;;
+
+ #-----------------------------------------------------------------------
+ # Local targets for cronjob support
+ #-----------------------------------------------------------------------
+ cron-msp)
+ cron_msp;
+ ;;
+
+ cron-mta)
+ cron_mta;
+ ;;
+
+ #-----------------------------------------------------------------------
+ # Default target - bitch and moan
+ #-----------------------------------------------------------------------
+ *)
+ echo "Invalid command <$1>";
+ echo "Usage: $0 <command>";
+ echo ' Where <command> is one of the following';
+ echo ' start|stop|restart|restart-if-running';
+ echo ' reload|force-reload';
+ echo ' newaliases|hoststat|purgestat|mailstats|mailq|runq|control';
+ echo ' status|debug|clean';
+ exit 1;
+ ;;
+ esac;
+
+exit 0;
diff --git a/debian/local/sendmailconfig.8 b/debian/local/sendmailconfig.8
new file mode 100644
index 0000000..b2cd52c
--- /dev/null
+++ b/debian/local/sendmailconfig.8
@@ -0,0 +1,41 @@
+.TH SENDMAILCONFIG 8 21-Jan-1997
+.SH NAME
+sendmailconfig \- configure sendmail for Debian systems
+.SH SYNOPSIS
+sendmailconfig [--no-reload]
+.SH DESCRIPTION
+.B sendmailconfig
+is used to simplify the configuration of sendmail(8) for use on Debian
+systems.
+.PP
+In the simplest case, you may run this program to (re)configure sendmail for
+your Debian system at any time. It will modify the file /etc/mail/sendmail.mc
+in order to create a working sendmail configuration which will be written to
+the file /etc/mail/sendmail.cf.
+.PP
+For advanced configurations, you can modify the sendmail.mc file before
+generating sendmail.cf. Future invokations of
+.B sendmailconfig
+will preserve these changes provided they are made at the end of the file.
+.PP
+Normally
+.B sendmailconfig
+will ask if you want to reload sendmail after making changes to its
+configuration. The --no-reload option will avoid this question.
+.SH FILES
+.TP
+/etc/mail/sendmail.mc
+sendmail m4 input to generate sendmail.cf
+.TP
+/etc/mail/sendmail.cf
+actual sendmail configuration file
+.TP
+/etc/mail/sendmail.cw
+names for which we will accept mail in the standard configuration
+.TP
+/etc/mail/sendmail.ct
+names of trusted users in the standard configuration
+.SH SEE ALSO
+sendmail(8)
+.SH AUTHOR
+Robert Leslie <rob@mars.org>
diff --git a/debian/local/sendmailconfig.in b/debian/local/sendmailconfig.in
new file mode 100644
index 0000000..1c2cf1e
--- /dev/null
+++ b/debian/local/sendmailconfig.in
@@ -0,0 +1,671 @@
+#!/bin/sh -e
+#-----------------------------------------------------------------------------
+# $Sendmail: sendmailconfig,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Interactively configure Sendmail for Debian
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# Robert Leslie <rob@mars.org>,
+# Rick Nelson <cowboy@debian.org>
+#
+#-----------------------------------------------------------------------------
+set -e;
+
+PATH='/usr/sbin:/usr/bin:/sbin:/bin';
+SENDMAIL_MC="@sysconfdir@/mail/sendmail.mc";
+SUBMIT_MC="@sysconfdir@/mail/submit.mc";
+
+# Path to other sendmail helpers
+if [ -x ./update_sendmail ]; then
+ sm_path='.';
+elif [ -x $(dirname $0)/update_sendmail ]; then
+ sm_path=$(dirname $0);
+else
+ sm_path=@datadir@/sendmail;
+ fi;
+
+set +e;
+reload="yes";
+umask 022;
+
+#------------------------------------------------------------------------------
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --no-reload)
+ reload="";
+ shift;
+ ;;
+
+ *)
+ echo "Usage: $0 [--no-reload]" >&2;
+ exit 1;
+ ;;
+ esac;
+ done;
+
+#------------------------------------------------------------------------------
+
+descrip() {
+ echo '';
+ echo "$1";
+ echo "$1" | sed -e 's/./-/g';
+ cat -;
+ echo '';
+ };
+
+yesno() {
+ local N='N' Y='Y';
+ local q="$1" def=$(eval "echo -n \$$2");
+
+ while :; do
+ echo -n "$q? [$def] ";
+ read REPLY;
+ REPLY=$(echo -n "$REPLY" | sed -e "s/^\ *//" -e "s/^\t*//");
+ test -n "$REPLY" || REPLY="$def";
+
+ case "$REPLY" in
+ [Yy]*)
+ echo yes > /dev/null;
+ eval "$2=\"Y\"";
+ return 0;
+ ;;
+ [Nn]*)
+ echo no > /dev/null;
+ eval "$2=\"N\"";
+ return 1;
+ ;;
+ esac;
+ done;
+ };
+
+input() {
+ local q="$1" def=$(eval "echo -n \$$2");
+
+ echo -n "$q? [$def] ";
+ read REPLY
+ REPLY=$(echo "$REPLY" | sed -e 's/^[ ]*//' -e 's/[ ]*$//' | cat);
+ test -n "$REPLY" || REPLY="$def";
+
+ if [ "NONE" = "$3" ]; then
+ case "$REPLY" in
+ [NnOoNnEe])
+ REPLY='';
+ ;;
+ esac;
+ fi;
+
+ eval "$2=\"$REPLY\"";
+ };
+
+testconfig() {
+ CONFIG=$(grep -Ee "^[[:space:]]*$1" $SENDMAIL_MC 2>/dev/null);
+ };
+
+makecf() {
+ if [ -x $sm_path/update_sendmail ]; then
+ echo "Updating sendmail environment ...";
+ $sm_path/update_sendmail || true;
+ fi;
+
+ if [ "$reload" ] && \
+ yesno \
+ "Reload the running sendmail now with the new configuration" Y
+ then
+ echo "Reloading sendmail ...";
+ @sysconfdir@/init.d/sendmail reload >/dev/null;
+ fi;
+}
+
+#------------------------------------------------------------------------------
+
+if [ -f $SENDMAIL_MC ]; then
+ if yesno "Configure sendmail with the existing @sysconfdir@/mail/sendmail.conf" Y
+ then
+ if ! $sm_path/update_conf; then
+ echo "Correct @sysconfdir@/mail/sendmail.conf before continuing.";
+ exit 1;
+ fi;
+ else
+ echo "Edit @sysconfdir@/mail/sendmail.conf and reissue $0.";
+ exit 0;
+ fi;
+ if yesno "Configure sendmail with the existing $SENDMAIL_MC" Y
+ then
+ makecf;
+ exit 0;
+ fi;
+ fi;
+
+###############################################################################
+
+exec 3>$SENDMAIL_MC.new;
+trap "rm -f $SENDMAIL_MC.new" 0;
+
+###############################################################################
+
+descrip "Sendmail Configuration" <<-EOT
+By answering the following questions, you can configure sendmail for your
+system. Default values are determined either by your existing configuration
+or from common usage.
+EOT
+
+echo -n "Press [ENTER] ";
+read REPLY;
+
+cat @datadir@/sendmail/cf/debian/sendmail.mc >&3;
+cp -a @datadir@/sendmail/cf/debian/submit.mc \
+ $SUBMIT_MC.new;
+echo "LOCAL_CONFIG" >&3;
+
+###############################################################################
+
+descrip "Mail Name" <<EOT
+Your \`mail name' is the hostname portion of the address to be shown on
+outgoing news and mail messages (following the username and @ sign). This
+name will be used by other programs besides sendmail; it should be the single,
+full domain name (FQDN) from which mail will appear to originate.
+EOT
+
+mailname=$(cat @sysconfdir@/mailname 2>/dev/null || hostname --fqdn);
+input "Mail name" mailname;
+
+echo "$mailname" >@sysconfdir@/mailname;
+
+###############################################################################
+
+descrip "Null Client" <<EOT
+A special configuration known as the "null client" can be created for this
+host if all mail should be forwarded to a central hub via a local SMTP-based
+network. This may be a suitable configuration if you want to forward all of
+your mail to your local Internet service provider (ISP) for delivery.
+
+To enable this option, give the name of the host to which all mail should be
+forwarded. Otherwise leave the option empty to disable it.
+To remove a prior name, use \`NONE'.
+EOT
+
+nullclient=""
+! testconfig "FEATURE\(\`?nullclient" ||
+ nullclient=$(echo -n "$CONFIG" | sed -e 's/[^,]*, *\([^)]*\).*/\1/');
+
+input "Null client forward host" nullclient "" NONE;
+
+if [ ! -z "$nullclient" ]; then
+ echo "FEATURE(\`nullclient', $nullclient)dnl" >&3;
+ fi;
+
+if [ -z "$nullclient" ]; then
+
+###############################################################################
+descrip "Smart Host" <<EOT
+A "Smart Host" is one that can deliver mail to external machines. By using
+a "Smart Host", we don't need DNS, or good connectivity ourselves. This is
+most likely what you want if you have a dialup link, or sit behind a firewall.
+
+To enable this option, give the name of the host to which all non-local mail
+should be forwarded. Otherwise leave the option empty.
+To remove a prior name, use \`NONE'.
+EOT
+
+smarthost="";
+#if [ -n "$nullclient" ]; then
+# smarthost="$nullclient"
+# fi
+! testconfig "define\(\`?SMART_HOST" ||
+ smarthost=$(echo -n "$CONFIG" | sed -e 's/[^:]*:*\([^)]*\).*/\1/');
+input "Smart Host:" smarthost "" NONE;
+
+test -z "$smarthost" || echo "define(\`SMART_HOST', \`$smarthost')dnl" >&3;
+#if [ -n "$nullclient" -a ! -z "$smarthost" ]; then
+# echo "undefine(\`ALIAS_FILE')dnl" >&3
+# echo "define(\`confFORWARD_PATH', \`')dnl" >&3
+# echo "define(\`MAIL_HUB', \`$smarthost')dnl" >&3
+# echo "MASQUERADE_AS(\`$smarthost')dnl" >&3
+# echo "FEATURE(\`allmasquerade')dnl" >&3
+# echo "FEATURE(\`masquerade_envelope')dnl" >&3
+# fi
+###############################################################################
+
+descrip "Address Canonification" <<EOT
+Usually sendmail will canonify all addresses by consulting a name server and
+resolving hosts to their fully qualified domain name (FQDN). Under special
+circumstances you may want to disable this feature, for example if this
+machine acts only as a mail gateway.
+EOT
+
+test -z "$nullclient" || cat <<EOT
+Since this host will be configured as a null client, this option controls
+whether addresses will be qualified with \`$mailname' when
+sent to the central hub via SMTP. Disabling this feature may cause mail to
+appear to come from (and be qualified by the domain for) the hub machine
+rather than this host.
+
+EOT
+
+nocanonify="N";
+! testconfig "FEATURE\(\`?nocanonify" || nocanonify="Y";
+
+! yesno "Disable address canonification" nocanonify || \
+ echo "FEATURE(\`nocanonify')dnl" >&3;
+
+###############################################################################
+
+descrip "SMTP Mailer" <<EOT
+If you plan to exchange mail with other computers, you should enable the
+SMTP mailer. Even if you don't plan to exchange mail with other computers,
+it is still a good idea to enable this so local programs can use it.
+EOT
+
+smtp="Y";
+if [ -f $SENDMAIL_MC ]; then
+ testconfig "MAILER\(\`?smtp" || smtp="N";
+fi;
+
+yesno "Enable the SMTP mailer" smtp || true;
+
+###############################################################################
+
+descrip "Masquerade Envelope" <<EOT
+If you want mail envelopes (as well as mail headers) to appear to come from
+\`$mailname', you can enable this option.
+EOT
+
+masqenvelope="Y";
+if [ -f $SENDMAIL_MC ]; then
+ testconfig "FEATURE\(\`?masquerade_envelope" || masqenvelope="N";
+fi;
+
+! yesno "Masquerade envelopes" masqenvelope || \
+ echo "FEATURE(\`masquerade_envelope')dnl" >&3;
+
+###############################################################################
+
+descrip "All Masquerade" <<EOT
+If enabled, this feature will cause recipient addresses to also appear to come
+from \`$mailname'. Normally they get the local hostname.
+Although this may be right for ordinary users, it can break local aliases. For
+example, if you send to "localalias", the originating sendmail will find that
+alias and send to all members, but send the message with
+"To: localalias@$mailname". Since that alias likely does
+not exist, replies will fail. Use this feature ONLY if you can guarantee that
+the ENTIRE namespace of \`$mailname' supersets all the
+local entries. If in doubt, it is safe to leave this option disabled.
+EOT
+
+allmasquerade="N";
+! testconfig "FEATURE\(\`?allmasquerade" || allmasquerade="Y";
+
+! yesno "All masquerade" allmasquerade || \
+ echo "FEATURE(\`allmasquerade')dnl" >&3;
+
+###############################################################################
+
+descrip "Dont masquerade mail to local users" <<EOT
+Send mail to local recipients without masquerading.
+EOT
+
+local_no_masquerade="N";
+! testconfig "FEATURE\(\`?local_no_masquerade" || local_no_masquerade="Y";
+
+! yesno "Dont masquerade local" local_no_masquerade ||
+ echo "FEATURE(\`local_no_masquerade')dnl" >&3;
+
+###############################################################################
+
+descrip "Always Add Domain" <<EOT
+If enabled, the local host domain is included even on locally delivered mail.
+Normally it is not added unless it is already present.
+EOT
+
+alwaysdomain="N";
+! testconfig "FEATURE\(\`?always_add_domain" || alwaysdomain="Y";
+
+! yesno "Always add domain" alwaysdomain || \
+ echo "FEATURE(\`always_add_domain')dnl" >&3;
+
+###############################################################################
+
+descrip "Mail Acceptance" <<EOT
+Sendmail is usually configured to accept mail for your mail name
+($mailname). However, under special circumstances you
+may not wish sendmail to do this, particularly if (and disabling this option
+generally requires that) mail for \`$mailname' is MXed
+to another host. If in doubt, it is safe to leave this option enabled.
+EOT
+
+acceptmailname="Y";
+if [ -f $SENDMAIL_MC ]; then
+ testconfig "^Cw.*$mailname" || acceptmailname="N";
+fi;
+
+yesno "Accept mail for \`$mailname'" acceptmailname || true;
+test "N" = "$acceptmailname" || \
+ echo "LOCAL_CONFIG
+Cw$mailname" >&3;
+
+###############################################################################
+
+descrip "Alternate Names" <<EOT
+In addition to the canonical mail name \`$mailname', you can
+add any number of additional alternate names to recognize for receiving mail.
+If other hosts are MXed to you for local mail, this is where you should list
+them. This list is saved into the file @sysconfdir@/mail/local-host-names
+so it can be changed later as needed.
+
+To answer this question, separate each alternate name with a space, or answer
+\`NONE' to eliminate all alternate names.
+EOT
+
+cw_file="@sysconfdir@/mail/local-host-names";
+altnames=$(cat "$cw_file" 2>/dev/null | tr -s '\n \t' ' ' |
+ sed -e 's/^ *//' -e 's/ *$//');
+input "Alternate names" altnames NONE;
+
+if [ -n "$altnames" ]; then
+ echo "$altnames" | tr -s ' \t' '\n' >$cw_file;
+else
+ echo "localhost" >$cw_file;
+fi;
+ chown root:smmsp $cw_file;
+ chmod 0644 $cw_file;
+
+echo "FEATURE(\`use_cw_file')dnl" >&3;
+
+###############################################################################
+
+descrip "Trusted Users" <<EOT
+Sendmail allows a special group of users to set their envelope "From" address
+using the -f option without generating a warning message. If you have
+software such as Majordomo installed, you will want to include the usernames
+from such software here. Note that "root", "daemon", and "uucp" are included
+automatically and do not need to be specified. This list is saved into the
+file @sysconfdir@/mail/trusted-users so it can be changed later as needed.
+
+To answer this question, separate each username with a space, or answer
+\`NONE' to eliminate all usernames.
+EOT
+
+ct_file="@sysconfdir@/mail/trusted-users";
+trusted=$(cat "$ct_file" 2>/dev/null | tr -s '\n \t' ' ' |
+ sed -e 's/^ *//' -e 's/ *$//');
+input "Trusted users" trusted NONE;
+
+if [ -n "$trusted" ]; then
+ echo "$trusted" | tr -s ' \t' '\n' >$ct_file;
+ chown root:smmsp $ct_file;
+ chmod 0644 $ct_file;
+else
+ cat /dev/null >$ct_file;
+fi;
+
+echo "FEATURE(\`use_ct_file')dnl" >&3;
+echo "FEATURE(\`use_ct_file')dnl" >> $SUBMIT_MC.new;
+
+###############################################################################
+
+descrip "Redirect Feature" <<EOT
+If enabled, this feature will allow you to alias old names to
+<new-address>.REDIRECT, causing sendmail to return mail to the sender with
+an error but indicating the recipient's new address.
+EOT
+
+redirect="N";
+! testconfig "FEATURE\(\`?redirect" || redirect="Y";
+
+! yesno "Enable redirect option" redirect || \
+ echo "FEATURE(\`redirect')dnl" >&3;
+
+###############################################################################
+
+descrip "UUCP Addresses" <<EOT
+Sendmail can be configured to be smart about UUCP addresses, or it can do
+nothing special with UUCP addresses at all. If you care about UUCP, you will
+need to do some additional configuration, perhaps outside of this script.
+
+*** NOTE *** If you use a smart host or do any kind of forwarding (ie
+LUSER_RELAY and LOCAL_RELAY), it is important that you say "Yes"
+here to prevent a multi-level relay hole - unless you know for *SURE* that
+your smart-host does not deal with UUCP addresses.
+
+(Be safe and just say Y)
+EOT
+
+uucp="Y";
+if [ -f $SENDMAIL_MC ]; then
+ testconfig "FEATURE\(\`?nouucp" || uucp="Y";
+fi;
+
+yesno "Enable UUCP addressing" uucp || \
+ echo "FEATURE(\`nouucp', \`reject')dnl" >&3;
+
+###############################################################################
+
+descrip "Sticky Host" <<EOT
+If enabled, mail sent to \`user@$mailname' is marked as
+"sticky" -- that is, the local addresses aren't matched against UDB and don't
+go through ruleset 5. This is used if you want a setup where \`user' is not
+necessarily the same as \`user@$mailname', e.g., to make
+a distinct domain-wide namespace. If in doubt, it is safe to leave this
+option disabled.
+EOT
+
+sticky="N";
+! testconfig "FEATURE\(\`?stickyhost" || sticky="Y";
+
+! yesno "Enable sticky host option" sticky || \
+ echo "FEATURE(\`stickyhost')dnl" >&3;
+
+###############################################################################
+
+descrip "DNS" <<EOT
+If you are directly connected to the Internet and have access to a domain
+name server, you should enable this option.
+EOT
+
+dns="Y";
+! testconfig "FEATURE\(\`?nodns" || dns="N";
+! testconfig "HACK\(\`?nodns" || dns="N";
+
+yesno "Enable DNS" dns || \
+ echo "HACK(\`nodns')dnl" >&3;
+
+###############################################################################
+
+if [ Y = "$dns" ]; then
+
+###############################################################################
+
+descrip "Best MX is Local" <<EOT
+If enabled, this option will cause sendmail to accept mail as though locally
+addressed for any host that lists this machine as the best possible MX record.
+This generates additional DNS traffic, but should be OK for low-to-medium
+traffic hosts. N.B.: This feature is fundamentally incompatible with wildcard
+MX records. If you have a wildcard MX record that matches your domain, you
+cannot use this feature.
+EOT
+
+bestmxlocal="N";
+! testconfig "FEATURE\(\`?bestmx_is_local" || bestmxlocal="Y";
+
+! yesno "Assume best MX is local" bestmxlocal || \
+ echo "FEATURE(\`bestmx_is_local')dnl" >&3;
+
+###############################################################################
+
+fi; # finished DNS configuration
+
+###############################################################################
+
+descrip "Mailertable" <<EOT
+If enabled, this option causes sendmail to read mail routing rules from
+the text file @sysconfdir@/mail/mailertable. This is needed for unusual mailers like
+ifmail and fax programs.
+More information is in @docdir@/sendmail-doc/op/op.txt.gz.
+EOT
+
+mailertable="N";
+! testconfig "FEATURE\(\`?mailertable" || mailertable="Y";
+
+! yesno "Enable the mailertable feature" mailertable || \
+ echo "FEATURE(\`mailertable')dnl" >&3;
+
+###############################################################################
+
+descrip "Sendmail Restricted Shell" <<EOT
+If enabled, this option causes sendmail to use the sendmail restricted shell
+program (smrsh) instead of /bin/sh for mailing to programs. This improves your
+ability to control what gets run via email; only those programs which appear
+in a special directory can be run. If you enable this option, please carefully
+read the smrsh(8) man page for further information.
+EOT
+
+smrsh="Y";
+! testconfig "FEATURE\(\'?smrsh" || smrsh="Y";
+
+! yesno "Use the Sendmail Restricted Shell (smrsh)" smrsh || \
+ echo "FEATURE(\`smrsh', \`@libexecdir@/smrsh')dnl" >&3;
+
+###############################################################################
+
+descrip "Mailer Name" <<EOT
+You can change the name used for internally generated outgoing messages.
+Usually this is \`MAILER-DAEMON' but it would not be unreasonable to change
+it to something such as \`postmaster'.
+EOT
+
+daemon="MAILER-DAEMON";
+! testconfig "define\(\`?confMAILER_NAME" ||
+ daemon=$(echo -n "$CONFIG" | sed -e 's/[^,]*, *`\([^'"'"']*\).*/\1/');
+
+input "Mailer name" daemon;
+
+test "MAILER-DAEMON" = "$daemon" ||
+ echo "define(\`confMAILER_NAME', \`$daemon')dnl" >&3;
+
+###############################################################################
+
+descrip "Me Too" <<EOT
+Sendmail normally excludes the sender address from group expansion. Enabling
+this option will cause the sender to be included.
+EOT
+
+metoo="N";
+! testconfig "define\(\`?confME_TOO.*True" || metoo="Y";
+
+! yesno "Enable me too option" metoo ||
+ echo "define(\`confME_TOO', True)dnl" >&3;
+
+###############################################################################
+
+descrip "Message Timeouts" <<EOT
+Sendmail will issue a warning message to the sender if it can't deliver a
+message within a reasonable amount of time. It will also send a failure
+notification and give up trying to deliver the message if it can't deliver it
+after an unreasonable amount of time.
+
+You can configure the message timeouts after which warning and failure
+notifications are sent. Sendmail's defaults are 4 hours and 5 days (4h/5d),
+respectively, but many people feel warnings after only 4 hours are premature.
+EOT
+
+qw="4h";
+! testconfig "define\(\`?confTO_QUEUEWARN" ||
+ qw=$(echo -n "$CONFIG" | sed -e 's/[^,]*, *`\([^'"'"']*\).*/\1/');
+
+qr="5d";
+! testconfig "define\(\`?confTO_QUEUERETURN" ||
+ qr=$(echo -n "$CONFIG" | sed -e 's/[^,]*, *`\([^'"'"']*\).*/\1/');
+
+timeouts="$qw/$qr";
+
+input "Message timeouts" timeouts;
+
+qw=$(expr "$timeouts" : '\([^/]*\)/');
+qr=$(expr "$timeouts" : '[^/]*/\(.*\)');
+
+test "4h" = "$qw" || echo "define(\`confTO_QUEUEWARN', \`$qw')dnl" >&3;
+test "5d" = "$qr" || echo "define(\`confTO_QUEUERETURN', \`$qr')dnl" >&3;
+
+###############################################################################
+# Support dialup configuration
+cat <<-EOT >&3
+dnl #
+dnl # Dialup/LAN connection overrides
+dnl #
+include(\`@sysconfdir@/mail/dialup.m4')dnl
+include(\`@sysconfdir@/mail/provider.m4')dnl
+dnl #
+EOT
+
+###############################################################################
+echo "MAILER_DEFINITIONS" >&3
+echo "MAILER(local)dnl" >&3
+
+test "N" = "$smtp" || echo "MAILER(smtp)dnl" >&3;
+
+###############################################################################
+
+if [ -e /etc/ifmail/config ] && \
+ [ -e @datadir@/sendmail/cf/mailer/ifmail.m4 ];
+then
+ echo "MAILER(ifmail)dnl" >&3;
+fi;
+
+###############################################################################
+
+fi; # finished non-"null client" configuration
+
+
+###############################################################################
+
+echo "" >&3;
+echo "LOCAL_CONFIG" >&3;
+#if [ -z $nullclient ]; then
+# echo "MASQUERADE_AS($mailname)dnl" >&3
+# fi
+
+if [ -f $SENDMAIL_MC ]; then
+ sed -n -e '/^## Custom/,$p' $SENDMAIL_MC >&3;
+else
+ echo "## Custom configurations below (will be preserved)" >&3;
+fi;
+
+descrip "Configuration Complete" <<EOT
+Advanced configuration, such as alternate mailers, the use of mailertables,
+Bitnet domains, and UUCP domains can be accomplished by manually editing the
+$SENDMAIL_MC configuration file and rerunning
+\`$0' to generate the appropriate @sysconfdir@/mail/sendmail.cf
+file. (Local changes made at the end of $SENDMAIL_MC
+will be preserved by \`$0'.)
+
+The m4 library files for sendmail configuration are kept in the
+@datadir@/sendmail/cf directory. You may wish to review the
+documentation in @docdir@/sendmail to assist in further customization.
+
+You may wish to customize your alias database; see the aliases(5) man page
+for information on the format and use of the /etc/aliases file.
+EOT
+
+###############################################################################
+
+exec 3>&-;
+
+if [ -f $SENDMAIL_MC ];then
+ echo "Saving old $SENDMAIL_MC as $SENDMAIL_MC.old ...";
+ mv -f $SENDMAIL_MC $SENDMAIL_MC.old;
+ fi;
+
+chown root:smmsp $SENDMAIL_MC.new;
+chmod 0644 $SENDMAIL_MC.new;
+mv -f $SENDMAIL_MC.new $SENDMAIL_MC;
+if [ ! -f @datadir@/sendmail/cf/feature/msp.m4 ]; then
+ chown root:smmsp $SUBMIT_MC.new;
+ chmod 0644 $SUBMIT_MC.new;
+ mv -f $SUBMIT_MC.new $SUBMIT_MC;
+ fi;
+trap 0;
+
+makecf;
+exit 0;
diff --git a/debian/local/service.switch b/debian/local/service.switch
new file mode 100644
index 0000000..2a64668
--- /dev/null
+++ b/debian/local/service.switch
@@ -0,0 +1,7 @@
+# /etc/mail/nsswitch.conf
+#
+# This is the format that sendmail expects (no colon after the service)
+#
+passwd files
+hosts files dns
+aliases files
diff --git a/debian/local/service.switch-nodns b/debian/local/service.switch-nodns
new file mode 100644
index 0000000..583b238
--- /dev/null
+++ b/debian/local/service.switch-nodns
@@ -0,0 +1,8 @@
+# /etc/mail/nsswitch.conf
+#
+# This is the format that sendmail expects (no colon after the service)
+# This file will prevent dns usage
+#
+passwd files
+hosts files
+aliases files
diff --git a/debian/local/socks_wrapper b/debian/local/socks_wrapper
new file mode 100644
index 0000000..ad89379
--- /dev/null
+++ b/debian/local/socks_wrapper
@@ -0,0 +1,31 @@
+#!/bin/bash
+# Richard Nelson <cowboy@debain.org>
+# Socks5 support wrapper for sendmail
+
+DAEMON=/usr/sbin/sendmail.real
+RUNSOCKS=/usr/bin/runsocks
+BASENAME=$(basename $0)
+
+# Adjust command name based upon the presence of the socks5 wrapper
+if [ -x $RUNSOCKS ]; then
+ COMMAND="$RUNSOCKS $DAEMON"
+else
+ COMMAND="$DAEMON"
+ fi
+#echo "$BASENAME command="$COMMAND
+
+# Exec the appropriate command
+case "$BASENAME" in
+ # These don't need socks support, and must be called by name
+ "hoststat" | "mailq" | "newaliases" | "purgestat")
+ exec -a $BASENAME $DAEMON "$@"
+ ;;
+ # These need socks support
+ "sendmail")
+ exec -a $DAEMON $COMMAND "$@"
+ ;;
+ # Help... shouldn't be here
+ *)
+ echo "panic, $BASENAME is not a valid alias for sendmail."
+ ;;
+ esac
diff --git a/debian/local/update_auth.in b/debian/local/update_auth.in
new file mode 100644
index 0000000..558c8b1
--- /dev/null
+++ b/debian/local/update_auth.in
@@ -0,0 +1,250 @@
+#!/bin/sh -e
+#-----------------------------------------------------------------------------
+#
+# $Sendmail: update_auth,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Sendmail support for SMTP AUTH (SASL)
+#
+# Copyright (c) 2000-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# Notes:
+#
+#-----------------------------------------------------------------------------
+set -e;
+
+NEW=0;
+DEFAULT=0;
+HOSTNAME=`hostname -s`;
+HOSTFQDN=`hostname -f`;
+DOMAINNAME=`hostname -d`;
+SMUID=sendmail;
+SMAID=sendmail;
+SMPWD=sendmailpwd;
+SMRLM=$HOSTNAME.$DOMAINNAME;
+
+# Check if SASL is installed
+if [ -d /usr/lib/sasl2 -a @sm_version_math@ -ge 527364 ]; then
+ SASLDBLISTUSERS='/usr/sbin/sasldblistusers2';
+ SASLPASSWD='/usr/sbin/saslpasswd2';
+ SASLLIB='/usr/lib/sasl2';
+ SASLSO='2';
+ SASLDB='/etc/sasldb2';
+ SASL_BIN='sasl2-bin';
+ echo " SASL V2 not supported for the nonce, checking for SASL V1";
+ fi;
+if [ -d /usr/lib/sasl ]; then
+ SASLDBLISTUSERS='/usr/sbin/sasldblistusers';
+ SASLPASSWD='/usr/sbin/saslpasswd';
+ SASLLIB='/usr/lib/sasl';
+ SASLSO='1';
+ SASLDB='/etc/sasldb';
+ SASL_BIN='sasl-bin';
+else
+ cat <<-EOT
+
+ SASL not installed, not configuring sendmail support.
+
+ To install sasl, get sasl-bin, libsasl-modules-plain,
+ libsasl-digestmd5-plain or libsasl-digestmd5-des.
+
+ To enable sendmail SASL support at a later date, invoke "$0"
+
+ EOT
+ exit 0;
+ fi;
+
+# Check for sasl-bin (wherein resides saslpasswd)
+if [ ! -x ${SASLPASSWD} ]; then
+ cat <<-EOT
+ ${SASL_BIN} not installed, not configuring sendmail support.
+
+ To enable sendmail SASL support at a later date, invoke "$0"
+
+ EOT
+ exit 0;
+ fi;
+#echo " ";
+#echo "Creating/Updating SASL information";
+
+# See if we need to rename an existing SASL info file
+if [ -f @sysconfdir@/mail/auth-info -a \
+ ! -f @sysconfdir@/mail/default-auth-info ]; then
+ mv @sysconfdir@/mail/auth-info \
+ @sysconfdir@/mail/default-auth-info;
+ fi;
+
+# Create Default SASL auth information
+if [ ! -f @sysconfdir@/mail/default-auth-info ]; then
+ cat <<-EOT > @sysconfdir@/mail/default-auth-info
+ $SMUID
+ $SMAID
+ $SMPWD
+ $SMRLM
+ EOT
+
+# Use exisisting SASL auth information
+else
+ SMUID=$(head -n1 @sysconfdir@/mail/default-auth-info);
+ SMAID=$(head -n2 @sysconfdir@/mail/default-auth-info | tail -n1 -);
+ SMPWD=$(head -n3 @sysconfdir@/mail/default-auth-info | tail -n1 -);
+ SMRLM=$(head -n4 @sysconfdir@/mail/default-auth-info | tail -n1 -);
+ fi;
+
+# Check for default settings, used in later test
+if [ "$SMUID" = 'sendmail' ] \
+&& [ "$SMAID" = 'sendmail' ] \
+&& [ "$SMPWD" = 'sendmailpwd' ]; then
+ DEFAULT=1;
+ fi;
+
+# Create any missing SASL configuration files
+if [ -d ${SASLLIB} ]; then
+ # SASL password configuration
+ if [ ! -f ${SASLLIB}/saslpasswd.conf ]; then
+ NEW=1;
+ cp @datadir@/sendmail/examples/sasl/saslpasswd.conf \
+ ${SASLLIB}/saslpasswd.conf;
+ fi;
+ chown root:root ${SASLLIB}/saslpasswd.conf;
+ chmod 0640 ${SASLLIB}/saslpasswd.conf;
+
+ # Sendmail SASL configuration
+ if [ ! -L ${SASLLIB}/Sendmail.conf ]; then
+ if [ -f ${SASLLIB}/Sendmail.conf ]; then
+ mv ${SASLLIB}/Sendmail.conf @sysconfdir@/mail/sasl/Sendmail.conf;
+ fi;
+ ln -sf @sysconfdir@/mail/sasl/Sendmail.conf \
+ ${SASLLIB}/Sendmail.conf;
+ fi;
+
+ # Make sure libraries are properly installed...
+ ( cd ${SASLLIB} && \
+ if [ -L libanonymous.so.${SASLSO} -a ! -L libanonymous.so ]; then \
+ ln -s libanonymous.so.${SASLSO} libanonymous.so; \
+ fi; \
+ if [ -L libcrammd5.so.${SASLSO} -a ! -L libcrammd5.so ]; then \
+ ln -s libcrammd5.so.${SASLSO} libcrammd5.so; \
+ fi; \
+ if [ -L libdigestmd5.so.${SASLSO} -a ! -L libdigestmd5.so ]; then \
+ ln -s libdigestmd5.so.${SASLSO} libdigestmd5.so; \
+ fi; \
+ if [ -L libdigestmd5.so.0 -a ! -L libdigestmd5.so ]; then \
+ ln -s libdigestmd5.so.0 libdigestmd5.so; \
+ fi; \
+ if [ -L libgssapiv2.so.${SASLSO} -a ! -L libgssapiv2.so ]; then \
+ ln -s libgssapiv2.so.${SASLSO} libgssapiv2.so; \
+ fi; \
+ if [ -L liblogin.so.${SASLSO} -a ! -L liblogin.so ]; then \
+ ln -s liblogin.so.${SASLSO} liblogin.so; \
+ fi; \
+ if [ -L liblogin.so.0 -a ! -L liblogin.so ]; then \
+ ln -s liblogin.so.0 liblogin.so; \
+ fi; \
+ if [ -L libplain.so.${SASLSO} -a ! -L libplain.so ]; then \
+ ln -s libplain.so.${SASLSO} libplain.so; \
+ fi; )
+ fi;
+
+# Create/update sendmail SASL files
+if [ ! -f @sysconfdir@/mail/sasl/Sendmail.conf ]; then
+ NEW=1;
+ cp @datadir@/sendmail/examples/sasl/Sendmail.conf \
+ @sysconfdir@/mail/sasl/Sendmail.conf;
+ fi;
+chown root:smmsp @sysconfdir@/mail/sasl/Sendmail.conf;
+chmod 0640 @sysconfdir@/mail/sasl/Sendmail.conf;
+
+# Recommend PAM for sendmail authorization
+if ! grep -qEe "^[[:space:]]*pwcheck_method:[[:space:]]*PAM" \
+ ${SASLLIB}/Sendmail.conf; then
+ cat <<-EOT
+
+ It is *strongly* recommended that you use PAM as the authentication
+ method for sendmail via SASL. Doing so will allow *all* your shell
+ users (those with an /etc/passwd entry) to automagically authenticate
+ themselves when using a MUA with SASL support turned on.
+
+ Do you wish to use PAM (Y|n)?
+ EOT
+ read yn;
+ yn=$(echo -n "$yn" | sed -e "s/^\ *//" -e "s/^\t*//");
+ test -n "$yn" || yn="Y";
+ case "$yn" in
+ [Yy]*)
+ if grep -qEe '^[[:space:]]*pwcheck_method:' \
+ @sysconfdir@/mail/sasl/Sendmail.conf; then
+ sed -e \
+ 's?^[[:space:]]*pwcheck_method:.*$?pwcheck_method: PAM?' \
+ @sysconfdir@/mail/sasl/Sendmail.conf \
+ > @sysconfdir@/mail/sasl/Sendmail.conf.new;
+ else
+ echo 'pwcheck_method: PAM' \
+ | cat @sysconfdir@/mail/sasl/Sendmail.conf - \
+ > @sysconfdir@/mail/sasl/Sendmail.conf.new;
+ fi;
+ if [ -f @sysconfdir@/mail/sasl/Sendmail.conf.new ]; then
+ chown root:smmsp @sysconfdir@/mail/sasl/Sendmail.conf.new;
+ chmod 0644 @sysconfdir@/mail/sasl/Sendmail.conf.new;
+ mv @sysconfdir@/mail/sasl/Sendmail.conf.new \
+ @sysconfdir@/mail/sasl/Sendmail.conf;
+ fi;
+ ;;
+ esac;
+ fi;
+
+# Make sure default-auth-info is secure
+if [ -f @sysconfdir@/mail/default-auth-info ]; then
+ chown root:smmsp @sysconfdir@/mail/default-auth-info;
+ chmod 0640 @sysconfdir@/mail/default-auth-info;
+ fi;
+
+# Create skeleton file, the saslpasswd command will get a failure ;-{
+if [ ! -f ${SASLDB} ]; then
+ NEW=1;
+ if [ -x ${SASLPASSWD} ]; then
+ ${SASLDBLISTUSERS} 1>/dev/null 2>&1 || true;
+ echo "$SMPWD" | ${SASLPASSWD} -p -c -u $SMRLM $SMAID \
+ 1>/dev/null 2>&1 || true;
+ chown root:smmsp ${SASLDB};
+ chmod 0660 ${SASLDB};
+ else
+ echo "*** You do not have the sasl-bin package installed!";
+ echo "*** Please install it and rerun $0";
+ echo "*** Sendmail can't use SASL until this is done...";
+ fi;
+ fi;
+
+# Set SMTP auth password
+if [ -x ${SASLPASSWD} ]; then
+ if [ $DEFAULT = 0 ]; then
+ echo "$SMPWD" | ${SASLPASSWD} -p -c -u $SMRLM $SMAID || true;
+ else
+ ${SASLPASSWD} -d -u $SMRLM $SMAID 1>/dev/null 2>&1 || true;
+ fi;
+ fi;
+
+# For sendmail, /etc/sasldb must be 0600 or (0640/0660 w/dontblamesendmail)
+if [ -f ${SASLDB} ]; then
+ find ${SASLDB} -gid 0 -print | xargs -r chown root:smmsp;
+ find ${SASLDB} -gid 8 -print | xargs -r chown root:smmsp;
+ find ${SASLDB} -group smmsp -print | xargs -r chmod g+rw;
+ chmod g-x,o-rwx ${SASLDB};
+ fi;
+
+# Tell them about the new wizbang features...
+if [ $NEW -eq 1 ]; then
+ cat <<-EOT
+
+ SASL is now minimally setup, there are a few ways to handle users:
+ *) Allow only shell users (default)
+ You're all set, nothing else to do !
+ *) Allow users other than shell
+ Add users via /usr/sbin/saslpasswd and make sure that the
+ realm you used matches what your users specify in their
+ netscape/outlook/mutt/etc profiles.
+
+ If you need to authorize sendmail as a sender, also update
+ @sysconfdir@/mail/default-auth-info and rerun $0.
+
+ EOT
+ fi;
diff --git a/debian/local/update_conf.in b/debian/local/update_conf.in
new file mode 100644
index 0000000..330a97a
--- /dev/null
+++ b/debian/local/update_conf.in
@@ -0,0 +1,1140 @@
+#!/usr/bin/perl -w
+#------------------------------------------------------------------------
+#
+# $Sendmail: update_conf,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Parse and update /etc/mail/sendmail.conf and reflect its values in
+# /etc/cron.d/sendmail and /etc/inetd.conf.
+#
+# Copyright (c) 2001-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+#------------------------------------------------------------------------
+#
+use strict; # be kosher
+use Cwd; # provide cwd()
+use Env; # A few environmental references
+use integer; # Peformance
+use Sys::Hostname; # make sure we have a valid hostname
+use Getopt::Long; # parameter handling
+use FileHandle; # I/O
+
+# Local libraries - for Debian Sendmail Perl helper functions
+# BEGIN { $main::my_path = substr($0,$[,rindex($0,'/')) };
+use lib ('.', substr($0,$[,rindex($0,'/')), "@datadir@/sendmail");
+require Parse_mc;
+
+$main::program_name = $0; #'update_conf';
+$main::program_version = '@sm_version@';
+$main::program_date = '@sm_date@ @sm_time@ cowboy';
+my $interp_pgm = "$^X";
+my $interp_vrm = $];
+$interp_vrm = ("$^V" | '000') if (defined $^V);
+my $current_time = scalar localtime;
+my $user = getlogin || (getpwuid($<))[0] || "Unknown!!";
+my $hostname = hostname();
+my $directory = cwd();
+
+my $conffile = "@sysconfdir@/mail/sendmail.conf";
+my $output_file = '';
+my $ofh = new FileHandle;
+my $debug = 0;
+my $result;
+
+#
+#------------------------------------------------------------------------------
+# Global variables
+#------------------------------------------------------------------------------
+my %parm_def;
+my %parameter;
+my %parm_kw;
+my %parm_bool;
+my %parm_deprecated;
+my %parm_hidden;
+
+#
+#------------------------------------------------------------------------------
+# Finally, some code (almost)
+#------------------------------------------------------------------------------
+
+#
+# Argument handling...
+$main::opt_help='';
+$main::opt_output_file='';
+$main::opt_input_file='';
+$main::opt_debug='';
+my @options = qw(
+ help|h
+ output-file|output_file|o:s
+ input-file|input_file|i:s
+ debug!
+ );
+$result = GetOptions(@options);
+if ( ! $result ) {
+ die "Terminating due to parameter error";
+ };
+if ( $main::opt_help ) {
+ warn "$main::program_name $main::program_version $main::program_date\n";
+ warn "$0 \n";
+ warn " -help\n" if $main::opt_help;
+ warn " -debug\n" if $main::opt_debug;
+ warn " -o $main::opt_output_file\n" if $main::opt_output_file;
+ warn " -i $main::opt_input_file\n" if $main::opt_input_file;
+ exit 0;
+ };
+
+$output_file = $main::opt_output_file if ($main::opt_output_file);
+my $input_file = $main::opt_input_file || $conffile;
+# $main::debug is used in Parse_mc !
+$main::debug = $main::opt_debug || '';
+$debug = $main::debug;
+
+# Obtain default values
+&set_defaults;
+
+# Update defaults according to current environment
+&update_defaults;
+
+# Read /etc/mail/sendmail.conf (if extant)
+&read_config;
+
+# Make sure things are kosher
+my $ok = &validate_config;
+if (! $ok) {
+ die "Terminating due to configuration error.";
+ };
+
+# [Re]write /etc/mail/sendmail.config
+&write_config;
+if ( $output_file eq '' ) {
+ chown '0', '0', $conffile;
+ chmod 0644, $conffile;
+ };
+
+# Reflect settings in /etc/cron.d/sendmail
+&write_crontab;
+if ( $output_file eq '' ) {
+ chown '0', '0', "@sysconfdir@/cron.d/sendmail";
+ chmod 0644, "@sysconfdir@/cron.d/sendmail";
+ };
+
+# Reflect settings in /etc/inetd.conf
+&update_inetd;
+
+# Create/Delete files
+&update_files;
+
+exit (0);
+
+#
+#------------------------------------------------------------------------
+# Set global values
+#------------------------------------------------------------------------
+sub set_defaults {
+
+ %parm_def = (
+ 'DAEMON_MODE' => 'Daemon'
+ ,'DAEMON_PARMS' => ''
+ ,'DAEMON_HOSTSTATS' => 'No'
+ ,'DAEMON_MAILSTATS' => 'No'
+ ,'QUEUE_MODE' => '${DAEMON_MODE}'
+ ,'QUEUE_INTERVAL' => '10'
+ ,'QUEUE_PARMS' => ''
+ ,'MSP_MODE' => 'Cron'
+ ,'MSP_INTERVAL' => '${QUEUE_INTERVAL}'
+ ,'MSP_PARMS' => '${QUEUE_PARMS}'
+ ,'MSP_MAILSTATS' => '${DAEMON_MAILSTATS}'
+ ,'MISC_PARMS' => ''
+ ,'CRON_MAILTO' => 'root'
+ ,'CRON_PARMS' => ''
+ ,'AGE_DATA' => ''
+ );
+
+ %parameter = %parm_def;
+
+ %parm_kw = (
+ 'DAEMON_MODE' => ['daemon', 'inetd']
+ ,'QUEUE_MODE' => ['daemon', 'cron']
+ ,'MSP_MODE' => ['daemon', 'cron', 'none']
+ );
+
+ %parm_bool = (
+ 'DAEMON_HOSTSTATS' => 1
+ ,'DAEMON_MAILSTATS' => 1
+ ,'MSP_MAILSTATS' => 1
+ );
+
+ %parm_deprecated = (
+ 'DAEMON_STATS' => 'DAEMON_MAILSTATS'
+ ,'MSP_STATS' => 'MSP_MAILSTATS'
+ );
+
+ %parm_hidden = (
+ 'prefix' => 1
+ ,'exec_prefix' => 1
+ ,'bindir' => 1
+ ,'sbindir' => 1
+ ,'libexecdir' => 1
+ ,'datadir' => 1
+ ,'sysconfdir' => 1
+ ,'sharedstatedir' => 1
+ ,'localstatedir' => 1
+ ,'libdir' => 1
+ ,'MTA_DAEMON' => 1
+ ,'MTA_COMMAND' => 1
+ ,'MTA_L' => 1
+ ,'MTA_L_QUEUE' => 1
+ ,'MTA_ROOT' => 1
+ ,'MTA_PIDFILE' => 1
+ ,'MSP_DAEMON' => 1
+ ,'MSP_COMMAND' => 1
+ ,'MSP_L' => 1
+ ,'MSP_L_QUEUE' => 1
+ ,'MSP_ROOT' => 1
+ ,'MSP_PIDFILE' => 1
+ );
+
+ };
+
+#
+#------------------------------------------------------------------------
+# Update default settings according to current environment
+#------------------------------------------------------------------------
+sub update_defaults {
+ my ($class, $flags, $files, $options);
+ my ($ok, $stats);
+ my $file;
+
+ # Obtain entry for HOST_STATUS_DIRECTORY
+ ($class, $flags, $files, $options) =
+ &Parse_mc::entry_dbs('confHOST_STATUS_DIRECTORY');
+ $file = @{$files}[0];
+ if ( $file ne '-' and -d $file ) {
+ $parameter{'DAEMON_HOSTSTATS'} = 'Yes';
+ }
+ else {
+ $parameter{'DAEMON_HOSTSTATS'} = 'No';
+ };
+
+ # Obtain entry for STATUS_FILE
+ ($class, $flags, $files, $options) =
+ &Parse_mc::entry_dbs('STATUS_FILE');
+ $file = @{$files}[0];
+ if ( $file ne '-' and -e $file ) {
+ $parameter{'DAEMON_MAILSTATS'} = 'Yes';
+ }
+ else {
+ $parameter{'DAEMON_MAILSTATS'} = 'No';
+ };
+
+ # Obtain entry for MSP_STATUS_FILE
+ ($class, $flags, $files, $options) =
+ &Parse_mc::entry_dbs('MSP_STATUS_FILE');
+ $file = @{$files}[0];
+ if ( $file ne '-' and -e $file ) {
+ $parameter{'MSP_MAILSTATS'} = 'Yes';
+ }
+ else {
+ $parameter{'MSP_MAILSTATS'} = 'No';
+ };
+
+ };
+
+#
+#------------------------------------------------------------------------
+# Obtain parameter name
+#------------------------------------------------------------------------
+sub get_name {
+ my ($name, $quiet) = @_;
+
+ # Handle deprecated/renamed variables
+ if ( exists($parm_deprecated{$name}) ) {
+ print STDERR "$name is deprecated."
+ if ($debug and ! $quiet);
+ if ( $parm_deprecated{$name} ) {
+ print STDERR " Please use $parm_deprecated{$name} instead.\n"
+ if ($debug and ! $quiet);
+ $name = $parm_deprecated{$name};
+ }
+ else {
+ print STDERR " It will be ignored.\n"
+ if ($debug and ! $quiet);
+ };
+ };
+
+ return $name;
+ };
+#
+#------------------------------------------------------------------------
+# Obtain value directly, or indirectly
+#------------------------------------------------------------------------
+sub get_value {
+ my ($name) = get_name(@_, '');
+ my $value = $parameter{$name};
+
+ my $tval = $value;
+ $tval =~ s/^\s*//;
+ my $ok = 1;
+ my $default = 0;
+
+ # Dereference loop... keep original value if we get any errors...
+ Dereference:;
+ if ($tval =~ /^\$/) {
+ my @ref_stack = ($name);
+ my %ref_hash = ($name => 1);
+ while ($tval =~ /^\$/ and $ok) {
+ my $start = 1;
+ my $del = 1;
+ my $char = substr($tval, 1, 1);
+ if ( $char eq '{' or $char eq '(' ) {
+ $start += 1; $del += 2;
+ };
+ my $ref = get_name(substr($tval, $start,
+ length($tval)-$del), '');
+ push @ref_stack, $ref;
+ if (exists($ref_hash{$ref})) {
+ print STDERR "Go directly to jail; do not pass go, ",
+ "do not collect \$200\n";
+ print STDERR " Reference loop: ",
+ join('->', @ref_stack, '...'),"\n";
+ $ok = 0;
+ }
+ else {
+ $ref_hash{$ref} = 1;
+ if (lc $ref eq 'default') {
+ $tval = $parm_def{$name};
+ print STDERR
+ "Setting $name to default value: ",
+ "$parm_def{$name}.\n"
+ if ($debug);
+ }
+ elsif (exists($parameter{$ref})) {
+ $tval = $parameter{$ref};
+ print STDERR
+ "Setting $name to value of $ref: $tval.\n"
+ if ($debug);
+ }
+ else {
+ print STDERR
+ "Can't deference $ref, doesn't exist.\n";
+ $ok = 0;
+ };
+ };
+ };
+ };
+
+ if ( $ok ) {
+ # Check keyword parms for valid values
+ if (exists $parm_kw{$name}) {
+ my @ltval = split(/\s/,$tval);
+ my $ltval = lc @ltval[$[];
+ my $found = "";
+ foreach my $value (@{$parm_kw{$name}}) {
+ if ($value eq $ltval) {
+ $found = 1; $tval = $ltval; };
+ };
+ if ( ! $found ) {
+ $default += 1;
+ if ( $default > 1 ) {
+ print STDERR
+ "Can't resolve $name, value=$value.\n";
+ $ok = 0;
+ }
+ else {
+ print STDERR "Illegal value($tval) for $name.\n",
+ " Valid values are: ",
+ join(', ', @{$parm_kw{$name}}),
+ "\n",
+ " Set to default: $parm_def{$name}.\n";
+ $tval = $parm_def{$name};
+ goto Dereference;
+ };
+ };
+ }
+
+ # Check boolean parms for valid values
+ elsif (exists $parm_bool{$name}) {
+ my @ltval = split(/\s/,$tval);
+ my $ltval = lc @ltval[$[];
+ $ltval =~ s/^[ty1].*/1/;
+ $ltval =~ s/^[fn0].*/0/;
+ if ($ltval eq '0' or $ltval eq '1') {
+ $tval = $ltval; }
+ else {
+ $default += 1;
+ if ( $default > 1 ) {
+ print STDERR
+ "Can't resolve $name, value=$value.\n";
+ $ok = 0;
+ }
+ else {
+ print STDERR "Illegal value($tval) for $name.\n",
+ " Valid values are: T[rue],Y[es],1,",
+ " F[alse],N[o],0\n",
+ " Set to default: $parm_def{$name}.\n";
+ $tval = $parm_def{$name};
+ goto Dereference;
+ };
+ };
+ };
+ };
+
+ $value = $tval if $ok;
+
+ print STDERR "get_value : $name => $value\n"
+ if ($debug);
+
+ return ($ok, $value);
+ };
+
+#
+#------------------------------------------------------------------------
+# Check for nullclient mode in /etc/mail/sendmail.mc
+#------------------------------------------------------------------------
+sub check_nullclient {
+ my $nullclient = 0;
+ my $in_file = "@sysconfdir@/mail/sendmail.mc";
+ if ( -r $in_file ) {
+ my $ifh;
+ unless ( open($ifh, "<$in_file") ) {
+ warn("Could not open $in_file($!), ignoring it.\n");
+ };
+
+ line: while (<$ifh>) {
+ next line if /^$/; # skip empty lines
+ next line if /^#/; # skip comments
+ next line if /^dnl /; # skip comments
+ chomp; # drop tailing \n
+
+ if (/^\s*FEATURE\(\s*`?nullclient/) {
+ $nullclient = 1;
+ last line;
+ };
+ };
+ };
+ return $nullclient;
+ };
+
+#
+#------------------------------------------------------------------------
+# Read input configuration file (if no input, just use defaults)
+#------------------------------------------------------------------------
+sub read_config {
+ @ARGV = split(' ', $input_file);
+ return if (! -r $input_file);
+
+ my $savename = '';
+ my $parmname = '';
+ my $parmval = '';
+ my $parmref = '';
+ my $defname = '';
+ my $defval = '';
+ my $tmpval = '';
+
+ print STDOUT "Reading configuration from ", join(',',@ARGV), ".\n";
+
+ line: while (<ARGV>) {
+ next line if /^$/; # skip empty lines
+ chomp; # drop tailing \n
+ if (s/\\$//) {
+ $_ .= <>;
+ redo unless eof();
+ };
+
+ # check commented lines for default parameter values
+ # a bit of a kluge, but it works out nicely
+ if (/^#\s*([\w_]+)="([^"]*)"/) {
+ $defname = get_name($1, 1);
+ $defval = $2;
+ print STDERR "Default: $defname => $defval.\n"
+ if ($debug);
+ next line;
+ };
+ # Skip any comments
+ next line if /^#/; # skip comments
+
+ # Process assignment statements
+ if (/^\s*([\w_]+)="([^"]*)"/) {
+ $savename = $1;
+ $parmname = get_name($savename, '');
+ $parmval = $2;
+ print STDERR "Value : $savename => $parmval.\n"
+ if ($debug);
+
+ # Do we know about this parameter?
+ # NOTE: keep, even if we don't know about it to prevent
+ # problems with up/down grades (not loose anything)
+ if ( ! exists($parm_def{$parmname}) and
+ ! exists($parm_hidden{$parmname}) ) {
+ print STDERR "$parmname is a user defined parameter.\n"
+ if ($debug);
+ };
+
+ # Note if value is default, if so, we'll change it to
+ # the current default - maybe counterintuitive, oh well
+ # it does help with migration
+ if ($parmname eq $defname and $parmval eq $defval) {
+ print STDERR "$parmname is the default value: $defval.\n"
+ if ($debug);
+ $parmval = $parm_def{$parmname};
+ };
+
+ # Finally, assign value
+ if ($savename eq $parmname) {
+ $parameter{$parmname} = $parmval;
+ }
+ else {
+ $parameter{$savename} = $parmval;
+ };
+ };
+ };
+ };
+
+#
+#------------------------------------------------------------------------
+# Validate current configuration
+#------------------------------------------------------------------------
+sub validate_config {
+
+ my $valid = 1;
+
+ print STDOUT "Validating configuration.\n";
+
+ # Really, we only care about the some of the variables - those
+ # that have defaults... the rest, well, so what !
+ foreach my $val (sort keys %parm_def) {
+ my ($ok, $value) = &get_value($val, 1);
+ if (! $ok) { $valid = 0; };
+ };
+
+ if (! $valid ) {
+ print STDERR "\nOne or more errors were encountered!\n\n";
+ };
+
+ return ($valid);
+ };
+
+#
+#------------------------------------------------------------------------
+# Write updated configuration file
+#------------------------------------------------------------------------
+sub write_config {
+ my $out_file = $output_file || $conffile;
+ print STDOUT "Writing configuration to $out_file.\n";
+ $out_file = '&STDOUT' if ($out_file eq '-');
+ unless ( open($ofh, ">$out_file") ) {
+ warn("Could not open $out_file($!), using STDOUT\n");
+ open($ofh, ">&STDOUT");
+ };
+ $out_file = '-' if ($out_file eq '&STDOUT');
+
+# print $ofh <<"EOT";
+####################################################################
+##### This file is automagically generated -- edit at your own risk
+#####
+##### file: ${out_file}
+##### generated via: (${interp_pgm} ${interp_vrm})
+##### ${main::program_name}
+##### version: ${main::program_version} ${main::program_date}
+##### by: ${user}\@${hostname}
+##### on: ${current_time}
+##### in: ${directory}
+##### input files:
+#EOT
+# foreach my $file ( split(' ', $input_file) ) {
+# print $ofh <<"EOT";
+##### ${file}
+#EOT
+# };
+# print $ofh <<"EOT";
+#####
+####################################################################
+ print $ofh <<"EOT";
+#------------------------------------------------------------------------------
+#
+# $out_file
+#
+# Copyright (c) 2001-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+# Version: ${main::program_version}
+# Time-stamp: <${main::program_date}>
+#
+# Parameter file for sendmail (sourced by /usr/share/sendmail/sendmail)
+# Make all changes herein, instead of altering /etc/init.d/sendmail.
+#
+# After making changes here, you'll need to run /usr/sbin/sendmailconfig
+# or ${main::program_name} to have the changes take effect -
+# If you change DAEMON_MODE, QUEUE_MODE, or QUEUE_INTERVAL, you'll also
+# need to run /etc/init.d/sendmail restart.
+#
+# Changes made herein will be kept across upgrades - except for comments!
+# Some comment lines have special significance ...
+#
+# **** **** **** **** DO NOT EDIT THE COMMENTS **** **** **** ****
+#
+# Supported parameters (and defaults) are listed herein.
+#
+# Notes:
+# * This setup allows sendmail to run in several modes:
+# - listener and queue runner..DAEMON_MODE="daemon".QUEUE_MODE="daemon"
+# - listener only..............DAEMON_MODE="daemon".QUEUE_MODE="none"
+# - queue runner only..........DAEMON_MODE="none"...QUEUE_MODE="daemon"
+# - *NOTHING* ?!?..............DAEMON_MODE="none"...QUEUE_MODE="none"
+#
+# * You can also run the listener from inetd:
+# - listener and queue runner..DAEMON_MODE="inetd"..QUEUE_MODE="daemon"
+# - listener only..............DAEMON_MODE="inetd"..QUEUE_MODE="none"
+#
+# * You can also run the queue runner from cron:
+# - listener and queue runner..DAEMON_MODE="....."..QUEUE_MODE="cron"
+# - queue runner only..........DAEMON_MODE="none"...QUEUE_MODE="cron"
+#
+# * _PARMS entries herein are shown in precedence order, any later _PARMS
+# field will, if applicable, override any previous _PARMS fields.
+#
+# * Values *MUST* be surrounded with double quotes ("), single quotes
+# will *NOT* work !
+#
+#------------------------------------------------------------------------------
+# SMTP Listener Configuration
+#
+# DAEMON_MODE="$parm_def{'DAEMON_MODE'}"; Keyword SMTP listener
+# daemon: Run as standalone daemon
+# inetd: Run from inet supervisor (forks for each mail)
+# none: No listener (ie, nullclient/smarthost)
+#
+# NOTE: for the nonce, DAEMON_MODE="none" is *NOT* supported !!!
+#
+DAEMON_MODE="$parameter{'DAEMON_MODE'}";
+#
+# DAEMON_PARMS="$parm_def{'DAEMON_PARMS'}"; String Listener parms
+# Any parameters here will be ignored when run from cron.
+# Note that MISC_PARMS and CRON_PARMS, if applicable, will override
+# anything declared herein.
+#
+DAEMON_PARMS="$parameter{'DAEMON_PARMS'}";
+#
+# DAEMON_HOSTSTATS="$parm_def{'DAEMON_HOSTSTATS'}"; Boolean Listener stats
+# This parameter determines whether or not host stats are collected
+# and available for the \`hoststat\` command to display. There will
+# be a (minor) performance hit, as files will be created/updated for each
+# sendmail delivery attempt. The files are fixed in size, and small,
+# but there can be many of them.
+#
+DAEMON_HOSTSTATS="$parameter{'DAEMON_HOSTSTATS'}";
+#
+# DAEMON_MAILSTATS="$parm_def{'DAEMON_MAILSTATS'}"; Boolean Listener stats
+# This parameter determines whether or not mailer stats are collected
+# and available for the \`mailstats\` command to display. There will
+# be a (minor) performance hit, as this file will be updated for each
+# item coming into, or out of, sendmail. The file is fixed in size,
+# and small, so there's no need to rotate it.
+#
+DAEMON_MAILSTATS="$parameter{'DAEMON_MAILSTATS'}";
+#
+#------------------------------------------------------------------------------
+# SMTP MTA Queue Runner Configuration
+#
+# QUEUE_MODE="$parm_def{'QUEUE_MODE'}"; Keyword SMTP queue runner
+# daemon: Run as standalone daemon
+# cron: Run from crontab
+# none: No queue runner (ie, nullclient/smarthost)
+#
+# NOTE: for the nonce, QUEUE_MODE="none" is *NOT* supported !!!
+#
+QUEUE_MODE="$parameter{'QUEUE_MODE'}";
+#
+# QUEUE_INTERVAL="$parm_def{'QUEUE_INTERVAL'}"; Integer in minutes
+# Interval at which to run the MTA queues. What interval should you use?
+# The amount of time that is acceptable before retrying delivery on
+# mail that couldn't be delivered in one run, or how long an item can
+# set in the queue before having the first delivery attempt done.
+#
+QUEUE_INTERVAL="$parameter{'QUEUE_INTERVAL'}";
+#
+# QUEUE_PARMS="$parm_def{'QUEUE_PARMS'}"; String queue parameters
+# Any parameters here are also used when run from cron.
+# Note that MISC_PARMS and CRON_PARMS, if applicable, will override
+# anything declared herein.
+#
+QUEUE_PARMS="$parameter{'QUEUE_PARMS'}";
+#
+#------------------------------------------------------------------------------
+# SMTP - MSP Queue Runner Configuration
+#
+# MSP_MODE="$parm_def{'MSP_MODE'}"; Keyword MSP queue runner mode
+# daemon: Run as standalone daemon
+# cron: Run from crontab
+# none: No queue runner (ie, nullclient/smarthost)
+#
+# NOTE: If QUEUE_MODE="cron" & MSP_MODE="none", the MSP queue will
+# be run as part of the MTA queue running process.
+#
+MSP_MODE="$parameter{'MSP_MODE'}";
+#
+# MSP_INTERVAL="$parm_def{'MSP_INTERVAL'}"; Integer in minutes
+# Interval at which to run the MSP queues. What interval should you use?
+# The amount of time that is acceptable before retrying delivery on
+# mail that couldn't be accepted by the MTA, and was therefore left
+# in the message submission queue. Probably should be the same as the
+# whats used in QUEUE_INTERVAL.
+#
+MSP_INTERVAL="$parameter{'MSP_INTERVAL'}";
+#
+# MSP_PARMS="$parm_def{'MSP_PARMS'}"; String queue parameters
+# Any parameters here are also used when run from cron.
+# Note that MISC_PARMS and CRON_PARMS, if applicable, will override
+# anything declared herein.
+#
+MSP_PARMS="$parameter{'MSP_PARMS'}";
+#
+# MSP_MAILSTATS="$parm_def{'MSP_MAILSTATS'}"; Boolean Listener stats
+# This parameter determines whether or not mailer stats are collected
+# and available for the \`mailstats\` command to display. There will
+# be a (minor) performance hit, as this file will be updated for each
+# item coming into, or out of, sendmail. The file is fixed in size,
+# and small, so there's no need to rotate it.
+#
+MSP_MAILSTATS="$parameter{'MSP_MAILSTATS'}";
+#
+#------------------------------------------------------------------------------
+# Miscellaneous Confguration
+#
+# MISC_PARMS="$parm_def{'MISC_PARMS'}"; String miscellaneous parameters
+# Miscellaneous parameters - applied to any sendmail invocation.
+# Any parameters here are also used when run from cron.
+# Applied after {DAEMON,QUEUE}_PARMS, and can therefore override them
+# if need be (in which case why did use them?)
+# Note that CRON_PARMS, if applicable, will override anything
+# declared herein.
+#
+# Here is where'd you setup and debugging or special parms that you
+# want shared betwixt the possibly separate listener/queue-runner
+# processes.
+#
+MISC_PARMS="$parameter{'MISC_PARMS'}";
+#
+#------------------------------------------------------------------------------
+# Cron Job Configuration
+#
+# CRON_MAILTO="$parm_def{'CRON_MAILTO'}"; String cronjob output
+# Recipient of *rare* cronjob output. Some cronjobs will be running
+# under user `mail`, so any problems encountered would probably be missed
+# so define a user who actually (hopefully) checks email now and again.
+#
+CRON_MAILTO="$parameter{'CRON_MAILTO'}";
+#
+# CRON_PARMS="$parm_def{'CRON_PARMS'}"; String cron specific parmeters
+# Cron parameters - applied *only* when sendmail queue running is done
+# via a cronjob. Applied after QUEUE_PARMS and MISC_PARMS, and can
+# therefore override them if need be.
+#
+CRON_PARMS="$parameter{'CRON_PARMS'}";
+#
+#------------------------------------------------------------------------------
+# Queue Aging Configuration
+#
+# Why would you want to age your queues? On every queue-run interval,
+# sendmail will try *every* file in the queue... If a site is down
+# for a while, considerable time can be wasted each interval in retrying
+# it. The scheme supported allows aging by time, and can move the older
+# files to another (less frequently run queue), thereby reducing overal
+# system impact - and providing better mail throughput.
+#
+# Note that this support is completely separate from QUEUE_MODE=cron,
+# you can age queues even if you're running QUEUE_MODE=daemon.
+#
+# There are four parts to the queue aging support, and these parts
+# may be repeated, to operate on multiple queues.
+#
+# 1. Interval at which to age the queues (in minutes).
+# What interval should you use? Roughly twice the normal queue
+# interval, so that messages are tried twice in each successively
+# slower queue.
+#
+# 2. Criteria (optional and defaults to interval). This is the
+# specification of which files to move. It defaults moving
+# files whose age in the queues exceeds the interval.
+# This field, if specified can be very complex - supporting
+# aging by just about anything! see qtool(8) for details.
+#
+# 3. To queue. This is the queue to which files will be moved.
+# It may be fully qualified, or relative to /var/spool/mqueue.
+#
+# 4. From queue. This is the queue from which files will be moved.
+# It may be fully qualified, or relative to /var/spool/mqueue.
+#
+# Samples:
+# AGE_DATA="[['25', '', 'hourly', 'main']]";
+# Every 25 minutes, move any file older than 25 minutes from
+# /var/spool/mqueue/main to /var/spool/mqueue/hourly
+#
+# AGE_DATA="[['25', '', 'hourly', 'main'],\\
+# ['125', '', 'daily', 'hourly']]";
+# Same as the above, but also move files from the hourly queue
+# to the daily queue after 125 minutes in the hourly queue.
+#
+# AGE_DATA="[['25',\\
+# '-e \\'\$msg{message}[0] == /Deferred: 452 4.2.2 Over quota/\\'',\\
+# 'overquota', 'main']]";
+# Every 25 minutes, move all files deferred because of quota
+# violations from /var/spool/mqueue/main to
+# /var/spool/mqueue/overquota where they can be processed on
+# a different interval, or by some other means.
+#
+# If the above samples suggest Perl arrays, well, they are...
+#
+# AGE_DATA="$parm_def{'AGE_DATA'}"; Perl array Queue aging data
+#
+EOT
+ my ($ok, $var) = &get_value('AGE_DATA');
+ my $tmpval = eval $var;
+ if ($@) {
+ warn $@;
+ }
+ else {
+ $var = $tmpval;
+ };
+ if (not defined $var) {
+ print $ofh 'AGE_DATA="";',"\n";
+ }
+ elsif (not ref $var) {
+ print $ofh 'AGE_DATA="',$var,'";',"\n";
+ }
+ elsif (@{$var} == 0) {
+ print $ofh 'AGE_DATA="";',"\n";
+ }
+ else {
+ print $ofh 'AGE_DATA="[\\',"\n";
+ foreach my $entry (@{$var}) {
+ foreach my $ndx ($[ .. $#{@{$entry}}) {
+ @{$entry}[$ndx] =~ s/'/\\'/g;
+ };
+ print $ofh "['",join("', '",@{$entry}),"'],\\\n";
+ };
+ print $ofh ']";',"\n";
+ };
+ print $ofh <<"EOT";
+#
+#------------------------------------------------------------------------------
+# Hidden variables (the blood be upon your hands)
+#
+EOT
+ foreach my $key (sort keys %parm_hidden) {
+ my ($ok, $value);
+ # Don't evaluate value, just stuff it...
+ next if ( ! $parameter{$key} );
+ ($ok, $value) = (1, $parameter{$key});
+ print $ofh "$key=",'"',$value,'";',"\n";
+ };
+ print $ofh <<"EOT";
+#
+#------------------------------------------------------------------------------
+# Deprecated variables (kept for reference)
+#
+EOT
+ foreach my $key (sort keys %parm_deprecated) {
+ my ($ok, $value);
+ # Don't evaluate value, just stuff it...
+ if ( $parm_deprecated{$key} ) {
+ ($ok, $value) = (1, join('','${', $parm_deprecated{$key}, '}'));
+ }
+ elsif ( $parameter{$key} ) {
+ ($ok, $value) = (1, $parameter{$key});
+ };
+ print $ofh "$key=",'"',$value,'";',"\n";
+ };
+ print $ofh <<"EOT";
+#
+#------------------------------------------------------------------------------
+# Unknown variables (kept for reference)
+#
+EOT
+ foreach my $key (sort keys %parameter) {
+ if (! exists($parm_def{$key}) and
+ ! exists($parm_deprecated{$key})) {
+ # Don't evaluate value, just stuff it...
+ my ($ok, $value) = (1, $parameter{$key});
+ print $ofh "$key=",'"',$value,'";',"\n";
+ };
+ };
+ print $ofh <<"EOT";
+#------------------------------------------------------------------------------
+#
+
+EOT
+
+ close($ofh);
+ };
+
+#
+#------------------------------------------------------------------------
+# Write updated cron file
+#------------------------------------------------------------------------
+sub write_crontab {
+ my $var;
+ my $interval = '';
+ my $test = "test -x @datadir@/sendmail/sendmail";
+ my $command = '';
+ my $ok = '';
+ my $mailto = '';
+ my $mmode = '';
+ my $qmode = '';
+ my $msp_line = '';
+ my $mta_line = '';
+ my $age_line = '';
+
+ ($ok, $mailto) = &get_value('CRON_MAILTO');
+ if ( ! $ok ) {
+ return;
+ };
+
+ my $out_file = $output_file || "@sysconfdir@/cron.d/sendmail";
+ print STDOUT "Writing $out_file.\n";
+ $out_file = '&STDOUT' if ($out_file eq '-');
+ unless ( open($ofh, ">$out_file") ) {
+ warn("Could not open $out_file($!), using STDOUT\n");
+ open($ofh, ">&STDOUT");
+ };
+ $out_file = '-' if ($out_file eq '&STDOUT');
+
+ print $ofh <<"EOT";
+####################################################################
+##### This file is automagically generated -- edit at your own risk
+#####
+##### file: ${out_file}
+##### generated via: (${interp_pgm} ${interp_vrm})
+##### ${main::program_name}
+##### version: ${main::program_version} ${main::program_date}
+##### by: ${user}\@${hostname}
+##### on: ${current_time}
+##### in: ${directory}
+##### input files:
+EOT
+ foreach my $file ( split(' ', $input_file) ) {
+ print $ofh <<"EOT";
+##### ${file}
+EOT
+ };
+ print $ofh <<"EOT";
+#####
+####################################################################
+#------------------------------------------------------------------------------
+#
+# $out_file
+#
+# Copyright (c) 2001-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+# Version: ${main::program_version}
+# Time-stamp: <${main::program_date}>
+#
+# Sendmail crontab - Call sendmail at various times to do the following:
+# 1) Age queues - move undelivered mail to a slower queue
+# 2) Retry any mail queued by the message submission process
+# 3) run the queues (deliver mail) if a standalone daemon is not desired
+#
+# Each processes is independant and guided by /etc/mail/sendmail.conf and
+# {sendmail,submit}.mc files.
+#
+# There isn't anything here that should need touching.
+#
+# Any requisite queue/misc parameters must be set in /etc/mail/sendmail.conf
+# and reflected herein via /usr/sbin/sendmailconfig (or more directly via
+# ${main::program_name}).
+#
+#------------------------------------------------------------------------------
+#
+# use default path, shell, home
+#SHELL=/bin/sh
+#PATH=
+#HOME=
+# send mail to this user, as `mail/smmsp` isn't real.
+MAILTO=$mailto
+#
+# format of entries:
+# m h dom mon dow user command
+#
+#------------------------------------------------------------------------------
+# Every so often, give sendmail a chance to run the MSP queues.
+#
+EOT
+ ($ok, $interval) = &get_value('MSP_INTERVAL');
+ $interval = join('', '*/', $interval);
+ $command = "$test && @datadir@/sendmail/sendmail cron-msp";
+ ($ok, $mmode) = &get_value('MSP_MODE');
+ ($ok, $qmode) = &get_value('QUEUE_MODE');
+ if ($mmode eq 'cron'
+ #or ($mmode eq 'none' and $qmode eq 'cron')
+ ) {
+ $msp_line =
+ "$interval * * * *\t\tsmmsp\t$command";
+ }
+ else {
+ $msp_line =
+ "#$interval * * * *\t\tsmmsp\t$command";
+ };
+ print $ofh "$msp_line\n";
+
+ print $ofh <<"EOT";
+#
+#------------------------------------------------------------------------------
+# Every so often, give sendmail a chance to run the MTA queues.
+# Will also run MSP queues if enabled
+#
+EOT
+ ($ok, $interval) = &get_value('QUEUE_INTERVAL');
+ $interval = join('','*/',$interval);
+ $command = "$test && @datadir@/sendmail/sendmail cron-mta";
+ if ($qmode eq 'cron') {
+ $mta_line =
+ "$interval * * * *\t\troot\t$command";
+ }
+ else {
+ $mta_line =
+ "#$interval * * * *\t\troot\t$command";
+ };
+ print $ofh "$mta_line\n";
+
+ print $ofh <<"EOT";
+#
+#------------------------------------------------------------------------------
+# Every so often, give sendmail a chance to age the queues.
+#
+EOT
+ ($ok, $var) = &get_value('AGE_DATA');
+ my $tmpval = eval $var;
+ if ($@) {
+ warn $@;
+ }
+ else {
+ $var = $tmpval;
+ };
+ if (not ref $var) {
+ print $ofh "# No queue aging\n";
+ }
+ elsif (@{$var} == 0) {
+ print $ofh "# No queue aging\n";
+ }
+ else {
+ foreach my $entry (@{$var}) {
+ $interval = "*/@$entry[0]";
+ my $criteria = @$entry[1] || join('','-s ',60*@$entry[0]);
+ my $to = @$entry[2];
+ my $from = @$entry[3];
+ $command = "$test && @datadir@/sendmail/qtool.pl";
+ $from = "@localstatedir@/spool/mqueue/$from"
+ if ($from !~ /^\//);
+ $to = "@localstatedir@/spool/mqueue/$to"
+ if ($to !~ /^\//);
+ $age_line =
+ "$interval * * * *\t\troot\t$command $criteria $to $from";
+ print $ofh "$age_line >/dev/null\n";
+ };
+ };
+ print $ofh <<"EOT";
+#
+EOT
+
+ close($ofh);
+ };
+
+#
+#------------------------------------------------------------------------
+# Update /etc/inetd.conf file
+#------------------------------------------------------------------------
+sub update_inetd {
+
+ # Don't try to write if we're debugging
+ if ($output_file ne '') {
+ return;
+ };
+
+ my ($ok, $mode) = &get_value('DAEMON_MODE');
+ if ( $ok ) {
+ if ( $mode eq 'inetd' ) {
+ system 'update-inetd --group MAIL --enable smtp,smtps,587'
+ }
+ else {
+ system 'update-inetd --group MAIL --disable smtp,smtps,587'
+ };
+ };
+
+ };
+
+#
+#------------------------------------------------------------------------
+# Update mail statistics information (create/delete files)
+#------------------------------------------------------------------------
+sub update_files {
+
+ # Don't try to write if we're debugging
+ if ($output_file ne '') {
+ return;
+ };
+
+ my ($class, $flags, $files, $options);
+ my ($ok, $stats);
+ my $file;
+
+ #
+ # Read the mc/m4 files
+ &Parse_mc::read_dbs('', '');
+
+ # Obtain entry for HOST_STATUS_DIRECTORY
+ ($class, $flags, $files, $options) =
+ &Parse_mc::entry_dbs('confHOST_STATUS_DIRECTORY');
+ $file = @{$files}[0];
+ ($ok, $stats) = &get_value('DAEMON_HOSTSTATS');
+ if ( $ok and $file ne '-' ) {
+ if ( $stats and ! -d $file) {
+ print STDOUT "Enabling HOST statistics file($file).\n";
+ system "mkdir ${file}";
+ my $gid = getgrnam('smmsp');
+ chown '0', $gid, $file;
+ chmod 02750, $file;
+ }
+ elsif ( ! $stats and -d $file ) {
+ print STDOUT "Disabling HOST statistics file($file).\n";
+ system "rm -rf ${file}";
+ };
+ };
+
+ # Obtain entry for STATUS_FILE
+ ($class, $flags, $files, $options) =
+ &Parse_mc::entry_dbs('STATUS_FILE');
+ $file = @{$files}[0];
+ ($ok, $stats) = &get_value('DAEMON_MAILSTATS');
+ if ( $ok and $file ne '-' ) {
+ if ( $stats and ! -e $file) {
+ print STDOUT "Enabling MTA statistics file($file).\n";
+ open 'STATS', ">$file";
+ close 'STATS';
+ my $gid = getgrnam('smmsp');
+ chown '0', $gid, $file;
+ chmod 0640, $file;
+ }
+ elsif ( ! $stats and -e $file ) {
+ print STDOUT "Disabling MTA statistics file($file).\n";
+ unlink $file;
+ };
+ };
+
+ # Obtain entry for MSP_STATUS_FILE
+ ($class, $flags, $files, $options) =
+ &Parse_mc::entry_dbs('MSP_STATUS_FILE');
+ $file = @{$files}[0];
+ ($ok, $stats) = &get_value('MSP_MAILSTATS');
+ if ( $ok and $file ne '-') {
+ if ( $stats and ! -e $file ) {
+ print STDOUT "Enabling MSP statistics file($file).\n";
+ open 'STATS', ">$file";
+ close 'STATS';
+ my $gid = getgrnam('smmsp');
+ chown '0', $gid, $file;
+ chmod 0660, $file;
+ }
+ elsif ( ! $stats and -e $file ) {
+ print STDOUT "Disabling MSP statistics file($file).\n";
+ unlink $file;
+ };
+ };
+
+ };
+
diff --git a/debian/local/update_db.in b/debian/local/update_db.in
new file mode 100644
index 0000000..72ee337
--- /dev/null
+++ b/debian/local/update_db.in
@@ -0,0 +1,591 @@
+#!/bin/sh -e
+#-----------------------------------------------------------------------------
+#
+# $Sendmail: update_db,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Update Sendmail databases for Debian
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# Notes (to all):
+# * assumes makemap dbtype /etc/mail/database < /etc/mail/database
+#
+# Notes (to self):
+# * changes made herein *must* be reflected in
+# parse_mc,update_mk,update_db,debian.m4
+# * multiple db options not supported
+# * userdb can also have multiple databases and then a forward!
+# * need sendmail stop/start
+#
+#-----------------------------------------------------------------------------
+set -e;
+
+# List of db files/features/etc
+db_files="databases Makefile crontab QUEUE_GROUP sendmail.cf submit.cf \
+ confCR_FILE confCT_FILE confCW_FILE confUSERDB_SPEC \
+ access_db authinfo bitdomain domaintable \
+ genericstable mailertable uucpdomain \
+ use_cw_file use_ct_file virtusertable ALIAS_FILE";
+
+# Path to other sendmail helpers
+if [ -x ./update_sendmail ]; then
+ sm_path='.';
+elif [ -x $(dirname $0)/update_sendmail ]; then
+ sm_path=$(dirname $0);
+else
+ sm_path=@datadir@/sendmail;
+ fi;
+
+# control amount of output
+verbosity=0;
+
+# flag used to ensure only one newaliases command is run
+newaliases_run=0;
+
+# flag used to indicate a dataset has been moved, may need another update
+changed=0;
+
+# max return code
+max_rc=0;
+missing_rqd=0;
+missing_opt=0;
+missing_cre=0;
+m4_errors=0;
+
+#-------------------------------------------------------------
+# Initial update of sendmail.mc/databases
+#-------------------------------------------------------------
+initial () {
+ if [ $verbosity -gt 1 ]; then
+ echo "initial()";
+ fi;
+ # Sigh... I wish this was in Perl...
+ $sm_path/parse_mc || true;
+ };
+
+#-------------------------------------------------------------
+# Handle found databases
+#-------------------------------------------------------------
+is_found () {
+ if [ $verbosity -gt 1 ]; then
+ echo "is_found: $dbfeat - $dbname";
+ fi;
+ process=1;
+
+ case "$dbfeat" in
+ ALIAS_FILE)
+ if [ -f @sysconfdir@/mail/aliases -a ! -f /etc/aliases ]; then
+ echo "Moving @sysconfdir@/mail/aliases to /etc/aliases";
+ mv @sysconfdir@/mail/aliases /etc/aliases;
+ ln -sf ../aliases @sysconfdir@/mail/aliases;
+ fi;
+ ;;
+ submit.cf)
+ if [ ! -f @datadir@/sendmail/cf/feature/msp.m4 ]; then
+ rm -f @sysconfdir@/mail/submit.cf 2>/dev/null;
+ rm -f @sysconfdir@/mail/submit.cf.errors 2>/dev/null;
+ process=0;
+ fi;
+ ;;
+ *)
+ ;;
+ esac;
+ };
+
+#-------------------------------------------------------------
+# Handle missing databases:
+# moving /etc/xxx to /etc/mail/xxx
+# rename /etc/mail/xxx to /etc/mail/yyy
+#-------------------------------------------------------------
+move_file () {
+ if [ -f $1 ]; then
+ if [ ! -L $1 ]; then
+ echo "Moving $1 to $dbname.";
+ mv $1 $dbname;
+ chown root:smmsp $dbname;
+ chmod 0644 $dbname;
+ if [ -f $1.db ]; then
+ mv -f /etc/$1.db $dbname.db;
+ fi;
+ if [ -f $1.pag ]; then
+ mv -f /etc/$1.pag $dbname.pag;
+ fi;
+ if [ -f $1.dir ]; then
+ mv -f /etc/$1.dir $dbname.dir;
+ fi;
+ changed=1;
+ process=1;
+ else
+ echo "$1 is a link, move it to $dbname";
+ if [ "$dbopts" = "-o" ]; then
+ missing_opt=`expr $missing_opt + 1`;
+ else
+ missing_rqd=`expr $missing_rqd + 1`;
+ fi;
+ fi;
+ true;
+ else
+ false;
+ fi;
+ };
+
+rename_file () {
+ if [ -f @sysconfdir@/mail/$1 ]; then
+ echo "Renaming @sysconfdir@/mail/$1 to $dbname.";
+ mv @sysconfdir@/mail/$1 $dbname;
+ chown root:smmsp $dbname;
+ chmod 0644 $dbname;
+ changed=1;
+ process=1;
+ true;
+ else
+ false;
+ fi;
+ };
+
+is_not_found () {
+ if [ $verbosity -gt 1 ]; then
+ echo "is_not_found: $dbfeat - $dbname";
+ fi;
+
+ case "$dbfeat" in
+ databases|Makefile)
+ :;
+ ;;
+ use_cw_file|confCW_FILE)
+ if move_file /etc/local-host-names; then
+ :;
+ elif rename_file sendmail.cw; then
+ :;
+ elif move_file /etc/sendmail.cw; then
+ :;
+ else
+ missing_cre=`expr $missing_cre + 1`;
+ echo "Warning: $dbfeat source" \
+ "file not found: $dbname";
+ echo " it was created";
+ echo "localhost" > $dbname;
+ echo `hostname -f` >> $dbname;
+ chown root:smmsp $dbname;
+ chmod 0644 $dbname;
+ fi;
+ ;;
+ use_ct_file|confCT_FILE)
+ if move_file /etc/trusted-users; then
+ :;
+ elif rename_file sendmail.ct; then
+ :;
+ elif move_file /etc/sendmail.ct; then
+ :;
+ else
+ missing_cre=`expr $missing_cre + 1`;
+ echo "Warning: $dbfeat source" \
+ "file not found: $dbname";
+ echo " it was created";
+ touch $dbname;
+ chown root:smmsp $dbname;
+ chmod 0644 $dbname;
+ fi;
+ ;;
+ HELP_FILE)
+ if move_file /etc/sendmail.hf; then
+ :;
+ elif rename_file sendmail.hf; then
+ :;
+ else
+ echo "Error: $dbfeat source file not found: $dbname";
+ missing_rqd=`expr $missing_rqd + 1`;
+ process=0;
+ fi;
+ ;;
+ ALIAS_FILE)
+ if [ -e /etc/$dbsname ]; then
+ echo "Linking /etc/$dbsname to $dbname";
+ ln -sf ../$dbsname $dbname;
+ if [ -f /etc/$dbsname.db ]; then
+ mv /etc/$dbsname.db @sysconfdir@/mail;
+ fi;
+ if [ -f /etc/$dbsname.pag ]; then
+ mv /etc/$dbsname.pag @sysconfdir@/mail;
+ fi;
+ if [ -f /etc/$dbsname.dir ]; then
+ mv /etc/$dbsname.dir @sysconfdir@/mail;
+ fi;
+ elif [ "$dbopts" = "-o" ]; then
+ echo "Informational: $dbfeat source" \
+ "file not found: $dbname";
+ missing_opt=`expr $missing_opt + 1`;
+ process=0;
+ else
+ echo "Error: $dbfeat source file not found: $dbname";
+ missing_rqd=`expr $missing_rqd + 1`;
+ process=0;
+ fi;
+ ;;
+ *.cf)
+ mcfile=$(echo "$dbsname" | sed -e 's/\..*//')
+ if move_file /etc/$dbsname; then
+ if [ -f @sysconfdir@/${mcfile}.cf ]; then
+ mv -f @sysconfdir@/${mcfile}.cf @sysconfdir@/mail/;
+ fi;
+ elif [ "$mcfile" = "sendmail" ]; then
+ cp @datadir@/sendmail/cf/debian/sendmail.mc \
+ $dbname;
+ chown root:smmsp $dbname;
+ chmod 0644 $dbname;
+ elif [ "$mcfile" = "submit" ]; then
+ cp @datadir@/sendmail/cf/debian/submit.mc \
+ $dbname;
+ chown root:smmsp $dbname;
+ chmod 0644 $dbname;
+ elif [ "$dbopts" = "-o" ]; then
+ echo "Informational: $dbfeat source" \
+ "file not found: $dbname";
+ missing_opt=`expr $missing_opt + 1`;
+ process=0;
+ else
+ echo "Error: $dbfeat source file not found: $dbname";
+ missing_rqd=`expr $missing_rqd + 1`;
+ process=0;
+ fi;
+ ;;
+ QUEUE_GROUP)
+ echo "Warning: $dbfeat source" \
+ "file not found: $dbname";
+ echo " it was created";
+ mkdir -p $dbname;
+ chown root:smmsp $dbname;
+ chmod 02750 $dbname;
+ ;;
+ crontab)
+ if [ -x $sm_path/update_conf ]; then
+ $sm_path/update_conf;
+ fi;
+ ;;
+ *)
+ if move_file /etc/$dbsname; then
+ :;
+ elif [ "$dbopts" = "-o" ]; then
+ :;
+ else
+ missing_cre=`expr $missing_cre + 1`;
+ echo "Warning: $dbfeat source" \
+ "file not found: $dbname";
+ echo " it was created";
+ touch $dbname;
+ chown root:smmsp $dbname;
+ chmod 0644 $dbname;
+ fi;
+ ;;
+ esac;
+ };
+
+#-------------------------------------------------------------
+# Handle empty databases
+#-------------------------------------------------------------
+is_empty () {
+ if [ $verbosity -gt 1 ]; then
+ echo "is_empty: $dbfeat - $dbname";
+ fi;
+ if [ $process -eq 1 ]; then
+ if [ "$dbtype" != "-" ]; then
+ rm -f $dbname.db;
+ rm -f $dbname.pag;
+ rm -f $dbname.dir;
+ fi;
+ case "$dbfeat" in
+ databases|Makefile)
+ :;
+ ;;
+ *)
+ echo "Informational: $dbfeat file empty: $dbname";
+ if [ "$dbopts" = "-o" ]; then
+ process=0;
+ fi;
+ ;;
+ esac;
+ fi;
+ };
+
+#-------------------------------------------------------------
+# Handle no data (exists, but is only comments) databases
+#-------------------------------------------------------------
+is_comments () {
+ if [ $verbosity -gt 1 ]; then
+ echo "is_comments: $dbfeat - $dbname";
+ fi;
+ if [ $process -eq 1 -a -s "$dbname" ]; then
+ if [ "$dbtype" != "-" ]; then
+ rm -f $dbname.db;
+ rm -f $dbname.pag;
+ rm -f $dbname.dir;
+ fi;
+ case "$dbfeat" in
+ databases|Makefile)
+ :;
+ ;;
+ *)
+ echo "Informational: $dbfeat no data: $dbname";
+ if [ "$dbopts" = "-o" ]; then
+ process=0;
+ fi;
+ ;;
+ esac;
+ fi;
+ };
+
+#-------------------------------------------------------------
+# Handle normal databases (exists, has data)
+#-------------------------------------------------------------
+is_normal () {
+ if [ $verbosity -gt 1 ]; then
+ echo "is_normal: $dbfeat - $dbname";
+ fi;
+
+ # Make sure sensitive databases are *not* generally readable
+ if [ "$dbsname" = "authinfo" \
+ -o "$dbsname" = "access" ]; then
+ chmod go-rwx $dbname;
+ fi;
+
+ if [ $process -eq 1 -a $max_rc -eq 0 ]; then
+ case "$dbtype" in
+ '-'|text|ldap)
+ :;
+ ;;
+ parse_mc)
+ $sm_path/parse_mc || true;
+ ;;
+ update_conf)
+ $sm_path/update_conf || true;
+ ;;
+ update_mk)
+ $sm_path/update_mk || true;
+ ;;
+ btree)
+ echo "Updating $dbname...";
+ @sbindir@/makemap -d $dbtype $dbname.new.db < $dbname;
+ chown root:smmsp $dbname.new.db;
+ chmod 0644 $dbname.new.db;
+ mv -f $dbname.new.db $dbname.db;
+ ;;
+ dbm | btree | hash)
+ echo "Updating $dbname...";
+ @sbindir@/makemap $dbtype $dbname.new.db < $dbname;
+ chown root:smmsp $dbname.new.db;
+ if [ "$dbsname" = "authinfo" \
+ -o "$dbsname" = "access" ]; then
+ chmod 0640 $dbname.new.db;
+ else
+ chmod 0644 $dbname.new.db;
+ fi;
+ mv -f $dbname.new.db $dbname.db;
+ ;;
+ newaliases)
+ echo "Updating $dbname...";
+ if [ $newaliases_run -eq 0 ]; then
+ newaliases_run=1;
+ @sbindir@/sendmail -bi || true;
+ fi;
+ if [ -f $dbname.db ]; then
+ chown root:smmsp $dbname.db;
+ chmod 0644 $dbname.db;
+ fi;
+ ;;
+ m4)
+ mcfile=$(echo "$dbsname" | sed -e 's/\..*//');
+ echo "Creating @sysconfdir@/mail/${mcfile}.cf...";
+ rm -f @sysconfdir@/mail/${mcfile}.cf.errors;
+ m4 @sysconfdir@/mail/${mcfile}.mc \
+ > @sysconfdir@/mail/${mcfile}.cf.new \
+ 2> @sysconfdir@/mail/${mcfile}.cf.errors || true;
+ chown root:smmsp @sysconfdir@/mail/${mcfile}.cf.new;
+ chmod 0644 @sysconfdir@/mail/${mcfile}.cf.new;
+ if [ ! -s @sysconfdir@/mail/${mcfile}.cf.errors ]; then
+ rm -f @sysconfdir@/mail/${mcfile}.cf.errors;
+ else
+ chown root:smmsp @sysconfdir@/mail/${mcfile}.cf.errors;
+ cat @sysconfdir@/mail/${mcfile}.cf.errors;
+ echo " ";
+ m4_errors=1;
+ fi;
+ # Can't tell if the errors are fatal or not ;-{
+ mv -f @sysconfdir@/mail/${mcfile}.cf.new \
+ @sysconfdir@/mail/${mcfile}.cf;
+ ;;
+ *)
+ echo "$dbtype map not done herein";
+ ;;
+ esac;
+ fi;
+ };
+
+#-------------------------------------------------------------
+# Handle completion
+#-------------------------------------------------------------
+final () {
+ if [ $verbosity -gt 1 ]; then
+ echo "final()";
+ fi;
+ };
+
+
+# status report if not for single database
+if [ -z "$1" ]; then
+ echo "Checking {sendmail,submit}.mc and related databases...";
+else
+ db_files="$1";
+ fi;
+
+initial;
+
+for file in $db_files; do \
+ line=$(grep -Ee "^[[:space:]]*$file" \
+ @sysconfdir@/mail/databases || true);
+ while ([ "$line" != "" ]); do
+ str=$(echo "$line" | cut -d "
+" -f 1);
+ line=$(echo "$line" | cut -d "
+" -f 2-);
+
+ # Strip line back into four pieces: feature, type, opts, name
+ dbfeat=$(echo "$str" | cut -d ":" -f 1);
+ dbtype=$(echo "$str" | cut -d ":" -f 2);
+ dbopts=$(echo "$str" | cut -d ":" -f 3);
+ dbname=$(echo "$str" | cut -d ":" -f 4);
+ dbregx=$(echo "$str" | cut -d ":" -f 5);
+ if [ $(dirname "$dbname") = "@sysconfdir@/mail" ]; then
+ dbsname=$(basename "$dbname");
+ elif [ $(dirname "$dbname") = "@sysconfdir@" ]; then
+ dbsname=$(basename "$dbname");
+ else
+ dbsname="$dbname";
+ fi;
+ if [ "$dbopts" = "-" ]; then
+ dbopts="";
+ fi;
+ if [ "$dbregx" = "-" ]; then
+ dbregx="";
+ fi;
+
+ # Check to see if we're doing one, or all
+ if [ ! -z "$1" ]; then
+ if [ "$1" = "$dbfeat" -o \
+ "$1" = "$dbname" -o \
+ "$1" = "$dbsname" ]; then
+ :;
+ else
+ continue;
+ fi;
+ fi;
+
+ # Check for special database types
+ case "$dbtype" in
+ ldap)
+ if [ $verbosity -gt 0 ]; then
+ echo "Skipping $dbname...";
+ fi;
+ continue
+ ;;
+ *)
+ ;;
+ esac;
+
+ # Kluge for aliases...
+ if [ "$dbname" = "ldap" ]; then
+ continue;
+ fi;
+
+ process=1;
+ if [ $verbosity -gt 0 ]; then
+ echo "Processing $dbname...";
+ fi;
+
+ # Check for database existance
+ if [ -f "$dbname" -o -d "$dbname" ]; then
+ is_found;
+ else
+ is_not_found;
+ fi;
+
+ # Skip the rest for directories
+ if [ ! -d "$dbname" ]; then
+
+ # Check for something in database
+ if [ ! -s "$dbname" ]; then
+ is_empty;
+ fi;
+
+ # Check for real data (not just comments)
+ if [ $process -eq 1 ]; then
+ if ! grep -qEe "^[[:space:]]*[^$\#]" $dbname; then
+ is_comments;
+ fi;
+ fi;
+
+ # Finally, assume a normal file...
+ is_normal;
+ fi;
+
+ done;
+ done;
+
+final;
+
+# Final notices...
+if [ $changed -ne 0 ]; then
+ echo " ";
+ echo "Informational: Some changes were made to file locations";
+ echo " Make sure sendmail.cf is rebuilt";
+ if [ $max_rc -lt 1 ]; then
+ max_rc=1;
+ fi;
+ fi;
+if [ $missing_opt -ne 0 ]; then
+ echo " ";
+ echo "Informational: $missing_opt optional database(s) sources";
+ echo " were not found, please investigate.";
+ fi;
+if [ $missing_cre -ne 0 ]; then
+ echo " ";
+ echo "Warning: $missing_cre database(s) sources";
+ echo " were not found, (but were created)";
+ echo " please investigate.";
+ fi;
+if [ $missing_rqd -ne 0 ]; then
+ echo " ";
+ echo "Error: $missing_rqd required database(s) sources";
+ echo " were not found, correct this before starting sendmail!";
+ if [ $max_rc -lt 2 ]; then
+ max_rc=2;
+ fi;
+ fi;
+if [ $missing_opt -ne 0 -o $missing_rqd -ne 0 ]; then
+ echo " ";
+ echo "$0 assumes that databases, and their source datasets";
+ echo "have the same base name (not counting the .db). If this is not";
+ echo "true, $0 can not rebuild your databases to make sure";
+ echo "they will work with the newer sendmail. You will have to do this";
+ echo "yourself - before starting sendmail.";
+ echo " ";
+ fi;
+if [ $m4_errors -ne 0 ]; then
+ echo " ";
+ echo "Warning: These messages were issued while creating sendmail.cf";
+ echo " make sure they are benign before starting sendmail!";
+ echo " ";
+ if [ -f @sysconfdir@/mail/sendmail.cf.errors ]; then
+ echo "Errors in generating sendmail.cf";
+ cat @sysconfdir@/mail/sendmail.cf.errors;
+ fi;
+ if [ -f @sysconfdir@/mail/submit.cf.errors ]; then
+ echo "Errors in generating submit.cf";
+ cat @sysconfdir@/mail/submit.cf.errors;
+ fi;
+ echo " "
+ if [ $max_rc -lt 2 ]; then
+ max_rc=2;
+ fi;
+ fi;
+exit $max_rc;
+
diff --git a/debian/local/update_ldap.in b/debian/local/update_ldap.in
new file mode 100644
index 0000000..5daca95
--- /dev/null
+++ b/debian/local/update_ldap.in
@@ -0,0 +1,118 @@
+#!/bin/sh -e
+#-----------------------------------------------------------------------------
+#
+# $Sendmail: update_ldap,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Sendmail support for LDAP
+#
+# Copyright (c) 2000-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# Notes: supports local umich-ldap and openldap v1/v2 servers
+#
+#-----------------------------------------------------------------------------
+set -e
+
+#
+# Flag to determine if this is an install or update
+NEW=0;
+
+#
+# Flag to determine if any local LDAP server was found
+FOUND=0;
+
+#
+# Path to LDAP server schema directory
+LDAP_PATH=;
+SCHEMA_PATH=;
+SCHEMA_NAME=;
+LDAP_VERSION=;
+
+install_schema () {
+#
+# Install sendmail.schema in the appropriate place
+#
+if [ ! -z "$SCHEMA_PATH" ]; then
+ if [ -f "${LDAP_PATH}/slapd.conf" ]; then
+ FOUND=1;
+ if [ ! -e "${SCHEMA_PATH}/sendmail.schema" ]; then
+ NEW=1;
+ fi;
+ cp -p @datadir@/sendmail/examples/ldap/$SCHEMA_NAME \
+ $SCHEMA_PATH/sendmail.schema;
+ chmod 0644 $SCHEMA_PATH/sendmail.schema;
+ chown root:root $SCHEMA_PATH/sendmail.schema;
+ fi;
+ fi;
+ };
+
+#
+# Check if OpenLDAP (2.0.x) is installed
+if [ -d /etc/ldap ]; then
+ LDAP_VERSION="$LDAP_VERSION OpenLDAP V2";
+ LDAP_PATH='/etc/ldap';
+ SCHEMA_PATH="${LDAP_PATH}/schema";
+ SCHEMA_NAME=sendmail.schema.v2;
+ install_schema;
+ fi;
+
+#
+# Check if OpenLDAP (1.x.x) is installed
+if [ -d /etc/openldap ]; then
+ LDAP_VERSION="$LDAP_VERSION OpenLDAP V1";
+ LDAP_PATH='/etc/openldap';
+ SCHEMA_PATH="${LDAP_PATH}";
+ SCHEMA_NAME=sendmail.schema.v1;
+ install_schema;
+ fi;
+
+#
+# Check if UMich-LDAP (3.3) is installed
+if [ -d /etc/umich-ldap ]; then
+ LDAP_VERSION="$LDAP_VERSION UMich-LDAP V3";
+ LDAP_PATH='/etc/umich-ldap';
+ SCHEMA_PATH="${LDAP_PATH}";
+ SCHEMA_NAME=sendmail.schema.v1;
+ install_schema;
+ fi;
+
+#
+# Tell them about the new wizbang features...
+if [ $NEW -eq 0 ]; then
+ :;
+else
+ echo " ";
+ echo "Creating/Updating $LDAP_VERSION information...";
+ echo " ";
+ echo "$SCHEMA_PATH/sendmail.schema has been installed";
+ fi;
+
+if [ $FOUND -eq 0 -a $NEW -eq 1 ]; then
+ cat <<-EOT
+
+ No local LDAP server was located (tried openldap v2/v1, umich-ldap).
+
+ If you wish to use sendmail and LDAP, you'll need to make sure your
+ server has the requisite schema setup.
+
+ You can find the schema (old and new) in the following places:
+ * $SCHEMA_PATH/sendmail.schema for the version of LDAP you
+ currently have installed (if any)
+ * @datadir@/sendmail/examples/ldap/sendmail.schema.<v>
+ where <v> is
+ <v1> for older schema (sendmail.{o,a}t.conf) format
+ <v2> for newer schema (sendmail.schema) format
+
+ If you later install a local LDAP server, be sure to re-run $0.
+ EOT
+elif [ $FOUND -eq 1 -a $NEW -eq 1 ]; then
+ cat <<-EOT
+
+ You have a local $LDAP_VERSION server! Depending upon how (and if)
+ you wish to use LDAP with sendmail, you'll want to check your
+ slapd.conf file and possibly include these files:
+ * $SCHEMA_PATH/sendmail.schema <- alias and other map support
+ * $SCHEMA_PATH/misc.schema <- OpenLDAP V2 ldap-mail-routing
+
+ If you later change your local LDAP server, be sure to re-run $0.
+ EOT
+ fi;
diff --git a/debian/local/update_mc.in b/debian/local/update_mc.in
new file mode 100644
index 0000000..b157b6a
--- /dev/null
+++ b/debian/local/update_mc.in
@@ -0,0 +1,212 @@
+#!/bin/sh -e
+#-----------------------------------------------------------------------------
+#
+# $Sendmail: update_mc,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Update Sendmail databases for Debian
+#
+# Copyright (c) 2000-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# Notes (to all):
+# * assumes makemap dbtype /etc/mail/database < /etc/mail/database
+#
+# Notes (to self):
+# * changes made herein *must* be reflected in
+# parse_mc,update_mk,update_db,debian.m4
+#
+#-----------------------------------------------------------------------------
+set -e;
+
+changed=0;
+
+#-----------------------------------------------------------------------------
+# Move sendmail.{mc,cf} from /etc/ to /etc/mail
+if [ ! -f @sysconfdir@/mail/sendmail.mc ]; then
+ if [ -f /etc/sendmail.mc ]; then
+ echo "Moving /etc/sendmail.* to /etc/mail/";
+ mv /etc/sendmail.mc @sysconfdir@/mail/sendmail.mc;
+ chown root:smmsp @sysconfdir@/mail/sendmail.mc;
+ chmod 0644 @sysconfdir@/mail/sendmail.mc;
+ changed=1;
+ fi;
+ if [ -f /etc/sendmail.cf ]; then
+ mv /etc/sendmail.cf @sysconfdir@/mail/sendmail.cf;
+ chown root:smmsp @sysconfdir@/mail/sendmail.cf;
+ chmod 0644 @sysconfdir@/mail/sendmail.cf;
+ changed=1;
+ fi;
+ fi;
+
+#-----------------------------------------------------------------------------
+# Install prototype submit.mc
+if [ ! -f @sysconfdir@/mail/submit.mc ]; then
+ cp -p @datadir@/sendmail/cf/debian/submit.mc \
+ @sysconfdir@/mail/submit.mc;
+ chown root:smmsp @sysconfdir@/mail/submit.mc;
+ chmod 0644 @sysconfdir@/mail/submit.mc;
+ fi;
+
+#-----------------------------------------------------------------------------
+# Make sure dialup support m4 files are extant
+if [ ! -f @sysconfdir@/mail/dialup.m4 ]; then
+ touch @sysconfdir@/mail/dialup.m4;
+ chown root:smmsp @sysconfdir@/mail/dialup.m4;
+ chmod 0640 @sysconfdir@/mail/dialup.m4;
+ fi;
+if [ ! -f @sysconfdir@/mail/provider.m4 ]; then
+ touch @sysconfdir@/mail/provider.m4;
+ chown root:smmsp @sysconfdir@/mail/provider.m4;
+ chmod 0640 @sysconfdir@/mail/provider.m4;
+ fi;
+
+#-----------------------------------------------------------------------------
+# Make sure not using text mailertable (it doesn't work)
+if (grep -qEe "^[[:space:]]*FEATURE\(\`?mailertable'?, \`text /etc/mail/mailertable'\)" @sysconfdir@/mail/sendmail.mc); then
+ changed=1;
+ echo "Correcting FEATURE(mailertable) in /etc/mail/sendmail.mc";
+ sed -e "s=^\([[:space:]]*\)\(\`\?\)FEATURE(\`\?mailertable'\?, \`text /etc/mail/mailertable')\(dnl\)\?=\1\2FEATURE(\`mailertable')dnl=g" \
+ @sysconfdir@/mail/sendmail.mc > @sysconfdir@/mail/sendmail.mc.new;
+ chown root:smmsp @sysconfdir@/mail/sendmail.mc.new;
+ chmod 0644 @sysconfdir@/mail/sendmail.mc.new;
+ mv @sysconfdir@/mail/sendmail.mc.new @sysconfdir@/mail/sendmail.mc;
+ fi;
+
+#-----------------------------------------------------------------------------
+# Make sure smrsh points to the correct location
+if (grep -qEe "^[[:space:]]*\`?FEATURE\(\`?smrsh'?[[:space:]]*,.*\)" \
+ @sysconfdir@/mail/sendmail.mc); then
+ changed=1;
+ echo "Correcting FEATURE(smrsh) in /etc/mail/sendmail.mc";
+ sed -e "s=\([[:space:]]*\)\(\`\?\)FEATURE(\`\?smrsh'\?[[:space:]]*,.*)\(dnl\)\?=\1\2FEATURE(\`smrsh')dnl=g" \
+ @sysconfdir@/mail/sendmail.mc > @sysconfdir@/mail/sendmail.mc.new;
+ chown root:smmsp @sysconfdir@/mail/sendmail.mc.new;
+ chmod 0644 @sysconfdir@/mail/sendmail.mc.new;
+ mv @sysconfdir@/mail/sendmail.mc.new @sysconfdir@/mail/sendmail.mc;
+ fi;
+
+#-----------------------------------------------------------------------------
+# Convert FEATURE(nouucp) to FEATURE(nouucp,reject)
+if (grep -qEe "^[[:space:]]*\`?FEATURE\(\`?nouucp'?\)" \
+ @sysconfdir@/mail/sendmail.mc); then
+ changed=1;
+ echo "Correcting FEATURE(nouucp) in /etc/mail/sendmail.mc";
+ sed -e "s=^\([[:space:]]*\)\(\`\?\)FEATURE(\`\?nouucp'\?)\(dnl\)\?=\1\2FEATURE(\`nouucp', \`reject')dnl=g" \
+ @sysconfdir@/mail/sendmail.mc > @sysconfdir@/mail/sendmail.mc.new;
+ chown root:smmsp @sysconfdir@/mail/sendmail.mc.new;
+ chmod 0644 @sysconfdir@/mail/sendmail.mc.new;
+ mv @sysconfdir@/mail/sendmail.mc.new @sysconfdir@/mail/sendmail.mc;
+ fi;
+
+#-----------------------------------------------------------------------------
+# Convert FEATURE(rbl) to FEATURE(dnsbl,rbl.maps.vix.com)
+if (grep -qEe "^[[:space:]]*\`?FEATURE\(\`?rbl'?\)" \
+ @sysconfdir@/mail/sendmail.mc); then
+ changed=1;
+ echo "Correcting FEATURE(rbl) in /etc/mail/sendmail.mc";
+ sed -e "s=^\([[:space:]]*\)\(\`\?\)FEATURE(\`\?rbl'\?)\(dnl\)\?=\1\2FEATURE(\`dnsbl', \`rbl.maps.vix.com')dnl=g" \
+ @sysconfdir@/mail/sendmail.mc > @sysconfdir@/mail/sendmail.mc.new;
+ chown root:smmsp @sysconfdir@/mail/sendmail.mc.new;
+ chmod 0644 @sysconfdir@/mail/sendmail.mc.new;
+ mv @sysconfdir@/mail/sendmail.mc.new @sysconfdir@/mail/sendmail.mc;
+ fi;
+
+#-----------------------------------------------------------------------------
+# Convert FEATURE(dont_masquerade_local) to FEATURE(local_no_masquerade)
+if [ -e @datadir@/sendmail/cf/feature/local_no_masquerade.m4 ]; then
+ if (grep -qEe "^[[:space:]]*\`?FEATURE\(\`?dont_masquerade_local'?\)" \
+ @sysconfdir@/mail/sendmail.mc); then
+ changed=1;
+ echo "Correcting FEATURE(dont_masquerade_local) in /etc/mail/sendmail.mc";
+ sed -e "s=^\([[:space:]]*\)\(\`\?\)FEATURE(\`\?dont_masquerade_local'\?)\(dnl\)\?=\1\2FEATURE(\`local_no_masquerade')dnl=g" \
+ @sysconfdir@/mail/sendmail.mc > @sysconfdir@/mail/sendmail.mc.new;
+ chown root:smmsp @sysconfdir@/mail/sendmail.mc.new;
+ chmod 0644 @sysconfdir@/mail/sendmail.mc.new;
+ mv @sysconfdir@/mail/sendmail.mc.new @sysconfdir@/mail/sendmail.mc;
+ fi;
+ fi;
+
+#-----------------------------------------------------------------------------
+# Convert FEATURE(access_db,...) to FEATURE(access_db)
+if (grep -qEe "^[[:space:]]*\`?FEATURE\(\`?access_db'?[[:space:]]*,.*\)" \
+ @sysconfdir@/mail/sendmail.mc); then
+ changed=1;
+ sed -e "s=^\([[:space:]]*\)\(\`\?\)FEATURE(\`\?access_db'\?[[:space:]]*,[[:space:]]*\`\?hash[[:space:]]*\(-o\)\?[[:space:]]*/etc/mail/access.db'\?[[:space:]]*)\(dnl\)\?=\1\2FEATURE(\`access_db')dnl=g" \
+ @sysconfdir@/mail/sendmail.mc > @sysconfdir@/mail/sendmail.mc.new;
+ chown root:smmsp @sysconfdir@/mail/sendmail.mc.new;
+ chmod 0644 @sysconfdir@/mail/sendmail.mc.new;
+ mv @sysconfdir@/mail/sendmail.mc.new @sysconfdir@/mail/sendmail.mc;
+ fi;
+
+#-----------------------------------------------------------------------------
+# change include(/usr/share/sendmail/sendmail.cf/m4/cf.m4)
+if (grep -qEe "^[[:space:]]*\`?include\(\`?@datadir@/sendmail/sendmail.cf/m4/cf.m4'?\)" \
+ @sysconfdir@/mail/sendmail.mc); then
+ sed -e "s=sendmail/sendmail.cf=sendmail/cf=g" \
+ @sysconfdir@/mail/sendmail.mc > @sysconfdir@/mail/sendmail.mc.new;
+ chown root:smmsp @sysconfdir@/mail/sendmail.mc.new;
+ chmod 0644 @sysconfdir@/mail/sendmail.mc.new;
+ mv @sysconfdir@/mail/sendmail.mc.new @sysconfdir@/mail/sendmail.mc;
+ sed -e "s=sendmail/sendmail.cf=sendmail/cf=g" \
+ @sysconfdir@/mail/submit.mc > @sysconfdir@/mail/submit.mc.new;
+ chown root:smmsp @sysconfdir@/mail/submit.mc.new;
+ chmod 0644 @sysconfdir@/mail/submit.mc.new;
+ mv @sysconfdir@/mail/submit.mc.new @sysconfdir@/mail/submit.mc;
+ fi;
+
+#-----------------------------------------------------------------------------
+# Add include(/usr/share/sendmail/cf/m4/cf.m4)
+if (grep -qEe "^[[:space:]]*\`?include\(\`?@datadir@/sendmail/cf/m4/cf.m4'?\)" \
+ @sysconfdir@/mail/sendmail.mc); then
+ true;
+else
+ changed=1;
+ echo "Adding include(.../cf.m4) to /etc/mail/sendmail.mc";
+ sed -e "s=^\([[:space:]]*\)\(\`\?\)VERSIONID(=\1\2include(\`@datadir@/sendmail/cf/m4/cf.m4')dnl\\
+\1\2VERSIONID(=" \
+ @sysconfdir@/mail/sendmail.mc > @sysconfdir@/mail/sendmail.mc.new;
+ chown root:smmsp @sysconfdir@/mail/sendmail.mc.new;
+ chmod 0644 @sysconfdir@/mail/sendmail.mc.new;
+ mv @sysconfdir@/mail/sendmail.mc.new @sysconfdir@/mail/sendmail.mc;
+ fi;
+
+#-----------------------------------------------------------------------------
+# Add define(`_USE_ETC_MAIL_')dnl
+if (grep -qEe "^[[:space:]]*\`?define\(\`?_USE_ETC_MAIL_" \
+ @sysconfdir@/mail/sendmail.mc); then
+ true;
+else
+ changed=1;
+ sed -e "s=^\([[:space:]]*\)\(\`\?\)include(\`\?@datadir@/sendmail/cf/m4/cf.m4'\?)\(dnl\)\?=\1\2define(\`_USE_ETC_MAIL_')dnl\\
+include(\`@datadir@/sendmail/cf/m4/cf.m4')dnl=" \
+ @sysconfdir@/mail/sendmail.mc > @sysconfdir@/mail/sendmail.mc.new;
+ chown root:smmsp @sysconfdir@/mail/sendmail.mc.new;
+ chmod 0644 @sysconfdir@/mail/sendmail.mc.new;
+ mv @sysconfdir@/mail/sendmail.mc.new @sysconfdir@/mail/sendmail.mc;
+ fi;
+
+#-----------------------------------------------------------------------------
+# Add DOMAIN(debian-mta)
+if (grep -qEe "^[[:space:]]*\`?DOMAIN\(\`?debian-mta'?\)" \
+ @sysconfdir@/mail/sendmail.mc); then
+ true;
+else
+ changed=1;
+ echo "Adding DOMAIN(debian-mta) to /etc/mail/sendmail.mc";
+ sed -e "s=^\([[:space:]]*\)\(\`\?\)OSTYPE(\`\?debian'\?)\(dnl\)\?=\1\2OSTYPE(\`debian')dnl\\
+\1\2DOMAIN(\`debian-mta')dnl=" \
+ @sysconfdir@/mail/sendmail.mc > @sysconfdir@/mail/sendmail.mc.new;
+ chown root:smmsp @sysconfdir@/mail/sendmail.mc.new;
+ chmod 0644 @sysconfdir@/mail/sendmail.mc.new;
+ mv /etc/mail/sendmail.mc.new /etc/mail/sendmail.mc
+ fi;
+
+#-----------------------------------------------------------------------------
+# Cleanup submit.mc
+sed -e "/^define(\`\?confRUN_AS_USER.*$/d" \
+ -e "/^define(\`\?confTRUSTED_USER.*$/d" \
+ @sysconfdir@/mail/submit.mc > @sysconfdir@/mail/submit.mc.new;
+ chown root:smmsp @sysconfdir@/mail/submit.mc.new;
+ chmod 0644 @sysconfdir@/mail/submit.mc.new;
+ mv /etc/mail/submit.mc.new /etc/mail/submit.mc
+
+exit $changed;
diff --git a/debian/local/update_mk.in b/debian/local/update_mk.in
new file mode 100644
index 0000000..02376ec
--- /dev/null
+++ b/debian/local/update_mk.in
@@ -0,0 +1,661 @@
+#!/usr/bin/perl -w
+#------------------------------------------------------------------------
+#
+# $Sendmail: update_mk,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Create /etc/mail/Makefile for Debian Sendmail databases
+#
+# Copyright 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# Notes (to all):
+# *
+#
+# Notes (to self):
+# * Should actually put data in some files (local-host-names, etc)
+#
+#------------------------------------------------------------------------
+#
+# Initialization of the perl environment
+use strict; # be kosher
+use Cwd; # provide cwd()
+use Env; # A few environmental references
+use integer; # Peformance
+use Sys::Hostname; # make sure we have a valid hostname
+use Getopt::Long; # parameter handling
+
+# Local libraries - for Debian Sendmail Perl helper functions
+# BEGIN { $main::my_path = substr($0,$[,rindex($0,'/')) };
+use lib ('.', substr($0,$[,rindex($0,'/')), "@datadir@/sendmail");
+require Parse_mc;
+
+# Version of this program
+#($main::MYNAME = $main::0) =~ s|.*/||;
+#$main::Author = "Richard Nelson";
+#$main::AuthorMail = "cowboy\@debian.org";
+#$main::Version = '$Revision: 2.00 $ ';
+$main::program_name = $0;
+$main::program_version = '@sm_version@';
+$main::program_date = '@sm_date@ @sm_time@ cowboy';
+$main::debug = 0;
+
+my $interp_pgm = "$^X";
+my $interp_vrm = $];
+$interp_vrm = ("$^V" | '000') if (defined $^V);
+my $current_time = scalar localtime;
+my $user = getlogin || (getpwuid($<))[0] || "Unknown!!";
+my $hostname = hostname();
+my $directory = getcwd();
+
+my $Makefile_def = "@sysconfdir@/mail/Makefile";
+# List of database entries that will be created if not found
+my %created_dbs;
+my @created_dbs;
+# A few files (like exposed-users) can be listed >1 times !
+my %created_files = ();
+my $reload_stamp = "@localstatedir@/run/sendmail/stampdir/reload";
+
+#
+#------------------------------------------------------------------------------
+# Finally, some code (almost)
+#------------------------------------------------------------------------------
+#
+# Argument handling...
+$main::opt_help='';
+$main::opt_output_file='';
+$main::opt_input_file='';
+$main::opt_debug='';
+my @options = qw(
+ help|h
+ output-file|output_file|o:s
+ input-file|input_file|i:s
+ debug!
+ );
+my $result = GetOptions(@options);
+if ( ! $result ) {
+ die "Terminating due to parameter error";
+ };
+if ( $main::opt_help ) {
+ warn "$main::program_name $main::program_version $main::program_date\n";
+ warn "$0 \n";
+ warn " -help\n" if $main::opt_help;
+ warn " -debug\n" if $main::opt_debug;
+ warn " -o $main::opt_output_file\n" if $main::opt_output_file;
+ warn " -i $main::opt_input_file\n" if $main::opt_input_file;
+ exit 0;
+ };
+
+my $Makefile = $main::opt_output_file || $Makefile_def;
+${Parse_mc::database_file} = $main::opt_input_file
+ if $main::opt_input_file;
+# $main::debug is used in Parse_mc !
+$main::debug = $main::opt_debug || $main::debug;
+
+# Let them know wtf is going on...
+print STDOUT "Creating ${Makefile}...\n";
+
+# Read the mc/m4 files
+&Parse_mc::read_dbs($Parse_mc::database_file, '');
+
+# Determine names with which we shall work
+my @databases = &get_names();
+
+# Write out the textual representation
+&write_make;
+
+#
+#------------------------------------------------------------------------------
+# Obtain list of candidate databases from sendmail.mc
+#------------------------------------------------------------------------------
+sub get_names {
+ my @names;
+
+ # Database types we know how to handle
+ my %make_types = (
+ 'btree' => 1
+ ,'dbm' => 1
+ ,'hash' => 1
+ ,'m4' => 1
+ ,'newaliases' => 1
+ ,'parse_mc' => 1
+ ,'update_conf' => 1
+ ,'update_mk' => 1
+ ,'QUEUE_GROUP' => 1
+ );
+
+ # Add any qualified databases to the list
+ foreach my $entry (&Parse_mc::names_dbs()) {
+ my ($class, $flags, $files, $options) =
+ &Parse_mc::entry_dbs($entry);
+ if ( (exists($make_types{$entry}) or
+ exists($make_types{$class}))
+ and @{$files}[0] ne '-'
+ and ! exists($created_dbs{$entry})) {
+ push @names, $entry;
+ push @created_dbs, $entry;
+ $created_dbs{$entry} = '';
+ };
+ };
+
+ return @names;
+ };
+
+#
+#------------------------------------------------------------------------------
+# Create Makefile
+#------------------------------------------------------------------------------
+sub write_make {
+ my $ofh = new FileHandle;
+
+ $Makefile = '&STDOUT' if ($Makefile eq '-');
+ unless ( open($ofh, ">$Makefile") ) {
+ warn("Could not open $Makefile($!), using STDOUT.\n");
+ open($ofh, ">&STDOUT");
+ };
+ $Makefile = '-' if ($Makefile eq '&STDOUT');
+
+ &write_header($ofh);
+ &write_target_clean($ofh);
+ &write_target_restart($ofh);
+ &write_target_sendmail($ofh);
+ &write_targets($ofh);
+ &write_files($ofh);
+ &write_footer($ofh);
+
+ close $ofh;
+ if ($Makefile eq $Makefile_def) {
+ my $gid = getgrnam('smmsp');
+ chown '0', $gid, $Makefile;
+ chmod 0754, $Makefile;
+ };
+ };
+
+#
+#------------------------------------------------------------------------------
+# Write Makefile header
+#------------------------------------------------------------------------------
+sub write_header {
+ my ($ofh) = @_;
+
+ print $ofh <<"EOT";
+#!/usr/bin/make -f
+####################################################################
+##### This file is automagically generated -- edit at your own risk
+#####
+##### Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#####
+##### file: ${Makefile} Makefile for Sendmail databases
+##### generated via: (${interp_pgm} ${interp_vrm})
+##### ${main::program_name}
+##### version: ${main::program_version} ${main::program_date}
+##### by: ${user}\@${hostname}
+##### on: ${current_time}
+##### in: ${directory}
+##### input files: ${Parse_mc::database_file}
+#####
+##### Usage:
+##### 1) Make all targets upto date - use one of the following:
+##### A) \`(cd @sysconfdir@/mail && make)\`
+##### B) \`make -f ${Makefile}\`
+##### C) \`${Makefile}\`
+##### 2) Force update of <target> - Add <target> to one of the
+##### prior commands ie, \`${Makefile} access\`. Most
+##### any reasonable <target> value is accepted.
+#####
+####################################################################
+SHELL=/bin/sh
+
+.SUFFIXES:
+.PRECIOUS: $Makefile
+
+#
+# all, the default target, will update everything
+#
+.PHONY: all
+all: sendmail $reload_stamp
+EOT
+ };
+
+#
+#------------------------------------------------------------------------------
+# Write Makefile 'CLEAN' target
+#------------------------------------------------------------------------------
+sub write_target_clean {
+ my ($ofh) = @_;
+ my @names;
+
+ %created_files = ();
+ foreach my $entry (@databases) {
+ next if ($entry eq 'QUEUE_GROUP' or $entry eq 'Makefile');
+ my ($class, $flags, $files, $options) =
+ &Parse_mc::entry_dbs($entry);
+ foreach my $file (@{$files}) {
+ next if ( $file eq '-'
+ or exists($created_files{$file}) );
+ $created_files{$file} = '';
+ my $dbname;
+ if ($class eq 'parse_mc' or $class eq 'update_mk'
+ or $class eq 'm4') {
+ $dbname = "@sysconfdir@/mail/$entry";
+ }
+ elsif ($class eq 'update_conf') {
+ $dbname = "@sysconfdir@/cron.d/sendmail";
+ }
+ elsif ($class eq 'btree' or $class eq 'hash'
+ or $class eq 'newaliases') {
+ $dbname = "$file.db";
+ }
+ else {
+ $dbname = $file;
+ };
+ push @names, $dbname;
+ };
+ };
+
+ print $ofh <<"EOT";
+
+#
+# clean target, remove {sendmail,submit}.cf and generated databases
+#
+EOT
+ print $ofh
+ ".PHONY: clean\n",
+ "clean: FORCE\n",
+ "\trm -f ",join(";\n\trm -f ", @names),";\n";
+ };
+
+#
+#------------------------------------------------------------------------------
+# Write Makefile 'RESTART' target
+#------------------------------------------------------------------------------
+sub write_target_restart {
+ my ($ofh) = @_;
+ my $file;
+
+ print $ofh <<"EOT";
+
+#
+# restart target, check to see if sendmail needs to be restarted
+#
+.PHONY: noreload norestart
+noreload norestart: FORCE
+ \@touch $reload_stamp;
+
+.PHONY: reload restart
+reload restart: FORCE
+ \@rm -f $reload_stamp;
+ \@\$(MAKE) -sf $Makefile $reload_stamp;
+
+EOT
+
+ # Spew secondary target of actual restart
+ %created_files = ();
+ my @right;
+ foreach my $entry (sort &Parse_mc::restart_dbs()) {
+ if (! exists($created_dbs{$entry})) {
+ push @created_dbs, $entry;
+ $created_dbs{$entry} = '';
+ };
+ my ($class, $flags, $files, $options) =
+ &Parse_mc::entry_dbs($entry);
+ foreach my $file (@{$files}) {
+ next if ( $file eq '-'
+ or exists($created_files{$file}) );
+ $created_files{$file} = '';
+ my $dbname = $file;
+ $dbname =~ s/\.mc$/\.cf/;
+ push @right, "$dbname";
+ };
+ };
+
+ print $ofh "$reload_stamp: \\\n\t",
+ join(" \\\n\t", @right), "\n",
+ "\t\@if [ ! -f \$\@ ]; then \\\n",
+ "\t\techo 'A forced reload...'; \\\n",
+ "\telse \\\n",
+ "\t\techo 'The following file(s) have changed:'; \\\n",
+ "\t\techo ' \$?'; \\\n",
+ "\t\tfi;\n",
+ "\t\@echo '** ** You should issue ",
+ "\`@sysconfdir@/init.d/sendmail reload\` ** **';\n";
+ };
+
+#
+#------------------------------------------------------------------------------
+# Write Sendmail dependancies
+#------------------------------------------------------------------------------
+sub write_target_sendmail {
+ my ($ofh) = @_;
+
+ print $ofh <<"EOT";
+
+#
+# sendmail targets, depend upon *ALL* relevant files/databases
+#
+.PHONY: sendmail
+sendmail: sendmail_files sendmail_dbs
+
+EOT
+ my (@smfiles, @smdbs);
+
+ %created_files = ();
+ foreach my $entry (@created_dbs) {
+ my ($class, $flags, $files, $options) =
+ &Parse_mc::entry_dbs($entry);
+ foreach my $file (@{$files}) {
+ next if $file eq '-';
+ next if $file eq 'ldap'; # ALIAS hack
+ if ($class eq 'parse_mc' or $class eq 'update_mk'
+ or $class eq 'm4') {
+ push @smfiles, "$file"
+ if (!exists($created_files{$file}));
+ $created_files{$file} = '';
+ push @smdbs, "@sysconfdir@/mail/$entry";
+ }
+ elsif ($class eq 'update_conf') {
+ push @smdbs, "@sysconfdir@/cron.d/sendmail";
+ }
+ elsif ($class eq 'btree' or $class eq 'hash'
+ or $class eq 'newaliases') {
+ push @smfiles, "$file"
+ if (!exists($created_files{$file}));
+ $created_files{$file} = '';
+ push @smdbs, "$file.db";
+ }
+ else {
+ push @smfiles, "$file"
+ if (!exists($created_files{$file}));
+ $created_files{$file} = '';
+ };
+ };
+ };
+
+ print $ofh ".PHONY: sendmail_files\n",
+ "sendmail_files: \\\n\t",
+ join(" \\\n\t", @smfiles), "\n\n";
+ print $ofh ".PHONY: sendmail_dbs\n",
+ "sendmail_dbs: \\\n\t",
+ join(" \\\n\t", @smdbs), "\n";
+ };
+
+#
+#------------------------------------------------------------------------------
+# Write Makefile individual targets
+#------------------------------------------------------------------------------
+sub write_targets {
+ my ($ofh) = @_;
+ my $file;
+
+ print $ofh <<"EOT";
+
+#
+# Individual database targets
+#
+
+#
+# Default db type is hash (Must be in /etc/mail, or
+# fully qualify the dataset for this target to work)
+#
+%.db: % FORCE
+ \@echo 'Updating \$\@...';
+ \@@sbindir@/makemap hash \$\@.new.db < \$<;
+ \@chown root:smmsp \$\@.new.db;
+ \@chmod 0644 \$\@.new.db
+ \@mv -f \$\@.new.db \$\@;
+EOT
+
+ # Spew primary target of <target>
+ foreach my $entry (@databases) {
+ my ($class, $flags, $files, $options) =
+ &Parse_mc::entry_dbs($entry);
+ my @names;
+ my $left = '';
+ my $right = '';
+ my $sleft = '';
+ my $dbname = '';
+ print $ofh "\n";
+
+ # Create short name(s) for database entries
+ $sleft .= "$entry ";
+ if ($class eq 'newaliases' or $class eq 'parse_mc'
+ or $class eq 'update_mk' or $class eq 'update_conf') {
+ $sleft = 'makefile make ' if ($class eq 'update_mk');
+ $sleft .= 'cron ' if ($class eq 'update_conf');
+ $sleft .= "$class ";
+ };
+
+ foreach my $file (@{$files}) {
+ next if $file eq '-';
+ next if $file eq 'ldap'; # ALIAS hack
+ if ($entry eq 'QUEUE_GROUP') {
+ $dbname = '';
+ $left = $entry;
+ }
+ elsif ($class eq 'parse_mc' or $class eq 'update_mk'
+ or $class eq 'm4') {
+ $dbname = "@sysconfdir@/mail/$entry";
+ }
+ elsif ($class eq 'update_conf') {
+ $dbname = "@sysconfdir@/cron.d/sendmail";
+ }
+ elsif ($class eq 'btree' or $class eq 'hash'
+ or $class eq 'newaliases') {
+ $dbname = "$file.db";
+ }
+ else {
+ $dbname = $file;
+ };
+ $left .= "$dbname ";
+ $right .= " $file";
+
+ # Create short name(s) for database entries
+ if ($class ne 'parse_mc' and $class ne 'update_mk'
+ and $class ne 'update_conf'
+ and $entry ne 'QUEUE_GROUP'
+ ) {
+ my $dbsname = "$dbname";
+ $dbsname =~ s/\/etc\/mail\///;
+ $sleft .= "$dbsname " if ($entry ne $dbsname);
+ if ($file ne $dbname) {
+ $dbsname =~ s/\.db//;
+ $sleft .= "$dbsname " if ($entry ne $dbsname);
+ };
+ };
+ };
+
+ # Spew out a phony entry suitable for FORCE
+ print $ofh '.PHONY: ', $sleft, "\n";
+ print $ofh $sleft,':', $right, " FORCE\n"
+ if ($entry ne 'QUEUE_GROUP');
+ if ($class eq 'update_mk') {
+ print $ofh "\t\@touch $right;\n",
+ "\t\@\$(MAKE) -sf $Makefile $left;\n";
+ }
+ elsif ($entry ne 'QUEUE_GROUP') {
+ print $ofh "\t\@rm -f $left;\n",
+ "\t\@\$(MAKE) -sf $Makefile $left;\n";
+ };
+
+ #
+ # Spew out the whole enchilada for this database
+ # Hidden dependancies (need to parse includes)
+ $right .= join(''," @sysconfdir@/mail/dialup.m4",
+ " @sysconfdir@/mail/provider.m4")
+ if ($entry eq 'sendmail.cf');
+ print $ofh $left, ':', $right, "\n";
+ next if ($entry eq 'QUEUE_GROUP');
+ print $ofh "\t\@echo 'Updating $entry ...';\n";
+ print $ofh "\t\@@sbindir@/sendmail -bi || true;\n"
+ if ($class eq 'newaliases');
+ print $ofh "\t\@@datadir@/sendmail/parse_mc || true;\n"
+ if ($class eq 'parse_mc');
+ print $ofh "\t\@@datadir@/sendmail/update_mk || true;\n"
+ if ($class eq 'update_mk');
+ print $ofh "\t\@@datadir@/sendmail/update_conf || true;\n"
+ if ($class eq 'update_conf');
+ foreach my $file (@{$files}) {
+ next if ( $file eq 'ldap' ); # ALIAS hack
+ my $dbname = $file;
+ my $newname = $file;
+ my $mode = '0644';
+ $mode = '0640' if ($entry eq 'authinfo'
+ or $entry eq 'access_db');
+ $mode = '0644' if ($class eq 'm4');
+ $mode = '0754' if ($class eq 'update_mk');
+ $mode = '02750' if ($entry eq 'QUEUE_GROUP');
+ if ($class eq 'btree' or $class eq 'hash') {
+ $dbname .= '.db';
+ $newname .= '.new.db';
+ if (index($flags, '-o') == -1) {
+ print $ofh "\t\@@sbindir@/makemap $class $newname \\\n",
+ "\t\t< $file;\n",
+ "\t\@chown root:smmsp $newname;\n",
+ "\t\@chmod $mode $newname;\n",
+ "\t\@mv -f $newname $dbname;\n";
+ }
+ else {
+ print $ofh
+ "\t\@if [ -s $file ]; then \\\n",
+ "\t\t@sbindir@/makemap $class $newname \\\n",
+ "\t\t\t< $file;\\\n",
+ "\t\tchown root:smmsp $newname;\\\n",
+ "\t\tchmod $mode $newname;\\\n",
+ "\t\tmv -f $newname $dbname;\\\n",
+ "\t\tfi;\n";
+ };
+ }
+ elsif ($class eq 'newaliases') {
+ $newname .= '.db';
+ print $ofh "\t\@if [ -f $newname ]; then \\\n",
+ "\t\tchown root:smmsp $newname; \\\n",
+ "\t\tchmod $mode $newname; \\\n",
+ "\t\tfi;\n";
+ }
+ elsif ($class eq 'parse_mc' or $class eq 'update_mk') {
+ $newname = "@sysconfdir@/mail/$entry";
+ print $ofh "\t\@chown root:smmsp $newname;\n",
+ "\t\@chmod $mode $newname;\n";
+ }
+ elsif ($class eq 'm4') {
+ $dbname =~ s/\.mc$/\.cf/;
+ $newname =~ s/\.mc$/\.cf\.new/;
+ my $lead = "\t";
+ my $leadh = "\t\@";
+ my $lead2 = "\t\t";
+ my $trail = "";
+ if ($entry eq 'submit.cf') {
+ $lead = "\t\t";
+ $leadh = "\t\t";
+ $lead2 = "\t\t\t";
+ $trail = "\\";
+ };
+ print $ofh
+ "\t\@rm -f ${dbname}.errors\n";
+ print $ofh
+ "\t\@if [ -f @datadir@/sendmail/cf/feature/msp.m4 ]; ",
+ "then \\\n" if ($entry eq 'submit.cf');
+ print $ofh
+ "${leadh}m4 $file > $newname \\\n",
+ "${lead2}2> ${dbname}.errors || true; $trail\n",
+ "${leadh}chown root:smmsp $newname; $trail\n",
+ "${leadh}chmod $mode $newname; $trail\n",
+ "${leadh}mv -f $newname $dbname; $trail\n",
+ "${leadh}if [ -s ${dbname}.errors ]; then \\\n",
+ "${lead2}chown root:smmsp ${dbname}.errors; \\\n",
+ "${lead2}cat ${dbname}.errors; \\\n",
+ "${lead}else \\\n",
+ "${lead2}rm -f ${dbname}.errors; \\\n",
+ "${lead2}fi; $trail\n";
+ print $ofh
+ "${lead}fi;\n" if ($entry eq 'submit.cf');
+ };
+ };
+ };
+ };
+
+#
+#------------------------------------------------------------------------------
+# Write Makefile file targets (create any missing files)
+#------------------------------------------------------------------------------
+sub write_files {
+ my ($ofh) = @_;
+
+ print $ofh <<"EOT";
+
+#
+# Individual file targets - create any requisite files
+#
+EOT
+
+ %created_files = ();
+ foreach my $entry (@created_dbs) {
+ my ($class, $flags, $files, $options) =
+ &Parse_mc::entry_dbs($entry);
+
+ # These are done above...
+ next if ($entry eq 'databases'
+ or $entry eq 'Makefile');
+
+ foreach my $file (@{$files}) {
+ next if ( $file eq '-'
+ or exists($created_files{$file}) );
+ $created_files{$file} = '';
+ my $mode = '0644';
+ $mode = '0640' if ($entry eq 'authinfo'
+ or $entry eq 'access_db');
+ $mode = '0644' if ($class eq 'm4');
+ $mode = '0754' if ($class eq 'update_mk');
+ $mode = '02750' if ($entry eq 'QUEUE_GROUP');
+ print $ofh "\n$file:\n",
+ "\t\@echo 'Creating $file';\n";
+ if ($entry eq 'QUEUE_GROUP') {
+ print $ofh "\t\@install -d",
+ " -o root -g smmsp -m $mode $file;\n",
+ "\t\@chown root:smmsp $file;\n",
+ "\t\@chmod $mode $file;\n";
+ }
+ elsif ($entry eq 'sendmail.cf') {
+ print $ofh "\t\@@sbindir@/sendmailconfig",
+ " --no-reload;\n";
+ }
+ elsif ($entry eq 'submit.cf') {
+ print $ofh "\t\@cp @datadir@/sendmail/",
+ "cf/debian/submit.mc \\\n",
+ "\t\t$file;\n",
+ "\t\@chown root:smmsp $file;\n",
+ "\t\@chmod $mode $file;\n";
+ }
+ elsif ($entry eq 'crontab') {
+ print $ofh "\t\@@datadir@/sendmail/update_conf;\n";
+ }
+ # FIXME: come back and create real data
+ # where needed (local-host-names, etc)
+ elsif (index($flags, '-o') == -1) {
+ print $ofh "\t\@touch $file;\n",
+ "\t\@chown root:smmsp $file;\n",
+ "\t\@chmod $mode $file;\n";
+ }
+ elsif (index($flags, '-o') != -1) {
+ print $ofh "\t# Optional file...\n";
+ };
+ };
+ };
+ };
+
+#
+#------------------------------------------------------------------------------
+# Write Makefile footer
+#------------------------------------------------------------------------------
+sub write_footer {
+ my ($ofh) = @_;
+
+print $ofh <<"EOT";
+
+#
+# FORCE target, allow one to override dependancies
+#
+.PHONY: FORCE
+FORCE: ;
+
+EOT
+ };
+
diff --git a/debian/local/update_notices b/debian/local/update_notices
new file mode 100644
index 0000000..522c1ef
--- /dev/null
+++ b/debian/local/update_notices
@@ -0,0 +1,177 @@
+#!/bin/sh
+#-----------------------------------------------------------------------------
+#
+# Update Notices for Debian Sendmail
+#
+# Copyright (c) 2001-2002 Richard Nelson. All Rights Reserved.
+# Time-stamp: <2001/08/15 15:00:00 cowboy>
+#
+# Notes (to all):
+# *
+#
+# Notes (to self):
+# *
+#
+#-----------------------------------------------------------------------------
+set -e;
+notices=0;
+version=$1;
+export LANG=C; # for the comparison of mail version...
+
+#-----------------------------------------------------------------------------
+# Notice Item
+#-----------------------------------------------------------------------------
+Notice_Item () {
+ if [ $notices -eq "0" ]; then
+ if [ -z $version ]; then
+ echo '
+*** WELCOME ***.................*** WELCOME ***.................*** WELCOME ***
+';
+ else
+ echo '
+*** IMPORTANT ***..............*** IMPORTANT ***..............*** IMPORTANT ***
+';
+ fi;
+ fi;
+ notices=`expr $notices + 1`;
+ echo '';
+ echo "${notices}: .....................................................";
+ cat -;
+ };
+
+#-----------------------------------------------------------------------------
+if [ -z "$version" ]; then
+ Notice_Item <<-EOT;
+ Sendmail is a powerful MTA, and you may find the sendmail-doc package
+ useful in the configuration phase. You should find even the few files
+ in /usr/share/doc/sendmail useful - they note recent Sendmail and Debian
+ changes, along with information on the features present in this package.
+ EOT
+ fi;
+
+#-----------------------------------------------------------------------------
+if test ! -z "$version" && \
+ (dpkg --compare-versions "$version" lt "00.00.00-00"); then
+ Notice_Item <<-EOT;
+ EOT
+ fi;
+
+#-----------------------------------------------------------------------------
+if test ! -z "$version" && \
+ (dpkg --compare-versions "$version" lt "8.12.6-5"); then
+ Notice_Item <<-EOT;
+
+ The group smmsp may have been created within the user, not
+ system range. To correct this issue, the group will be deleted
+ and recreated.
+
+ For this to work, you will need to let sendmailconfig run, or
+ manually run /usr/share/sendmail/update_sendmail immediately
+ after saying 'no' to the sendmailconfig questions.
+ EOT
+ fi;
+
+#-----------------------------------------------------------------------------
+if test ! -z "$version" && \
+ (dpkg --compare-versions "$version" lt "8.12.2-1"); then
+ Notice_Item <<-EOT;
+ smrsh functionality has moved from /usr/lib/sm.bin to /etc/mail/smrsh.
+
+ Sendmail will populate the directory with some of the more common MDAs
+ (procmail,maildrop,deliver,etc.) that are installed, but doesn't know
+ about listserver type programs (majordomo, mailman, etc.) So you'll
+ need to place links to those binaries in /etc/mail/smrsh.
+
+ Also, if you add a new MDA, you'll need to rerun sendmailconfig to
+ make sure the MDA is available for smrsh processing!
+ EOT
+ Notice_Item <<-EOT;
+ Sendmail has changed to use the standard uid/gid smmsp for the MSP.
+ If you've not changed queue directories, you'll be all set.
+
+ However, if you've moved queue directories, you'll need to make sure
+ that all of them are 0750 root:smmsp
+ EOT
+ fi;
+
+#-----------------------------------------------------------------------------
+if test ! -z "$version" && \
+ (dpkg --compare-versions "$version" lt "8.12.0-1"); then
+ Notice_Item <<-EOT;
+ The automatic virtual-host changes have been removed because
+ they caused problems for some people...
+
+ If you need to do ip based virtual hosting, add HACK(\`virthost_by_ip')dnl
+ to your sendmail.mc and read /usr/share/doc/sendmail/op/op.{ps,txt}.gz
+ for the 'b' modifier to DAEMON_OPTIONS.
+ EOT
+ Notice_Item <<-EOT;
+ If you'd like to support MSP->MTA and/or MTA->MTA authentication, you
+ can get a good start by using HACK(\`debian_auth')dnl.
+ EOT
+ Notice_Item <<-EOT;
+ The commands 'mailq' and 'hoststat' are now useable by normal users.
+ EOT
+ Notice_Item <<-EOT;
+ Sendmail now defaults to being uid=mail (instead of daemon) when
+ calling the MDA to deliver mail. This means that if you have files
+ that are written to by the MDA, they need to be writable by uid=mail!
+ EOT
+ fi;
+
+#-----------------------------------------------------------------------------
+if test ! -z "$version" && \
+ (dpkg --compare-versions "$version" lt "8.11.6+8.12.0.Beta19-1"); then
+ Notice_Item <<-EOT;
+ You can now control the collection of host statistics via settings in
+ /etc/mail/sendmail.conf, please edit the file to your needs.
+ EOT
+ fi;
+
+#-----------------------------------------------------------------------------
+if test ! -z "$version" && \
+ (dpkg --compare-versions "$version" lt "8.11.5+8.12.0.Beta17-1"); then
+ Notice_Item <<-EOT;
+ You can now control the collection of mailer statistics via settings in
+ /etc/mail/sendmail.conf, please edit the file to your needs.
+ EOT
+ fi;
+
+#-----------------------------------------------------------------------------
+if test ! -z "$version" && \
+ (dpkg --compare-versions "$version" lt "8.11.3+8.12.0.Beta7-4"); then
+ Notice_Item <<-EOT;
+ Sendmail has extended control over queue management, and these changes
+ can cause a performance drop if you don't change your local
+ configuration.
+
+ Old:
+ MaxDaemonChildren controlled number of listener *and* queue runners
+
+ Sendmail would fork as many children as needed to run the queues
+
+ New:
+ MaxDaemonChildren still works as a total limit
+ MaxQueueChildren limits *only* the number of total queue runners
+ MaxRunnersPerQueue limits the number of runners per individual
+ queue (in 8.11+, you can have multiple queues) -- *AND* you
+ can override this global limit on per queue basis!
+ MaxQueueRunSize limits the number of messages processed per queue run
+
+ Sendmail only forks upto MaxRunnersPerQueue for each queue per run
+
+ The gotcha here is that MaxRunnersPerQueue defaults to one !
+
+ I've changed the default MaxRunnersPerQueue to 5, so deliveries aren't
+ single threaded, but you may want to have more or less than 5.
+ EOT
+ fi;
+
+#-----------------------------------------------------------------------------
+if [ "$notices" -ne "0" ]; then
+ echo '';
+ echo -n 'Press [ENTER] to continue';
+ read yn;
+ fi;
+#-----------------------------------------------------------------------------
+
diff --git a/debian/local/update_sendmail b/debian/local/update_sendmail
new file mode 100644
index 0000000..e7c5fe1
--- /dev/null
+++ b/debian/local/update_sendmail
@@ -0,0 +1,77 @@
+#!/bin/sh -e
+#-----------------------------------------------------------------------------
+#
+# Update Sendmail environment for Debian
+#
+# Copyright (c) 2001-2001 Richard Nelson. All Rights Reserved.
+# Time-stamp: <2001/01/17 10:00:00 cowboy>
+#
+# Notes (to all):
+# *
+#
+# Notes (to self):
+# *
+#
+#-----------------------------------------------------------------------------
+set -e;
+
+# Path to other sendmail helpers
+sm_path=$(dirname $0);
+
+# control amount of output
+verbosity=0;
+
+# flag used to indicate a dataset has been moved, may need another update
+changed=0;
+
+#-------------------------------------------------------------
+# Make sure the system is setup
+if [ -x $sm_path/update_sys ]; then
+ $sm_path/update_sys || changed=1;
+ fi;
+
+#-------------------------------------------------------------
+# update smrsh/sensible-mda information if possible
+if [ -x $sm_path/update_smrsh ]; then
+ $sm_path/update_smrsh || true;
+ fi;
+
+#-------------------------------------------------------------
+# update LDAP information if possible
+if [ -x $sm_path/update_ldap ]; then
+ $sm_path/update_ldap || true;
+ fi;
+
+#-------------------------------------------------------------
+# update SMTP AUTH (SASL) information if possible
+if [ -x $sm_path/update_auth ]; then
+ $sm_path/update_auth || true;
+ fi;
+
+#-------------------------------------------------------------
+# update TLS(SSL) information if possible
+if [ -x $sm_path/update_tls ]; then
+ $sm_path/update_tls || true;
+ fi;
+
+#-------------------------------------------------------------
+# Check and update (if needed) /etc/hosts.allow
+if [ -x $sm_path/update_tcpd ]; then
+ $sm_path/update_tcpd || true;
+ fi;
+
+#-------------------------------------------------------------
+# Perform some [safe] updates to an existing sendmail.mc to make
+# sure it is compatible with the current executables.
+if [ -x $sm_path/update_mc ]; then
+ $sm_path/update_mc || changed=1;
+ fi;
+
+#-------------------------------------------------------------
+# Make sure the databases are in the expected locations
+if [ -x $sm_path/update_db ]; then
+ $sm_path/update_db || changed=1;
+ fi;
+
+#-------------------------------------------------------------
+exit $changed
diff --git a/debian/local/update_smrsh.in b/debian/local/update_smrsh.in
new file mode 100644
index 0000000..8a27d6d
--- /dev/null
+++ b/debian/local/update_smrsh.in
@@ -0,0 +1,73 @@
+#!/bin/sh -e
+#-----------------------------------------------------------------------------
+#
+# $Sendmail: update_smrsh,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Update MDA programs used by Sendmail for Debian
+#
+# Copyright (c) 2002-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# Notes (to all):
+# * The entries in /etc/mail/smrsh are used by the feature(smrsh) and
+# sensible-mda.
+#
+# Notes (to self):
+# *
+#
+#-----------------------------------------------------------------------------
+set -e;
+
+# flag used to indicate a dataset has been moved, may need another update
+changed=0;
+new=1;
+
+def_progs="\
+ @libexecdir@/mail.local \
+ @libexecdir@/sensible-mda \
+ /usr/bin/vacation \
+ /usr/bin/procmail \
+ /usr/bin/maildrop \
+ /usr/bin/deliver \
+ ";
+
+echo " ";
+echo "Checking for installed MDAs...";
+
+#------------------------------------------------------------------------------
+# /etc/mail/smrsh is where the links to MDAs and authorized forwarding progs
+if [ ! -e @sysconfdir@/mail/smrsh ]; then
+ changed=1;
+ new=1;
+ fi;
+chown root:root @sysconfdir@/mail/smrsh;
+chmod 02755 @sysconfdir@/mail/smrsh;
+
+#------------------------------------------------------------------------------
+# Iterate over the default list of programs and create any missing items
+for file in $def_progs; do
+ ppath=$(dirname "$file");
+ pname=$(basename "$file");
+
+ # the file doesn't exist, see if we can remove its link
+ if [ ! -e $file ]; then
+
+ # let have there own version eh?
+ if [ -e @sysconfdir@/mail/smrsh/$pname ]; then
+ true;
+
+ # no, if its a danglink symlink, drop it
+ elif [ -L @sysconfdir@/mail/smrsh/$pname ]; then
+ echo "Removing link for no longer extant program ($pname)";
+ rm @sysconfdir@/mail/smrsh/$pname;
+ fi;
+
+ # the file exists, see if we need to add its link
+ elif [ ! -e @sysconfdir@/mail/smrsh/$pname ]; then
+ echo "Adding link for newly extant program ($pname)";
+ ln -sf $file @sysconfdir@/mail/smrsh/$pname;
+ changed=1;
+ fi;
+ done;
+
+#------------------------------------------------------------------------------
+exit $changed;
diff --git a/debian/local/update_sys.in b/debian/local/update_sys.in
new file mode 100644
index 0000000..89cad19
--- /dev/null
+++ b/debian/local/update_sys.in
@@ -0,0 +1,282 @@
+#!/bin/sh
+#-----------------------------------------------------------------------------
+#
+# $Sendmail: update_sys,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Update system files used by Sendmail for Debian
+#
+# Copyright (c) 2001-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# Notes (to all):
+# * Several directories/files have their permissions forced...
+# This is done to allow the MSP/MTA split
+# * This exec runs 'set +e' to ignore errors!!! this is done to
+# support those running NFS (or similiar) systems, where the
+# chmod/chown may fail - If this happens, you'll need to update
+# those items by hand !
+#
+# Notes (to self):
+# *
+#
+#-----------------------------------------------------------------------------
+set +e;
+
+# flag used to indicate a dataset has been moved, may need another update
+changed=0;
+
+#------------------------------------------------------------------------------
+# Create any needed directories, and move any prior data to its new home
+
+#------------------------------------------------------------------------------
+# /etc/aliases should exist, though not owned by sendmail, we'll create one
+if [ ! -e @sysconfdir@/aliases ]; then
+ changed=1;
+ if [ -f @datadir@/doc/sendmail/examples/db/aliases ]; then
+ echo "Creating @sysconfdir@/aliases (not found)";
+ cp @datadir@/sendmail/examples/db/aliases \
+ @sysconfdir@/aliases;
+ else
+ touch @sysconfdir@/aliases;
+ fi;
+ chown root:root @sysconfdir@/aliases;
+ chmod 0644 @sysconfdir@/aliases;
+ fi;
+
+#------------------------------------------------------------------------------
+# /var/mail is the FHS user mail location, /var/spool/mail is older
+# Note: we set the sticky bit to prevent a sgid exploit from erasing files
+if [ ! -e @localstatedir@/mail ]; then
+ changed=1;
+ if [ -L @localstatedir@/spool/mail ]; then
+ ln -sf spool/mail @localstatedir@/mail;
+ elif [ -d @localstatedir@/spool/mail ]; then
+ mv @localstatedir@/spool/mail @localstatedir@/mail;
+ chown root:root @localstatedir@/mail;
+ chmod 03775 @localstatedir@/mail;
+ else
+ mkdir @localstatedir@/mail;
+ chown root:root @localstatedir@/mail;
+ chmod 03775 @localstatedir@/mail;
+ fi;
+ fi;
+#
+# Make sure the sticky bit is set in pre-existing directories
+if [ -d @localstatedir@/mail -a ! -k @localstatedir@/mail ]; then
+ chmod a+t @localstatedir@/mail;
+ fi;
+if [ -d @localstatedir@/spool/mail -a ! -k @localstatedir@/spool/mail ]; then
+ chmod a+t @localstatedir@/spool/mail;
+ fi;
+if [ ! -d @localstatedir@/spool/mail -a ! -L @localstatedir@/spool/mail ]; then
+ ln -sf ../mail @localstatedir@/spool/mail;
+ #mkdir @localstatedir@/spool/mail;
+ #chown root:root @localstatedir@/spool/mail;
+ #chmod 03775 @localstatedir@/spool/mail;
+ fi;
+
+#------------------------------------------------------------------------------
+# /etc/mail is where the Sendmail config files live
+if [ ! -d @sysconfdir@/mail ]; then
+ changed=1;
+ mkdir @sysconfdir@/mail;
+ fi;
+chown root:smmsp @sysconfdir@/mail;
+chmod 02755 @sysconfdir@/mail;
+#
+# With the MSP/MTA split, we don't want any g=w files or directories
+# to save us from potential sgid attacks
+find @sysconfdir@/mail -perm +g=w \( -type f -o -type d \) -print \
+ | xargs -r chmod g-w,o-w;
+
+#------------------------------------------------------------------------------
+# /var/run/sendmail is where we store pid files, control sockets, stamps, etc
+if [ ! -d @localstatedir@/run/sendmail ]; then
+ changed=1;
+ mkdir @localstatedir@/run/sendmail;
+ fi;
+chown root:smmsp @localstatedir@/run/sendmail;
+chmod 02750 @localstatedir@/run/sendmail;
+if [ ! -d @localstatedir@/run/sendmail/mta ]; then
+ mkdir @localstatedir@/run/sendmail/mta;
+ fi;
+chown root:smmsp @localstatedir@/run/sendmail/mta;
+chmod 02750 @localstatedir@/run/sendmail/mta;
+if [ ! -d @localstatedir@/run/sendmail/msp ]; then
+ mkdir @localstatedir@/run/sendmail/msp;
+ fi;
+chown smmsp:smmsp @localstatedir@/run/sendmail/msp;
+chmod 02770 @localstatedir@/run/sendmail/msp;
+if [ ! -d @localstatedir@/run/sendmail/stampdir ]; then
+ mkdir @localstatedir@/run/sendmail/stampdir;
+ fi;
+chown root:smmsp @localstatedir@/run/sendmail/stampdir;
+chmod 02770 @localstatedir@/run/sendmail/stampdir;
+#
+# Remove older files
+rm -f /var/run/sendmail.pid;
+rm -f /var/run/sendmail/sendmail.pid;
+rm -f /var/run/sendmail/smcontrol;
+
+#------------------------------------------------------------------------------
+# /var/lib/sendmail is where we stuff host status and sendmail.st
+# instead of the mail queue and /etc/ (respectively)
+if [ ! -d @localstatedir@/lib/sendmail ]; then
+ changed=1;
+ mkdir @localstatedir@/lib/sendmail;
+ fi;
+chown root:smmsp @localstatedir@/lib/sendmail;
+chmod 02750 @localstatedir@/lib/sendmail;
+if [ -d /var/state/sendmail/host_status ]; then
+ changed=1;
+ echo "Moving /var/state/sendmail/host_status to /var/lib/sendmail/";
+ mv -f /var/state/sendmail/host_status \
+ @localstatedir@/lib/sendmail/host_status;
+ fi;
+if [ -d /var/sendmail/host_status ]; then
+ changed=1;
+ echo "Moving /var/sendmail/host_status to /var/lib/sendmail/";
+ mv -f /var/sendmail/host_status \
+ @localstatedir@/lib/sendmail/host_status;
+ fi;
+if [ ! -d @localstatedir@/lib/sendmail/host_status ]; then
+ mkdir @localstatedir@/lib/sendmail/host_status;
+ fi;
+chown root:smmsp @localstatedir@/lib/sendmail/host_status;
+chmod 02750 @localstatedir@/lib/sendmail/host_status;
+find @localstatedir@/lib/sendmail/host_status -type d -print \
+ | xargs -r chown root:smmsp;
+find @localstatedir@/lib/sendmail/host_status -type d -print \
+ | xargs -r chmod 02750;
+#
+# if sendmail.st doesn't exist, don't create it !
+if [ -f /var/log/sendmail.st ]; then
+ changed=1;
+ echo "Moving /var/log/sendmail.st to /var/lib/sendmail/";
+ mv /var/log/sendmail.st \
+ @localstatedir@/lib/sendmail/sendmail.st;
+ fi;
+if [ -f /var/sendmail/sendmail.st ]; then
+ changed=1;
+ echo "Moving /var/sendmail/sendmail.st to /var/lib/sendmail/";
+ mv /var/sendmail/sendmail.st \
+ @localstatedir@/lib/sendmail/sendmail.st;
+ fi;
+if [ -f @localstatedir@/lib/sendmail/sendmail.st ]; then
+ chown root:smmsp @localstatedir@/lib/sendmail/sendmail.st;
+ chmod 0640 @localstatedir@/lib/sendmail/sendmail.st;
+ if [ ! -f @localstatedir@/lib/sendmail/sm-client.st ]; then
+ touch @localstatedir@/lib/sendmail/sm-client.st;
+ fi;
+ fi;
+if [ -f @localstatedir@/lib/sendmail/sm-client.st ]; then
+ chown smmsp:smmsp @localstatedir@/lib/sendmail/sm-client.st;
+ chmod 0660 @localstatedir@/lib/sendmail/sm-client.st;
+ fi;
+if [ ! -f @localstatedir@/lib/sendmail/dead.letter ]; then
+ touch @localstatedir@/lib/sendmail/dead.letter;
+ fi;
+chown root:smmsp @localstatedir@/lib/sendmail/dead.letter;
+chmod 0660 @localstatedir@/lib/sendmail/dead.letter;
+#
+# Remove older files
+rm -rf /var/sendmail;
+rm -rf /var/state/sendmail;
+
+#------------------------------------------------------------------------------
+# /var/spool/mqueue is the MTA mail queue directory
+if [ ! -d @localstatedir@/spool/mqueue ]; then
+ changed=1;
+ mkdir @localstatedir@/spool/mqueue;
+ fi;
+chown root:smmsp @localstatedir@/spool/mqueue;
+chmod 02750 @localstatedir@/spool/mqueue;
+#
+# With the MSP/MTA split, we *DO* need g=r, gid=smmsp queue directories and
+# files mailq to work...
+find @localstatedir@/spool/mqueue -print \
+ | xargs -r chown root:smmsp;
+find @localstatedir@/spool/mqueue -type d -print \
+ | xargs -r chmod g+rxs-w,o-rwx;
+find @localstatedir@/spool/mqueue -type f -print \
+ | xargs -r chmod g+r-wx,o-rwx;
+
+#------------------------------------------------------------------------------
+# /var/spool/mqueue-client is the MSP mail queue directory
+if [ ! -d @localstatedir@/spool/mqueue-client ]; then
+ mkdir @localstatedir@/spool/mqueue-client;
+ fi;
+chown smmsp:smmsp @localstatedir@/spool/mqueue-client;
+chmod 02770 @localstatedir@/spool/mqueue-client;
+find @localstatedir@/spool/mqueue-client -perm +o=r -print \
+ | xargs -r chmod o-rwx;
+
+#------------------------------------------------------------------------------
+# /var/log/mail is where we keep our log crap (via syslog)
+# Try to fixup syslog, syslog-ng, etc...
+if [ ! -d @localstatedir@/log/mail -a \
+ ! -f /var/log/mail ]; then
+ echo "Moving /var/log/mail.* to /var/log/mail/mail.*";
+ echo "You will need to adjust any log reading scripts accordingly";
+ mkdir @localstatedir@/log/mail;
+ chown root:smmsp @localstatedir@/log/mail;
+ chmod 02770 @localstatedir@/log/mail;
+ mv -f /var/log/mail.log @localstatedir@/log/mail/ \
+ 1>/dev/null 2>&1;
+ mv -f /var/log/mail.log.[0-9]* @localstatedir@/log/mail/ \
+ 1>/dev/null 2>&1;
+ mv -f /var/log/mail.err @localstatedir@/log/mail/\
+ 1>/dev/null 2>&1;
+ mv -f /var/log/mail.err.[0-9]* @localstatedir@/log/mail/ \
+ 1>/dev/null 2>&1;
+ mv -f /var/log/mail.info @localstatedir@/log/mail/ \
+ 1>/dev/null 2>&1;
+ mv -f /var/log/mail.info.[0-9]* @localstatedir@/log/mail/ \
+ 1>/dev/null 2>&1;
+ mv -f /var/log/mail.warn @localstatedir@/log/mail/ \
+ 1>/dev/null 2>&1;
+ mv -f /var/log/mail.warn.[0-9]* @localstatedir@/log/mail/ \
+ 1>/dev/null 2>&1;
+ # Create link for compatility with logscan package
+ ln -sf @localstatedir@/log/mail/mail.log /var/log/mail.log;
+ fi;
+#
+# Support for sysklogd package
+if [ -f /etc/syslog.conf ]; then
+ sed -e "s?/var/log/mail.log?@localstatedir@/log/mail/mail.log?g" \
+ -e "s?/var/log/mail.err?@localstatedir@/log/mail/mail.err?g" \
+ -e "s?/var/log/mail.info?@localstatedir@/log/mail/mail.info?g" \
+ -e "s?/var/log/mail.warn?@localstatedir@/log/mail/mail.warn?g" \
+ /etc/syslog.conf > /etc/syslog.conf.new;
+ chown root:root /etc/syslog.conf.new;
+ chmod 0644 /etc/syslog.conf.new;
+ mv /etc/syslog.conf.new /etc/syslog.conf;
+ /etc/init.d/sysklogd reload;
+ fi;
+#
+# Support for syslog-ng package
+if [ -f /etc/syslog-ng/syslog-ng.conf ]; then
+ sed -e "s?/var/log/mail.log?@localstatedir@/log/mail/mail.log?g" \
+ -e "s?/var/log/mail.err?@localstatedir@/log/mail/mail.err?g" \
+ -e "s?/var/log/mail.info?@localstatedir@/log/mail/mail.info?g" \
+ -e "s?/var/log/mail.warn?@localstatedir@/log/mail/mail.warn?g" \
+ /etc/syslog-ng/syslog-ng.conf > \
+ /etc/syslog-ng/syslog-ng.conf.new;
+ chown root:root /etc/syslog-ng/syslog-ng.conf.new;
+ chmod 0644 /etc/syslog-ng/syslog-ng.conf.new;
+ mv /etc/syslog-ng/syslog-ng.conf.new \
+ /etc/syslog-ng/syslog-ng.conf;
+ /etc/init.d/syslog-ng reload;
+ if [ -f /etc/logrotate.d/syslog-ng ]; then
+ sed -e '/\/var\/log\/mail\..*/{:a;N;/}\n/!ba;d;}' \
+ /etc/logrotate.d/syslog-ng > \
+ /etc/logrotate.d/syslog-ng.new;
+ chown root:root /etc/logrotate.d/syslog-ng.new;
+ chmod 0644 /etc/logrotate.d/syslog-ng.new;
+ mv /etc/logrotate.d/syslog-ng.new \
+ /etc/logrotate.d/syslog-ng;
+ true;
+ fi;
+ fi;
+
+#------------------------------------------------------------------------------
+exit $changed;
diff --git a/debian/local/update_tcpd b/debian/local/update_tcpd
new file mode 100644
index 0000000..e3b430a
--- /dev/null
+++ b/debian/local/update_tcpd
@@ -0,0 +1,53 @@
+#!/bin/sh -e
+#-----------------------------------------------------------------------------
+#
+# Update TCPD environment (TCP Wrappers) for sendmail
+#
+# Copyright (c) 2001-2001 Richard Nelson. All Rights Reserved.
+# Time-stamp: <2001/01/17 10:00:00 cowboy>
+#
+# Notes (to all):
+#
+# Notes (to self):
+#
+#-----------------------------------------------------------------------------
+set -e
+
+#------------------------------------------------------------------------------
+# Check to see if sendmail is mentioned in /etc/hosts.allow
+# Note: This check is far from perfect - it requires sendmail and : be
+# on the same line. If you've got a better approach, I'd love to
+# see it (Maybe awk/perl)!
+
+if grep -qEe "^[^#:]*sendmail[^:]*[:]" /etc/hosts.allow 2>/dev/null; then
+ need_tcpd=0
+else
+ need_tcpd=1
+ fi
+
+if [ ! -e /etc/hosts.allow ]; then
+ need_tcpd=0
+ fi
+
+if [ $need_tcpd -eq 1 ]; then
+ cat <<-EOT
+
+ Updating /etc/hosts.allow, adding "sendmail: all".
+
+ Please edit /etc/hosts.allow and check the rules location to
+ make sure your security measures have not been overridden -
+ it is common to move the sendmail:all line to the *end* of
+ the file, so your more selective rules take precedence.
+EOT
+
+ echo "sendmail: all" | cat - /etc/hosts.allow >/etc/hosts.allow.new
+ mv -f /etc/hosts.allow.new /etc/hosts.allow
+
+ if [ -e /etc/init.d/netbase ]; then
+ /etc/init.d/netbase reload >/dev/null
+ elif [ -e /etc/init.d/inetd ]; then
+ /etc/init.d/inetd reload >/dev/null
+ fi
+ fi
+
+exit 0
diff --git a/debian/local/update_tls.in b/debian/local/update_tls.in
new file mode 100644
index 0000000..7d833fe
--- /dev/null
+++ b/debian/local/update_tls.in
@@ -0,0 +1,305 @@
+#!/bin/sh -e
+#-----------------------------------------------------------------------------
+#
+# $Sendmail: update_tls,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Sendmail support for TLS
+#
+# Copyright (c) 2000-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# Notes:
+#
+#-----------------------------------------------------------------------------
+set -e;
+
+#------------------------------------------------------------------------------
+# Local variables
+#---------------------------------------------------------------------------
+HOSTNAME=`hostname -s`;
+DOMAINNAME=`hostname -d`;
+SSL_FQDN=`hostname -f`;
+SSL_EMAIL="admin@${SSL_FQDN}";
+export SSL_FQDN SSL_EMAIL;
+PROGRAM='sendmail';
+CERT_DIR="@sysconfdir@/ssl/certs";
+COM_PRM="@sysconfdir@/mail/tls/$PROGRAM-common.prm";
+COM_KEY="@sysconfdir@/mail/tls/$PROGRAM-common.key";
+MTA_CFG="@sysconfdir@/mail/tls/$PROGRAM-server.cfg";
+MTA_CSR="@sysconfdir@/mail/tls/$PROGRAM-server.csr";
+MTA_CRT="@sysconfdir@/mail/tls/$PROGRAM-server.crt";
+MSP_CFG="@sysconfdir@/mail/tls/$PROGRAM-client.cfg";
+MSP_CSR="@sysconfdir@/mail/tls/$PROGRAM-client.csr";
+MSP_CRT="@sysconfdir@/mail/tls/$PROGRAM-client.crt";
+NEW=0;
+REFD=0;
+
+#---------------------------------------------------------------------------
+# create_config: Function to create openssl configuration file
+#---------------------------------------------------------------------------
+create_config () {
+cat >$MTA_CFG <<EOT
+[ ca ]
+default_days = 365
+x509_extensions = X509v3
+[ req ]
+default_bits = 1024
+distinguished_name = req_DN
+[ req_DN ]
+countryName = "1. Country Name (2 letter code)"
+countryName_min = 2
+countryName_max = 2
+countryName_default =
+stateOrProvinceName = "2. State or Province Name (full name) "
+stateOrProvinceName_default =
+localityName = "3. Locality Name (eg, city) "
+localityName_default =
+0.organizationName = "4. Organization Name (eg, company) "
+0.organizationName_default = Sendmail
+organizationalUnitName = "5. Organizational Unit Name (eg, section) "
+organizationalUnitName_default = Sendmail Server
+commonName = "6. Common Name (MUST==FQDN) "
+commonName_max = 64
+commonName_default = \$ENV::SSL_FQDN
+emailAddress = "7. Email Address (eg, name@FQDN)"
+emailAddress_max = 40
+emailAddress_default = \$ENV::SSL_EMAIL
+[ x509v3 ]
+subjectAltName = email:copy
+issuerAltName = issuer:copy
+basicConstraints = CA:false
+nsComment = "Sendmail generated custom certificate"
+nsCertType = server
+nsSslServerName = \$ENV::SSL_FQDN
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+EOT
+};
+
+
+#---------------------------------------------------------------------------
+# Check if OpenSSL is installed
+if [ ! -d "$CERT_DIR" ]; then
+ cat <<-EOT
+
+ OpenSSL is not installed, will not configure sendmail support for it.
+
+ to install openssl, get openssl.
+
+ To enable sendmail TLS support at a later date, invoke "$0"
+
+ EOT
+ exit 0;
+ fi;
+
+echo ' ';
+echo 'Creating/Updating SSL(for TLS) information';
+
+
+#---------------------------------------------------------------------------
+# Process arguments
+#---------------------------------------------------------------------------
+case "$1" in
+ [Nn][Ee][Ww]*)
+ echo 'Removing any pre-existing sendmail certificates.';
+ if [ -x @bindir@/openssl ]; then
+ if [ -f $MTA_CRT ]; then
+ LINK="$CERT_DIR/"$(openssl x509 -noout -hash < $MTA_CRT)".0";
+ rm -f $LINK 2>/dev/null;
+ fi;
+ if [ -f $MSP_CRT ]; then
+ LINK="$CERT_DIR/"$(openssl x509 -noout -hash < $MSP_CRT)".0";
+ rm -f $LINK 2>/dev/null;
+ fi;
+ fi;
+ rm -f $MTA_CSR $MTA_CRT 2>/dev/null;
+ rm -f $MSP_CSR $MSP_CRT 2>/dev/null;
+ rm -f $COM_PRM $COM_KEY 2>/dev/null;
+ ;;
+ esac
+
+#---------------------------------------------------------------------------
+# Make sure sendmail.mc points to proper /etc/mail/tls/starttls.m4
+if [ -f @sysconfdir@/mail/sendmail.mc ]; then
+ if (grep -qEe "^[[:space:]]*include\(\`?@sysconfdir@/mail/starttls.m4" \
+ @sysconfdir@/mail/sendmail.mc); then
+ sed -e "s=^\([[:space:]]*\)\(\`\?\)include(\`\?@sysconfdir@/mail/starttls.m4'\?)\(dnl\)\?=\1\2include(\`@sysconfdir@/mail/tls/starttls.m4')dnl=g" \
+ @sysconfdir@/mail/sendmail.mc > @sysconfdir@/mail/sendmail.mc.new;
+ chown root:smmsp @sysconfdir@/mail/sendmail.mc.new;
+ chmod 0644 @sysconfdir@/mail/sendmail.mc.new;
+ mv @sysconfdir@/mail/sendmail.mc.new @sysconfdir@/mail/sendmail.mc;
+ fi;
+ fi;
+if [ -f @sysconfdir@/mail/submit.mc ]; then
+ if (grep -qEe "^[[:space:]]*include\(\`?@sysconfdir@/mail/starttls.m4" \
+ @sysconfdir@/mail/submit.mc); then
+ sed -e "s=^\([[:space:]]*\)\(\`\?\)include(\`\?@sysconfdir@/mail/starttls.m4'\?)\(dnl\)\?=\1\2include(\`@sysconfdir@/mail/tls/starttls.m4')dnl=g" \
+ @sysconfdir@/mail/submit.mc > @sysconfdir@/mail/submit.mc.new;
+ chown root:smmsp @sysconfdir@/mail/submit.mc.new;
+ chmod 0644 @sysconfdir@/mail/submit.mc.new;
+ mv @sysconfdir@/mail/submit.mc.new @sysconfdir@/mail/submit.mc;
+ fi;
+ fi;
+
+#---------------------------------------------------------------------------
+# check for references to starttls.m4 in sendmail.mc
+if [ -f @sysconfdir@/mail/sendmail.mc ]; then
+ if grep -qEe "^[[:space:]]*include\(\`?@sysconfdir@/mail/tls/starttls.m4" \
+ @sysconfdir@/mail/sendmail.mc; then
+ REFD=1;
+ fi;
+ fi;
+
+#---------------------------------------------------------------------------
+# Make sure prototype /etc/mail/tls/starttls.m4 exists
+if [ -L @sysconfdir@/mail/starttls.m4 ]; then
+ rm @sysconfdir@/mail/starttls.m4;
+ fi;
+if [ -f @sysconfdir@/mail/starttls.m4 ]; then
+ mv @sysconfdir@/mail/starttls.m4 @sysconfdir@/mail/tls/starttls.m4;
+ fi;
+if [ ! -f @sysconfdir@/mail/tls/starttls.m4 ]; then
+ NEW=1;
+ cp -a @datadir@/sendmail/cf/debian/starttls.m4 \
+ @sysconfdir@/mail/tls/starttls.m4;
+ echo ' ';
+ echo 'Created template file @sysconfdir@/mail/tls/starttls.m4';
+ echo 'Edit this file if you wish to change the default tls setup.';
+ fi;
+
+#---------------------------------------------------------------------------
+# check for SSL
+if [ -d "$CERT_DIR" ]; then
+ if [ -f $MTA_CRT -a -f $MSP_CRT ]; then
+ echo 'You already have sendmail certificates';
+ echo ' ';
+ chown root:smmsp $COM_KEY;
+ chown root:smmsp $MTA_CRT;
+ chown root:smmsp $MSP_CRT;
+ else
+ if [ -x @bindir@/openssl ]; then
+ yn="Y";
+ else
+ cat <<-EOT
+ $PROGRAM needs openssl (not installed) to create a
+ certificate to validate users
+
+ If you don't need a certificate, say No
+ If you want a certificate, install openssl and say Yes
+
+ Do you wish to create a certificate?
+ EOT
+ read yn;
+ yn=$(echo -n "$yn" | sed -e "s/^\ *//" -e "s/^\t*//");
+ test -n "$yn" || yn="N";
+ fi;
+
+ # Create new (self-signed) certificate
+ case "$yn" in
+ [Yy]*)
+ echo "Creating SSL certificates for sendmail.";
+ # Create prompt file
+ if [ ! -f @sysconfdir@/mail/tls/no_prompt ]; then
+ cat >@sysconfdir@/mail/tls/no_prompt <<-EOT
+
+
+
+
+
+
+
+ EOT
+ fi;
+
+ # Create config files
+ if [ ! -f $MTA_CFG ]; then
+ create_config;
+ chmod 0600 $MTA_CFG;
+ fi;
+ if [ ! -f $MSP_CFG ]; then
+ sed -e "s/Sendmail Server/Sendmail Client/" \
+ $MTA_CFG > $MSP_CFG;
+ chmod 0600 $MSP_CFG;
+ fi;
+ # Create shared DSA/DH password parameters
+ # Skip this for now...
+ if [ ! -f $COM_PRM ]; then
+ #openssl dsaparam 1024 -out $COM_PRM;
+ #openssl dhparam -dsaparam -in $COM_PRM >> $COM_PRM;
+ touch $COM_PRM;
+ chmod 0600 $COM_PRM;
+ fi;
+ # Create shared DSA/RSA key (RSA preferred for browser support)
+ if [ ! -f $COM_KEY ]; then
+ openssl genrsa -out $COM_KEY 1024;
+ #openssl gendsa -out $COM_KEY $COM_PRM;
+ chown root:smmsp $COM_KEY;
+ chmod 0640 $COM_KEY;
+ fi;
+ # sendmail requires that CN=fqdn
+ # Prompts: 1) Country Name (2 letter code)
+ # 2) State or Province Name
+ # 3) Locality Name (eg, city)
+ # 4) Organization Name (eg, company)
+ # 5) Organizational Unit Name (eg, section)
+ # 6) Common Name (eg, YOUR name)
+ # 7) Email Address
+ if [ ! -f $MTA_CRT ]; then
+ openssl req -new -config $MTA_CFG -key $COM_KEY \
+ -out $MTA_CSR \
+ <@sysconfdir@/mail/tls/no_prompt >/dev/null 2>&1;
+ chmod 0600 $MTA_CSR;
+ openssl x509 -req -extfile $MTA_CFG \
+ -signkey $COM_KEY -in $MTA_CSR \
+ -out $MTA_CRT -days 365 \
+ >/dev/null 2>&1;
+ chown root:smmsp $MTA_CRT;
+ chmod 0644 $MTA_CRT;
+ fi;
+ if [ ! -f $MSP_CRT ]; then
+ openssl req -new -config $MSP_CFG -key $COM_KEY \
+ -out $MSP_CSR \
+ <@sysconfdir@/mail/tls/no_prompt >/dev/null 2>&1;
+ chmod 0600 $MSP_CSR;
+ openssl x509 -req -extfile $MSP_CFG \
+ -signkey $COM_KEY -in $MSP_CSR \
+ -out $MSP_CRT -days 365 \
+ >/dev/null 2>&1;
+ chown root:smmsp $MSP_CRT;
+ chmod 0644 $MSP_CRT;
+ fi;
+ esac;
+ fi;
+
+ # Create hash link for new certificate (must do msp last!)
+ if [ -f $MTA_CRT ]; then
+ LINK="$CERT_DIR/"$(openssl x509 -noout -hash < $MTA_CRT)".0";
+ if [ ! -f $LINK ]; then
+ ln -sf $MTA_CRT $LINK;
+ fi;
+ fi;
+ if [ -f $MSP_CRT ]; then
+ LINK="$CERT_DIR/"$(openssl x509 -noout -hash < $MSP_CRT)".0";
+ if [ ! -f $LINK ]; then
+ ln -sf $MSP_CRT $LINK;
+ fi;
+ fi;
+ fi;
+
+if [ $REFD -eq 0 ]; then
+ cat <<-EOT
+
+ *** *** *** WARNING *** WARNING *** WARNING *** WARNING *** *** ***
+
+ Everything you need to support STARTTLS (encrypted mail transmission
+ and user authentication via certificates) is installed and configured
+ but *IS* not being used.
+
+ To enable sendmail to use STARTTLS, you need to:
+ 1) Add this line to @sysconfdir@/mail/sendmail.mc and optionally
+ to @sysconfdir@/mail/submit.mc:
+ include(\`@sysconfdir@/mail/tls/starttls.m4')dnl
+ 2) Run sendmailconfig
+ 3) Restart sendmail
+
+ EOT
+ fi;
diff --git a/debian/patches/8.12/8.12.3/CAN-2003-0681.patch b/debian/patches/8.12/8.12.3/CAN-2003-0681.patch
new file mode 100644
index 0000000..de31a60
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/CAN-2003-0681.patch
@@ -0,0 +1,87 @@
+Index: parseaddr.c
+===================================================================
+RCS file: /cvs/sendmail/parseaddr.c,v
+retrieving revision 8.359.2.6
+diff -u -r8.359.2.6 parseaddr.c
+--- parseaddr.c 27 Mar 2003 02:39:53 -0000 8.359.2.6
++++ sendmail-8.12.3/sendmail/parseaddr.c 30 Mar 2003 16:41:50 -0000
+@@ -1000,6 +1008,8 @@
+ }
+ if (pvp == NULL)
+ return EX_USAGE;
++ if (maxatom <= 0)
++ return EX_USAGE;
+
+ /*
+ ** Run through the list of rewrite rules, applying
+@@ -1866,6 +1880,7 @@
+ register ENVELOPE *e;
+ {
+ bool tempfail = false;
++ int maxatom;
+ struct mailer **mp;
+ register struct mailer *m;
+ register char *p;
+@@ -1880,6 +1895,7 @@
+ printav(tv);
+ }
+
++ maxatom = MAXATOM;
+ if (a == NULL)
+ a = (ADDRESS *) sm_rpool_malloc_x(e->e_rpool, sizeof *a);
+ memset((char *) a, '\0', sizeof *a);
+@@ -1919,14 +1935,22 @@
+ return a;
+ }
+ mname = *++tv;
++ --maxatom;
+
+ /* extract host and user portions */
+ if (*++tv != NULL && (**tv & 0377) == CANONHOST)
++ {
+ hostp = ++tv;
++ --maxatom;
++ }
+ else
+ hostp = NULL;
++ --maxatom;
+ while (*tv != NULL && (**tv & 0377) != CANONUSER)
++ {
+ tv++;
++ --maxatom;
++ }
+ if (*tv == NULL)
+ {
+ syserr("554 5.3.5 buildaddr: no user");
+@@ -1937,6 +1961,7 @@
+ else if (hostp != NULL)
+ cataddr(hostp, tv - 1, hbuf, sizeof hbuf, '\0');
+ cataddr(++tv, NULL, ubuf, sizeof ubuf, ' ');
++ --maxatom;
+
+ /* save away the host name */
+ if (sm_strcasecmp(mname, "error") == 0)
+@@ -2041,6 +2066,7 @@
+ {
+ p++;
+ tv++;
++ --maxatom;
+ a->q_flags |= QNOTREMOTE;
+ }
+
+@@ -2071,11 +2097,11 @@
+ !bitset(RF_SENDERADDR|RF_HEADERADDR, flags))
+ {
+ /* sender addresses done later */
+- (void) REWRITE(tv, 2, e);
++ (void) rewrite(tv, 2, 0, e, maxatom);
+ if (m->m_re_rwset > 0)
+- (void) REWRITE(tv, m->m_re_rwset, e);
++ (void) rewrite(tv, m->m_re_rwset, 0, e, maxatom);
+ }
+- (void) REWRITE(tv, 4, e);
++ (void) rewrite(tv, 4, 0, e, maxatom);
+
+ /* save the result for the command line/RCPT argument */
+ cataddr(tv, NULL, ubuf, sizeof ubuf, '\0');
+
diff --git a/debian/patches/8.12/8.12.3/CAN-2003-0694.patch b/debian/patches/8.12/8.12.3/CAN-2003-0694.patch
new file mode 100644
index 0000000..bdba504
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/CAN-2003-0694.patch
@@ -0,0 +1,15 @@
+diff -ru build-tree.orig/sendmail-8.12.3/sendmail/parseaddr.c build-tree/sendmail-8.12.3/sendmail/parseaddr.c
+--- build-tree.orig/sendmail-8.12.3/sendmail/parseaddr.c 2003-09-17 10:43:53.000000000 -0400
++++ sendmail-8.12.3/sendmail/parseaddr.c 2003-09-17 10:45:06.000000000 -0400
+@@ -700,7 +700,11 @@
+ addr[MAXNAME] = '\0';
+ returnnull:
+ if (delimptr != NULL)
++ {
++ if (p > addr)
++ p--;
+ *delimptr = p;
++ }
+ CurEnv->e_to = saveto;
+ return NULL;
+ }
diff --git a/debian/patches/8.12/8.12.3/bf.c.8.51 b/debian/patches/8.12/8.12.3/bf.c.8.51
new file mode 100644
index 0000000..fec8d59
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/bf.c.8.51
@@ -0,0 +1,30 @@
+Index: sendmail/bf.c
+diff -u sendmail/bf.c:8.51 sendmail/bf.c:8.52
+--- sendmail/bf.c:8.51 Mon Mar 4 13:51:25 2002
++++ ./sendmail-8.12.3/sendmail/bf.c Thu Apr 11 14:00:15 2002
+@@ -202,12 +202,24 @@
+ ** any value of errno specified by sm_io_setinfo()
+ */
+
++#ifdef __STDC__
++/*
++** XXX This is a temporary hack since MODE_T on HP-UX 10.x is short.
++** If we use K&R here, the compiler will complain about
++** Inconsistent parameter list declaration
++** due to the change from short to int.
++*/
++
+ SM_FILE_T *
++bfopen(char *filename, MODE_T fmode, size_t bsize, long flags)
++#else /* __STDC__ */
++SM_FILE_T *
+ bfopen(filename, fmode, bsize, flags)
+ char *filename;
+ MODE_T fmode;
+ size_t bsize;
+ long flags;
++#endif /* __STDC__ */
+ {
+ MODE_T omask;
+ SM_FILE_T SM_IO_SET_TYPE(vector, BF_FILE_TYPE, sm_bfopen, sm_bfclose,
+
diff --git a/debian/patches/8.12/8.12.3/domain.c.8.181 b/debian/patches/8.12/8.12.3/domain.c.8.181
new file mode 100644
index 0000000..da6a59f
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/domain.c.8.181
@@ -0,0 +1,16 @@
+Index: domain.c
+===================================================================
+RCS file: /cvs/sendmail/domain.c,v
+retrieving revision 8.181
+diff -u -r8.181 domain.c
+--- domain.c 2002/05/24 23:48:42 8.181
++++ ./sendmail-8.12.3/sendmail/domain.c 2002/06/27 15:45:27
+@@ -737,7 +737,7 @@
+ #endif /* _FFR_BESTMX_BETTER_TRUNCATION */
+
+ _res.options &= ~(RES_DNSRCH|RES_DEFNAMES);
+- nmx = getmxrr(name, mxhosts, NULL, false, statp, true, NULL);
++ nmx = getmxrr(name, mxhosts, NULL, false, statp, false, NULL);
+ _res.options = saveopts;
+ if (nmx <= 0)
+ return NULL;
diff --git a/debian/patches/8.12/8.12.3/dpatch.001 b/debian/patches/8.12/8.12.3/dpatch.001
new file mode 100644
index 0000000..972c1c2
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/dpatch.001
@@ -0,0 +1,50 @@
+# Remove -Y from procmail arguements
+#
+# To apply this patch:
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'applypatch' program with this patch file as input.
+#
+# If you do not have 'applypatch', it is part of the 'makepatch' package
+# that you can fetch from the Comprehensive Perl Archive Network:
+# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
+# In the above URL, 'x' should be 2 or higher.
+#
+# To apply this patch without the use of 'applypatch':
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'patch' program with this file as input.
+#
+#### End of Preamble ####
+
+#### Patch data follows ####
+diff -c 'cf/feature/local_procmail.m4' 'debian/patches/local_procmail.m4'
+Index: ./cf/feature/local_procmail.m4
+Prereq: 8.21
+*** sendmail-8.12.3/cf/feature/local_procmail.m4 Sat Nov 20 15:26:21 1999
+--- ./debian/patches/local_procmail.m4 Sat Nov 20 15:39:46 1999
+***************
+*** 27,32 ****
+ `/usr/local/bin/procmail'),
+ _ARG_))
+ define(`LOCAL_MAILER_ARGS',
+! ifelse(len(X`'_ARG2_), `1', `procmail -Y -a $h -d $u', _ARG2_))
+ define(`LOCAL_MAILER_FLAGS',
+ ifelse(len(X`'_ARG3_), `1', `SPfhn9', _ARG3_))
+--- 27,32 ----
+ `/usr/local/bin/procmail'),
+ _ARG_))
+ define(`LOCAL_MAILER_ARGS',
+! ifelse(len(X`'_ARG2_), `1', `procmail -a $h -d $u', _ARG2_))
+ define(`LOCAL_MAILER_FLAGS',
+ ifelse(len(X`'_ARG3_), `1', `SPfhn9', _ARG3_))
+#### End of Patch data ####
+
+#### ApplyPatch data follows ####
+# Data version : 1.0
+# Date generated : Sat Nov 20 15:39:47 1999
+# Generated by : makepatch 2.00
+# Recurse directories : Yes
+# p 'cf/feature/local_procmail.m4' 941
+#### End of ApplyPatch data ####
+
+#### End of Patch kit [created: Sat Nov 20 15:39:47 1999] ####
+#### Checksum: 49 1730 1445 ####
diff --git a/debian/patches/8.12/8.12.3/dpatch.002 b/debian/patches/8.12/8.12.3/dpatch.002
new file mode 100644
index 0000000..6f569d9
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/dpatch.002
@@ -0,0 +1,19 @@
+--- sendmail-8.12.3/cf/mailer/cyrus.m4 Tue May 2 14:40:24 2000
++++ ./debian/patches/cf/mailer/cyrus.m4 Tue May 2 14:41:21 2000
+@@ -36,12 +36,12 @@
+ #
+
+ _DEFIFNOT(`CYRUS_MAILER_FLAGS', `Ah5@/:|')
+-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_PATH',, `define(`CYRUS_MAILER_PATH', /usr/sbin/cyrdeliver)')
++ifdef(`CYRUS_MAILER_ARGS',, `define(`CYRUS_MAILER_ARGS', `cyrdeliver -e -m $h -- $u')')
+ ifdef(`CYRUS_MAILER_USER',, `define(`CYRUS_MAILER_USER', `cyrus:mail')')
+ _DEFIFNOT(`CYRUS_BB_MAILER_FLAGS', `u')
+-ifdef(`CYRUS_BB_MAILER_ARGS',, `define(`CYRUS_BB_MAILER_ARGS', `deliver -e -m $u')')
++ifdef(`CYRUS_BB_MAILER_ARGS',, `define(`CYRUS_BB_MAILER_ARGS', `cyrdeliver -e -m $u')')
+ define(`_CYRUS_QGRP', `ifelse(defn(`CYRUS_MAILER_QGRP'),`',`', ` Q=CYRUS_MAILER_QGRP,')')dnl
+
+ POPDIVERT
+
+
diff --git a/debian/patches/8.12/8.12.3/dpatch.003 b/debian/patches/8.12/8.12.3/dpatch.003
new file mode 100644
index 0000000..511d2b0
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/dpatch.003
@@ -0,0 +1,52 @@
+# Change sendmail call -obq to -obi
+#
+# To apply this patch:
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'applypatch' program with this patch file as input.
+#
+# If you do not have 'applypatch', it is part of the 'makepatch' package
+# that you can fetch from the Comprehensive Perl Archive Network:
+# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
+# In the above URL, 'x' should be 2 or higher.
+#
+# To apply this patch without the use of 'applypatch':
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'patch' program with this file as input.
+#
+#### End of Preamble ####
+
+#### Patch data follows ####
+diff -c 'rmail/rmail.c' 'debian/patches/rmail.c'
+Index: ./rmail/rmail.c
+Prereq: 8.61
+*** sendmail-8.12.3/rmail/rmail.c Sat Sep 16 18:20:25 2000
+--- ./debian/patches/rmail.c Thu Sep 28 17:00:59 2000
+***************
+*** 318,324 ****
+ args[i++] = _PATH_SENDMAIL; /* Build sendmail's argument list. */
+ args[i++] = "-G"; /* relay submission */
+ args[i++] = "-oee"; /* No errors, just status. */
+! args[i++] = "-odq"; /* Queue it, don't try to deliver. */
+ args[i++] = "-oi"; /* Ignore '.' on a line by itself. */
+
+ /* set from system and protocol used */
+--- 318,324 ----
+ args[i++] = _PATH_SENDMAIL; /* Build sendmail's argument list. */
+ args[i++] = "-G"; /* relay submission */
+ args[i++] = "-oee"; /* No errors, just status. */
+! args[i++] = "-odi"; /* deliver in the foreground. */
+ args[i++] = "-oi"; /* Ignore '.' on a line by itself. */
+
+ /* set from system and protocol used */
+#### End of Patch data ####
+
+#### ApplyPatch data follows ####
+# Data version : 1.0
+# Date generated : Thu Sep 28 17:01:04 2000
+# Generated by : makepatch 2.00
+# Recurse directories : Yes
+# p './build-tree/sendmail-8.11.1/rmail/rmail.c' 12072
+#### End of ApplyPatch data ####
+
+#### End of Patch kit [created: Thu Sep 28 17:01:04 2000] ####
+#### Checksum: 51 2010 21691 ####
diff --git a/debian/patches/8.12/8.12.3/dpatch.004 b/debian/patches/8.12/8.12.3/dpatch.004
new file mode 100644
index 0000000..867a195
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/dpatch.004
@@ -0,0 +1,52 @@
+# Make control socket mode 0660
+#
+# To apply this patch:
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'applypatch' program with this patch file as input.
+#
+# If you do not have 'applypatch', it is part of the 'makepatch' package
+# that you can fetch from the Comprehensive Perl Archive Network:
+# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
+# In the above URL, 'x' should be 2 or higher.
+#
+# To apply this patch without the use of 'applypatch':
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'patch' program with this file as input.
+#
+#### End of Preamble ####
+
+#### Patch data follows ####
+diff -c 'sendmail/control.c' 'debian/patches/control.c'
+Index: ./sendmail/control.c
+Prereq: 8.118
+*** sendmail-8.12.3/sendmail/control.c Sat Nov 20 15:26:23 1999
+--- ./debian/patches/control.c Sat Nov 20 15:39:52 1999
+***************
+*** 92,98 ****
+ }
+ }
+
+! if (chmod(ControlSocketName, S_IRUSR|S_IWUSR) < 0)
+ {
+ save_errno = errno;
+ closecontrolsocket(TRUE);
+--- 92,98 ----
+ }
+ }
+
+! if (chmod(ControlSocketName, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) < 0)
+ {
+ save_errno = errno;
+ closecontrolsocket(TRUE);
+#### End of Patch data ####
+
+#### ApplyPatch data follows ####
+# Data version : 1.0
+# Date generated : Sat Nov 20 15:39:53 1999
+# Generated by : makepatch 2.00
+# Recurse directories : Yes
+# p 'sendmail/control.c' 6165
+#### End of ApplyPatch data ####
+
+#### End of Patch kit [created: Sat Nov 20 15:39:53 1999] ####
+#### Checksum: 51 1497 50060 ####
diff --git a/debian/patches/8.12/8.12.3/dpatch.005 b/debian/patches/8.12/8.12.3/dpatch.005
new file mode 100644
index 0000000..c4ba0c5
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/dpatch.005
@@ -0,0 +1,54 @@
+# /usr/bin/faxmail, !/usr/local/bin/faxmail
+#
+# To apply this patch:
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'applypatch' program with this patch file as input.
+#
+# If you do not have 'applypatch', it is part of the 'makepatch' package
+# that you can fetch from the Comprehensive Perl Archive Network:
+# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
+# In the above URL, 'x' should be 2 or higher.
+#
+# To apply this patch without the use of 'applypatch':
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'patch' program with this file as input.
+#
+#### End of Preamble ####
+
+#### Patch data follows ####
+diff -c './cf/mailer/fax.m4' 'fax.m4'
+Index: ./cf/mailer/fax.m4
+Prereq: 8.16
+*** sendmail-8.12.3/cf/mailer/fax.m4 Mon Oct 18 02:35:28 1999
+--- ./fax.m4 Wed Jan 3 14:26:13 2001
+***************
+*** 19,26 ****
+ ifdef(`FAX_MAILER_ARGS',,
+ `define(`FAX_MAILER_ARGS', faxmail -d $u@$h $f)')
+ ifdef(`FAX_MAILER_PATH',,
+! `define(`FAX_MAILER_PATH', /usr/local/bin/faxmail)')
+ ifdef(`FAX_MAILER_MAX',,
+ `define(`FAX_MAILER_MAX', 100000)')
+ define(`_FAX_QGRP', `ifelse(defn(`FAX_MAILER_QGRP'),`',`', ` Q=FAX_MAILER_QGRP,')')dnl
+ POPDIVERT
+--- 19,26 ----
+ ifdef(`FAX_MAILER_ARGS',,
+ `define(`FAX_MAILER_ARGS', faxmail -d $u@$h $f)')
+ ifdef(`FAX_MAILER_PATH',,
+! `define(`FAX_MAILER_PATH', /usr/bin/faxmail)')
+ ifdef(`FAX_MAILER_MAX',,
+ `define(`FAX_MAILER_MAX', 100000)')
+ define(`_FAX_QGRP', `ifelse(defn(`FAX_MAILER_QGRP'),`',`', ` Q=FAX_MAILER_QGRP,')')dnl
+ POPDIVERT
+#### End of Patch data ####
+
+#### ApplyPatch data follows ####
+# Data version : 1.0
+# Date generated : Wed Jan 3 14:27:33 2001
+# Generated by : makepatch 2.00
+# Recurse directories : Yes
+# p '../../build-tree/sendmail-8.11.2/cf/mailer/fax.m4' 1062
+#### End of ApplyPatch data ####
+
+#### End of Patch kit [created: Wed Jan 3 14:27:33 2001] ####
+#### Checksum: 51 1807 4852 ####
diff --git a/debian/patches/8.12/8.12.3/dsa-doublebounce.patch b/debian/patches/8.12/8.12.3/dsa-doublebounce.patch
new file mode 100644
index 0000000..f920d0a
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/dsa-doublebounce.patch
@@ -0,0 +1,20 @@
+diff -u doublebounce.pl.old doublebounce.pl
+--- doublebounce.pl.old Sun Feb 7 05:44:09 1999
++++ ./sendmail-8.12.3/contrib/doublebounce.pl Mon Apr 14 08:46:02 2003
+@@ -26,6 +26,7 @@
+
+
+ use Socket;
++use Fcntl;
+
+ # look for debug flag
+ #
+@@ -45,7 +46,7 @@
+ # I thought about reading it into a buffer here, but some messages
+ # are 10+Mb so a buffer may not be a good idea
+ #
+-if (! open(MSG, "+> $tmp")) {
++if (! sysopen(MSG, "$tmp", O_RDWR|O_CREAT|O_EXCL, 0600)) {
+ # can't open temp file -- send message to local postmaster
+ # open(MAIL, "| /usr/sbin/sendmail -oeq postmaster");
+ print MAIL <STDIN>;
diff --git a/debian/patches/8.12/8.12.3/dsa-expn.patch b/debian/patches/8.12/8.12.3/dsa-expn.patch
new file mode 100644
index 0000000..c24bfaa
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/dsa-expn.patch
@@ -0,0 +1,20 @@
+diff -u expn.old expn
+--- expn.old Sat Apr 5 00:07:36 2003
++++ ./sendmail-8.12.3/contrib/expn.pl Mon Apr 14 08:37:41 2003
+@@ -8,6 +8,7 @@
+
+ use 5.001;
+ use IO::Socket;
++use Fcntl;
+
+ # system requirements:
+ # must have 'nslookup' and 'hostname' programs.
+@@ -999,7 +1000,7 @@
+ }
+
+ $0 = "$av0 - nslookup of $server";
+- open(T,">/tmp/expn$$") || die "open > /tmp/expn$$: $!\n";
++ sysopen(T,"/tmp/expn$$",O_RDWR|O_CREAT|O_EXCL,0600) || die "open > /tmp/expn$$: $!\n";
+ print T "set querytype=MX\n";
+ print T "$server\n";
+ close(T);
diff --git a/debian/patches/8.12/8.12.3/main.c.8.876 b/debian/patches/8.12/8.12.3/main.c.8.876
new file mode 100644
index 0000000..9be7994
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/main.c.8.876
@@ -0,0 +1,17 @@
+Index: main.c
+===================================================================
+RCS file: /cvs/sendmail/main.c,v
+retrieving revision 8.876
+diff -u -r8.876 main.c
+--- ./sendmail-8.12.3/sendmail/main.c 2002/02/27 23:49:52 8.876
++++ main.c 2002/04/10 23:59:28
+@@ -726,6 +726,8 @@
+ (void) sm_signal(SIGPIPE, SIG_IGN);
+ OldUmask = umask(022);
+ FullName = getextenv("NAME");
++ if (FullName != NULL)
++ FullName = newstr(FullName);
+
+ /*
+ ** Initialize name server if it is going to be used.
+
diff --git a/debian/patches/8.12/8.12.3/maxseq.patch b/debian/patches/8.12/8.12.3/maxseq.patch
new file mode 100644
index 0000000..3b2009b
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/maxseq.patch
@@ -0,0 +1,51 @@
+# This is a patch for conf.h to update it to conf.h.new
+#
+# To apply this patch:
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'applypatch' program with this patch file as input.
+#
+# If you do not have 'applypatch', it is part of the 'makepatch' package
+# that you can fetch from the Comprehensive Perl Archive Network:
+# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
+# In the above URL, 'x' should be 2 or higher.
+#
+# To apply this patch without the use of 'applypatch':
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'patch' program with this file as input.
+#
+#### End of Preamble ####
+
+#### Patch data follows ####
+diff -c 'conf.h' 'conf.h.new'
+Index: ./conf.h
+Prereq: 8.560
+*** ./sendmail-8.12.3/sendmail/conf.h Fri Sep 21 19:01:46 2001
+--- ./conf.h.new Wed Oct 10 09:24:41 2001
+***************
+*** 71,76 ****
+ #define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */
+ #define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */
+! #define MAXMAPSTACK 12 /* max # of stacked or sequenced maps */
+ #if MILTER
+ # define MAXFILTERS 25 /* max # of milter filters */
+ # define MAXFILTERMACROS 50 /* max # of macros per milter cmd */
+--- 71,76 ----
+ #define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */
+ #define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */
+! #define MAXMAPSTACK 128 /* max # of stacked or sequenced maps */
+ #if MILTER
+ # define MAXFILTERS 25 /* max # of milter filters */
+ # define MAXFILTERMACROS 50 /* max # of macros per milter cmd */
+#### End of Patch data ####
+
+#### ApplyPatch data follows ####
+# Data version : 1.0
+# Date generated : Wed Oct 10 09:25:12 2001
+# Generated by : makepatch 2.00_03
+# Recurse directories : Yes
+# p 'conf.h' 6809
+#### End of ApplyPatch data ####
+
+#### End of Patch kit [created: Wed Oct 10 09:25:12 2001] ####
+#### Patch checksum: 34 1333 28813 ####
+#### Checksum: 52 2010 19538 ####
diff --git a/debian/patches/8.12/8.12.3/patch.milter.replbody b/debian/patches/8.12/8.12.3/patch.milter.replbody
new file mode 100644
index 0000000..6321210
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/patch.milter.replbody
@@ -0,0 +1,63 @@
+Index: sendmail/bf.c
+diff -u sendmail/bf.c:8.52 sendmail/bf.c:8.53
+--- sendmail/bf.c:8.52 Thu Apr 11 14:00:15 2002
++++ ./sendmail-8.12.3/sendmail/bf.c Sat Apr 13 20:55:07 2002
+@@ -795,11 +795,12 @@
+ errno = EINVAL;
+ return -1;
+ #else /* NOFTRUNCATE */
++ if (lseek(bfp->bf_disk_fd, 0, SEEK_SET) < 0)
++ return -1;
+ return ftruncate(bfp->bf_disk_fd, 0);
+ #endif /* NOFTRUNCATE */
+ }
+- else
+- return 0;
++ return 0;
+ }
+
+ /*
+
+------------------------------------
+Index: sendmail/milter.c
+diff -u sendmail/milter.c:8.195 sendmail/milter.c:8.196
+--- sendmail/milter.c:8.195 Thu Apr 11 10:30:29 2002
++++ ./sendmail-8.12.3/sendmail/milter.c Sat Apr 13 20:55:07 2002
+@@ -2903,8 +2903,6 @@
+ {
+ int err;
+
+-# if NOFTRUNCATE
+- /* XXX: Not much we can do except rewind it */
+ err = sm_io_error(e->e_dfp);
+ (void) sm_io_flush(e->e_dfp, SM_TIME_DEFAULT);
+
+@@ -2920,16 +2918,26 @@
+ /* errno is set implicitly by fseek() before return */
+ err = sm_io_seek(e->e_dfp, SM_TIME_DEFAULT,
+ 0, SEEK_SET);
++ if (err < 0)
++ {
++ MILTER_DF_ERROR("milter_replbody: sm_io_seek %s: %s");
++ return -1;
++ }
++# if NOFTRUNCATE
++ /* XXX: Not much we can do except rewind it */
++ errno = EINVAL;
++ MILTER_DF_ERROR("milter_replbody: ftruncate not available on this platform (%s:%s)");
++ return -1;
+ # else /* NOFTRUNCATE */
+ err = ftruncate(sm_io_getinfo(e->e_dfp,
+ SM_IO_WHAT_FD, NULL),
+ 0);
+-# endif /* NOFTRUNCATE */
+ if (err < 0)
+ {
+ MILTER_DF_ERROR("milter_replbody: sm_io ftruncate %s: %s");
+ return -1;
+ }
++# endif /* NOFTRUNCATE */
+ }
+
+ if (prevsize > e->e_msgsize)
+
diff --git a/debian/patches/8.12/8.12.3/proto.m4.8.646 b/debian/patches/8.12/8.12.3/proto.m4.8.646
new file mode 100644
index 0000000..395cbb0
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/proto.m4.8.646
@@ -0,0 +1,11 @@
+--- proto.m4- Thu Nov 14 17:01:56 2002
++++ ./sendmail-8.12.3/cf/m4/proto.m4 Thu Nov 14 17:02:19 2002
+@@ -2228,7 +2228,7 @@
+ dnl ${client_resolve} should be OK, so go ahead
+ R$* $: <@> $&{client_name}
+ dnl should not be necessary since it has been done for client_addr already
+-R<@> $@ RELAY
++#R<@> $@ RELAY
+ dnl workspace: <@> ${client_name} (not empty)
+ # pass to name server to make hostname canonical
+ R<@> $* $=P $:<?> $1 $2
diff --git a/debian/patches/8.12/8.12.3/proto.m4.8.649.2.13 b/debian/patches/8.12/8.12.3/proto.m4.8.649.2.13
new file mode 100644
index 0000000..2c3a283
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/proto.m4.8.649.2.13
@@ -0,0 +1,18 @@
+Index: proto.m4
+===================================================================
+RCS file: /cvs/cf/m4/proto.m4,v
+retrieving revision 8.649.2.12
+retrieving revision 8.649.2.13
+diff -u -r8.649.2.12 -r8.649.2.13
+--- proto.m4 3 Dec 2002 16:48:37 -0000 8.649.2.12
++++ ./sendmail-8.12.3/cf/m4/proto.m4 4 Dec 2002 00:12:18 -0000 8.649.2.13
+@@ -1761,6 +1761,9 @@
+ dnl workspace: {client_name} $| {client_addr}
+ R$+ $| $+ $: $>D < $1 > <?> <+ Connect> < $2 >
+ dnl workspace: <result-of-lookup> <{client_addr}>
++dnl OR $| $+ if client_name is empty
++R $| $+ $: $>A < $1 > <?> <+ Connect> <> empty client_name
++dnl workspace: <result-of-lookup> <{client_addr}>
+ R<?> <$+> $: $>A < $1 > <?> <+ Connect> <> no: another lookup
+ dnl workspace: <result-of-lookup> (<>|<{client_addr}>)
+ R<?> <$*> $: OK found nothing
diff --git a/debian/patches/8.12/8.12.3/recipient.c.8.330.2.1 b/debian/patches/8.12/8.12.3/recipient.c.8.330.2.1
new file mode 100644
index 0000000..10516b0
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/recipient.c.8.330.2.1
@@ -0,0 +1,17 @@
+Index: recipient.c
+===================================================================
+RCS file: /cvs/sendmail/recipient.c,v
+retrieving revision 8.330
+retrieving revision 8.330.2.1
+diff -u -r8.330 -r8.330.2.1
+--- ./sendmail-8.12.3/sendmail/recipient.c 29 May 2002 18:20:03 -0000 8.330
++++ recipient.c 27 Aug 2002 20:21:02 -0000 8.330.2.1
+@@ -679,7 +679,7 @@
+ ** the current recipient is marked expensive.
+ */
+
+- if (WILL_BE_QUEUED(e->e_sendmode) ||
++ if (UseMSP || WILL_BE_QUEUED(e->e_sendmode) ||
+ (!bitset(EF_SPLIT, e->e_flags) && e->e_ntries == 0 &&
+ FastSplit > 0))
+ sortfn = sorthost;
diff --git a/debian/patches/8.12/8.12.3/security.parsaddr b/debian/patches/8.12/8.12.3/security.parsaddr
new file mode 100644
index 0000000..90daf45
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/security.parsaddr
@@ -0,0 +1,58 @@
+diff -u -Nur --exclude CVS sendmail-8.12.3.orig/sendmail/parseaddr.c sendmail-8.12.3/sendmail/parseaddr.c
+--- sendmail-8.12.3.orig/sendmail/parseaddr.c 2003-04-01 20:52:13.000000000 +0200
++++ sendmail-8.12.3/sendmail/parseaddr.c 2003-04-04 15:59:07.000000000 +0200
+@@ -608,7 +608,7 @@
+ };
+
+
+-#define NOCHAR -1 /* signal nothing in lookahead token */
++#define NOCHAR (-1) /* signal nothing in lookahead token */
+
+ char **
+ prescan(addr, delim, pvpbuf, pvpbsize, delimptr, toktab)
+@@ -694,6 +694,7 @@
+ /* see if there is room */
+ if (q >= &pvpbuf[pvpbsize - 5])
+ {
++ addrtoolong:
+ usrerr("553 5.1.1 Address too long");
+ if (strlen(addr) > MAXNAME)
+ addr[MAXNAME] = '\0';
+@@ -705,11 +706,15 @@
+ }
+
+ /* squirrel it away */
++#if !ALLOW_255
++ if ((char) c == (char) -1 && !tTd(82, 101))
++ c &= 0x7f;
++#endif /* !ALLOW_255 */
+ *q++ = c;
+ }
+
+ /* read a new input character */
+- c = *p++;
++ c = (unsigned char)*p++;
+ if (c == '\0')
+ {
+ /* diagnose and patch up bad syntax */
+@@ -764,6 +769,9 @@
+ }
+ else if (c != '!' || state == QST)
+ {
++ /* see if there is room */
++ if (q >= &pvpbuf[pvpbsize - 5])
++ goto addrtoolong;
+ *q++ = '\\';
+ continue;
+ }
+@@ -849,6 +857,10 @@
+ /* new token */
+ if (tok != q)
+ {
++ /* see if there is room */
++ if (q >= &pvpbuf[pvpbsize - 5])
++ goto addrtoolong;
++
+ *q++ = '\0';
+ if (tTd(22, 36))
+ {
diff --git a/debian/patches/8.12/8.12.3/sendmail.8.12.security.cr.patch b/debian/patches/8.12/8.12.3/sendmail.8.12.security.cr.patch
new file mode 100644
index 0000000..0e62081
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/sendmail.8.12.security.cr.patch
@@ -0,0 +1,462 @@
+--- sendmail/headers.c 13 Jan 2003 19:30:28 -0000 8.266.4.3
++++ ./sendmail-8.12.3/sendmail/headers.c 16 Jan 2003 23:31:17 -0000
+@@ -676,8 +676,8 @@
+ if (buf[0] != '\0')
+ {
+ if (bitset(H_FROM, h->h_flags))
+- expand(crackaddr(buf), buf, sizeof buf,
+- e);
++ expand(crackaddr(buf, e),
++ buf, sizeof buf, e);
+ h->h_value = sm_rpool_strdup_x(e->e_rpool, buf);
+ h->h_flags &= ~H_DEFAULT;
+ }
+@@ -998,7 +998,11 @@
+ ** it and replaces it with "$g". The parse is totally ad hoc
+ ** and isn't even guaranteed to leave something syntactically
+ ** identical to what it started with. However, it does leave
+-** something semantically identical.
++** something semantically identical if possible, else at least
++** syntactically correct.
++**
++** For example, it changes "Real Name <real@example.com> (Comment)"
++** to "Real Name <$g> (Comment)".
+ **
+ ** This algorithm has been cleaned up to handle a wider range
+ ** of cases -- notably quoted and backslash escaped strings.
+@@ -1007,6 +1011,7 @@
+ **
+ ** Parameters:
+ ** addr -- the address to be cracked.
++** e -- the current envelope.
+ **
+ ** Returns:
+ ** a pointer to the new version.
+@@ -1019,28 +1024,50 @@
+ ** be copied if it is to be reused.
+ */
+
++#define SM_HAVE_ROOM ((bp < buflim) && (buflim <= bufend))
++
++/*
++** Append a character to bp if we have room.
++** If not, punt and return $g.
++*/
++
++#define SM_APPEND_CHAR(c) \
++ do \
++ { \
++ if (SM_HAVE_ROOM) \
++ *bp++ = (c); \
++ else \
++ goto returng; \
++ } while (0)
++
++#if MAXNAME < 10
++ERROR MAXNAME must be at least 10
++#endif /* MAXNAME < 10 */
++
+ char *
+-crackaddr(addr)
++crackaddr(addr, e)
+ register char *addr;
++ ENVELOPE *e;
+ {
+ register char *p;
+ register char c;
+- int cmtlev;
+- int realcmtlev;
+- int anglelev, realanglelev;
+- int copylev;
+- int bracklev;
+- bool qmode;
+- bool realqmode;
+- bool skipping;
+- bool putgmac = false;
+- bool quoteit = false;
+- bool gotangle = false;
+- bool gotcolon = false;
++ int cmtlev; /* comment level in input string */
++ int realcmtlev; /* comment level in output string */
++ int anglelev; /* angle level in input string */
++ int copylev; /* 0 == in address, >0 copying */
++ int bracklev; /* bracket level for IPv6 addr check */
++ bool addangle; /* put closing angle in output */
++ bool qmode; /* quoting in original string? */
++ bool realqmode; /* quoting in output string? */
++ bool putgmac = false; /* already wrote $g */
++ bool quoteit = false; /* need to quote next character */
++ bool gotangle = false; /* found first '<' */
++ bool gotcolon = false; /* found a ':' */
+ register char *bp;
+ char *buflim;
+ char *bufhead;
+ char *addrhead;
++ char *bufend;
+ static char buf[MAXNAME + 1];
+
+ if (tTd(33, 1))
+@@ -1055,25 +1082,22 @@
+ ** adjusted later if we find them.
+ */
+
++ buflim = bufend = &buf[sizeof(buf) - 1];
+ bp = bufhead = buf;
+- buflim = &buf[sizeof buf - 7];
+ p = addrhead = addr;
+- copylev = anglelev = realanglelev = cmtlev = realcmtlev = 0;
++ copylev = anglelev = cmtlev = realcmtlev = 0;
+ bracklev = 0;
+- qmode = realqmode = false;
++ qmode = realqmode = addangle = false;
+
+ while ((c = *p++) != '\0')
+ {
+ /*
+- ** If the buffer is overful, go into a special "skipping"
+- ** mode that tries to keep legal syntax but doesn't actually
+- ** output things.
++ ** Try to keep legal syntax using spare buffer space
++ ** (maintained by buflim).
+ */
+
+- skipping = bp >= buflim;
+-
+- if (copylev > 0 && !skipping)
+- *bp++ = c;
++ if (copylev > 0)
++ SM_APPEND_CHAR(c);
+
+ /* check for backslash escapes */
+ if (c == '\\')
+@@ -1088,8 +1112,8 @@
+ p--;
+ goto putg;
+ }
+- if (copylev > 0 && !skipping)
+- *bp++ = c;
++ if (copylev > 0)
++ SM_APPEND_CHAR(c);
+ goto putg;
+ }
+
+@@ -1097,8 +1121,14 @@
+ if (c == '"' && cmtlev <= 0)
+ {
+ qmode = !qmode;
+- if (copylev > 0 && !skipping)
++ if (copylev > 0 && SM_HAVE_ROOM)
++ {
++ if (realqmode)
++ buflim--;
++ else
++ buflim++;
+ realqmode = !realqmode;
++ }
+ continue;
+ }
+ if (qmode)
+@@ -1110,15 +1140,15 @@
+ cmtlev++;
+
+ /* allow space for closing paren */
+- if (!skipping)
++ if (SM_HAVE_ROOM)
+ {
+ buflim--;
+ realcmtlev++;
+ if (copylev++ <= 0)
+ {
+ if (bp != bufhead)
+- *bp++ = ' ';
+- *bp++ = c;
++ SM_APPEND_CHAR(' ');
++ SM_APPEND_CHAR(c);
+ }
+ }
+ }
+@@ -1128,7 +1158,7 @@
+ {
+ cmtlev--;
+ copylev--;
+- if (!skipping)
++ if (SM_HAVE_ROOM)
+ {
+ realcmtlev--;
+ buflim++;
+@@ -1139,7 +1169,7 @@
+ else if (c == ')')
+ {
+ /* syntax error: unmatched ) */
+- if (copylev > 0 && !skipping)
++ if (copylev > 0 && SM_HAVE_ROOM)
+ bp--;
+ }
+
+@@ -1157,7 +1187,7 @@
+
+ /*
+ ** Check for DECnet phase IV ``::'' (host::user)
+- ** or ** DECnet phase V ``:.'' syntaxes. The latter
++ ** or DECnet phase V ``:.'' syntaxes. The latter
+ ** covers ``user@DEC:.tay.myhost'' and
+ ** ``DEC:.tay.myhost::user'' syntaxes (bletch).
+ */
+@@ -1166,10 +1196,10 @@
+ {
+ if (cmtlev <= 0 && !qmode)
+ quoteit = true;
+- if (copylev > 0 && !skipping)
++ if (copylev > 0)
+ {
+- *bp++ = c;
+- *bp++ = *p;
++ SM_APPEND_CHAR(c);
++ SM_APPEND_CHAR(*p);
+ }
+ p++;
+ goto putg;
+@@ -1180,41 +1210,43 @@
+ bp = bufhead;
+ if (quoteit)
+ {
+- *bp++ = '"';
++ SM_APPEND_CHAR('"');
+
+ /* back up over the ':' and any spaces */
+ --p;
+- while (isascii(*--p) && isspace(*p))
++ while (p > addr &&
++ isascii(*--p) && isspace(*p))
+ continue;
+ p++;
+ }
+ for (q = addrhead; q < p; )
+ {
+ c = *q++;
+- if (bp < buflim)
++ if (quoteit && c == '"')
+ {
+- if (quoteit && c == '"')
+- *bp++ = '\\';
+- *bp++ = c;
++ SM_APPEND_CHAR('\\');
++ SM_APPEND_CHAR(c);
+ }
++ else
++ SM_APPEND_CHAR(c);
+ }
+ if (quoteit)
+ {
+ if (bp == &bufhead[1])
+ bp--;
+ else
+- *bp++ = '"';
++ SM_APPEND_CHAR('"');
+ while ((c = *p++) != ':')
+- {
+- if (bp < buflim)
+- *bp++ = c;
+- }
+- *bp++ = c;
++ SM_APPEND_CHAR(c);
++ SM_APPEND_CHAR(c);
+ }
+
+ /* any trailing white space is part of group: */
+- while (isascii(*p) && isspace(*p) && bp < buflim)
+- *bp++ = *p++;
++ while (isascii(*p) && isspace(*p))
++ {
++ SM_APPEND_CHAR(*p);
++ p++;
++ }
+ copylev = 0;
+ putgmac = quoteit = false;
+ bufhead = bp;
+@@ -1223,10 +1255,7 @@
+ }
+
+ if (c == ';' && copylev <= 0 && !ColonOkInAddr)
+- {
+- if (bp < buflim)
+- *bp++ = c;
+- }
++ SM_APPEND_CHAR(c);
+
+ /* check for characters that may have to be quoted */
+ if (strchr(MustQuoteChars, c) != NULL)
+@@ -1254,42 +1283,45 @@
+
+ /* oops -- have to change our mind */
+ anglelev = 1;
+- if (!skipping)
+- realanglelev = 1;
++ if (SM_HAVE_ROOM)
++ {
++ if (!addangle)
++ buflim--;
++ addangle = true;
++ }
+
+ bp = bufhead;
+ if (quoteit)
+ {
+- *bp++ = '"';
++ SM_APPEND_CHAR('"');
+
+ /* back up over the '<' and any spaces */
+ --p;
+- while (isascii(*--p) && isspace(*p))
++ while (p > addr &&
++ isascii(*--p) && isspace(*p))
+ continue;
+ p++;
+ }
+ for (q = addrhead; q < p; )
+ {
+ c = *q++;
+- if (bp < buflim)
++ if (quoteit && c == '"')
+ {
+- if (quoteit && c == '"')
+- *bp++ = '\\';
+- *bp++ = c;
++ SM_APPEND_CHAR('\\');
++ SM_APPEND_CHAR(c);
+ }
++ else
++ SM_APPEND_CHAR(c);
+ }
+ if (quoteit)
+ {
+ if (bp == &buf[1])
+ bp--;
+ else
+- *bp++ = '"';
++ SM_APPEND_CHAR('"');
+ while ((c = *p++) != '<')
+- {
+- if (bp < buflim)
+- *bp++ = c;
+- }
+- *bp++ = c;
++ SM_APPEND_CHAR(c);
++ SM_APPEND_CHAR(c);
+ }
+ copylev = 0;
+ putgmac = quoteit = false;
+@@ -1301,13 +1333,14 @@
+ if (anglelev > 0)
+ {
+ anglelev--;
+- if (!skipping)
++ if (SM_HAVE_ROOM)
+ {
+- realanglelev--;
+- buflim++;
++ if (addangle)
++ buflim++;
++ addangle = false;
+ }
+ }
+- else if (!skipping)
++ else if (SM_HAVE_ROOM)
+ {
+ /* syntax error: unmatched > */
+ if (copylev > 0)
+@@ -1316,7 +1349,7 @@
+ continue;
+ }
+ if (copylev++ <= 0)
+- *bp++ = c;
++ SM_APPEND_CHAR(c);
+ continue;
+ }
+
+@@ -1324,30 +1357,42 @@
+ putg:
+ if (copylev <= 0 && !putgmac)
+ {
+- if (bp > bufhead && bp[-1] == ')')
+- *bp++ = ' ';
+- *bp++ = MACROEXPAND;
+- *bp++ = 'g';
++ if (bp > buf && bp[-1] == ')')
++ SM_APPEND_CHAR(' ');
++ SM_APPEND_CHAR(MACROEXPAND);
++ SM_APPEND_CHAR('g');
+ putgmac = true;
+ }
+ }
+
+ /* repair any syntactic damage */
+- if (realqmode)
++ if (realqmode && bp < bufend)
+ *bp++ = '"';
+- while (realcmtlev-- > 0)
++ while (realcmtlev-- > 0 && bp < bufend)
+ *bp++ = ')';
+- while (realanglelev-- > 0)
++ if (addangle && bp < bufend)
+ *bp++ = '>';
+- *bp++ = '\0';
++ *bp = '\0';
++ if (bp < bufend)
++ goto success;
++
++ returng:
++ /* String too long, punt */
++ buf[0] = '<';
++ buf[1] = MACROEXPAND;
++ buf[2]= 'g';
++ buf[3] = '>';
++ buf[4]= '\0';
++ sm_syslog(LOG_ALERT, e->e_id,
++ "Dropped invalid comments from header address");
+
++ success:
+ if (tTd(33, 1))
+ {
+ sm_dprintf("crackaddr=>`");
+ xputs(buf);
+ sm_dprintf("'\n");
+ }
+-
+ return buf;
+ }
+ /*
+--- sendmail/main.c 8 Jan 2003 23:09:59 -0000 8.887.2.17
++++ ./sendmail-8.12.3/sendmail/main.c 14 Jan 2003 02:38:58 -0000
+@@ -4423,7 +4423,7 @@
+ "Usage: /parse address\n");
+ return;
+ }
+- q = crackaddr(p);
++ q = crackaddr(p, e);
+ (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
+ "Cracked address = ");
+ xputs(q);
+--- sendmail/parseaddr.c 26 Sep 2002 23:03:39 -0000 8.359.2.3
++++ ./sendmail-8.12.3/sendmail/parseaddr.c 14 Jan 2003 02:38:58 -0000
+@@ -2509,7 +2509,7 @@
+ if (bitset(RF_CANONICAL, flags) || bitnset(M_NOCOMMENT, m->m_flags))
+ fancy = "\201g";
+ else
+- fancy = crackaddr(name);
++ fancy = crackaddr(name, e);
+
+ /*
+ ** Turn the name into canonical form.
+--- sendmail/sendmail.h 12 Dec 2002 22:46:35 -0000 8.919.2.15
++++ ./sendmail-8.12.3/sendmail/sendmail.h 14 Jan 2003 02:38:58 -0000
+@@ -394,7 +394,7 @@
+
+ /* functions */
+ extern void cataddr __P((char **, char **, char *, int, int));
+-extern char *crackaddr __P((char *));
++extern char *crackaddr __P((char *, ENVELOPE *));
+ extern bool emptyaddr __P((ADDRESS *));
+ extern ADDRESS *getctladdr __P((ADDRESS *));
+ extern int include __P((char *, bool, ADDRESS *, ADDRESS **, int, ENVELOPE *));
+
diff --git a/debian/patches/8.12/8.12.3/smrsh-20020924.patch b/debian/patches/8.12/8.12.3/smrsh-20020924.patch
new file mode 100644
index 0000000..d9f4c93
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/smrsh-20020924.patch
@@ -0,0 +1,63 @@
+Index: smrsh.c
+===================================================================
+RCS file: /cvs/smrsh/smrsh.c,v
+retrieving revision 8.58
+diff -u -r8.58 smrsh.c
+--- ./sendmail-8.12.3/smrsh/smrsh.c 25 May 2002 02:41:31 -0000 8.58
++++ smrsh.c 24 Sep 2002 23:58:16 -0000
+@@ -57,6 +57,8 @@
+ #include <sm/limits.h>
+ #include <sm/string.h>
+ #include <sys/file.h>
++#include <sys/types.h>
++#include <sys/stat.h>
+ #include <string.h>
+ #include <ctype.h>
+ #include <errno.h>
+@@ -145,6 +147,7 @@
+ char *newenv[2];
+ char pathbuf[1000];
+ char specialbuf[32];
++ struct stat st;
+
+ #ifndef DEBUG
+ # ifndef LOG_MAIL
+@@ -302,6 +305,38 @@
+ (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
+ "Trying %s\n", cmdbuf);
+ #endif /* DEBUG */
++ if (stat(cmdbuf, &st) < 0)
++ {
++ /* can't stat it */
++ (void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
++ "%s: %s not available for sendmail programs (stat failed)\n",
++ prg, cmd);
++ if (p != NULL)
++ *p = ' ';
++#ifndef DEBUG
++ syslog(LOG_CRIT, "uid %d: attempt to use %s (stat failed)",
++ (int) getuid(), cmd);
++#endif /* ! DEBUG */
++ exit(EX_UNAVAILABLE);
++ }
++ if (!S_ISREG(st.st_mode)
++#ifdef S_ISLNK
++ && !S_ISLNK(st.st_mode)
++#endif /* S_ISLNK */
++ )
++ {
++ /* can't stat it */
++ (void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
++ "%s: %s not available for sendmail programs (not a file)\n",
++ prg, cmd);
++ if (p != NULL)
++ *p = ' ';
++#ifndef DEBUG
++ syslog(LOG_CRIT, "uid %d: attempt to use %s (not a file)",
++ (int) getuid(), cmd);
++#endif /* ! DEBUG */
++ exit(EX_UNAVAILABLE);
++ }
+ if (access(cmdbuf, X_OK) < 0)
+ {
+ /* oops.... crack attack possiblity */
diff --git a/debian/patches/8.12/8.12.3/socks.patch b/debian/patches/8.12/8.12.3/socks.patch
new file mode 100644
index 0000000..61b3046
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/socks.patch
@@ -0,0 +1,50 @@
+# This is a patch for conf.c to update it to conf.c.new
+#
+# To apply this patch:
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'applypatch' program with this patch file as input.
+#
+# If you do not have 'applypatch', it is part of the 'makepatch' package
+# that you can fetch from the Comprehensive Perl Archive Network:
+# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
+# In the above URL, 'x' should be 2 or higher.
+#
+# To apply this patch without the use of 'applypatch':
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'patch' program with this file as input.
+#
+#### End of Preamble ####
+
+#### Patch data follows ####
+diff -c 'conf.c' 'conf.c.new'
+Index: ./conf.c
+Prereq: 8.961
+*** ./sendmail-8.12.3/sendmail/conf.c Thu May 17 14:19:41 2001
+--- ./sendmail/conf.c.new Wed May 23 13:01:15 2001
+***************
+*** 3760,3765 ****
+--- 3760,3770 ----
+ vendor_post_defaults(e)
+ ENVELOPE *e;
+ {
++ char *p;
++ if ((p = getenv("LD_PRELOAD")))
++ setuserenv("LD_PRELOAD", p);
++ if ((p = getenv("LD_LIBRARY_PATH")))
++ setuserenv("LD_LIBRARY_PATH", p);
+ #ifdef __QNX__
+ char *p;
+
+#### End of Patch data ####
+
+#### ApplyPatch data follows ####
+# Data version : 1.0
+# Date generated : Wed May 23 13:02:56 2001
+# Generated by : makepatch 2.00_03
+# Recurse directories : Yes
+# p 'conf.c' 130464
+#### End of ApplyPatch data ####
+
+#### End of Patch kit [created: Wed May 23 13:02:56 2001] ####
+#### Patch checksum: 30 772 52154 ####
+#### Checksum: 48 1448 42818 ####
diff --git a/debian/patches/8.12/8.12.3/z_CVE-2006-0058.patch b/debian/patches/8.12/8.12.3/z_CVE-2006-0058.patch
new file mode 100644
index 0000000..a81a583
--- /dev/null
+++ b/debian/patches/8.12/8.12.3/z_CVE-2006-0058.patch
@@ -0,0 +1,2768 @@
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/libsm/fflush.c sendmail-8.12.3/libsm/fflush.c
+--- sendmail-8.12.3.orig/libsm/fflush.c 2001-09-11 06:04:48.000000000 +0200
++++ sendmail-8.12.3/libsm/fflush.c 2006-03-22 22:42:44.000000000 +0100
+@@ -145,6 +145,7 @@ sm_flush(fp, timeout)
+ return SM_IO_EOF;
+ }
+ SM_IO_WR_TIMEOUT(fp, fd, *timeout);
++ t = 0;
+ }
+ }
+ return 0;
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/libsm/local.h sendmail-8.12.3/libsm/local.h
+--- sendmail-8.12.3.orig/libsm/local.h 2002-02-20 03:40:24.000000000 +0100
++++ sendmail-8.12.3/libsm/local.h 2006-03-22 22:42:45.000000000 +0100
+@@ -193,7 +193,7 @@ extern const char SmFileMagic[];
+ else \
+ { \
+ (time)->tv_sec = (val) / 1000; \
+- (time)->tv_usec = ((val) - ((time)->tv_sec * 1000)) * 10; \
++ (time)->tv_usec = ((val) - ((time)->tv_sec * 1000)) * 1000; \
+ } \
+ if ((val) == SM_TIME_FOREVER) \
+ { \
+@@ -277,7 +277,7 @@ extern const char SmFileMagic[];
+ else \
+ { \
+ sm_io_to.tv_sec = (to) / 1000; \
+- sm_io_to.tv_usec = ((to) - (sm_io_to.tv_sec * 1000)) * 10; \
++ sm_io_to.tv_usec = ((to) - (sm_io_to.tv_sec * 1000)) * 1000; \
+ } \
+ FD_ZERO(&sm_io_to_mask); \
+ FD_SET((fd), &sm_io_to_mask); \
+@@ -285,8 +285,11 @@ extern const char SmFileMagic[];
+ FD_SET((fd), &sm_io_x_mask); \
+ if (gettimeofday(&sm_io_to_before, NULL) < 0) \
+ return SM_IO_EOF; \
+- sm_io_to_sel = select((fd) + 1, NULL, &sm_io_to_mask, &sm_io_x_mask, \
+- &sm_io_to); \
++ do \
++ { \
++ sm_io_to_sel = select((fd) + 1, NULL, &sm_io_to_mask, \
++ &sm_io_x_mask, &sm_io_to); \
++ } while (sm_io_to_sel < 0 && errno == EINTR); \
+ if (sm_io_to_sel < 0) \
+ { \
+ /* something went wrong, errno set */ \
+@@ -301,10 +304,9 @@ extern const char SmFileMagic[];
+ /* else loop again */ \
+ if (gettimeofday(&sm_io_to_after, NULL) < 0) \
+ return SM_IO_EOF; \
+- timersub(&sm_io_to_before, &sm_io_to_after, &sm_io_to_diff); \
+- timersub(&sm_io_to, &sm_io_to_diff, &sm_io_to); \
+- (to) -= (sm_io_to.tv_sec * 1000); \
+- (to) -= (sm_io_to.tv_usec / 10); \
++ timersub(&sm_io_to_after, &sm_io_to_before, &sm_io_to_diff); \
++ (to) -= (sm_io_to_diff.tv_sec * 1000); \
++ (to) -= (sm_io_to_diff.tv_usec / 1000); \
+ if ((to) < 0) \
+ (to) = 0; \
+ }
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/libsm/refill.c sendmail-8.12.3/libsm/refill.c
+--- sendmail-8.12.3.orig/libsm/refill.c 2001-09-11 06:04:49.000000000 +0200
++++ sendmail-8.12.3/libsm/refill.c 2006-03-22 22:42:45.000000000 +0100
+@@ -71,8 +71,11 @@ static int sm_lflush __P((SM_FILE_T *, i
+ FD_SET((fd), &sm_io_x_mask); \
+ if (gettimeofday(&sm_io_to_before, NULL) < 0) \
+ return SM_IO_EOF; \
+- (sel_ret) = select((fd) + 1, &sm_io_to_mask, NULL, \
+- &sm_io_x_mask, (to)); \
++ do \
++ { \
++ (sel_ret) = select((fd) + 1, &sm_io_to_mask, NULL, \
++ &sm_io_x_mask, (to)); \
++ } while ((sel_ret) < 0 && errno == EINTR); \
+ if ((sel_ret) < 0) \
+ { \
+ /* something went wrong, errno set */ \
+@@ -89,7 +92,7 @@ static int sm_lflush __P((SM_FILE_T *, i
+ /* calulate wall-clock time used */ \
+ if (gettimeofday(&sm_io_to_after, NULL) < 0) \
+ return SM_IO_EOF; \
+- timersub(&sm_io_to_before, &sm_io_to_after, &sm_io_to_diff); \
++ timersub(&sm_io_to_after, &sm_io_to_before, &sm_io_to_diff); \
+ timersub((to), &sm_io_to_diff, (to)); \
+ }
+
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/collect.c sendmail-8.12.3/sendmail/collect.c
+--- sendmail-8.12.3.orig/sendmail/collect.c 2002-03-15 02:32:47.000000000 +0100
++++ sendmail-8.12.3/sendmail/collect.c 2006-03-22 22:47:28.000000000 +0100
+@@ -15,7 +15,6 @@
+
+ SM_RCSID("@(#)$Id: collect.c,v 8.241 2002/03/15 01:32:47 gshapiro Exp $")
+
+-static void collecttimeout __P((time_t));
+ static void dferror __P((SM_FILE_T *volatile, char *, ENVELOPE *));
+ static void eatfrom __P((char *volatile, ENVELOPE *));
+ static void collect_doheader __P((ENVELOPE *));
+@@ -263,10 +262,6 @@ collect_dfopen(e)
+ ** If data file cannot be created, the process is terminated.
+ */
+
+-static jmp_buf CtxCollectTimeout;
+-static bool volatile CollectProgress;
+-static SM_EVENT *volatile CollectTimeout = NULL;
+-
+ /* values for input state machine */
+ #define IS_NORM 0 /* middle of line */
+ #define IS_BOL 1 /* beginning of line */
+@@ -288,26 +283,30 @@ collect(fp, smtpmode, hdrp, e)
+ register ENVELOPE *e;
+ {
+ register SM_FILE_T *volatile df;
+- volatile bool ignrdot;
+- volatile time_t dbto;
++ bool ignrdot;
++ int dbto;
+ register char *volatile bp;
+- volatile int c;
+- volatile bool inputerr;
++ int c;
++ bool inputerr;
+ bool headeronly;
+- char *volatile buf;
+- volatile int buflen;
+- volatile int istate;
+- volatile int mstate;
+- volatile int hdrslen;
+- volatile int numhdrs;
+- volatile int afd;
+- unsigned char *volatile pbp;
++ char *buf;
++ int buflen;
++ int istate;
++ int mstate;
++ int hdrslen;
++ int numhdrs;
++ int afd;
++ unsigned char *pbp;
+ unsigned char peekbuf[8];
+ char bufbuf[MAXLINE];
+
+ df = NULL;
+ ignrdot = smtpmode ? false : IgnrDot;
+- dbto = smtpmode ? TimeOuts.to_datablock : 0;
++
++ /* timeout for I/O functions is in milliseconds */
++ dbto = smtpmode ? ((int) TimeOuts.to_datablock * 1000)
++ : SM_TIME_FOREVER;
++ sm_io_setinfo(fp, SM_IO_WHAT_TIMEOUT, &dbto);
+ c = SM_IO_EOF;
+ inputerr = false;
+ headeronly = hdrp != NULL;
+@@ -319,7 +318,6 @@ collect(fp, smtpmode, hdrp, e)
+ pbp = peekbuf;
+ istate = IS_BOL;
+ mstate = SaveFrom ? MS_HEADER : MS_UFROM;
+- CollectProgress = false;
+
+ /*
+ ** Tell ARPANET to go ahead.
+@@ -340,22 +338,6 @@ collect(fp, smtpmode, hdrp, e)
+ ** the larger picture (e.g., header versus body).
+ */
+
+- if (dbto != 0)
+- {
+- /* handle possible input timeout */
+- if (setjmp(CtxCollectTimeout) != 0)
+- {
+- if (LogLevel > 2)
+- sm_syslog(LOG_NOTICE, e->e_id,
+- "timeout waiting for input from %s during message collect",
+- CURHOSTNAME);
+- errno = 0;
+- usrerr("451 4.4.1 timeout waiting for input during message collect");
+- goto readerr;
+- }
+- CollectTimeout = sm_setevent(dbto, collecttimeout, dbto);
+- }
+-
+ e->e_msgsize = 0;
+ for (;;)
+ {
+@@ -378,9 +360,26 @@ collect(fp, smtpmode, hdrp, e)
+ sm_io_clearerr(fp);
+ continue;
+ }
++
++ /* timeout? */
++ if (c == SM_IO_EOF && errno == EAGAIN
++ && smtpmode)
++ {
++ /*
++ ** Override e_message in
++ ** usrerr() as this is the
++ ** reason for failure that
++ ** should be logged for
++ ** undelivered recipients.
++ */
++
++ e->e_message = NULL;
++ errno = 0;
++ inputerr = true;
++ goto readabort;
++ }
+ break;
+ }
+- CollectProgress = true;
+ if (TrafficLogFile != NULL && !headeronly)
+ {
+ if (istate == IS_BOL)
+@@ -523,6 +522,18 @@ bufferchar:
+ buflen *= 2;
+ else
+ buflen += MEMCHUNKSIZE;
++ if (buflen <= 0)
++ {
++ sm_syslog(LOG_NOTICE, e->e_id,
++ "header overflow from %s during message collect",
++ CURHOSTNAME);
++ errno = 0;
++ e->e_flags |= EF_CLRQUEUE;
++ e->e_status = "5.6.0";
++ usrerrenh(e->e_status,
++ "552 Headers too large");
++ goto discard;
++ }
+ buf = xalloc(buflen);
+ memmove(buf, obuf, bp - obuf);
+ bp = &buf[bp - obuf];
+@@ -566,6 +577,7 @@ bufferchar:
+ usrerrenh(e->e_status,
+ "552 Headers too large (%d max)",
+ MaxHeadersLength);
++ discard:
+ mstate = MS_DISCARD;
+ }
+ }
+@@ -605,6 +617,24 @@ nextstate:
+ sm_io_clearerr(fp);
+ errno = 0;
+ c = sm_io_getc(fp, SM_TIME_DEFAULT);
++
++ /* timeout? */
++ if (c == SM_IO_EOF && errno == EAGAIN
++ && smtpmode)
++ {
++ /*
++ ** Override e_message in
++ ** usrerr() as this is the
++ ** reason for failure that
++ ** should be logged for
++ ** undelivered recipients.
++ */
++
++ e->e_message = NULL;
++ errno = 0;
++ inputerr = true;
++ goto readabort;
++ }
+ } while (c == SM_IO_EOF && errno == EINTR);
+ if (c != SM_IO_EOF)
+ (void) sm_io_ungetc(fp, SM_TIME_DEFAULT, c);
+@@ -614,6 +644,11 @@ nextstate:
+ continue;
+ }
+
++ SM_ASSERT(bp > buf);
++
++ /* guaranteed by isheader(buf) */
++ SM_ASSERT(*(bp - 1) != '\n' || bp > buf + 1);
++
+ /* trim off trailing CRLF or NL */
+ if (*--bp != '\n' || *--bp != '\r')
+ bp++;
+@@ -680,10 +715,6 @@ readerr:
+ inputerr = true;
+ }
+
+- /* reset global timer */
+- if (CollectTimeout != NULL)
+- sm_clrevent(CollectTimeout);
+-
+ if (headeronly)
+ return;
+
+@@ -761,6 +792,7 @@ readerr:
+ }
+
+ /* An EOF when running SMTP is an error */
++ readabort:
+ if (inputerr && (OpMode == MD_SMTP || OpMode == MD_DAEMON))
+ {
+ char *host;
+@@ -782,13 +814,14 @@ readerr:
+ problem, host,
+ shortenstring(e->e_from.q_paddr, MAXSHORTSTR));
+ if (sm_io_eof(fp))
+- usrerr("451 4.4.1 collect: %s on connection from %s, from=%s",
++ usrerr("421 4.4.1 collect: %s on connection from %s, from=%s",
+ problem, host,
+ shortenstring(e->e_from.q_paddr, MAXSHORTSTR));
+ else
+- syserr("451 4.4.1 collect: %s on connection from %s, from=%s",
++ syserr("421 4.4.1 collect: %s on connection from %s, from=%s",
+ problem, host,
+ shortenstring(e->e_from.q_paddr, MAXSHORTSTR));
++ flush_errors(true);
+
+ /* don't return an error indication */
+ e->e_to = NULL;
+@@ -862,39 +895,6 @@ readerr:
+ markstats(e, (ADDRESS *) NULL, STATS_NORMAL);
+ }
+
+-static void
+-collecttimeout(timeout)
+- time_t timeout;
+-{
+- int save_errno = errno;
+-
+- /*
+- ** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD
+- ** ANYTHING TO THIS ROUTINE UNLESS YOU KNOW WHAT YOU ARE
+- ** DOING.
+- */
+-
+- if (CollectProgress)
+- {
+- /* reset the timeout */
+- CollectTimeout = sm_sigsafe_setevent(timeout, collecttimeout,
+- timeout);
+- CollectProgress = false;
+- }
+- else
+- {
+- /* event is done */
+- CollectTimeout = NULL;
+- }
+-
+- /* if no progress was made or problem resetting event, die now */
+- if (CollectTimeout == NULL)
+- {
+- errno = ETIMEDOUT;
+- longjmp(CtxCollectTimeout, 1);
+- }
+- errno = save_errno;
+-}
+ /*
+ ** DFERROR -- signal error on writing the data file.
+ **
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/conf.c sendmail-8.12.3/sendmail/conf.c
+--- sendmail-8.12.3.orig/sendmail/conf.c 2006-03-22 22:27:15.000000000 +0100
++++ sendmail-8.12.3/sendmail/conf.c 2006-03-22 22:42:45.000000000 +0100
+@@ -5145,8 +5145,8 @@ sm_syslog(level, id, fmt, va_alist)
+ va_dcl
+ #endif /* __STDC__ */
+ {
+- static char *buf = NULL;
+- static size_t bufsize;
++ char *buf;
++ size_t bufsize;
+ char *begin, *end;
+ int save_errno;
+ int seq = 1;
+@@ -5170,11 +5170,8 @@ sm_syslog(level, id, fmt, va_alist)
+ else
+ idlen = strlen(id) + SyslogPrefixLen;
+
+- if (buf == NULL)
+- {
+- buf = buf0;
+- bufsize = sizeof buf0;
+- }
++ buf = buf0;
++ bufsize = sizeof buf0;
+
+ for (;;)
+ {
+@@ -5216,8 +5213,8 @@ sm_syslog(level, id, fmt, va_alist)
+ (void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
+ "%s: %s\n", id, newstring);
+ #endif /* LOG */
+- if (buf == buf0)
+- buf = NULL;
++ if (buf != buf0)
++ sm_free(buf);
+ errno = save_errno;
+ return;
+ }
+@@ -5281,8 +5278,8 @@ sm_syslog(level, id, fmt, va_alist)
+ (void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
+ "%s[%d]: %s\n", id, seq, begin);
+ #endif /* LOG */
+- if (buf == buf0)
+- buf = NULL;
++ if (buf != buf0)
++ sm_free(buf);
+ errno = save_errno;
+ }
+ /*
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/deliver.c sendmail-8.12.3/sendmail/deliver.c
+--- sendmail-8.12.3.orig/sendmail/deliver.c 2002-03-23 19:30:40.000000000 +0100
++++ sendmail-8.12.3/sendmail/deliver.c 2006-03-22 23:32:26.000000000 +0100
+@@ -3179,16 +3179,33 @@ do_transfer:
+ }
+ else if (!clever)
+ {
++ bool ok;
++
+ /*
+ ** Format and send message.
+ */
+
+- putfromline(mci, e);
+- (*e->e_puthdr)(mci, e->e_header, e, M87F_OUTER);
+- (*e->e_putbody)(mci, e, NULL);
++ rcode = EX_OK;
++ errno = 0;
++ ok = putfromline(mci, e);
++ if (ok)
++ ok = (*e->e_puthdr)(mci, e->e_header, e, M87F_OUTER);
++ if (ok)
++ ok = (*e->e_putbody)(mci, e, NULL);
++
++ /*
++ ** Ignore an I/O error that was caused by EPIPE.
++ ** Some broken mailers don't read the entire body
++ ** but just exit() thus causing an I/O error.
++ */
++
++ if (!ok && (sm_io_error(mci->mci_out) && errno == EPIPE))
++ ok = true;
+
+- /* get the exit status */
++ /* (always) get the exit status */
+ rcode = endmailer(mci, e, pv);
++ if (!ok)
++ rcode = EX_TEMPFAIL;
+ if (rcode == EX_TEMPFAIL && SmtpError[0] == '\0')
+ {
+ /*
+@@ -4335,13 +4352,13 @@ logdelivery(m, mci, dsn, status, ctladdr
+ ** e -- the envelope.
+ **
+ ** Returns:
+-** none
++** true iff line was written successfully
+ **
+ ** Side Effects:
+ ** outputs some text to fp.
+ */
+
+-void
++bool
+ putfromline(mci, e)
+ register MCI *mci;
+ ENVELOPE *e;
+@@ -4351,7 +4368,7 @@ putfromline(mci, e)
+ char xbuf[MAXLINE];
+
+ if (bitnset(M_NHDR, mci->mci_mailer->m_flags))
+- return;
++ return true;
+
+ mci->mci_flags |= MCIF_INHEADER;
+
+@@ -4392,8 +4409,9 @@ putfromline(mci, e)
+ }
+ }
+ expand(template, buf, sizeof buf, e);
+- putxline(buf, strlen(buf), mci, PXLF_HEADER);
++ return putxline(buf, strlen(buf), mci, PXLF_HEADER);
+ }
++
+ /*
+ ** PUTBODY -- put the body of a message.
+ **
+@@ -4404,7 +4422,7 @@ putfromline(mci, e)
+ ** not be permitted in the resulting message.
+ **
+ ** Returns:
+-** none.
++** true iff message was written successfully
+ **
+ ** Side Effects:
+ ** The message is written onto fp.
+@@ -4415,13 +4433,15 @@ putfromline(mci, e)
+ #define OS_CR 1 /* read a carriage return */
+ #define OS_INLINE 2 /* putting rest of line */
+
+-void
++bool
+ putbody(mci, e, separator)
+ register MCI *mci;
+ register ENVELOPE *e;
+ char *separator;
+ {
+ bool dead = false;
++ bool ioerr = false;
++ int save_errno;
+ char buf[MAXLINE];
+ #if MIME8TO7
+ char *boundaries[MAXMIMENESTING + 1];
+@@ -4451,10 +4471,12 @@ putbody(mci, e, separator)
+ {
+ if (bitset(MCIF_INHEADER, mci->mci_flags))
+ {
+- putline("", mci);
++ if (!putline("", mci))
++ goto writeerr;
+ mci->mci_flags &= ~MCIF_INHEADER;
+ }
+- putline("<<< No Message Collected >>>", mci);
++ if (!putline("<<< No Message Collected >>>", mci))
++ goto writeerr;
+ goto endofmessage;
+ }
+
+@@ -4483,26 +4505,31 @@ putbody(mci, e, separator)
+ */
+
+ /* make sure it looks like a MIME message */
+- if (hvalue("MIME-Version", e->e_header) == NULL)
+- putline("MIME-Version: 1.0", mci);
++ if (hvalue("MIME-Version", e->e_header) == NULL &&
++ !putline("MIME-Version: 1.0", mci))
++ goto writeerr;
+
+ if (hvalue("Content-Type", e->e_header) == NULL)
+ {
+ (void) sm_snprintf(buf, sizeof buf,
+ "Content-Type: text/plain; charset=%s",
+ defcharset(e));
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+
+ /* now do the hard work */
+ boundaries[0] = NULL;
+ mci->mci_flags |= MCIF_INHEADER;
+- (void) mime8to7(mci, e->e_header, e, boundaries, M87F_OUTER);
++ if (mime8to7(mci, e->e_header, e, boundaries, M87F_OUTER) ==
++ SM_IO_EOF)
++ goto writeerr;
+ }
+ # if MIME7TO8
+ else if (bitset(MCIF_CVT7TO8, mci->mci_flags))
+ {
+- (void) mime7to8(mci, e->e_header, e);
++ if (!mime7to8(mci, e->e_header, e))
++ goto writeerr;
+ }
+ # endif /* MIME7TO8 */
+ else if (MaxMimeHeaderLength > 0 || MaxMimeFieldLength > 0)
+@@ -4524,8 +4551,9 @@ putbody(mci, e, separator)
+ if (bitset(EF_DONT_MIME, e->e_flags))
+ SuprErrs = true;
+
+- (void) mime8to7(mci, e->e_header, e, boundaries,
+- M87F_OUTER|M87F_NO8TO7);
++ if (mime8to7(mci, e->e_header, e, boundaries,
++ M87F_OUTER|M87F_NO8TO7) == SM_IO_EOF)
++ goto writeerr;
+
+ /* restore SuprErrs */
+ SuprErrs = oldsuprerrs;
+@@ -4545,7 +4573,8 @@ putbody(mci, e, separator)
+
+ if (bitset(MCIF_INHEADER, mci->mci_flags))
+ {
+- putline("", mci);
++ if (!putline("", mci))
++ goto writeerr;
+ mci->mci_flags &= ~MCIF_INHEADER;
+ }
+
+@@ -4636,11 +4665,6 @@ putbody(mci, e, separator)
+ dead = true;
+ continue;
+ }
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+ pos++;
+ }
+ for (xp = buf; xp < bp; xp++)
+@@ -4653,11 +4677,6 @@ putbody(mci, e, separator)
+ dead = true;
+ break;
+ }
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+ }
+ if (dead)
+ continue;
+@@ -4668,11 +4687,6 @@ putbody(mci, e, separator)
+ mci->mci_mailer->m_eol)
+ == SM_IO_EOF)
+ break;
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+ pos = 0;
+ }
+ else
+@@ -4702,11 +4716,6 @@ putbody(mci, e, separator)
+ mci->mci_mailer->m_eol)
+ == SM_IO_EOF)
+ continue;
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+
+ if (TrafficLogFile != NULL)
+ {
+@@ -4763,11 +4772,6 @@ putch:
+ dead = true;
+ continue;
+ }
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+ pos++;
+ continue;
+ }
+@@ -4783,11 +4787,6 @@ putch:
+ dead = true;
+ continue;
+ }
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+
+ if (TrafficLogFile != NULL)
+ {
+@@ -4811,11 +4810,6 @@ putch:
+ mci->mci_mailer->m_eol)
+ == SM_IO_EOF)
+ continue;
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+ pos = 0;
+ ostate = OS_HEAD;
+ }
+@@ -4833,11 +4827,6 @@ putch:
+ dead = true;
+ continue;
+ }
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+ pos++;
+ ostate = OS_INLINE;
+ }
+@@ -4864,11 +4853,6 @@ putch:
+ dead = true;
+ break;
+ }
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+ }
+ pos += bp - buf;
+ }
+@@ -4878,11 +4862,9 @@ putch:
+ (void) sm_io_fputs(TrafficLogFile,
+ SM_TIME_DEFAULT,
+ mci->mci_mailer->m_eol);
+- (void) sm_io_fputs(mci->mci_out, SM_TIME_DEFAULT,
+- mci->mci_mailer->m_eol);
+-
+- /* record progress for DATA timeout */
+- DataProgress = true;
++ if (sm_io_fputs(mci->mci_out, SM_TIME_DEFAULT,
++ mci->mci_mailer->m_eol) == SM_IO_EOF)
++ goto writeerr;
+ }
+ }
+
+@@ -4892,6 +4874,7 @@ putch:
+ qid_printqueue(e->e_dfqgrp, e->e_dfqdir),
+ DATAFL_LETTER, e->e_id);
+ ExitStat = EX_IOERR;
++ ioerr = true;
+ }
+
+ endofmessage:
+@@ -4906,23 +4889,35 @@ endofmessage:
+ ** offset to match.
+ */
+
++ save_errno = errno;
+ if (e->e_dfp != NULL)
+ (void) bfrewind(e->e_dfp);
+
+ /* some mailers want extra blank line at end of message */
+ if (!dead && bitnset(M_BLANKEND, mci->mci_mailer->m_flags) &&
+ buf[0] != '\0' && buf[0] != '\n')
+- putline("", mci);
++ {
++ if (!putline("", mci))
++ goto writeerr;
++ }
+
+- (void) sm_io_flush(mci->mci_out, SM_TIME_DEFAULT);
+- if (sm_io_error(mci->mci_out) && errno != EPIPE)
++ if (!dead &&
++ (sm_io_flush(mci->mci_out, SM_TIME_DEFAULT) == SM_IO_EOF ||
++ (sm_io_error(mci->mci_out) && errno != EPIPE)))
+ {
++ save_errno = errno;
+ syserr("putbody: write error");
+ ExitStat = EX_IOERR;
++ ioerr = true;
+ }
+
+- errno = 0;
++ errno = save_errno;
++ return !dead && !ioerr;
++
++ writeerr:
++ return false;
+ }
++
+ /*
+ ** MAILFILE -- Send a message to a file.
+ **
+@@ -5447,14 +5442,14 @@ mailfile(filename, mailer, ctladdr, sffl
+ }
+ #endif /* MIME7TO8 */
+
+- putfromline(&mcibuf, e);
+- (*e->e_puthdr)(&mcibuf, e->e_header, e, M87F_OUTER);
+- (*e->e_putbody)(&mcibuf, e, NULL);
+- putline("\n", &mcibuf);
+- if (sm_io_flush(f, SM_TIME_DEFAULT) != 0 ||
++ if (!putfromline(&mcibuf, e) ||
++ !(*e->e_puthdr)(&mcibuf, e->e_header, e, M87F_OUTER) ||
++ !(*e->e_putbody)(&mcibuf, e, NULL) ||
++ !putline("\n", &mcibuf) ||
++ (sm_io_flush(f, SM_TIME_DEFAULT) != 0 ||
+ (SuperSafe != SAFE_NO &&
+ fsync(sm_io_getinfo(f, SM_IO_WHAT_FD, NULL)) < 0) ||
+- sm_io_error(f))
++ sm_io_error(f)))
+ {
+ setstat(EX_IOERR);
+ #if !NOFTRUNCATE
+@@ -6011,66 +6006,19 @@ ssl_retry:
+ if ((result = SSL_connect(clt_ssl)) <= 0)
+ {
+ int i;
+- bool timedout;
+- time_t left;
+- time_t now = curtime();
+- struct timeval tv;
+-
+- /* what to do in this case? */
+- i = SSL_get_error(clt_ssl, result);
++ int ssl_err;
+
+- /*
+- ** For SSL_ERROR_WANT_{READ,WRITE}:
+- ** There is not a complete SSL record available yet
+- ** or there is only a partial SSL record removed from
+- ** the network (socket) buffer into the SSL buffer.
+- ** The SSL_connect will only succeed when a full
+- ** SSL record is available (assuming a "real" error
+- ** doesn't happen). To handle when a "real" error
+- ** does happen the select is set for exceptions too.
+- ** The connection may be re-negotiated during this time
+- ** so both read and write "want errors" need to be handled.
+- ** A select() exception loops back so that a proper SSL
+- ** error message can be gotten.
+- */
++ ssl_err = SSL_get_error(clt_ssl, result);
++ i = tls_retry(clt_ssl, rfd, wfd, tlsstart,
++ TimeOuts.to_starttls, ssl_err, "client");
++ if (i > 0)
++ goto ssl_retry;
+
+- left = TimeOuts.to_starttls - (now - tlsstart);
+- timedout = left <= 0;
+- if (!timedout)
+- {
+- tv.tv_sec = left;
+- tv.tv_usec = 0;
+- }
+-
+- if (!timedout && i == SSL_ERROR_WANT_READ)
+- {
+- fd_set ssl_maskr, ssl_maskx;
+-
+- FD_ZERO(&ssl_maskr);
+- FD_SET(rfd, &ssl_maskr);
+- FD_ZERO(&ssl_maskx);
+- FD_SET(rfd, &ssl_maskx);
+- if (select(rfd + 1, &ssl_maskr, NULL, &ssl_maskx, &tv)
+- > 0)
+- goto ssl_retry;
+- }
+- if (!timedout && i == SSL_ERROR_WANT_WRITE)
+- {
+- fd_set ssl_maskw, ssl_maskx;
+-
+- FD_ZERO(&ssl_maskw);
+- FD_SET(wfd, &ssl_maskw);
+- FD_ZERO(&ssl_maskx);
+- FD_SET(rfd, &ssl_maskx);
+- if (select(wfd + 1, NULL, &ssl_maskw, &ssl_maskx, &tv)
+- > 0)
+- goto ssl_retry;
+- }
+ if (LogLevel > 5)
+ {
+ sm_syslog(LOG_ERR, e->e_id,
+- "STARTTLS=client, error: connect failed=%d, SSL_error=%d, timedout=%d",
+- result, i, (int) timedout);
++ "STARTTLS=client, error: connect failed=%d, SSL_error=%d, errno=%d",
++ result, i, errno);
+ if (LogLevel > 8)
+ tlslogerr("client");
+ }
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/headers.c sendmail-8.12.3/sendmail/headers.c
+--- sendmail-8.12.3.orig/sendmail/headers.c 2006-03-22 22:27:15.000000000 +0100
++++ sendmail-8.12.3/sendmail/headers.c 2006-03-22 22:59:58.000000000 +0100
+@@ -17,7 +17,7 @@ SM_RCSID("@(#)$Id: headers.c,v 8.266 200
+
+ static size_t fix_mime_header __P((char *));
+ static int priencode __P((char *));
+-static void put_vanilla_header __P((HDR *, char *, MCI *));
++static bool put_vanilla_header __P((HDR *, char *, MCI *));
+
+ /*
+ ** SETUPHEADERS -- initialize headers in symbol table
+@@ -849,7 +849,6 @@ logsender(e, msgid)
+ char *name;
+ register char *sbp;
+ register char *p;
+- int l;
+ char hbuf[MAXNAME + 1];
+ char sbuf[MAXLINE + 1];
+ char mbuf[MAXNAME + 1];
+@@ -858,6 +857,8 @@ logsender(e, msgid)
+ /* XXX do we still need this? sm_syslog() replaces control chars */
+ if (msgid != NULL)
+ {
++ size_t l;
++
+ l = strlen(msgid);
+ if (l > sizeof mbuf - 1)
+ l = sizeof mbuf - 1;
+@@ -1401,13 +1402,13 @@ crackaddr(addr, e)
+ ** flags -- MIME conversion flags.
+ **
+ ** Returns:
+-** none.
++** success
+ **
+ ** Side Effects:
+ ** none.
+ */
+
+-void
++bool
+ putheader(mci, hdr, e, flags)
+ register MCI *mci;
+ HDR *hdr;
+@@ -1527,7 +1528,8 @@ putheader(mci, hdr, e, flags)
+ {
+ if (tTd(34, 11))
+ sm_dprintf("\n");
+- put_vanilla_header(h, p, mci);
++ if (!put_vanilla_header(h, p, mci))
++ goto writeerr;
+ continue;
+ }
+
+@@ -1586,7 +1588,8 @@ putheader(mci, hdr, e, flags)
+ /* no other recipient headers: truncate value */
+ (void) sm_strlcpyn(obuf, sizeof obuf, 2,
+ h->h_field, ":");
+- putline(obuf, mci);
++ if (!putline(obuf, mci))
++ goto writeerr;
+ }
+ continue;
+ }
+@@ -1605,7 +1608,8 @@ putheader(mci, hdr, e, flags)
+ }
+ else
+ {
+- put_vanilla_header(h, p, mci);
++ if (!put_vanilla_header(h, p, mci))
++ goto writeerr;
+ }
+ }
+
+@@ -1622,18 +1626,25 @@ putheader(mci, hdr, e, flags)
+ !bitset(MCIF_CVT8TO7|MCIF_CVT7TO8|MCIF_INMIME, mci->mci_flags) &&
+ hvalue("MIME-Version", e->e_header) == NULL)
+ {
+- putline("MIME-Version: 1.0", mci);
++ if (!putline("MIME-Version: 1.0", mci))
++ goto writeerr;
+ if (hvalue("Content-Type", e->e_header) == NULL)
+ {
+ (void) sm_snprintf(obuf, sizeof obuf,
+ "Content-Type: text/plain; charset=%s",
+ defcharset(e));
+- putline(obuf, mci);
++ if (!putline(obuf, mci))
++ goto writeerr;
+ }
+- if (hvalue("Content-Transfer-Encoding", e->e_header) == NULL)
+- putline("Content-Transfer-Encoding: 8bit", mci);
++ if (hvalue("Content-Transfer-Encoding", e->e_header) == NULL
++ && !putline("Content-Transfer-Encoding: 8bit", mci))
++ goto writeerr;
+ }
+ #endif /* MIME8TO7 */
++ return true;
++
++ writeerr:
++ return false;
+ }
+ /*
+ ** PUT_VANILLA_HEADER -- output a fairly ordinary header
+@@ -1644,10 +1655,10 @@ putheader(mci, hdr, e, flags)
+ ** mci -- the connection info for output
+ **
+ ** Returns:
+-** none.
++** success
+ */
+
+-static void
++static bool
+ put_vanilla_header(h, v, mci)
+ HDR *h;
+ char *v;
+@@ -1672,7 +1683,8 @@ put_vanilla_header(h, v, mci)
+ l = SPACELEFT(obuf, obp) - 1;
+
+ (void) sm_snprintf(obp, SPACELEFT(obuf, obp), "%.*s", l, v);
+- putxline(obuf, strlen(obuf), mci, putflags);
++ if (!putxline(obuf, strlen(obuf), mci, putflags))
++ goto writeerr;
+ v += l + 1;
+ obp = obuf;
+ if (*v != ' ' && *v != '\t')
+@@ -1680,7 +1692,10 @@ put_vanilla_header(h, v, mci)
+ }
+ (void) sm_snprintf(obp, SPACELEFT(obuf, obp), "%.*s",
+ (int) (SPACELEFT(obuf, obp) - 1), v);
+- putxline(obuf, strlen(obuf), mci, putflags);
++ return putxline(obuf, strlen(obuf), mci, putflags);
++
++ writeerr:
++ return false;
+ }
+ /*
+ ** COMMAIZE -- output a header field, making a comma-translated list.
+@@ -1693,13 +1708,13 @@ put_vanilla_header(h, v, mci)
+ ** e -- the envelope containing the message.
+ **
+ ** Returns:
+-** none.
++** success
+ **
+ ** Side Effects:
+ ** outputs "p" to file "fp".
+ */
+
+-void
++bool
+ commaize(h, p, oldstyle, mci, e)
+ register HDR *h;
+ register char *p;
+@@ -1817,13 +1832,6 @@ commaize(h, p, oldstyle, mci, e)
+ }
+ name = denlstring(name, false, true);
+
+- /*
+- ** record data progress so DNS timeouts
+- ** don't cause DATA timeouts
+- */
+-
+- DataProgress = true;
+-
+ /* output the name with nice formatting */
+ opos += strlen(name);
+ if (!firstone)
+@@ -1831,7 +1839,8 @@ commaize(h, p, oldstyle, mci, e)
+ if (opos > omax && !firstone)
+ {
+ (void) sm_strlcpy(obp, ",\n", SPACELEFT(obuf, obp));
+- putxline(obuf, strlen(obuf), mci, putflags);
++ if (!putxline(obuf, strlen(obuf), mci, putflags))
++ goto writeerr;
+ obp = obuf;
+ (void) sm_strlcpy(obp, " ", sizeof obp);
+ opos = strlen(obp);
+@@ -1849,8 +1858,14 @@ commaize(h, p, oldstyle, mci, e)
+ firstone = false;
+ *p = savechar;
+ }
+- *obp = '\0';
+- putxline(obuf, strlen(obuf), mci, putflags);
++ if (obp < &obuf[sizeof obuf])
++ *obp = '\0';
++ else
++ obuf[sizeof obuf - 1] = '\0';
++ return putxline(obuf, strlen(obuf), mci, putflags);
++
++ writeerr:
++ return false;
+ }
+ /*
+ ** COPYHEADER -- copy header list
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/mime.c sendmail-8.12.3/sendmail/mime.c
+--- sendmail-8.12.3.orig/sendmail/mime.c 2002-03-13 08:28:05.000000000 +0100
++++ sendmail-8.12.3/sendmail/mime.c 2006-03-22 23:06:09.000000000 +0100
+@@ -81,6 +81,7 @@ static bool MapNLtoCRLF;
+ ** MBT_FINAL -- the final boundary
+ ** MBT_INTERMED -- an intermediate boundary
+ ** MBT_NOTSEP -- an end of file
++** SM_IO_EOF -- I/O error occurred
+ */
+
+ struct args
+@@ -293,7 +294,8 @@ mime8to7(mci, header, e, boundaries, fla
+ mci->mci_flags |= MCIF_INMIME;
+
+ /* skip the early "comment" prologue */
+- putline("", mci);
++ if (!putline("", mci))
++ goto writeerr;
+ mci->mci_flags &= ~MCIF_INHEADER;
+ bt = MBT_FINAL;
+ while (sm_io_fgets(e->e_dfp, SM_TIME_DEFAULT, buf, sizeof buf)
+@@ -302,8 +304,9 @@ mime8to7(mci, header, e, boundaries, fla
+ bt = mimeboundary(buf, boundaries);
+ if (bt != MBT_NOTSEP)
+ break;
+- putxline(buf, strlen(buf), mci,
+- PXLF_MAPFROM|PXLF_STRIP8BIT);
++ if (!putxline(buf, strlen(buf), mci,
++ PXLF_MAPFROM|PXLF_STRIP8BIT))
++ goto writeerr;
+ if (tTd(43, 99))
+ sm_dprintf(" ...%s", buf);
+ }
+@@ -314,19 +317,24 @@ mime8to7(mci, header, e, boundaries, fla
+ auto HDR *hdr = NULL;
+
+ (void) sm_strlcpyn(buf, sizeof buf, 2, "--", bbuf);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ if (tTd(43, 35))
+ sm_dprintf(" ...%s\n", buf);
+ collect(e->e_dfp, false, &hdr, e);
+ if (tTd(43, 101))
+ putline("+++after collect", mci);
+- putheader(mci, hdr, e, flags);
++ if (!putheader(mci, hdr, e, flags))
++ goto writeerr;
+ if (tTd(43, 101))
+ putline("+++after putheader", mci);
+ bt = mime8to7(mci, hdr, e, boundaries, flags);
++ if (bt == SM_IO_EOF)
++ goto writeerr;
+ }
+ (void) sm_strlcpyn(buf, sizeof buf, 3, "--", bbuf, "--");
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ if (tTd(43, 35))
+ sm_dprintf(" ...%s\n", buf);
+ boundaries[i] = NULL;
+@@ -339,8 +347,9 @@ mime8to7(mci, header, e, boundaries, fla
+ bt = mimeboundary(buf, boundaries);
+ if (bt != MBT_NOTSEP)
+ break;
+- putxline(buf, strlen(buf), mci,
+- PXLF_MAPFROM|PXLF_STRIP8BIT);
++ if (!putxline(buf, strlen(buf), mci,
++ PXLF_MAPFROM|PXLF_STRIP8BIT))
++ goto writeerr;
+ if (tTd(43, 99))
+ sm_dprintf(" ...%s", buf);
+ }
+@@ -368,17 +377,20 @@ mime8to7(mci, header, e, boundaries, fla
+ {
+ auto HDR *hdr = NULL;
+
+- putline("", mci);
++ if (!putline("", mci))
++ goto writeerr;
+
+ mci->mci_flags |= MCIF_INMIME;
+ collect(e->e_dfp, false, &hdr, e);
+ if (tTd(43, 101))
+ putline("+++after collect", mci);
+- putheader(mci, hdr, e, flags);
++ if (!putheader(mci, hdr, e, flags))
++ goto writeerr;
+ if (tTd(43, 101))
+ putline("+++after putheader", mci);
+ if (hvalue("MIME-Version", hdr) == NULL)
+- putline("MIME-Version: 1.0", mci);
++ if (!putline("MIME-Version: 1.0", mci))
++ goto writeerr;
+ bt = mime8to7(mci, hdr, e, boundaries, flags);
+ mci->mci_flags &= ~MCIF_INMIME;
+ return bt;
+@@ -474,11 +486,13 @@ mime8to7(mci, header, e, boundaries, fla
+
+ (void) sm_snprintf(buf, sizeof buf,
+ "Content-Transfer-Encoding: %.200s", cte);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ if (tTd(43, 36))
+ sm_dprintf(" ...%s\n", buf);
+ }
+- putline("", mci);
++ if (!putline("", mci))
++ goto writeerr;
+ mci->mci_flags &= ~MCIF_INHEADER;
+ while (sm_io_fgets(e->e_dfp, SM_TIME_DEFAULT, buf, sizeof buf)
+ != NULL)
+@@ -486,7 +500,8 @@ mime8to7(mci, header, e, boundaries, fla
+ bt = mimeboundary(buf, boundaries);
+ if (bt != MBT_NOTSEP)
+ break;
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+ if (sm_io_eof(e->e_dfp))
+ bt = MBT_FINAL;
+@@ -499,12 +514,13 @@ mime8to7(mci, header, e, boundaries, fla
+
+ if (tTd(43, 36))
+ sm_dprintf(" ...Content-Transfer-Encoding: base64\n");
+- putline("Content-Transfer-Encoding: base64", mci);
++ if (!putline("Content-Transfer-Encoding: base64", mci))
++ goto writeerr;
+ (void) sm_snprintf(buf, sizeof buf,
+ "X-MIME-Autoconverted: from 8bit to base64 by %s id %s",
+ MyHostName, e->e_id);
+- putline(buf, mci);
+- putline("", mci);
++ if (!putline(buf, mci) || !putline("", mci))
++ goto writeerr;
+ mci->mci_flags &= ~MCIF_INHEADER;
+ while ((c1 = mime_getchar_crlf(e->e_dfp, boundaries, &bt)) !=
+ SM_IO_EOF)
+@@ -512,7 +528,8 @@ mime8to7(mci, header, e, boundaries, fla
+ if (linelen > 71)
+ {
+ *bp = '\0';
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ linelen = 0;
+ bp = buf;
+ }
+@@ -542,7 +559,8 @@ mime8to7(mci, header, e, boundaries, fla
+ *bp++ = Base64Code[c2 & 0x3f];
+ }
+ *bp = '\0';
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+ else
+ {
+@@ -565,12 +583,14 @@ mime8to7(mci, header, e, boundaries, fla
+
+ if (tTd(43, 36))
+ sm_dprintf(" ...Content-Transfer-Encoding: quoted-printable\n");
+- putline("Content-Transfer-Encoding: quoted-printable", mci);
++ if (!putline("Content-Transfer-Encoding: quoted-printable",
++ mci))
++ goto writeerr;
+ (void) sm_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);
++ if (!putline(buf, mci) || !putline("", mci))
++ goto writeerr;
+ mci->mci_flags &= ~MCIF_INHEADER;
+ fromstate = 0;
+ c2 = '\n';
+@@ -592,7 +612,8 @@ mime8to7(mci, header, e, boundaries, fla
+ *bp++ = Base16Code['.' & 0x0f];
+ }
+ *bp = '\0';
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ linelen = fromstate = 0;
+ bp = buf;
+ c2 = c1;
+@@ -621,7 +642,8 @@ mime8to7(mci, header, e, boundaries, fla
+ c2 = '\n';
+ *bp++ = '=';
+ *bp = '\0';
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ linelen = fromstate = 0;
+ bp = buf;
+ if (c2 == '.')
+@@ -659,13 +681,17 @@ mime8to7(mci, header, e, boundaries, fla
+ if (linelen > 0 || boundaries[0] != NULL)
+ {
+ *bp = '\0';
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+
+ }
+ if (tTd(43, 3))
+ sm_dprintf("\t\t\tmime8to7=>%s (basic)\n", MimeBoundaryNames[bt]);
+ return bt;
++
++ writeerr:
++ return SM_IO_EOF;
+ }
+ /*
+ ** MIME_GETCHAR -- get a character for MIME processing
+@@ -948,7 +974,7 @@ static int mime_fromqp __P((unsigned cha
+ ** e -- envelope.
+ **
+ ** Returns:
+-** none.
++** true iff body was written successfully
+ */
+
+ static char index_64[128] =
+@@ -965,7 +991,7 @@ static char index_64[128] =
+
+ # define CHAR64(c) (((c) < 0 || (c) > 127) ? -1 : index_64[(c)])
+
+-void
++bool
+ mime7to8(mci, header, e)
+ register MCI *mci;
+ HDR *header;
+@@ -998,25 +1024,31 @@ mime7to8(mci, header, e)
+ {
+ (void) sm_snprintf(buf, sizeof buf,
+ "Content-Transfer-Encoding: %s", p);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+- putline("", mci);
++ if (!putline("", mci))
++ goto writeerr;
+ mci->mci_flags &= ~MCIF_INHEADER;
+ while (sm_io_fgets(e->e_dfp, SM_TIME_DEFAULT, buf, sizeof buf)
+ != NULL)
+- putline(buf, mci);
+- return;
++ {
++ if (!putline(buf, mci))
++ goto writeerr;
++ }
++ return true;
+ }
+ cataddr(pvp, NULL, buf, sizeof buf, '\0');
+ cte = sm_rpool_strdup_x(e->e_rpool, buf);
+
+ mci->mci_flags |= MCIF_INHEADER;
+- putline("Content-Transfer-Encoding: 8bit", mci);
++ if (!putline("Content-Transfer-Encoding: 8bit", mci))
++ goto writeerr;
+ (void) sm_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);
++ if (!putline(buf, mci) || !putline("", mci))
++ goto writeerr;
+ mci->mci_flags &= ~MCIF_INHEADER;
+
+ /*
+@@ -1130,8 +1162,11 @@ again:
+ continue;
+
+ if (fbufp - fbuf > 0)
+- putxline((char *) fbuf, fbufp - fbuf - 1, mci,
+- pxflags);
++ {
++ if (!putxline((char *) fbuf, fbufp - fbuf - 1,
++ mci, pxflags))
++ goto writeerr;
++ }
+ fbufp = fbuf;
+ if (off >= 0 && buf[off] != '\0')
+ {
+@@ -1147,7 +1182,8 @@ again:
+ if (fbufp > fbuf)
+ {
+ *fbufp = '\0';
+- putxline((char *) fbuf, fbufp - fbuf, mci, pxflags);
++ if (!putxline((char *) fbuf, fbufp - fbuf, mci, pxflags))
++ goto writeerr;
+ }
+
+ /*
+@@ -1157,10 +1193,15 @@ again:
+ ** but so is auto-converting MIME in the first place.
+ */
+
+- putline("", mci);
++ if (!putline("", mci))
++ goto writeerr;
+
+ if (tTd(43, 3))
+ sm_dprintf("\t\t\tmime7to8 => %s to 8bit done\n", cte);
++ return true;
++
++ writeerr:
++ return false;
+ }
+ /*
+ ** The following is based on Borenstein's "codes.c" module, with simplifying
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/parseaddr.c sendmail-8.12.3/sendmail/parseaddr.c
+--- sendmail-8.12.3.orig/sendmail/parseaddr.c 2006-03-22 22:27:15.000000000 +0100
++++ sendmail-8.12.3/sendmail/parseaddr.c 2006-03-22 22:42:45.000000000 +0100
+@@ -1330,7 +1330,7 @@ rewrite(pvp, ruleset, reclevel, e, maxat
+ /* $&x replacement */
+ char *mval = macvalue(rp[1], e);
+ char **xpvp;
+- int trsize = 0;
++ size_t trsize = 0;
+ static size_t pvpb1_size = 0;
+ static char **pvpb1 = NULL;
+ char pvpbuf[PSBUFSIZE];
+@@ -1345,7 +1345,7 @@ rewrite(pvp, ruleset, reclevel, e, maxat
+ /* save the remainder of the input */
+ for (xpvp = pvp; *xpvp != NULL; xpvp++)
+ trsize += sizeof *xpvp;
+- if ((size_t) trsize > pvpb1_size)
++ if (trsize > pvpb1_size)
+ {
+ if (pvpb1 != NULL)
+ sm_free(pvpb1);
+@@ -1400,7 +1400,7 @@ rewrite(pvp, ruleset, reclevel, e, maxat
+ {
+ char **hbrvp;
+ char **xpvp;
+- int trsize;
++ size_t trsize;
+ char *replac;
+ int endtoken;
+ STAB *map;
+@@ -1489,7 +1489,7 @@ rewrite(pvp, ruleset, reclevel, e, maxat
+ *++arg_rvp = NULL;
+
+ /* save the remainder of the input string */
+- trsize = (int) (avp - rvp + 1) * sizeof *rvp;
++ trsize = (avp - rvp + 1) * sizeof *rvp;
+ memmove((char *) pvpb1, (char *) rvp, trsize);
+
+ /* look it up */
+@@ -2924,7 +2924,7 @@ rscheck(rwset, p1, p2, e, rmcomm, cnt, l
+ char *logid;
+ {
+ char *volatile buf;
+- int bufsize;
++ size_t bufsize;
+ int saveexitstat;
+ int volatile rstat = EX_OK;
+ char **pvp;
+@@ -3138,7 +3138,7 @@ rscap(rwset, p1, p2, e, pvp, pvpbuf, siz
+ int size;
+ {
+ char *volatile buf;
+- int bufsize;
++ size_t bufsize;
+ int volatile rstat = EX_OK;
+ int rsno;
+ bool saveQuickAbort = QuickAbort;
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/savemail.c sendmail-8.12.3/sendmail/savemail.c
+--- sendmail-8.12.3.orig/sendmail/savemail.c 2001-12-28 23:32:19.000000000 +0100
++++ sendmail-8.12.3/sendmail/savemail.c 2006-03-22 22:42:45.000000000 +0100
+@@ -15,7 +15,7 @@
+
+ SM_RCSID("@(#)$Id: savemail.c,v 8.297 2001/12/28 22:32:19 ca Exp $")
+
+-static void errbody __P((MCI *, ENVELOPE *, char *));
++static bool errbody __P((MCI *, ENVELOPE *, char *));
+ static bool pruneroute __P((char *));
+
+ /*
+@@ -426,12 +426,13 @@ savemail(e, sendbody)
+ p = macvalue('g', e);
+ macdefine(&e->e_macro, A_PERM, 'g', e->e_sender);
+
+- putfromline(&mcibuf, e);
+- (*e->e_puthdr)(&mcibuf, e->e_header, e, M87F_OUTER);
+- (*e->e_putbody)(&mcibuf, e, NULL);
+- putline("\n", &mcibuf); /* XXX EOL from FileMailer? */
+- (void) sm_io_flush(fp, SM_TIME_DEFAULT);
+- if (sm_io_error(fp) ||
++ if (!putfromline(&mcibuf, e) ||
++ !(*e->e_puthdr)(&mcibuf, e->e_header, e,
++ M87F_OUTER) ||
++ !(*e->e_putbody)(&mcibuf, e, NULL) ||
++ !putline("\n", &mcibuf) ||
++ sm_io_flush(fp, SM_TIME_DEFAULT) == SM_IO_EOF ||
++ sm_io_error(fp) ||
+ sm_io_close(fp, SM_TIME_DEFAULT) < 0)
+ state = ESM_PANIC;
+ else
+@@ -744,14 +745,14 @@ returntosender(msg, returnq, flags, e)
+ ** separator -- any possible MIME separator (unused).
+ **
+ ** Returns:
+-** none
++** success
+ **
+ ** Side Effects:
+ ** Outputs the body of an error message.
+ */
+
+ /* ARGSUSED2 */
+-static void
++static bool
+ errbody(mci, e, separator)
+ register MCI *mci;
+ register ENVELOPE *e;
+@@ -769,14 +770,16 @@ errbody(mci, e, separator)
+
+ if (bitset(MCIF_INHEADER, mci->mci_flags))
+ {
+- putline("", mci);
++ if (!putline("", mci))
++ goto writeerr;
+ mci->mci_flags &= ~MCIF_INHEADER;
+ }
+ if (e->e_parent == NULL)
+ {
+ syserr("errbody: null parent");
+- putline(" ----- Original message lost -----\n", mci);
+- return;
++ if (!putline(" ----- Original message lost -----\n", mci))
++ goto writeerr;
++ return true;
+ }
+
+ /*
+@@ -785,11 +788,12 @@ errbody(mci, e, separator)
+
+ if (e->e_msgboundary != NULL)
+ {
+- putline("This is a MIME-encapsulated message", mci);
+- putline("", mci);
+ (void) sm_strlcpyn(buf, sizeof buf, 2, "--", e->e_msgboundary);
+- putline(buf, mci);
+- putline("", mci);
++ if (!putline("This is a MIME-encapsulated message", mci) ||
++ !putline("", mci) ||
++ !putline(buf, mci) ||
++ !putline("", mci))
++ goto writeerr;
+ }
+
+ /*
+@@ -811,31 +815,36 @@ errbody(mci, e, separator)
+ if (!pm_notify && q == NULL &&
+ !bitset(EF_FATALERRS|EF_SENDRECEIPT, e->e_parent->e_flags))
+ {
+- putline(" **********************************************",
+- mci);
+- putline(" ** THIS IS A WARNING MESSAGE ONLY **",
+- mci);
+- putline(" ** YOU DO NOT NEED TO RESEND YOUR MESSAGE **",
+- mci);
+- putline(" **********************************************",
+- mci);
+- putline("", mci);
++ if (!putline(" **********************************************",
++ mci) ||
++ !putline(" ** THIS IS A WARNING MESSAGE ONLY **",
++ mci) ||
++ !putline(" ** YOU DO NOT NEED TO RESEND YOUR MESSAGE **",
++ mci) ||
++ !putline(" **********************************************",
++ mci) ||
++ !putline("", mci))
++ goto writeerr;
+ }
+ (void) sm_snprintf(buf, sizeof buf,
+ "The original message was received at %s",
+ arpadate(ctime(&e->e_parent->e_ctime)));
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ expand("from \201_", buf, sizeof buf, e->e_parent);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+
+ /* include id in postmaster copies */
+ if (pm_notify && e->e_parent->e_id != NULL)
+ {
+ (void) sm_strlcpyn(buf, sizeof buf, 2, "with id ",
+ e->e_parent->e_id);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+- putline("", mci);
++ if (!putline("", mci))
++ goto writeerr;
+
+ /*
+ ** Output error message header (if specified and available).
+@@ -861,17 +870,19 @@ errbody(mci, e, separator)
+ {
+ translate_dollars(buf);
+ expand(buf, buf, sizeof buf, e);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+ (void) sm_io_close(xfile, SM_TIME_DEFAULT);
+- putline("\n", mci);
++ if (!putline("\n", mci))
++ goto writeerr;
+ }
+ }
+ else
+ {
+ expand(ErrMsgFile, buf, sizeof buf, e);
+- putline(buf, mci);
+- putline("", mci);
++ if (!putline(buf, mci) || !putline("", mci))
++ goto writeerr;
+ }
+ }
+
+@@ -889,21 +900,24 @@ errbody(mci, e, separator)
+
+ if (printheader)
+ {
+- putline(" ----- The following addresses had permanent fatal errors -----",
+- mci);
++ if (!putline(" ----- The following addresses had permanent fatal errors -----",
++ mci))
++ goto writeerr;
+ printheader = false;
+ }
+
+ (void) sm_strlcpy(buf, shortenstring(q->q_paddr, MAXSHORTSTR),
+ sizeof buf);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ if (q->q_rstatus != NULL)
+ {
+ (void) sm_snprintf(buf, sizeof buf,
+ " (reason: %s)",
+ shortenstring(exitstat(q->q_rstatus),
+ MAXSHORTSTR));
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+ if (q->q_alias != NULL)
+ {
+@@ -911,11 +925,12 @@ errbody(mci, e, separator)
+ " (expanded from: %s)",
+ shortenstring(q->q_alias->q_paddr,
+ MAXSHORTSTR));
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+ }
+- if (!printheader)
+- putline("", mci);
++ if (!printheader && !putline("", mci))
++ goto writeerr;
+
+ /* transient non-fatal errors */
+ printheader = true;
+@@ -929,25 +944,28 @@ errbody(mci, e, separator)
+
+ if (printheader)
+ {
+- putline(" ----- The following addresses had transient non-fatal errors -----",
+- mci);
++ if (!putline(" ----- The following addresses had transient non-fatal errors -----",
++ mci))
++ goto writeerr;
+ printheader = false;
+ }
+
+ (void) sm_strlcpy(buf, shortenstring(q->q_paddr, MAXSHORTSTR),
+ sizeof buf);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ if (q->q_alias != NULL)
+ {
+ (void) sm_snprintf(buf, sizeof buf,
+ " (expanded from: %s)",
+ shortenstring(q->q_alias->q_paddr,
+ MAXSHORTSTR));
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+ }
+- if (!printheader)
+- putline("", mci);
++ if (!printheader && !putline("", mci))
++ goto writeerr;
+
+ /* successful delivery notifications */
+ printheader = true;
+@@ -980,25 +998,28 @@ errbody(mci, e, separator)
+
+ if (printheader)
+ {
+- putline(" ----- The following addresses had successful delivery notifications -----",
+- mci);
++ if (!putline(" ----- The following addresses had successful delivery notifications -----",
++ mci))
++ goto writeerr;
+ printheader = false;
+ }
+
+ (void) sm_snprintf(buf, sizeof buf, "%s (%s)",
+ shortenstring(q->q_paddr, MAXSHORTSTR), p);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ if (q->q_alias != NULL)
+ {
+ (void) sm_snprintf(buf, sizeof buf,
+ " (expanded from: %s)",
+ shortenstring(q->q_alias->q_paddr,
+ MAXSHORTSTR));
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+ }
+- if (!printheader)
+- putline("", mci);
++ if (!printheader && !putline("", mci))
++ goto writeerr;
+
+ /*
+ ** Output transcript of errors
+@@ -1007,8 +1028,9 @@ errbody(mci, e, separator)
+ (void) sm_io_flush(smioout, SM_TIME_DEFAULT);
+ if (e->e_parent->e_xfp == NULL)
+ {
+- putline(" ----- Transcript of session is unavailable -----\n",
+- mci);
++ if (!putline(" ----- Transcript of session is unavailable -----\n",
++ mci))
++ goto writeerr;
+ }
+ else
+ {
+@@ -1019,11 +1041,12 @@ errbody(mci, e, separator)
+ while (sm_io_fgets(e->e_parent->e_xfp, SM_TIME_DEFAULT, buf,
+ sizeof buf) != NULL)
+ {
+- if (printheader)
+- putline(" ----- Transcript of session follows -----\n",
+- mci);
++ if (printheader && !putline(" ----- Transcript of session follows -----\n",
++ mci))
++ goto writeerr;
+ printheader = false;
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+ }
+ errno = 0;
+@@ -1035,11 +1058,12 @@ errbody(mci, e, separator)
+
+ if (e->e_msgboundary != NULL)
+ {
+- putline("", mci);
+ (void) sm_strlcpyn(buf, sizeof buf, 2, "--", e->e_msgboundary);
+- putline(buf, mci);
+- putline("Content-Type: message/delivery-status", mci);
+- putline("", mci);
++ if (!putline("", mci) ||
++ !putline(buf, mci) ||
++ !putline("Content-Type: message/delivery-status", mci) ||
++ !putline("", mci))
++ goto writeerr;
+
+ /*
+ ** Output per-message information.
+@@ -1051,13 +1075,15 @@ errbody(mci, e, separator)
+ (void) sm_snprintf(buf, sizeof buf,
+ "Original-Envelope-Id: %.800s",
+ xuntextify(e->e_parent->e_envid));
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+
+ /* Reporting-MTA: is us (required) */
+ (void) sm_snprintf(buf, sizeof buf,
+ "Reporting-MTA: dns; %.800s", MyHostName);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+
+ /* DSN-Gateway: not relevant since we are not translating */
+
+@@ -1071,13 +1097,15 @@ errbody(mci, e, separator)
+ (void) sm_snprintf(buf, sizeof buf,
+ "Received-From-MTA: %s; %.800s",
+ p, RealHostName);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+
+ /* Arrival-Date: -- when it arrived here */
+ (void) sm_strlcpyn(buf, sizeof buf, 2, "Arrival-Date: ",
+ arpadate(ctime(&e->e_parent->e_ctime)));
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+
+ /* Deliver-By-Date: -- when it should have been delivered */
+ if (IS_DLVR_BY(e->e_parent))
+@@ -1088,7 +1116,8 @@ errbody(mci, e, separator)
+ (void) sm_strlcpyn(buf, sizeof buf, 2,
+ "Deliver-By-Date: ",
+ arpadate(ctime(&dbyd)));
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+
+ /*
+@@ -1131,7 +1160,8 @@ errbody(mci, e, separator)
+ else
+ continue;
+
+- putline("", mci);
++ if (!putline("", mci))
++ goto writeerr;
+
+ /* Original-Recipient: -- passed from on high */
+ if (q->q_orcpt != NULL)
+@@ -1139,7 +1169,8 @@ errbody(mci, e, separator)
+ (void) sm_snprintf(buf, sizeof buf,
+ "Original-Recipient: %.800s",
+ q->q_orcpt);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+
+ /* Figure out actual recipient */
+@@ -1188,7 +1219,8 @@ errbody(mci, e, separator)
+ (void) sm_snprintf(buf, sizeof buf,
+ "Final-Recipient: %s",
+ q->q_finalrcpt);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+
+ /* X-Actual-Recipient: -- the real problem address */
+@@ -1199,13 +1231,15 @@ errbody(mci, e, separator)
+ (void) sm_snprintf(buf, sizeof buf,
+ "X-Actual-Recipient: %s",
+ actual);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+
+ /* Action: -- what happened? */
+ (void) sm_strlcpyn(buf, sizeof buf, 2, "Action: ",
+ action);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+
+ /* Status: -- what _really_ happened? */
+ if (q->q_status != NULL)
+@@ -1217,7 +1251,8 @@ errbody(mci, e, separator)
+ else
+ p = "2.0.0";
+ (void) sm_strlcpyn(buf, sizeof buf, 2, "Status: ", p);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+
+ /* Remote-MTA: -- who was I talking to? */
+ if (q->q_statmta != NULL)
+@@ -1231,7 +1266,8 @@ errbody(mci, e, separator)
+ p = &buf[strlen(buf) - 1];
+ if (*p == '.')
+ *p = '\0';
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+
+ /* Diagnostic-Code: -- actual result from other end */
+@@ -1243,7 +1279,8 @@ errbody(mci, e, separator)
+ (void) sm_snprintf(buf, sizeof buf,
+ "Diagnostic-Code: %s; %.800s",
+ p, q->q_rstatus);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+
+ /* Last-Attempt-Date: -- fine granularity */
+@@ -1252,7 +1289,8 @@ errbody(mci, e, separator)
+ (void) sm_strlcpyn(buf, sizeof buf, 2,
+ "Last-Attempt-Date: ",
+ arpadate(ctime(&q->q_statdate)));
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+
+ /* Will-Retry-Until: -- for delayed messages only */
+ if (QS_IS_QUEUEUP(q->q_state))
+@@ -1264,7 +1302,8 @@ errbody(mci, e, separator)
+ (void) sm_strlcpyn(buf, sizeof buf, 2,
+ "Will-Retry-Until: ",
+ arpadate(ctime(&xdate)));
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+ }
+ }
+@@ -1274,7 +1313,8 @@ errbody(mci, e, separator)
+ ** Output text of original message
+ */
+
+- putline("", mci);
++ if (!putline("", mci))
++ goto writeerr;
+ if (bitset(EF_HAS_DF, e->e_parent->e_flags))
+ {
+ sendbody = !bitset(EF_NO_BODY_RETN, e->e_parent->e_flags) &&
+@@ -1282,21 +1322,27 @@ errbody(mci, e, separator)
+
+ if (e->e_msgboundary == NULL)
+ {
+- if (sendbody)
+- putline(" ----- Original message follows -----\n", mci);
+- else
+- putline(" ----- Message header follows -----\n", mci);
++ if (!putline(
++ sendbody
++ ? " ----- Original message follows -----\n"
++ : " ----- Message header follows -----\n",
++ mci))
++ {
++ goto writeerr;
++ }
+ }
+ else
+ {
+ (void) sm_strlcpyn(buf, sizeof buf, 2, "--",
+ e->e_msgboundary);
+
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ (void) sm_strlcpyn(buf, sizeof buf, 2, "Content-Type: ",
+ sendbody ? "message/rfc822"
+ : "text/rfc822-headers");
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+
+ p = hvalue("Content-Transfer-Encoding",
+ e->e_parent->e_header);
+@@ -1310,43 +1356,62 @@ errbody(mci, e, separator)
+ (void) sm_snprintf(buf, sizeof buf,
+ "Content-Transfer-Encoding: %s",
+ p);
+- putline(buf, mci);
++ if (!putline(buf, mci))
++ goto writeerr;
+ }
+ }
+- putline("", mci);
++ if (!putline("", mci))
++ goto writeerr;
+ save_errno = errno;
+- putheader(mci, e->e_parent->e_header, e->e_parent, M87F_OUTER);
++ if (!putheader(mci, e->e_parent->e_header, e->e_parent,
++ M87F_OUTER))
++ goto writeerr;
+ errno = save_errno;
+ if (sendbody)
+- putbody(mci, e->e_parent, e->e_msgboundary);
++ {
++ if (!putbody(mci, e->e_parent, e->e_msgboundary))
++ goto writeerr;
++ }
+ else if (e->e_msgboundary == NULL)
+ {
+- putline("", mci);
+- putline(" ----- Message body suppressed -----", mci);
++ if (!putline("", mci) ||
++ !putline(" ----- Message body suppressed -----",
++ mci))
++ {
++ goto writeerr;
++ }
+ }
+ }
+ else if (e->e_msgboundary == NULL)
+ {
+- putline(" ----- No message was collected -----\n", mci);
++ if (!putline(" ----- No message was collected -----\n", mci))
++ goto writeerr;
+ }
+
+ if (e->e_msgboundary != NULL)
+ {
+- putline("", mci);
+ (void) sm_strlcpyn(buf, sizeof buf, 3, "--", e->e_msgboundary,
+ "--");
+- putline(buf, mci);
++ if (!putline("", mci) || !putline(buf, mci))
++ goto writeerr;
+ }
+- putline("", mci);
+- (void) sm_io_flush(mci->mci_out, SM_TIME_DEFAULT);
++ if (!putline("", mci) ||
++ sm_io_flush(mci->mci_out, SM_TIME_DEFAULT) == SM_IO_EOF)
++ goto writeerr;
+
+ /*
+ ** Cleanup and exit
+ */
+
+ if (errno != 0)
++ {
++ writeerr:
+ syserr("errbody: I/O error");
++ return false;
++ }
++ return true;
+ }
++
+ /*
+ ** SMTPTODSN -- convert SMTP to DSN status code
+ **
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/sendmail.h sendmail-8.12.3/sendmail/sendmail.h
+--- sendmail-8.12.3.orig/sendmail/sendmail.h 2006-03-22 22:27:15.000000000 +0100
++++ sendmail-8.12.3/sendmail/sendmail.h 2006-03-22 22:42:45.000000000 +0100
+@@ -780,12 +780,12 @@ extern struct hdrinfo HdrInfo[];
+ /* functions */
+ extern void addheader __P((char *, char *, int, ENVELOPE *));
+ extern unsigned long chompheader __P((char *, int, HDR **, ENVELOPE *));
+-extern void commaize __P((HDR *, char *, bool, MCI *, ENVELOPE *));
++extern bool commaize __P((HDR *, char *, bool, MCI *, ENVELOPE *));
+ extern HDR *copyheader __P((HDR *, SM_RPOOL_T *));
+ extern void eatheader __P((ENVELOPE *, bool, bool));
+ extern char *hvalue __P((char *, HDR *));
+ extern bool isheader __P((char *));
+-extern void putfromline __P((MCI *, ENVELOPE *));
++extern bool putfromline __P((MCI *, ENVELOPE *));
+ extern void setupheaders __P((void));
+
+ /*
+@@ -840,9 +840,9 @@ struct envelope
+ short e_sendmode; /* message send mode */
+ short e_errormode; /* error return mode */
+ short e_timeoutclass; /* message timeout class */
+- void (*e_puthdr)__P((MCI *, HDR *, ENVELOPE *, int));
++ bool (*e_puthdr)__P((MCI *, HDR *, ENVELOPE *, int));
+ /* function to put header of message */
+- void (*e_putbody)__P((MCI *, ENVELOPE *, char *));
++ bool (*e_putbody)__P((MCI *, ENVELOPE *, char *));
+ /* function to put body of message */
+ ENVELOPE *e_parent; /* the message this one encloses */
+ ENVELOPE *e_sibling; /* the next envelope of interest */
+@@ -940,8 +940,8 @@ extern void clearenvelope __P((ENVELOPE
+ extern void dropenvelope __P((ENVELOPE *, bool, bool));
+ extern ENVELOPE *newenvelope __P((ENVELOPE *, ENVELOPE *, SM_RPOOL_T *));
+ extern void printenvflags __P((ENVELOPE *));
+-extern void putbody __P((MCI *, ENVELOPE *, char *));
+-extern void putheader __P((MCI *, HDR *, ENVELOPE *, int));
++extern bool putbody __P((MCI *, ENVELOPE *, char *));
++extern bool putheader __P((MCI *, HDR *, ENVELOPE *, int));
+
+ /*
+ ** Message priority classes.
+@@ -1558,7 +1558,7 @@ EXTERN unsigned long PrivacyFlags; /* pr
+ #define M87F_NO8TO7 0x0004 /* don't do 8->7 bit conversions */
+
+ /* functions */
+-extern void mime7to8 __P((MCI *, HDR *, ENVELOPE *));
++extern bool mime7to8 __P((MCI *, HDR *, ENVELOPE *));
+ extern int mime8to7 __P((MCI *, HDR *, ENVELOPE *, char **, int));
+
+ /*
+@@ -2087,7 +2087,6 @@ EXTERN bool ColonOkInAddr; /* single col
+ #if !defined(_USE_SUN_NSSWITCH_) && !defined(_USE_DEC_SVC_CONF_)
+ EXTERN bool ConfigFileRead; /* configuration file has been read */
+ #endif /* !defined(_USE_SUN_NSSWITCH_) && !defined(_USE_DEC_SVC_CONF_) */
+-EXTERN bool volatile DataProgress; /* have we sent anything since last check */
+ EXTERN bool DisConnected; /* running with OutChannel redirect to transcript file */
+ EXTERN bool DontExpandCnames; /* do not $[...$] expand CNAMEs */
+ EXTERN bool DontInitGroups; /* avoid initgroups() because of NIS cost */
+@@ -2444,8 +2443,8 @@ extern void printopenfds __P((bool));
+ extern void printqueue __P((void));
+ extern void printrules __P((void));
+ extern pid_t prog_open __P((char **, int *, ENVELOPE *));
+-extern void putline __P((char *, MCI *));
+-extern void putxline __P((char *, size_t, MCI *, int));
++extern bool putline __P((char *, MCI *));
++extern bool putxline __P((char *, size_t, MCI *, int));
+ extern void queueup_macros __P((int, SM_FILE_T *, ENVELOPE *));
+ extern void readcf __P((char *, bool, ENVELOPE *));
+ extern SIGFUNC_DECL reapchild __P((int));
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/sfsasl.c sendmail-8.12.3/sendmail/sfsasl.c
+--- sendmail-8.12.3.orig/sendmail/sfsasl.c 2002-02-22 05:41:28.000000000 +0100
++++ sendmail-8.12.3/sendmail/sfsasl.c 2006-03-22 23:53:19.000000000 +0100
+@@ -482,6 +482,125 @@ tls_close(fp)
+ # define MAX_TLS_IOS 4
+
+ /*
++** TLS_RETRY -- check whether a failed SSL operation can be retried
++**
++** Parameters:
++** ssl -- TLS structure
++** rfd -- read fd
++** wfd -- write fd
++** tlsstart -- start time of TLS operation
++** timeout -- timeout for TLS operation
++** err -- SSL error
++** where -- description of operation
++**
++** Results:
++** >0 on success
++** 0 on timeout
++** <0 on error
++*/
++
++int
++tls_retry(ssl, rfd, wfd, tlsstart, timeout, err, where)
++ SSL *ssl;
++ int rfd;
++ int wfd;
++ time_t tlsstart;
++ int timeout;
++ int err;
++ const char *where;
++{
++ int ret;
++ time_t left;
++ time_t now = curtime();
++ struct timeval tv;
++
++ ret = -1;
++
++ /*
++ ** For SSL_ERROR_WANT_{READ,WRITE}:
++ ** There is not a complete SSL record available yet
++ ** or there is only a partial SSL record removed from
++ ** the network (socket) buffer into the SSL buffer.
++ ** The SSL_connect will only succeed when a full
++ ** SSL record is available (assuming a "real" error
++ ** doesn't happen). To handle when a "real" error
++ ** does happen the select is set for exceptions too.
++ ** The connection may be re-negotiated during this time
++ ** so both read and write "want errors" need to be handled.
++ ** A select() exception loops back so that a proper SSL
++ ** error message can be gotten.
++ */
++
++ left = timeout - (now - tlsstart);
++ if (left <= 0)
++ return 0; /* timeout */
++ tv.tv_sec = left;
++ tv.tv_usec = 0;
++
++ if (LogLevel > 14)
++ {
++ sm_syslog(LOG_INFO, NOQID,
++ "STARTTLS=%s, info: fds=%d/%d, err=%d",
++ where, rfd, wfd, err);
++ }
++
++ if (FD_SETSIZE > 0 &&
++ ((err == SSL_ERROR_WANT_READ && rfd >= FD_SETSIZE) ||
++ (err == SSL_ERROR_WANT_WRITE && wfd >= FD_SETSIZE)))
++ {
++ if (LogLevel > 5)
++ {
++ sm_syslog(LOG_ERR, NOQID,
++ "STARTTLS=%s, error: fd %d/%d too large",
++ where, rfd, wfd);
++ if (LogLevel > 8)
++ tlslogerr(where);
++ }
++ errno = EINVAL;
++ }
++ else if (err == SSL_ERROR_WANT_READ)
++ {
++ fd_set ssl_maskr, ssl_maskx;
++
++ FD_ZERO(&ssl_maskr);
++ FD_SET(rfd, &ssl_maskr);
++ FD_ZERO(&ssl_maskx);
++ FD_SET(rfd, &ssl_maskx);
++ do
++ {
++ ret = select(rfd + 1, &ssl_maskr, NULL, &ssl_maskx,
++ &tv);
++ } while (ret < 0 && errno == EINTR);
++ if (ret < 0 && errno > 0)
++ ret = -errno;
++ }
++ else if (err == SSL_ERROR_WANT_WRITE)
++ {
++ fd_set ssl_maskw, ssl_maskx;
++
++ FD_ZERO(&ssl_maskw);
++ FD_SET(wfd, &ssl_maskw);
++ FD_ZERO(&ssl_maskx);
++ FD_SET(rfd, &ssl_maskx);
++ do
++ {
++ ret = select(wfd + 1, NULL, &ssl_maskw, &ssl_maskx,
++ &tv);
++ } while (ret < 0 && errno == EINTR);
++ if (ret < 0 && errno > 0)
++ ret = -errno;
++ }
++ return ret;
++}
++
++/* errno to force refill() etc to stop (see IS_IO_ERROR()) */
++#ifdef ETIMEDOUT
++# define SM_ERR_TIMEOUT ETIMEDOUT
++#else /* ETIMEDOUT */
++# define SM_ERR_TIMEOUT EIO
++#endif /* ETIMEDOUT */
++
++/*
+ ** TLS_READ -- read secured information for the caller
+ **
+ ** Parameters:
+@@ -502,38 +621,42 @@ tls_read(fp, buf, size)
+ char *buf;
+ size_t size;
+ {
+- int r;
+- static int again = MAX_TLS_IOS;
++ int r, rfd, wfd, try, ssl_err;
+ struct tls_obj *so = (struct tls_obj *) fp->f_cookie;
++ time_t tlsstart;
+ char *err;
+
++ try = 99;
++ err = NULL;
++ tlsstart = curtime();
++
++ retry:
+ r = SSL_read(so->con, (char *) buf, size);
+
+ if (r > 0)
+- {
+- again = MAX_TLS_IOS;
+ return r;
+- }
+
+ err = NULL;
+- switch (SSL_get_error(so->con, r))
++ switch (ssl_err = SSL_get_error(so->con, r))
+ {
+ case SSL_ERROR_NONE:
+ case SSL_ERROR_ZERO_RETURN:
+- again = MAX_TLS_IOS;
+ break;
+ case SSL_ERROR_WANT_WRITE:
+- if (--again <= 0)
+- err = "read W BLOCK";
+- else
+- errno = EAGAIN;
+- break;
++ err = "read W BLOCK";
++ /* FALLTHROUGH */
+ case SSL_ERROR_WANT_READ:
+- if (--again <= 0)
++ if (err == NULL)
+ err = "read R BLOCK";
+- else
+- errno = EAGAIN;
++ rfd = SSL_get_rfd(so->con);
++ wfd = SSL_get_wfd(so->con);
++ try = tls_retry(so->con, rfd, wfd, tlsstart,
++ TimeOuts.to_datablock, ssl_err, "read");
++ if (try > 0)
++ goto retry;
++ errno = SM_ERR_TIMEOUT;
+ break;
++
+ case SSL_ERROR_WANT_X509_LOOKUP:
+ err = "write X BLOCK";
+ break;
+@@ -556,7 +679,6 @@ tls_read(fp, buf, size)
+ int save_errno;
+
+ save_errno = (errno == 0) ? EIO : errno;
+- again = MAX_TLS_IOS;
+ if (LogLevel > 7)
+ sm_syslog(LOG_WARNING, NOQID,
+ "STARTTLS: read error=%s (%d)", err, r);
+@@ -586,36 +708,39 @@ tls_write(fp, buf, size)
+ const char *buf;
+ size_t size;
+ {
+- int r;
+- static int again = MAX_TLS_IOS;
++ int r, rfd, wfd, try, ssl_err;
+ struct tls_obj *so = (struct tls_obj *) fp->f_cookie;
++ time_t tlsstart;
+ char *err;
+
++ try = 99;
++ err = NULL;
++ tlsstart = curtime();
++
++ retry:
+ r = SSL_write(so->con, (char *) buf, size);
+
+ if (r > 0)
+- {
+- again = MAX_TLS_IOS;
+ return r;
+- }
+ err = NULL;
+- switch (SSL_get_error(so->con, r))
++ switch (ssl_err = SSL_get_error(so->con, r))
+ {
+ case SSL_ERROR_NONE:
+ case SSL_ERROR_ZERO_RETURN:
+- again = MAX_TLS_IOS;
+ break;
+ case SSL_ERROR_WANT_WRITE:
+- if (--again <= 0)
+- err = "write W BLOCK";
+- else
+- errno = EAGAIN;
+- break;
++ err = "read W BLOCK";
++ /* FALLTHROUGH */
+ case SSL_ERROR_WANT_READ:
+- if (--again <= 0)
+- err = "write R BLOCK";
+- else
+- errno = EAGAIN;
++ if (err == NULL)
++ err = "read R BLOCK";
++ rfd = SSL_get_rfd(so->con);
++ wfd = SSL_get_wfd(so->con);
++ try = tls_retry(so->con, rfd, wfd, tlsstart,
++ DATA_PROGRESS_TIMEOUT, ssl_err, "write");
++ if (try > 0)
++ goto retry;
++ errno = SM_ERR_TIMEOUT;
+ break;
+ case SSL_ERROR_WANT_X509_LOOKUP:
+ err = "write X BLOCK";
+@@ -642,7 +767,6 @@ tls_write(fp, buf, size)
+ int save_errno;
+
+ save_errno = (errno == 0) ? EIO : errno;
+- again = MAX_TLS_IOS;
+ if (LogLevel > 7)
+ sm_syslog(LOG_WARNING, NOQID,
+ "STARTTLS: write error=%s (%d)", err, r);
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/sfsasl.h sendmail-8.12.3/sendmail/sfsasl.h
+--- sendmail-8.12.3.orig/sendmail/sfsasl.h 2000-09-19 23:30:49.000000000 +0200
++++ sendmail-8.12.3/sendmail/sfsasl.h 2006-03-22 22:42:45.000000000 +0100
+@@ -17,6 +17,8 @@ extern int sfdcsasl __P((SM_FILE_T **, S
+ #endif /* SASL */
+
+ # if STARTTLS
++extern int tls_retry __P((SSL *, int, int, time_t, int, int,
++ const char *));
+ extern int sfdctls __P((SM_FILE_T **, SM_FILE_T **, SSL *));
+ # endif /* STARTTLS */
+
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/srvrsmtp.c sendmail-8.12.3/sendmail/srvrsmtp.c
+--- sendmail-8.12.3.orig/sendmail/srvrsmtp.c 2002-04-02 05:51:02.000000000 +0200
++++ sendmail-8.12.3/sendmail/srvrsmtp.c 2006-03-23 00:01:40.000000000 +0100
+@@ -1374,70 +1374,20 @@ smtp(nullserver, d_flags, e)
+ if ((r = SSL_ACC(srv_ssl)) <= 0)
+ {
+ int i;
+- bool timedout;
+- time_t left;
+- time_t now = curtime();
+- struct timeval tv;
++ int ssl_err;
+
+- /* what to do in this case? */
+- i = SSL_get_error(srv_ssl, r);
++ ssl_err = SSL_get_error(srv_ssl, r);
++ i = tls_retry(srv_ssl, rfd, wfd, tlsstart,
++ TimeOuts.to_starttls, ssl_err,
++ "server");
++ if (i > 0)
++ goto ssl_retry;
+
+- /*
+- ** For SSL_ERROR_WANT_{READ,WRITE}:
+- ** There is no SSL record available yet
+- ** or there is only a partial SSL record
+- ** removed from the network (socket) buffer
+- ** into the SSL buffer. The SSL_accept will
+- ** only succeed when a full SSL record is
+- ** available (assuming a "real" error
+- ** doesn't happen). To handle when a "real"
+- ** error does happen the select is set for
+- ** exceptions too.
+- ** The connection may be re-negotiated
+- ** during this time so both read and write
+- ** "want errors" need to be handled.
+- ** A select() exception loops back so that
+- ** a proper SSL error message can be gotten.
+- */
+-
+- left = TimeOuts.to_starttls - (now - tlsstart);
+- timedout = left <= 0;
+- if (!timedout)
+- {
+- tv.tv_sec = left;
+- tv.tv_usec = 0;
+- }
+-
+- /* XXX what about SSL_pending() ? */
+- if (!timedout && i == SSL_ERROR_WANT_READ)
+- {
+- fd_set ssl_maskr, ssl_maskx;
+-
+- FD_ZERO(&ssl_maskr);
+- FD_SET(rfd, &ssl_maskr);
+- FD_ZERO(&ssl_maskx);
+- FD_SET(rfd, &ssl_maskx);
+- if (select(rfd + 1, &ssl_maskr, NULL,
+- &ssl_maskx, &tv) > 0)
+- goto ssl_retry;
+- }
+- if (!timedout && i == SSL_ERROR_WANT_WRITE)
+- {
+- fd_set ssl_maskw, ssl_maskx;
+-
+- FD_ZERO(&ssl_maskw);
+- FD_SET(wfd, &ssl_maskw);
+- FD_ZERO(&ssl_maskx);
+- FD_SET(rfd, &ssl_maskx);
+- if (select(wfd + 1, NULL, &ssl_maskw,
+- &ssl_maskx, &tv) > 0)
+- goto ssl_retry;
+- }
+ if (LogLevel > 5)
+ {
+ sm_syslog(LOG_WARNING, NOQID,
+- "STARTTLS=server, error: accept failed=%d, SSL_error=%d, timedout=%d",
+- r, i, (int) timedout);
++ "STARTTLS=server, error: accept failed=%d, SSL_error=%d, errno=%d",
++ r, i, errno);
+ if (LogLevel > 8)
+ tlslogerr("server");
+ }
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/usersmtp.c sendmail-8.12.3/sendmail/usersmtp.c
+--- sendmail-8.12.3.orig/sendmail/usersmtp.c 2002-04-03 02:23:25.000000000 +0200
++++ sendmail-8.12.3/sendmail/usersmtp.c 2006-03-22 22:42:45.000000000 +0100
+@@ -19,7 +19,6 @@ SM_RCSID("@(#)$Id: usersmtp.c,v 8.431 20
+
+
+ extern void markfailure __P((ENVELOPE *, ADDRESS *, MCI *, int, bool));
+-static void datatimeout __P((void));
+ static void esmtp_check __P((char *, bool, MAILER *, MCI *, ENVELOPE *));
+ static void helo_options __P((char *, bool, MAILER *, MCI *, ENVELOPE *));
+ static int smtprcptstat __P((ADDRESS *, MAILER *, MCI *, ENVELOPE *));
+@@ -2227,9 +2226,6 @@ smtprcptstat(to, m, mci, e)
+ ** exit status corresponding to DATA command.
+ */
+
+-static jmp_buf CtxDataTimeout;
+-static SM_EVENT *volatile DataTimeout = NULL;
+-
+ int
+ smtpdata(m, mci, e, ctladdr, xstart)
+ MAILER *m;
+@@ -2241,7 +2237,7 @@ smtpdata(m, mci, e, ctladdr, xstart)
+ register int r;
+ int rstat;
+ int xstat;
+- time_t timeout;
++ int timeout;
+ char *enhsc;
+
+ /*
+@@ -2351,43 +2347,22 @@ smtpdata(m, mci, e, ctladdr, xstart)
+ ** factor. The main thing is that it should not be infinite.
+ */
+
+- if (setjmp(CtxDataTimeout) != 0)
+- {
+- mci->mci_errno = errno;
+- mci->mci_state = MCIS_ERROR;
+- mci_setstat(mci, EX_TEMPFAIL, "4.4.2", NULL);
+-
+- /*
+- ** If putbody() couldn't finish due to a timeout,
+- ** rewind it here in the timeout handler. See
+- ** comments at the end of putbody() for reasoning.
+- */
+-
+- if (e->e_dfp != NULL)
+- (void) bfrewind(e->e_dfp);
+-
+- errno = mci->mci_errno;
+- syserr("451 4.4.1 timeout writing message to %s", CurHostName);
+- smtpquit(m, mci, e);
+- return EX_TEMPFAIL;
+- }
+-
+ if (tTd(18, 101))
+ {
+ /* simulate a DATA timeout */
+- timeout = 1;
++ timeout = 10;
+ }
+ else
+- timeout = DATA_PROGRESS_TIMEOUT;
+-
+- DataTimeout = sm_setevent(timeout, datatimeout, 0);
++ timeout = DATA_PROGRESS_TIMEOUT * 1000;
++ sm_io_setinfo(mci->mci_out, SM_IO_WHAT_TIMEOUT, &timeout);
+
+
+ /*
+ ** Output the actual message.
+ */
+
+- (*e->e_puthdr)(mci, e->e_header, e, M87F_OUTER);
++ if (!(*e->e_puthdr)(mci, e->e_header, e, M87F_OUTER))
++ goto writeerr;
+
+ if (tTd(18, 101))
+ {
+@@ -2395,14 +2370,13 @@ smtpdata(m, mci, e, ctladdr, xstart)
+ (void) sleep(2);
+ }
+
+- (*e->e_putbody)(mci, e, NULL);
++ if (!(*e->e_putbody)(mci, e, NULL))
++ goto writeerr;
+
+ /*
+ ** Cleanup after sending message.
+ */
+
+- if (DataTimeout != NULL)
+- sm_clrevent(DataTimeout);
+
+ #if PIPELINING
+ }
+@@ -2442,7 +2416,9 @@ smtpdata(m, mci, e, ctladdr, xstart)
+ }
+
+ /* terminate the message */
+- (void) sm_io_fprintf(mci->mci_out, SM_TIME_DEFAULT, ".%s", m->m_eol);
++ if (sm_io_fprintf(mci->mci_out, SM_TIME_DEFAULT, ".%s", m->m_eol) ==
++ SM_IO_EOF)
++ goto writeerr;
+ if (TrafficLogFile != NULL)
+ (void) sm_io_fprintf(TrafficLogFile, SM_TIME_DEFAULT,
+ "%05d >>> .\n", (int) CurrentPid);
+@@ -2492,50 +2468,27 @@ smtpdata(m, mci, e, ctladdr, xstart)
+ shortenstring(SmtpReplyBuffer, 403));
+ }
+ return rstat;
+-}
+
+-static void
+-datatimeout()
+-{
+- int save_errno = errno;
++ writeerr:
++ mci->mci_errno = errno;
++ mci->mci_state = MCIS_ERROR;
++ mci_setstat(mci, EX_TEMPFAIL, "4.4.2", NULL);
+
+ /*
+- ** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD
+- ** ANYTHING TO THIS ROUTINE UNLESS YOU KNOW WHAT YOU ARE
+- ** DOING.
++ ** If putbody() couldn't finish due to a timeout,
++ ** rewind it here in the timeout handler. See
++ ** comments at the end of putbody() for reasoning.
+ */
+
+- if (DataProgress)
+- {
+- time_t timeout;
+-
+- /* check back again later */
+- if (tTd(18, 101))
+- {
+- /* simulate a DATA timeout */
+- timeout = 1;
+- }
+- else
+- timeout = DATA_PROGRESS_TIMEOUT;
+-
+- /* reset the timeout */
+- DataTimeout = sm_sigsafe_setevent(timeout, datatimeout, 0);
+- DataProgress = false;
+- }
+- else
+- {
+- /* event is done */
+- DataTimeout = NULL;
+- }
++ if (e->e_dfp != NULL)
++ (void) bfrewind(e->e_dfp);
+
+- /* if no progress was made or problem resetting event, die now */
+- if (DataTimeout == NULL)
+- {
+- errno = ETIMEDOUT;
+- longjmp(CtxDataTimeout, 1);
+- }
+- errno = save_errno;
++ errno = mci->mci_errno;
++ syserr("451 4.4.1 timeout writing message to %s", CurHostName);
++ smtpquit(m, mci, e);
++ return EX_TEMPFAIL;
+ }
++
+ /*
+ ** SMTPGETSTAT -- get status code from DATA in LMTP
+ **
+diff -u -p -Nr --exclude CVS sendmail-8.12.3.orig/sendmail/util.c sendmail-8.12.3/sendmail/util.c
+--- sendmail-8.12.3.orig/sendmail/util.c 2002-04-04 23:32:15.000000000 +0200
++++ sendmail-8.12.3/sendmail/util.c 2006-03-22 22:42:45.000000000 +0100
+@@ -878,18 +878,18 @@ fixcrlf(line, stripnl)
+ ** mci -- the mailer connection information.
+ **
+ ** Returns:
+-** none
++** true iff line was written successfully
+ **
+ ** Side Effects:
+ ** output of l to mci->mci_out.
+ */
+
+-void
++bool
+ putline(l, mci)
+ register char *l;
+ register MCI *mci;
+ {
+- putxline(l, strlen(l), mci, PXLF_MAPFROM);
++ return putxline(l, strlen(l), mci, PXLF_MAPFROM);
+ }
+ /*
+ ** PUTXLINE -- putline with flags bits.
+@@ -908,13 +908,13 @@ putline(l, mci)
+ ** PXLF_NOADDEOL -- don't add an EOL if one wasn't present.
+ **
+ ** Returns:
+-** none
++** true iff line was written successfully
+ **
+ ** Side Effects:
+ ** output of l to mci->mci_out.
+ */
+
+-void
++bool
+ putxline(l, len, mci, pxflags)
+ register char *l;
+ size_t len;
+@@ -966,11 +966,6 @@ putxline(l, len, mci, pxflags)
+ if (sm_io_putc(mci->mci_out, SM_TIME_DEFAULT,
+ '.') == SM_IO_EOF)
+ dead = true;
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+ if (TrafficLogFile != NULL)
+ (void) sm_io_putc(TrafficLogFile,
+ SM_TIME_DEFAULT, '.');
+@@ -983,11 +978,6 @@ putxline(l, len, mci, pxflags)
+ if (sm_io_putc(mci->mci_out, SM_TIME_DEFAULT,
+ '>') == SM_IO_EOF)
+ dead = true;
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+ if (TrafficLogFile != NULL)
+ (void) sm_io_putc(TrafficLogFile,
+ SM_TIME_DEFAULT,
+@@ -999,16 +989,11 @@ putxline(l, len, mci, pxflags)
+ while (l < q)
+ {
+ if (sm_io_putc(mci->mci_out, SM_TIME_DEFAULT,
+- (unsigned char) *l++) == SM_IO_EOF)
++ (unsigned char) *l++) == SM_IO_EOF)
+ {
+ dead = true;
+ break;
+ }
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+ }
+ if (dead)
+ break;
+@@ -1024,11 +1009,6 @@ putxline(l, len, mci, pxflags)
+ dead = true;
+ break;
+ }
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+ if (TrafficLogFile != NULL)
+ {
+ for (l = l_base; l < q; l++)
+@@ -1052,11 +1032,9 @@ putxline(l, len, mci, pxflags)
+ {
+ if (sm_io_putc(mci->mci_out, SM_TIME_DEFAULT, '.') ==
+ SM_IO_EOF)
+- break;
+- else
+ {
+- /* record progress for DATA timeout */
+- DataProgress = true;
++ dead = true;
++ break;
+ }
+ if (TrafficLogFile != NULL)
+ (void) sm_io_putc(TrafficLogFile,
+@@ -1069,11 +1047,9 @@ putxline(l, len, mci, pxflags)
+ {
+ if (sm_io_putc(mci->mci_out, SM_TIME_DEFAULT, '>') ==
+ SM_IO_EOF)
+- break;
+- else
+ {
+- /* record progress for DATA timeout */
+- DataProgress = true;
++ dead = true;
++ break;
+ }
+ if (TrafficLogFile != NULL)
+ (void) sm_io_putc(TrafficLogFile,
+@@ -1091,11 +1067,6 @@ putxline(l, len, mci, pxflags)
+ dead = true;
+ break;
+ }
+- else
+- {
+- /* record progress for DATA timeout */
+- DataProgress = true;
+- }
+ }
+ if (dead)
+ break;
+@@ -1106,11 +1077,9 @@ putxline(l, len, mci, pxflags)
+ if ((!bitset(PXLF_NOADDEOL, pxflags) || !noeol) &&
+ sm_io_fputs(mci->mci_out, SM_TIME_DEFAULT,
+ mci->mci_mailer->m_eol) == SM_IO_EOF)
+- break;
+- else
+ {
+- /* record progress for DATA timeout */
+- DataProgress = true;
++ dead = true;
++ break;
+ }
+ if (l < end && *l == '\n')
+ {
+@@ -1119,11 +1088,9 @@ putxline(l, len, mci, pxflags)
+ {
+ if (sm_io_putc(mci->mci_out, SM_TIME_DEFAULT,
+ ' ') == SM_IO_EOF)
+- break;
+- else
+ {
+- /* record progress for DATA timeout */
+- DataProgress = true;
++ dead = true;
++ break;
+ }
+
+ if (TrafficLogFile != NULL)
+@@ -1132,10 +1099,10 @@ putxline(l, len, mci, pxflags)
+ }
+ }
+
+- /* record progress for DATA timeout */
+- DataProgress = true;
+ } while (l < end);
++ return !dead;
+ }
++
+ /*
+ ** XUNLINK -- unlink a file, doing logging as appropriate.
+ **
diff --git a/debian/patches/contrib/etrn.patch01 b/debian/patches/contrib/etrn.patch01
new file mode 100644
index 0000000..616c748
--- /dev/null
+++ b/debian/patches/contrib/etrn.patch01
@@ -0,0 +1,42 @@
+--- sendmail-8.12.5/contrib/etrn.pl.mwe Tue Jul 9 11:17:50 2002
++++ sendmail-8.12.5/contrib/etrn.pl Tue Jul 9 11:33:13 2002
+@@ -81,12 +81,13 @@
+ while (<CF>){
+ if (/^Fw.*$/){ # look for a line starting with "Fw"
+ $cwfile = $_;
+- chop($cwfile);
+- $optional = /^Fw-o/;
+- $cwfile =~ s,^Fw[^/]*,,; # extract the file name
+-
++ chomp($cwfile);
++ ($optional,$cwfile,$comment_delim) = /^Fw(-o)?\s*(\S*)\s*(?:\s%(.*))?$/;
++ if (!$comment_delim) $comment_delim = '[^#]';
++ $comment_delim =~ s/[\\](.)/$1/g; # unescape
+ if (-r $cwfile) {
+- push (@cwfiles, $cwfile);
++ push (@cwfiles, {'file' => $cwfile, 'nocomment' => $comment_delim});
++
+ } else {
+ die "$cwfile is not readable" unless $optional;
+ }
+@@ -103,16 +104,16 @@
+
+ for $cwfile (@cwfiles) {
+ $0 = "$av0 - reading $cwfile";
+- if (open(CW, "<$cwfile")){
++ if (open(CW, "<$cwfile->{'file'}")){
+ while (<CW>){
+- next if /^\#/;
++ next unless /^$cwfile->{'nocomment'}/;
+ $thishost = $_;
+- chop($thishost);
++ chomp($thishost);
+ push(@hosts, $thishost) unless $thishost =~ $hostname;
+ }
+ close(CW);
+ } else {
+- die "open $cwfile: $!";
++ die "open $cwfile->{'file'}: $!";
+ }
+ }
+ }
diff --git a/debian/patches/patches.index b/debian/patches/patches.index
new file mode 100644
index 0000000..7b45ffb
--- /dev/null
+++ b/debian/patches/patches.index
@@ -0,0 +1,16 @@
+The following Debian specific patches have been applied:
+
+ *) dpatch.001 cf/feature/local_procmail.m4
+ Remove -Y from procmail arguements
+
+ *) dpatch.002 cf/mailer/cyrus.m4
+ Support cyrus-deliver MDA (Thanks Manoj Srivastava)
+
+ *) dpatch.003 rmail/rmail.c
+ Change sendmail call -obq to -obi
+
+ *) dpatch.004 sendmail/control.c
+ Make control socket mode 0660
+
+ *) dpatch.005 cf/mailer/fax.m4
+ /usr/bin/faxmail, !/usr/local/bin/faxmail
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..4beba56
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,1189 @@
+#!/usr/bin/make -f
+#------------------------------------------------------------------------------
+# vim: syntax=make
+#
+# $Sendmail: rules,v 8.12.3 2003-09-17 15:19:44 cowboy Exp $
+#
+# Copyright (c) 1998-2003 Richard Nelson. All Rights Reserved.
+#
+# ./rules. Generated from rules.in by configure.
+#
+# Rules file for Sendmail 8.12.3-6.5(527363)
+# on Debian 3.0
+# via Debhelper V4
+#
+# Note: the .in file supports Sendmail 8.7.6 - 8.12.7
+# on Debian slink, potato, woody, testing, sid, ...
+# but the generated file is customized to the version noted above.
+#
+# The only thing to watch for is to make sure the changelog correctly
+# reflects the appropriate version and distribution!
+#
+# To support private builds:
+# 1) use the environment variables (defaults shown first):
+# CC=gcc|gcc-3.0..........-- choose compiler
+# CFLAGS='-O2 -Wall [-g]'.-- choose compile options
+# DEFINES=''..............-- additional -Dxxx
+# SM_CONF_OPT=''..........-- additional configure options
+# SM_BUILD_OPT=''.........-- additional build options
+# 2) Build the package using your normal setup:
+# A) [fakeroot] debian/rules binary
+# B) debuild -rfakeroot
+# C) dpkg-buildpackage -rfakeroot -uc -us
+#
+# DEB_BUILD_OPTIONS (global Debian package build options)
+# Debian specific, and common across package options
+# noopt - Do *NOT* compile with optimization (force -O0)
+# nostrip - Do *NOT* strip binaries (for debugging)
+#
+#
+# SM_CONF_OPT
+# Additional configure options and/or overrides may be specified thusly:
+# 1) export SM_CONF_OPT='--enable-shm=no'
+# dpkg-buildpackage -rfakeroot -uc -us
+# 2) SM_CONF_OPT='--enable-shm=no' dpkg-buildpackage
+# 3) debuild -e SM_CONF_OPT='--enable-shm=no'
+# etc...
+#
+# SM_BUILD_OPT
+# 1) export SM_BUILD_OPT='notls'
+# dpkg-buildpackage -rfakeroot -uc -us
+# 2) SM_BUILD_OPT='notls' dpkg-buildpackage -rfakeroot -uc -us
+# 3) debuild -e SM_BUILD_OPT='notls' -e CLFAGS='-O3 Wall'
+# etc...
+#
+# Supported options values for SM_BUILD_OPT:
+# notls Disable STARTTLS (OpenSSL) support
+# noauth Disable SMTP AUTH (sasl) support
+# nodev Disable generation of libmilter-dev package
+# nodoc Disable generation of sendmail-doc package
+#
+# This make file uses scripts from the DBS (0.8) package!
+#
+# Richard Nelson <cowboy@debian.org> 2003-09-17 15:19:44 (+0000)
+#------------------------------------------------------------------------------
+#SHELL := /bin/sh -x
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use. (we'll set it later)
+#export DH_COMPAT=4
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+# Support separate debian directory
+ifeq (yes, $(shell test -d debian && echo 'yes'))
+ debian_dir := debian
+ pwd_dir := ${PWD}
+else
+ debian_dir := .
+ pwd_dir := ${PWD}/..
+ endif
+
+# Determine build,host architectures (via dpkg-architecture)
+ifeq (, ${DEB_BUILD_ARCH})
+ ifeq (yes, $(shell test -x /usr/bin/dpkg-architecture && echo 'yes'))
+ include ${debian_dir}/scripts/dpkg-arch.mk
+ endif
+ endif
+
+# Check for cross-compilation
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+ ifneq (, $(DEB_BUILD_GNU_TYPE))
+ endif
+ endif
+
+# will want path info for some things... Like patches/changelogs...
+pwd_string := $(shell expr "${pwd_dir}" : '.*-\([0-9.].*\)')
+ifeq (, $(findstring +,${pwd_string}))
+ pwd_version := ${pwd_string}
+else
+ pwd_version := $(shell expr "${pwd_string}" : '.*+\([0-9.].*\)')
+ endif
+pwd_major := $(shell expr "${pwd_version}" : '\([0-9]*\.[0-9]*\)')
+
+# get package/version information from the changelog
+package := $(shell (cd ${debian_dir}/.. && \
+ dpkg-parsechangelog 2>/dev/null) | awk '/^Source:/ {print $$2}')
+version_string := $(shell (cd ${debian_dir}/.. && \
+ dpkg-parsechangelog 2>/dev/null) | awk '/^Version:/ {print $$2}')
+version_full := $(shell expr "${version_string}" : '\([^-]*\)')
+version_debian := $(shell expr "${version_string}" : '[^-]*\(-.*\)')
+version := ${version_full}
+version_major := $(shell expr "${version_full}" : '\([0-9]*\.[0-9]*\)')
+version_minor := $(shell expr "${version_full}" : '[0-9]*\.[0-9]*\.\(.*\)')
+ifneq (, $(findstring +,${version_minor}))
+ beta_version := $(shell expr "${version_full}" : '.*+\([0-9.].*\)')
+ beta_major := $(shell expr "${beta_version}" : '\([0-9]*\.[0-9]*\)')
+ beta_minor := $(shell expr "${beta_version}" : '[0-9]*\.[0-9]*\.\(.*\)')
+ ifneq (, $(beta_version))
+ version := ${beta_version}
+ version_major := ${beta_major}
+ version_minor := ${beta_minor}
+ endif
+ endif
+
+# Many things depend upon which release (slink, potato, woody, etc.)
+PKG_DIR := ${debian_dir}/${package}
+DATA_DIR := /usr/share
+ifeq (v4, $(shell (cd ${debian_dir}/.. && dh_testversion 4.0.0 2>/dev/null && echo 'v4')))
+ DH_COMPAT := 4
+else
+ ifeq (v3, $(shell (cd ${debian_dir}/.. && dh_testversion 3.0.0 2>/dev/null && echo 'v3')))
+ DH_COMPAT := 3
+ else
+ ifeq (v2, $(shell (cd ${debian_dir}/.. && dh_testversion 2.0.40 2>/dev/null && echo 'v2')))
+ DH_COMPAT := 2
+ else
+ DH_COMPAT := 1
+ PKG_DIR := ${debian_dir}/tmp
+ DATA_DIR := /usr
+ endif
+ endif
+ endif
+export DH_COMPAT
+
+# the dbs rules
+TAR_DIR := ${package}-${version}
+# Handle the case where the changelog is newer that what we're building
+ifneq (yes, $(shell test -e ${debian_dir}/../${TAR_DIR}.tar.gz && echo 'yes'))
+ TAR_DIR := ${package}-${pwd_version}
+ endif
+SOURCE_DIR := build-tree
+BUILD_TREE := ${SOURCE_DIR}/${TAR_DIR}
+PATCH_DIR := ${debian_dir}/patches/${version_major}/${version}
+SCRIPT_DIR := ${debian_dir}/scripts
+STAMP_DIR := ${debian_dir}/build/stampdir
+
+# Include Debian Autoconf settings
+ifeq (yes, $(shell test -e ${debian_dir}/build/autoconf.mk && echo 'yes'))
+ include ${debian_dir}/build/autoconf.mk
+else
+ include ${debian_dir}/build/autoconf.mk.in
+ endif
+
+# these are strictly for my own consuption
+PKG_DOC := ${debian_dir}/${package}-doc${docdir}/${package}-doc
+MAKE_SUBDIRS := examples local sensible_mda
+PACKAGES := sendmail sendmail-doc libmilter-dev
+SM_SUBDIRS := editmap libmilter mail.local mailstats \
+ makemap praliases rmail sendmail smrsh vacation
+#
+# We want delayed interpretation of the options !
+ifeq (yes, $(shell test -x /usr/bin/debuild && echo 'yes'))
+ DEB_BUILD = \
+ SM_CONF_OPT="${SM_CONF_OPT}" \
+ SM_BUILD_OPT="${SM_BUILD_OPT}" \
+ DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS}" \
+ debuild -e SM_CONF_OPT -e SM_BUILD_OPT
+else
+ DEB_BUILD = \
+ SM_CONF_OPT="${SM_CONF_OPT}" \
+ SM_BUILD_OPT="${SM_BUILD_OPT}" \
+ DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS}" \
+ dpkg-buildpackage
+ endif
+
+# Process build-time options:
+# 1) options from SM_BUILD_OPT (Prior to configure)
+# 2) defaults (Prior to configure)
+ENABLE_INDEP := yes
+ENABLE_ARCH := yes
+ENABLE_LIB := no
+ENABLE_BIN := yes
+ifneq (, $(findstring notls,${SM_BUILD_OPT}))
+ ENABLE_TLS := no
+else
+ ENABLE_TLS := yes
+ endif
+ifneq (, $(findstring noauth,${SM_BUILD_OPT}))
+ ENABLE_AUTH := no
+else
+ ENABLE_AUTH := yes
+ endif
+ifneq (, $(findstring nodev,${SM_BUILD_OPT}))
+ ENABLE_DEV := no
+else
+ ENABLE_DEV := yes
+ endif
+ifneq (, $(findstring nodoc,${SM_BUILD_OPT}))
+ ENABLE_DOC := no
+else
+ ENABLE_DOC := yes
+ endif
+#
+# Summarize above options into -INDEP and -ARCH for this Makefile
+ENABLE_INDEP := ${ENABLE_DOC}
+ifeq (no, ${ENABLE_BIN})
+ ifeq (no, ${ENABLE_LIB})
+ ifeq (no, ${ENABLE_DEV})
+ ENABLE_ARCH := no
+ endif
+ endif
+ endif
+
+all:
+ @echo 'Please specify a real target in the future...';
+ $(MAKE) -f ${debian_dir}/rules \
+ version_string=${pwd_string} \
+ SM_CONF_OPT="${SM_CONF_OPT}" SM_BUILD_OPT="${SM_BUILD_OPT}" \
+ DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS}" \
+ binary;
+
+
+#------------------------------------------------------------------------------
+# Rules to maintain the external Debian directory
+#------------------------------------------------------------------------------
+#-------------
+refresh-dbs:
+ @echo 'updating debian/scripts directory...';
+ cp -af /usr/share/dbs/* ${SCRIPT_DIR}/;
+ chmod a-w ${SCRIPT_DIR}/*;
+
+#-------------
+refresh-debian:
+ @dh_testdir;
+ @echo 'updating debian directory ...';
+ sudo $(RM) -r debian;
+ cp -a ../debian ./;
+ sudo $(RM) -r ${SOURCE_DIR} ${STAMP_DIR};
+ rm -f ${debian_dir}/config.status;
+ touch ${debian_dir}/rules;
+ $(MAKE) -f ${debian_dir}/rules \
+ version_string=${pwd_string} \
+ SM_CONF_OPT="${SM_CONF_OPT}" SM_BUILD_OPT="${SM_BUILD_OPT}" \
+ DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS}" \
+ debian-setup;
+
+debian-setup:
+ # Force a configure here, using $${PWD} so the changelog, etc.
+ # wind up with the right version numbers
+ rm -f ${debian_dir}/configure ${debian_dir}/config.status;
+ rm -f ${debian_dir}/build/autoconf.mk;
+ $(MAKE) -f ${debian_dir}/rules \
+ version_string=${pwd_string} \
+ SM_CONF_OPT="${SM_CONF_OPT}" SM_BUILD_OPT="${SM_BUILD_OPT}" \
+ DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS}" \
+ configure;
+ $(MAKE) -f ${debian_dir}/rules clean-debian;
+
+ # Remove pieces not needed for further building
+ find ${debian_dir}/patches -type d -a ! -name 'patches' \
+ -a ! -name 'contrib' \
+ -a ! -name "${pwd_major}" \
+ -a ! -name "${pwd_version}" \
+ | xargs -r $(RM) -r;
+ $(RM) -r ${debian_dir}/bugs ${debian_dir}/private ${debian_dir}/watch;
+ $(RM) ${debian_dir}/build/acinclude.m4 \
+ ${debian_dir}/build/aclocal.m4 \
+ ${debian_dir}/build/sendmail.m4 \
+ ${debian_dir}/build/ndbm.m4 \
+ ${debian_dir}/config.log ${debian_dir}/config.cache \
+ ${debian_dir}/config.status \
+ ${debian_dir}/build/config.guess ${debian_dir}/build/config.sub;
+ $(RM) -r ${debian_dir}/autom4te.cache;
+ # Fakeout Make to look like current
+ $(RM) ${debian_dir}/configure.ac;
+ echo `date` > ${debian_dir}/configure.ac;
+ touch ${debian_dir}/configure;
+ touch ${debian_dir}/rules;
+
+
+#-------------
+clean-debian:
+ @echo 'cleaning debian directory...';
+ find ${debian_dir} -name '*~' -o -name '\.*\.swp' \
+ | xargs -r rm;
+ $(RM) ${debian_dir}/*.sav;
+ $(RM) ${debian_dir}/config.log ${debian_dir}/config.cache \
+ ${debian_dir}/config.status \
+ ${debian_dir}/build/config.guess.sav \
+ ${debian_dir}/build/config.sub.sav;
+ $(RM) -r ${debian_dir}/autom4te.cache;
+ # can't touch control/changelog/configure -- needed by debuild, etc
+ for file in $$(find ${debian_dir} -type f -name '*\.in' \
+ -a ! -name 'configure.in'); do \
+ $(RM) $$(echo "$$file" | sed -e 's/\.in$$//'); \
+ done;
+ $(RM) ${STAMP_DIR}/autotools ${STAMP_DIR}/configure;
+
+#-------------
+refresh-faq:
+ @echo 'Refreshing FAQ'
+ @chmod u+w ${debian_dir}/faq.txt;
+ (cd ${debian_dir} && wget --passive-ftp --timestamping \
+ --cache=off http://www.sendmail.org/faq/faq.txt;);
+ @chmod a-w ${debian_dir}/faq.txt;
+ @echo 'Refreshing Misc'
+ @chmod u+w ${debian_dir}/cf/feature/rhsbl.m4;
+ (cd ${debian_dir}/cf/feature && wget --passive-ftp --timestamping \
+ --cache=off http://www.rfc-ignorant.org/rhsbl.m4;);
+ @chmod u-w ${debian_dir}/cf/feature/rhsbl.m4;
+
+
+#-------------
+world:
+ # Debian build daemons don't (for the nonce) support build-indep,
+ # so this rule allows *me* to build both arch and indep portions
+ # of sendmail in one go (so I don't forget).
+ @dh_testdir;
+ $(MAKE) -f ${debian_dir}/rules info;
+ time ${DEB_BUILD} -rfakeroot
+
+test:
+ @dh_testdir;
+ $(MAKE) -f ${debian_dir}/rules clean-debian;
+ fakeroot $(MAKE) -f ${debian_dir}/rules clean;
+ $(MAKE) -f ${debian_dir}/rules \
+ ENABLE_TLS=yes ENABLE_DEV=no ENABLE_DOC=no \
+ CFLAGS='-O2 -Wall' DEB_BUILD_OPTIONS='nostrip' configure;
+ #time ${DEB_BUILD} -rfakeroot -d -us -uc;
+ time $(MAKE) -f ${debian_dir}/rules build-arch;
+
+print:
+ @dh_testdir;
+ -(cd ${BUILD_TREE}/.. && \
+ for file in `find . -name 'README'`; do \
+ lpr $$file; \
+ done; );
+ -(cd ${BUILD_TREE}/.. && \
+ lpr */KNOWNBUGS; \
+ lpr */RELEASE_NOTES; \
+ lpr */sendmail/SECURITY; \
+ lpr */sendmail/TUNING; \
+ lpr */sendmail/TRACEFLAGS; \
+ lpr */doc/op/op.ps; \
+ lpr */cf/feature/nullclient.m4; \
+ lpr */cf/feature/msp.m4; \
+ );
+ -(cd ${debian_dir} && \
+ lpr ../../${debian_dir}/configure.ac; \
+ lpr ../../${debian_dir}/build/rules.in; \
+ lpr build/site.config.m4.in; \
+ lpr cf/hack/msp_nullclient.m4; \
+ );
+
+
+#------------------------------------------------------------------------------
+# Misc rules
+#------------------------------------------------------------------------------
+#-------------
+${STAMP_DIR}:
+ mkdir -p ${STAMP_DIR};
+
+
+#------------------------------------------------------------------------------
+# Autoconf rules
+#------------------------------------------------------------------------------
+#-------------
+${debian_dir}/rules: ${debian_dir}/build/rules.in ${debian_dir}/config.status
+ # *** *** *** configure changed ?!? *** *** ***
+ if [ -e ${debian_dir}/config.status ]; then \
+ chmod ug+x ${debian_dir}/config.status; \
+ (cd ${debian_dir} && ./config.status;); \
+ fi;
+
+#-------------
+${debian_dir}/config.status: ${debian_dir}/configure
+ # *** *** *** configure changed ?!? *** *** ***
+ if [ -e ${debian_dir}/config.status ]; then \
+ chmod ug+x ${debian_dir}/config.status; \
+ (cd ${debian_dir} && ./config.status --recheck;) \
+ fi;
+
+#-------------
+${debian_dir}/configure: ${debian_dir}/configure.ac
+ # *** *** *** configure.ac changed ?!? *** *** ***
+ cp -af ${debian_dir}/configure.ac \
+ ${debian_dir}/configure.in;
+ (cd ${debian_dir} && autoconf;);
+ $(RM) ${debian_dir}/configure.in;
+ chmod ug+x ${debian_dir}/configure;
+
+#-------------
+autotools: ${STAMP_DIR} ${STAMP_DIR}/autotools
+${STAMP_DIR}/autotools:
+
+ #Add here commands to setup the autotools environment
+
+ # Make sure we have the latest available config.{guess,sub}
+ # Allow the package to override either by faking the date...
+ if [ -e /usr/share/misc/config.guess -a \
+ -e ${debian_dir}/build/config.guess ]; then \
+ OLDDATEGUESS=`${debian_dir}/build/config.guess -t | tr -d - `; \
+ NEWDATEGUESS=`/usr/share/misc/config.guess -t | tr -d - `; \
+ if [ "$$OLDDATEGUESS" -lt "$$NEWDATEGUESS" ]; then \
+ if [ ! -e ${debian_dir}/build/config.guess.sav ]; then \
+ cp -pf ${debian_dir}/build/config.guess \
+ ${debian_dir}/build/config.guess.sav;\
+ fi; \
+ if [ -e ${debian_dir}/build/config.guess.sav ]; then \
+ cp -pf /usr/share/misc/config.guess \
+ ${debian_dir}/build/config.guess; \
+ fi; \
+ fi; \
+ fi;
+ if [ -e /usr/share/misc/config.sub -a \
+ -e ${debian_dir}/build/config.sub ]; then \
+ OLDDATESUB=`${debian_dir}/build/config.sub -t | tr -d - `; \
+ NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d - `; \
+ if [ "$$OLDDATESUB" -lt "$$NEWDATESUB" ]; then \
+ if [ ! -e ${debian_dir}/build/config.sub.sav ]; then \
+ cp -pf ${debian_dir}/build/config.sub \
+ ${debian_dir}/build/config.sub.sav; \
+ fi; \
+ if [ -e ${debian_dir}/build/config.sub.sav ]; then \
+ cp -pf /usr/share/misc/config.sub \
+ ${debian_dir}/build/config.sub; \
+ fi; \
+ fi; \
+ fi;
+
+ touch ${STAMP_DIR}/autotools;
+
+
+
+#------------------------------------------------------------------------------
+# Build/Package check rules
+#------------------------------------------------------------------------------
+#-------------
+info:
+
+ #--------------------------------------------------------------------
+ # The following information will be used for this run:
+ # Source = ${package} ${pwd_string}
+ # Package = ${package} ${version_string}
+ # Version = ${version_major}.${version_minor}${version_debian}
+ # Arch = ${DEB_BUILD_ARCH} on ${DEB_HOST_ARCH}
+ # Options
+ # config opt = ${SM_CONF_OPT}
+ # build opt = ${SM_BUILD_OPT}
+ # ENABLE_TLS = ${ENABLE_TLS}
+ # ENABLUE_AUTH= ${ENABLE_AUTH}
+ # ENABLE_DEV = ${ENABLE_DEV}
+ # ENABLE_DOC = ${ENABLE_DOC}
+ # compile opt = ${CC} ${CFLAGS} ${DEFINES}
+ # DEB_BUILD_OPTIONS = ${DEB_BUILD_OPTIONS}
+ # DH_VERBOSE = ${DH_VERBOSE}
+ # DH_OPTIONS = ${DH_OPTIONS}
+ # DH_COMPAT = ${DH_COMPAT}
+ #--------------------------------------------------------------------
+
+#-------------
+buildinfo:
+ @echo '';
+ @dpkg -l \
+ debhelper \
+ dpkg-dev \
+ gcc \
+ 'libc6*' \
+ binutils \
+ ldso \
+ make \
+ m4 \
+ libdb3 libdb3-dev \
+ libdb2 libdb2-dev \
+ libwrap0 libwrap0-dev \
+ libldap2 libldap2-dev \
+ libopenldap1 libopenldap-dev \
+ umich-libldap umich-libldap-dev \
+ libsasl7 libsasl-dev \
+ openssl libssl-dev 'libssl0*' \
+ ${BUILD_INFO} \
+ 2> /dev/null \
+ | awk '$$1 == "ii" { printf("%s-%s\n", $$2, $$3) }' \
+ | tee ${debian_dir}/${package}.buildinfo.Debian;
+ @echo '';
+ @chmod 644 ${debian_dir}/${package}.buildinfo.Debian;
+
+#-------------
+pristine:
+ @dh_testdir;
+ #$(MAKE) -f ${debian_dir}/rules info;
+ #
+ # Fail if there are any modifications to the original
+ # tarball, other than the debian directory
+ if [ -f ../${package}_${version_string}.diff.gz ]; then \
+ zgrep -e "^\+\+\+ " ../${package}_${version_string}.diff.gz \
+ | sed -e "/^\+\+\+ ${package}-${version}\/debian\/.*$$/d" - \
+ | sed -e "/^+\+\+ ${package}-${version}\/upstream\/patches\/.*$$/d" - \
+ | [ ! -z - ]; \
+ fi;
+
+ # Check for presence of TLS (crypto) enablement and bitch if found
+ @if (grep -qEe '^#TLS:[[:space:]]*yes' \
+ ${debian_dir}/build/site.config.m4); then \
+ echo '** ** --------------------------------------------------- ** **';\
+ echo '** ** This package contains crypto support ! Be careful ! ** **';\
+ echo '** ** --------------------------------------------------- ** **';\
+ fi;
+
+#-------------
+verify:
+ @dh_testdir;
+ # Verifying the md5 summs and signed files
+ @for file in $$(find . -maxdepth 1 -name '*.md5'); do \
+ echo "Checking MD5 source: $$file."; \
+ cat $$file; \
+ md5sum -c $$file; \
+ done;
+ @for file in $$(find . -maxdepth 1 -name '*.sig'); do \
+ echo "Checking signature file $$file."; \
+ part=$$(echo "$$file" | sed -e 's/\.sig$$//'); \
+ if [ -f $$part ]; then \
+ gpg --verify $$part.sig $$part || true; \
+ elif [ -f $$part.gz ]; then \
+ gunzip -c $$part.gz > $$part; \
+ gpg --verify $$part.sig $$part || true; \
+ rm $$part; \
+ fi; \
+ done;
+
+
+#------------------------------------------------------------------------------
+# User callable rules
+#------------------------------------------------------------------------------
+#-------------
+clean:
+ dh_testdir;
+ dh_testroot;
+
+ # Add here commands to clean up after the build process.
+ #-$(MAKE) clean;
+ #-$(MAKE) distclean;
+
+ # First, remove any patches, and source directories
+ #$(MAKE) -f ${debian_dir}/sys-build.mk source.clean;
+
+ # Debian stuff
+ $(RM) -r ${SOURCE_DIR} ${STAMP_DIR};
+ $(RM) ${debian_dir}/*.buildinfo.Debian;
+ for file in tmp ${PACKAGES};do \
+ $(RM) -r ${debian_dir}/$$file; \
+ done;
+
+ # Local stuff
+ for subdir in ${MAKE_SUBDIRS}; do \
+ (cd ${debian_dir}/$$subdir && $(MAKE) -f Makefile.in clean;); \
+ done;
+
+ifeq (3, $(shell test ${DH_COMPAT} -ge 3 && echo '3'))
+ # Debhelper V3 conffile handling - prevent duplicates
+ for file in $$(find ${debian_dir} -maxdepth 1 -type f \
+ -name '*\.conffiles\.sav'); do \
+ mv $$file $$(echo "$$file" | sed -e 's?\.sav$$??'); \
+ done;
+endif
+
+ # can't touch control/changelog/configure -- needed by debuild, etc
+ $(RM) ${debian_dir}/config.log ${debian_dir}/config.cache \
+ ${debian_dir}/config.status;
+ $(RM) -r ${debian_dir}/autom4te.cache
+ for file in $$(find ${debian_dir} -type f -name '*\.in' \
+ -a ! -name 'configure.in'); do \
+ $(RM) $$(echo "$$file" | sed -e 's/\.in$$//'); \
+ done;
+
+ # Restore pre-existing config.{guess,sub}
+ -if [ -e ${debian_dir}/buil/config.sub.sav ]; then \
+ cp -pf ${debian_dir}/build/config.sub.sav \
+ ${debian_dir}/build/config.sub \
+ && $(RM) ${debian_dir}/build/config.sub.sav; \
+ fi;
+ -if [ -e ${debian_dir}/build/config.guess.sav ]; then \
+ cp -pf ${debian_dir}/build/config.guess.sav \
+ ${debian_dir}/build/config.guess \
+ && $(RM) ${debian_dir}/build/config.guess.sav; \
+ fi;
+
+ # Cleanup after build (for pristine source, smaller diffs)
+ #find .. -name ${package}*.asc -size 0 -maxdepth 1 -exec rm {} ';';
+ dh_clean;
+
+
+#-------------
+setup: ${STAMP_DIR}/setup
+${STAMP_DIR}/setup:
+
+# Support separate debian directory
+ifeq (yes, $(shell test -d debian && echo 'yes'))
+ dh_testdir;
+
+ # unpack and patch source
+ $(MAKE) -f ${SCRIPT_DIR}/dbs-build.mk \
+ BUILD_TREE="${BUILD_TREE}" TAR_DIR="${TAR_DIR}" \
+ STAMP_DIR="${STAMP_DIR}" PATCH_DIR="${PATCH_DIR}" \
+ SCRIPT_DIR="${SCRIPT_DIR}" \
+ ${STAMP_DIR}/unpack ${STAMP_DIR}/patch;
+
+ touch ${STAMP_DIR}/setup;
+endif
+
+
+#-------------
+configure: ${STAMP_DIR}/configure
+${STAMP_DIR}/configure: ${STAMP_DIR}/setup ${STAMP_DIR}/autotools
+
+ $(MAKE) -f ${debian_dir}/rules info;
+
+ #Add here commands to configure the package.
+ #./configure --prefix=/usr
+
+ # Use autoconf to handle varying degrees of library support
+ # NOTE: options values are Yes/No/Auto, but auto isn't always
+ # used herein, as it can cause problems to be ignored
+ # so it is only used on items of lesser importance
+ chmod ug+x ${debian_dir}/configure;
+ (cd ${debian_dir} && \
+ ./configure \
+ --build=${DEB_BUILD_GNU_TYPE} \
+ --host=${DEB_HOST_GNU_TYPE} \
+ --prefix=/usr \
+ --libexecdir=/usr/lib/sm.bin \
+ --datadir=${DATA_DIR} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --infodir=${DATA_DIR}/info \
+ --mandir=${DATA_DIR}/man \
+ --srcdir=${pwd_dir}/debian \
+ --with-buildtree=${BUILD_TREE} \
+ --with-docdir=${DATA_DIR}/doc \
+ --with-revision=${version_debian} \
+ --enable-regex=auto \
+ --enable-ndbm=no \
+ --enable-newdb=yes \
+ --enable-nis=auto \
+ --enable-nisplus=auto \
+ --enable-ldap=yes \
+ --enable-hesiod=no \
+ --enable-tcpd=auto \
+ --enable-bind=no \
+ --enable-ipv6=auto \
+ --enable-maillock=yes \
+ --enable-auth=${ENABLE_AUTH} \
+ --enable-tls=${ENABLE_TLS} \
+ --enable-shm=auto \
+ --enable-doc=${ENABLE_DOC} \
+ --enable-dev=${ENABLE_DEV} \
+ ${SM_CONF_OPT} \
+ ;);
+ # CC="${CC}" CFLAGS="${CFLAGS}
+
+ifeq (3, $(shell test ${DH_COMPAT} -ge 3 && echo '3'))
+ # Debhelper V3 conffile handling - prevent duplicates
+ for file in $$(find ${debian_dir} -maxdepth 1 -type f \
+ -name '*.conffiles'); do \
+ mv $$file $$file.sav; \
+ done;
+endif
+
+ touch ${STAMP_DIR}/configure;
+
+
+#-------------
+build-indep: ${STAMP_DIR}/build-indep
+${STAMP_DIR}/build-indep: ${STAMP_DIR}/configure
+
+# Skip work if nothing to do...
+ifeq (yes, ${ENABLE_INDEP})
+ dh_testdir;
+
+ # Document what we're building against
+ $(MAKE) -f ${debian_dir}/rules buildinfo;
+
+ # Add here commands to build/compile the documentation/package.
+ #$(MAKE) doc;
+
+ # Only valid on newer (8.11+) Sendmails
+ #(cd ${BUILD_TREE}/doc/op/ && make op.txt);
+ # So we'll do it by hand...
+ $(RM) ${BUILD_TREE}/doc/op/op.txt;
+ pic -C ${BUILD_TREE}/doc/op/op.me | eqn -C -Tascii \
+ | GROFF_NO_SGR=1 groff -Tascii -me | ul -t dumb > ${BUILD_TREE}/doc/op/op.txt;
+
+ # Debian stuff
+ for subdir in ${MAKE_SUBDIRS}; do \
+ (cd ${debian_dir}/$$subdir && $(MAKE) build-indep;); \
+ done;
+endif
+
+ touch ${STAMP_DIR}/build-indep;
+
+
+#-------------
+build-arch: ${STAMP_DIR}/build-arch
+${STAMP_DIR}/build-arch: ${STAMP_DIR}/configure
+
+# Skip work if nothing to do...
+ifeq (yes, ${ENABLE_ARCH})
+ dh_testdir;
+
+ # Document what we're building against
+ $(MAKE) -f ${debian_dir}/rules buildinfo;
+
+ # Add here commands to compile the package.
+ #$(MAKE);
+
+ # Place our m4 configuration files for the sendmail build to use
+ if [ -d ${BUILD_TREE}/devtools/Site ]; then \
+ cp -f ${debian_dir}/build/site.config.m4 ${BUILD_TREE}/devtools/Site/; \
+ fi;
+
+ # Correct some paths in upstream man pages
+ sed -e "s?/usr/adm/sm.bin?${sysconfdir}/mail/smrsh?g" \
+ -e "s?sm.bin?${sysconfdir}/mail/smrsh?g" \
+ ${BUILD_TREE}/smrsh/smrsh.8 \
+ > ${BUILD_TREE}/smrsh/smrsh.8.new;
+ mv ${BUILD_TREE}/smrsh/smrsh.8.new ${BUILD_TREE}/smrsh/smrsh.8;
+ sed -e "s?/etc/mail/statistics?${localstatedir}/lib/sendmail/sendmail.st?g"\
+ ${BUILD_TREE}/sendmail/sendmail.8 \
+ > ${BUILD_TREE}/sendmail/sendmail.8.new;
+ mv ${BUILD_TREE}/sendmail/sendmail.8.new \
+ ${BUILD_TREE}/sendmail/sendmail.8;
+
+ # Finally, build the whole enchilada (we'll let sendmail figure
+ # which, if any of the dependant libraries each component needs)
+ for subdir in ${SM_SUBDIRS}; do \
+ if [ -d ${BUILD_TREE}/$${subdir} ]; then \
+ (cd ${BUILD_TREE}/$${subdir} && ./Build -S;); \
+ fi; \
+ done;
+
+ # Remove our config m4 files
+ $(RM) ${BUILD_TREE}/devtools/Site/site.config.m4;
+
+ # Debian stuff
+ for subdir in ${MAKE_SUBDIRS}; do \
+ (cd ${debian_dir}/$$subdir && $(MAKE) build-arch;); \
+ done;
+endif
+
+ touch ${STAMP_DIR}/build-arch;
+
+
+#-------------
+install-indep: ${STAMP_DIR}/install-indep
+${STAMP_DIR}/install-indep: DH_OPTIONS=-i
+${STAMP_DIR}/install-indep: ${STAMP_DIR}/build-indep
+
+# Skip work if nothing to do...
+ifeq (yes, ${ENABLE_INDEP})
+ dh_testdir;
+ dh_testroot;
+ dh_clean -k;
+ dh_installdirs;
+ if [ -x /usr/bin/dh_link ]; then dh_link; fi;
+
+ # Add here commands to install the documentation/package.
+ #$(MAKE) prefix=`pwd`/${PKG_DIR}/usr install;
+
+ # sendmail operations guide and other documentation
+ $(INSTALL_DATA) ${BUILD_TREE}/doc/op/op.ps ${PKG_DOC}/op;
+ $(INSTALL_DATA) ${BUILD_TREE}/doc/op/op.txt ${PKG_DOC}/op;
+ $(INSTALL_DATA) ${BUILD_TREE}/README ${PKG_DOC}/;
+ $(INSTALL_DATA) ${BUILD_TREE}/KNOWNBUGS ${PKG_DOC}/;
+ $(INSTALL_DATA) ${BUILD_TREE}/cf/README ${PKG_DOC}/cf.README;
+ $(INSTALL_DATA) debian/README.Debian.sendmail \
+ ${PKG_DOC}/sendmail/README.Debian;
+ $(INSTALL_DATA) ${BUILD_TREE}/sendmail/README \
+ ${PKG_DOC}/sendmail/;
+ if [ -f ${BUILD_TREE}/sendmail/SECURITY ]; then \
+ $(INSTALL_DATA) ${BUILD_TREE}/sendmail/SECURITY \
+ ${PKG_DOC}/sendmail/SECURITY; \
+ fi;
+ $(INSTALL_DATA) ${BUILD_TREE}/sendmail/TRACEFLAGS \
+ ${PKG_DOC}/sendmail/TRACEFLAGS;
+ if [ -f ${BUILD_TREE}/sendmail/TUNING ]; then \
+ $(INSTALL_DATA) ${BUILD_TREE}/sendmail/TUNING \
+ ${PKG_DOC}/sendmail/TUNING; \
+ fi;
+ sed -e "s?/usr/libexec?${libexecdir}?g" \
+ -e "s?/usr/ucb/vacation?${libexecdir}/vacation.sendmail?g" \
+ -e "s?/usr/adm/sm.bin?/etc/mail/smrsh?g" \
+ ${BUILD_TREE}/smrsh/README \
+ > ${PKG_DOC}/smrsh.README;
+ $(INSTALL_DATA) debian/faq.txt ${PKG_DOC}/;
+
+ # libmilter-dev package
+ if [ -d ${BUILD_TREE}/libmilter ]; then \
+ $(INSTALL_DATA) debian/README.Debian.libmilter-dev \
+ ${PKG_DOC}/libmilter/README.Debian; \
+ $(INSTALL_DATA) ${BUILD_TREE}/libmilter/README \
+ ${PKG_DOC}/libmilter/README; \
+ if [ -d ${BUILD_TREE}/libmilter/docs ]; then \
+ cp -a ${BUILD_TREE}/libmilter/docs/* \
+ ${PKG_DOC}/libmilter/html; \
+ fi; \
+ fi;
+
+ # Debian stuff
+ for subdir in ${MAKE_SUBDIRS}; do \
+ (cd ${debian_dir}/$$subdir && \
+ $(MAKE) install-indep \
+ DESTDIR="../../${PKG_DOC}";); \
+ done;
+
+ # Multiple package fixup
+ #dh_movefiles -i --sourcedir debian/${package};
+
+ # Actions from binary-common
+ #
+ dh_fixperms;
+ #
+ # Cleanup misc permissions, etc... (fakeroot, dh_fixperms, etc.)
+endif
+
+ touch ${STAMP_DIR}/install-indep;
+
+
+#-------------
+install-arch: ${STAMP_DIR}/install-arch
+${STAMP_DIR}/install-arch: DH_OPTIONS=-a
+${STAMP_DIR}/install-arch: ${STAMP_DIR}/build-arch
+
+# Skip work if nothing to do...
+ifeq (yes, ${ENABLE_ARCH})
+ dh_testdir;
+ dh_testroot;
+ dh_clean -k;
+ dh_installdirs;
+ if [ -x /usr/bin/dh_link ]; then dh_link; fi;
+
+ # Add here commands to install the package into ${PKG_DIR}.
+ #$(MAKE) prefix=`pwd`/${PKG_DIR}/usr install;
+
+ # sendmail install proper... with a little help ;-}
+ #$(MAKE) install DESTDIR="$${pwd}/${PKG_DIR}";
+
+ # Finally, install the whole enchilada
+ for subdir in ${SM_SUBDIRS}; do \
+ if [ -d ${BUILD_TREE}/$${subdir} ]; then \
+ if [ "$${subdir}" = 'libmilter' ]; then \
+ :; \
+ elif [ "$${subdir}" = 'mail.local' -o \
+ "$${subdir}" = 'rmail' ]; then \
+ (cd ${BUILD_TREE}/obj*/$${subdir} && \
+ $(MAKE) force-install \
+ DESTDIR="../../../../${PKG_DIR}";); \
+ else \
+ (cd ${BUILD_TREE}/obj*/$${subdir} && \
+ $(MAKE) install \
+ DESTDIR="../../../../${PKG_DIR}";); \
+ fi; \
+ fi; \
+ done;
+ # Support older Sendmail (below 8.10.0)
+ if [ -f ${PKG_DIR}${sysconfdir}/mail/sendmail.hf ]; then \
+ mv -f ${PKG_DIR}${sysconfdir}/mail/sendmail.hf \
+ ${PKG_DIR}${sysconfdir}/mail/helpfile; \
+ $(RM) ${PKG_DIR}${localstatedir}/lib/sendmail/sendmail.st; \
+ fi;
+
+ # FHS says that rmail belongs in ${sbindir}
+ mv ${PKG_DIR}${bindir}/rmail ${PKG_DIR}${sbindir}/rmail;
+
+ # Sendmail alias handling...
+ # NOTE: whilst smptd is a valid alias for sendmail, we don't create
+ # one so that we can co-exists with smtpd (a firewall frontend)
+ # NOTE: newscache package also contains ${sbindir}/hoststat
+ # NOTE: newalias, purgestat, etc. aren't for the general user..
+ # yeah, yeah, I know... these can be done with -b<flag>!
+ (cd ${PKG_DIR}${bindir} && \
+ $(RM) hoststat mailq newaliases purgestat smtpd;)
+ ln -sf ../sbin/sendmail ${PKG_DIR}${libdir}/sendmail;
+ (cd ${PKG_DIR}${sbindir} && for file in \
+ newaliases hoststat purgestat \
+ ; do \
+ ln -sf sendmail $$file; \
+ done;);
+ # Handle man pages for these aliases
+ (cd ${PKG_DIR}${mandir}/man8 && for file in \
+ hoststat.8.gz purgestat.8.gz \
+ ; do \
+ ln -sf sendmail.8.gz $$file; \
+ done;);
+ # Place those removed aliases in ${libexecdir} (mostly for me)
+ (cd ${PKG_DIR}${libexecdir} && for file in \
+ hoststat mailq newaliases purgestat smtpd; do \
+ ln -sf ../../sbin/sendmail $$file; \
+ done;);
+ # NOTE: with the MSP/MTA split, we'll provide our own mailstats (keep orig)
+ mv ${PKG_DIR}${sbindir}/mailstats \
+ ${PKG_DIR}${libexecdir}/mailstats;
+ # Special handling of vacation - Debian has a seperate package
+ # with a different version (sigh) keep our copy just in case...
+ if [ -d ${BUILD_TREE}/vacation ]; then \
+ mv ${PKG_DIR}${bindir}/vacation \
+ ${PKG_DIR}${libexecdir}/vacation.sendmail; \
+ mv ${PKG_DIR}${mandir}/man1/vacation.1 \
+ ${PKG_DIR}${mandir}/man1/vacation.sendmail.1; \
+ fi;
+ # m4 configuration directories
+ cp -a ${BUILD_TREE}/cf/* ${PKG_DIR}${datadir}/sendmail/cf;
+ $(RM) ${PKG_DIR}${datadir}/sendmail/cf/README;
+ $(RM) ${PKG_DIR}${datadir}/sendmail/cf/sendmail.schema;
+ $(RM) ${PKG_DIR}${datadir}/sendmail/cf/cf/Build;
+ $(RM) ${PKG_DIR}${datadir}/sendmail/cf/cf/Makefile;
+ $(RM) ${PKG_DIR}${datadir}/sendmail/cf/cf/*.cf;
+
+ # contributed stuff - scripts
+ sed -e 's?/usr/local/bin/perl?/usr/bin/perl?g' \
+ -e "s?/etc/sendmail.cf?${sysconfdir}/mail/sendmail.cf?g" \
+ ${BUILD_TREE}/contrib/etrn.pl \
+ > ${PKG_DIR}${sbindir}/etrn;
+ chmod 0755 ${PKG_DIR}${sbindir}/etrn;
+ if [ -f ${BUILD_TREE}/contrib/etrn.0 ]; then \
+ sed 's?/usr/local/bin/perl?/usr/bin/perl?g' \
+ ${BUILD_TREE}/contrib/etrn.0 \
+ > ${PKG_DIR}${mandir}/man8/etrn.8; \
+ else \
+ sed 's?/usr/local/bin/perl?/usr/bin/perl?g' \
+ ${BUILD_TREE}/contrib/etrn.pl \
+ > ${PKG_DIR}${mandir}/man8/etrn.8; \
+ fi;
+ sed -e 's?/usr/local/bin/perl?/usr/bin/perl?g' \
+ ${BUILD_TREE}/contrib/expn.pl \
+ > ${PKG_DIR}${bindir}/expn;
+ chmod 0755 ${PKG_DIR}${bindir}/expn;
+ sed 's?/usr/local/bin/perl?/usr/bin/perl?g' \
+ ${BUILD_TREE}/contrib/expn.pl \
+ > ${PKG_DIR}${mandir}/man8/expn.8;
+ sed -e "s?/etc/sendmail.cf?${sysconfdir}/mail/sendmail.cf?g" \
+ debian/checksendmail/checksendmail.perl \
+ > ${PKG_DIR}${sbindir}/checksendmail;
+ chmod 0755 ${PKG_DIR}${sbindir}/checksendmail;
+ $(INSTALL_DATA) debian/checksendmail/checksendmail.8 \
+ ${PKG_DIR}${mandir}/man8/;
+ sed -e 's?/usr/local/bin/perl?/usr/bin/perl?g' \
+ -e 's?/usr/sbin/sendmail -q30m -bd?/etc/init.d/sendmail start?g' \
+ ${BUILD_TREE}/contrib/smcontrol.pl \
+ > ${PKG_DIR}${datadir}/sendmail/smcontrol.pl;
+ chmod 0755 ${PKG_DIR}${datadir}/sendmail/smcontrol.pl;
+ $(INSTALL_SCRIPT) ${BUILD_TREE}/contrib/doublebounce.pl \
+ ${PKG_DIR}${datadir}/sendmail;
+ if [ -f ${BUILD_TREE}/contrib/qtool.pl ]; then \
+ sed -e 's?/usr/bin/env perl?/usr/bin/perl?g' \
+ ${BUILD_TREE}/contrib/qtool.pl \
+ > ${PKG_DIR}${datadir}/sendmail/qtool.pl; \
+ chmod 0755 ${PKG_DIR}${datadir}/sendmail/qtool.pl; \
+ $(INSTALL_DATA) ${BUILD_TREE}/contrib/qtool.8 \
+ ${PKG_DIR}${mandir}/man8/; \
+ fi;
+ if [ -f ${BUILD_TREE}/contrib/buildvirtuser ]; then \
+ $(INSTALL_SCRIPT) ${BUILD_TREE}/contrib/buildvirtuser \
+ ${PKG_DIR}${datadir}/sendmail/; \
+ fi;
+
+ # contributed stuff - examples
+ sed 's?/bin/perl?/usr/bin/perl?g' \
+ ${BUILD_TREE}/contrib/passwd-to-alias.pl \
+ > ${PKG_DIR}${datadir}/sendmail/examples/passwd-to-alias;
+ chmod 0755 ${PKG_DIR}${datadir}/sendmail/examples/passwd-to-alias;
+
+ # contributed stuff - m4 scripts
+ if [ -f ${BUILD_TREE}/contrib/domainmap.m4 ]; then \
+ $(INSTALL_DATA) ${BUILD_TREE}/contrib/domainmap.m4 \
+ ${PKG_DIR}${datadir}/sendmail/cf/feature; \
+ fi;
+ if [ -f ${BUILD_TREE}/contrib/dnsblaccess.m4 ]; then \
+ $(INSTALL_DATA) ${BUILD_TREE}/contrib/dnsblaccess.m4 \
+ ${PKG_DIR}${datadir}/sendmail/cf/hack; \
+ fi;
+
+ # Debian stuff
+ for subdir in ${MAKE_SUBDIRS}; do \
+ (cd ${debian_dir}/$$subdir && \
+ $(MAKE) install-arch \
+ DESTDIR="../../${PKG_DIR}";); \
+ done;
+ # Debian stuff - m4 scripts
+ (cd debian && \
+ for file in $$(find cf -type f -name '*.m4' -o -name '*.mc'); do \
+ $(INSTALL_DATA) $$file \
+ ../${PKG_DIR}${datadir}/sendmail/$$file; \
+ done;);
+ # Debian stuff - examples
+ $(INSTALL_DATA) debian/checksendmail/address.resolve \
+ ${PKG_DIR}${datadir}/sendmail/examples/;
+
+ # libmilter-dev package
+ifeq (yes, ${ENABLE_DEV})
+ if [ -d ${BUILD_TREE}/libmilter ]; then \
+ (cd ${BUILD_TREE}/obj*/libmilter && \
+ $(MAKE) install \
+ DESTDIR="../../../../debian/libmilter-dev";); \
+ $(INSTALL_PROGRAM) ${BUILD_TREE}/obj.*/libmilter/libmilter.a \
+ debian/libmilter-dev${libdir}/libmilter/; \
+ $(INSTALL_DATA) ${BUILD_TREE}/include/libmilter/mfapi.h \
+ debian/libmilter-dev${includedir}/libmilter/; \
+ if [ -f ${BUILD_TREE}/include/libmilter/mfdef.h ]; then \
+ $(INSTALL_DATA) ${BUILD_TREE}/include/libmilter/mfdef.h \
+ debian/libmilter-dev${includedir}/libmilter/; \
+ fi; \
+ $(INSTALL_PROGRAM) ${BUILD_TREE}/obj.*/libsmutil/libsmutil.a \
+ debian/libmilter-dev${libdir}/libmilter/; \
+ if [ -d ${BUILD_TREE}/libsm ]; then \
+ $(INSTALL_PROGRAM) ${BUILD_TREE}/obj.*/libsm/libsm.a \
+ debian/libmilter-dev${libdir}/libmilter/; \
+ fi; \
+ fi;
+endif
+
+ # Multiple package fixup
+ #dh_movefiles -a --sourcedir debian/${package};
+
+ # Actions from binary-common
+ #dh_installcron;
+ $(INSTALL_SCRIPT) debian/${package}.cron.daily \
+ ${PKG_DIR}${sysconfdir}/cron.daily/sendmail;
+ #dh_installlogrotate;
+ #$(INSTALL_DATA) debian/${package}.logrotate \
+ # ${PKG_DIR}${sysconfdir}/logrotate.d/sendmail;
+ #
+ dh_fixperms;
+ #
+ # Cleanup misc permissions, etc... (fakeroot, dh_fixperms, etc.)
+ chmod a+x ${PKG_DIR}${datadir}/sendmail/cf/sh/makeinfo.sh;
+ chown root:root ${PKG_DIR}${sysconfdir}/mail/helpfile;
+ chown root:root ${PKG_DIR}${sysconfdir}/mail/peers/provider;
+ chown root:root ${PKG_DIR}${sysconfdir}/mail/service.switch*;
+ #
+ # You may want to make some executables suid here.
+ chown root:mail ${PKG_DIR}${sbindir}/sendmail;
+ chmod 04755 ${PKG_DIR}${sbindir}/sendmail;
+ chown root:mail ${PKG_DIR}${libexecdir}/mailstats;
+ chmod 02755 ${PKG_DIR}${libexecdir}/mailstats;
+ chown root:mail ${PKG_DIR}${libexecdir}/mail.local;
+ chmod 0755 ${PKG_DIR}${libexecdir}/mail.local;
+ chown root:mail ${PKG_DIR}${libexecdir}/smrsh;
+ chmod 0755 ${PKG_DIR}${libexecdir}/smrsh;
+ chown root:mail ${PKG_DIR}${libexecdir}/sensible-mda;
+ chmod 0755 ${PKG_DIR}${libexecdir}/sensible-mda;
+
+ # Special case Perl for Debian Slink (2.1), debhelper v1
+ if [ ! -x /usr/bin/dh_perl ]; then \
+ echo 'perl:Depends=perl5|perl' >> debian/substvars; fi;
+
+ # Install Lintian overrides
+ $(INSTALL_DATA) -d -g root -m 755 ${PKG_DIR}${datadir}/lintian/overrides
+ $(INSTALL_DATA) -g root -m 644 debian/${package}.lintian-overrides \
+ ${PKG_DIR}${datadir}/lintian/overrides/${package}
+endif
+
+ touch ${STAMP_DIR}/install-arch;
+
+
+#-------------
+# This single target is used to build all the packages, all at once, or
+# one at a time. So keep in mind: any options passed to commands here will
+# affect _all_ packages. Anything you want to only affect one package
+# should be put in another target, such as the install target.
+#
+# Must not depend on anything. This is to be called by
+# binary-arch/binary-indep in another 'make' thread.
+binary-common:
+ # Need this version of debhelper for DH_OPTIONS to work.
+ dh_testversion 1.1.17;
+ dh_testdir;
+ dh_testroot;
+ # Done in install-xxx, but still need to get rid of *.debhelper !!!
+ #dh_clean -k;
+ $(RM) debian/*.debhelper;
+
+ dh_installchangelogs -k ${BUILD_TREE}/RELEASE_NOTES;
+ #-------- needs script name ala installinit ----
+ # Done in install-xxx
+ #dh_installcron;
+ if [ -x /usr/bin/dh_installdebconf ]; then dh_installdebconf; fi;
+ dh_installdocs;
+ #dh_installemacsen;
+ #dh_installexamples;
+ #if [ -x /usr/bin/dh_installinfo ]; then dh_installinfo; fi;
+ dh_installinit --init-script=sendmail;
+ #-------- needs script name ala installinit ----
+ # Done in install-xxx
+ #if [ -x /usr/bin/dh_installlogrotate ]; then dh_installlogrotate; fi;
+ if [ -x /usr/bin/dh_installman ]; then dh_installman; fi;
+ #dh_installmenu;
+ #dh_installmime;
+ #dh_undocumented;
+ if [ -x /usr/bin/dh_installpam ]; then dh_installpam; fi;
+ # Done in install-xxx
+ #if [ -x /usr/bin/dh_link ]; then dh_link; fi;
+ifeq (, $(findstring nostrip,${DEB_BUILD_OPTIONS}))
+ dh_strip;
+else
+ #dh_strip;
+endif
+ dh_compress;
+ # Done in install-xxx
+ #dh_fixperms;
+ # Need to special case this now that we're using dynamic uid/gid
+ #if [ -x /usr/sbin/suidregister -a -s /etc/suid.conf ]; then
+ # dh_suidregister; fi;
+ #
+ # Cleanup misc permissions, etc... (fakeroot, dh_fixperms, etc.)
+ # Done in install-xxx
+ #
+ # You may want to make some executables suid here.
+ # Done in install-xxx
+ #
+ #dh_makeshlibs;
+ dh_installdeb;
+ dh_shlibdeps;
+ if [ -x /usr/bin/dh_perl ]; then dh_perl; fi
+ dh_gencontrol;
+ dh_md5sums;
+ dh_builddeb;
+
+ $(MAKE) -f ${debian_dir}/rules pristine;
+
+
+#-------------
+# Build architecture independant packages using the common target.
+# (Uncomment this next line if you have such packages.)
+binary-indep: ${STAMP_DIR}/build-indep ${STAMP_DIR}/install-indep
+
+# Skip work if nothing to do...
+ifeq (yes, ${ENABLE_INDEP})
+ $(MAKE) -f ${debian_dir}/rules DH_OPTIONS=-i binary-common;
+endif
+
+
+#-------------
+# Build architecture dependant packages using the common target.
+binary-arch: ${STAMP_DIR}/build-arch ${STAMP_DIR}/install-arch
+
+# Skip work if nothing to do...
+ifeq (yes, ${ENABLE_ARCH})
+ $(MAKE) -f ${debian_dir}/rules DH_OPTIONS=-a binary-common;
+endif
+
+
+#-------------
+# Any other binary targets build just one binary package at a time.
+binary-%:
+ $(MAKE) -f ${debian_dir}/rules binary-common DH_OPTIONS=-p$*;
+
+
+#-------------
+# Below here is fairly generic really
+
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+# Due to buildd not (for the nonce) supporting build-arch, kluge next rule
+build: build-arch
+install: install-indep install-arch
+binary: binary-indep binary-arch
+.PHONY: refresh-dbs refresh-debian update-debian refresh-faq
+.PHONY: pristine
+.PHONY: info buildinfo
+.PHONY: setup autotools configure
+.PHONY: clean build build-indep build-arch
+.PHONY: install install-indep install-arch
+.PHONY: binary binary-indep binary-arch
+.SUFFIXES:
+.PRECIOUS: ${debian_dir}/rules
diff --git a/debian/scripts/dbs-build.mk b/debian/scripts/dbs-build.mk
new file mode 100644
index 0000000..1fe8000
--- /dev/null
+++ b/debian/scripts/dbs-build.mk
@@ -0,0 +1,94 @@
+#!/usr/bin/make -f
+# Separate tarball/patch build system by Adam Heath <doogie@debian.org>
+# Modified by Ben Collins <bcollins@debian.org>
+
+SHELL = /bin/bash -e
+SOURCE_DIR = build-tree
+STAMP_DIR = stampdir
+PATCH_DIR = debian/patches
+SCRIPT_DIR = /usr/share/dbs
+
+patched = $(STAMP_DIR)/patch
+unpacked = $(STAMP_DIR)/unpack
+
+ifdef TAR_DIR
+ BUILD_TREE = $(SOURCE_DIR)/$(TAR_DIR)
+else
+ BUILD_TREE = $(SOURCE_DIR)
+endif
+
+dh_mak_deps = $(shell DH_COMPAT=$(DH_COMPAT) perl $(SCRIPT_DIR)/dbs_split makedeps)
+dh_gen_deps = $(shell DH_COMPAT=$(DH_COMPAT) perl $(SCRIPT_DIR)/dbs_split gendeps)
+
+$(dh_mak_deps): $(dh_gen_deps)
+ perl $(SCRIPT_DIR)/dbs_split
+
+setup: $(dh_mak_deps)
+ dh_testdir
+ @-up-scripts
+ $(MAKE) -f debian/rules $(unpacked) $(patched)
+
+$(patched)/: $(STAMP_DIR)/created $(unpacked)
+ test -d $(STAMP_DIR)/patches || mkdir -p $(STAMP_DIR)/patches
+ @if [ -d "$(PATCH_DIR)" ]; then \
+ mkdir -p $(STAMP_DIR)/log/patches; \
+ for f in `(cd $(PATCH_DIR); find -type f ! -name 'chk-*') | sort | \
+ sed s,'./',,g`; do \
+ stampfile=$(STAMP_DIR)/patches/$$f; \
+ log=$(STAMP_DIR)/log/patches/$$f; \
+ if [ ! -e $$stampfile ]; then \
+ echo -n "Applying patch $(PATCH_DIR)/$$f ... "; \
+ if $(SHELL) $(SCRIPT_DIR)/file2cat $(PATCH_DIR)/$$f | \
+ (cd $(SOURCE_DIR);patch -p0 --no-backup-if-mismatch) > $$log 2>&1; then \
+ echo successful.; \
+ touch $$stampfile; \
+ else \
+ echo "failed! (check $$log for reason)"; \
+ exit 1; \
+ fi; \
+ else \
+ echo Already applied $(PATCH_DIR)/$$f.; \
+ fi; \
+ done; \
+ fi
+ touch $@
+
+unpacked: $(unpacked)
+$(unpacked): $(STAMP_DIR)/created
+ mkdir -p $(STAMP_DIR)/sources $(SOURCE_DIR) $(STAMP_DIR)/log/sources
+ @for f in `find . -type f -maxdepth 1 -name \*.tgz -o -name \*.tar.gz -o \
+ -name \*.tar.bz -o -name \*.tar.bz2 | sort | sed s,'./',,g`; do \
+ stampfile=$(STAMP_DIR)/sources/`basename $$f`; \
+ log=$(STAMP_DIR)/log/sources/`basename $$f`; \
+ if [ ! -e $$stampfile ]; then \
+ echo -n "Extracting source $$f ... "; \
+ if $(SHELL) $(SCRIPT_DIR)/file2cat $$f | \
+ (cd $(SOURCE_DIR); tar xv) > $$log 2>&1; then \
+ echo successful.; \
+ touch $$stampfile; \
+ else \
+ echo failed!; \
+ exit 1; \
+ fi; \
+ else \
+ echo Already unpacked $$f.; \
+ fi; \
+ done
+ touch $@
+
+make_patch:
+ mv $(BUILD_TREE) $(BUILD_TREE).new
+ rm -rf $(STAMP_DIR)
+ $(MAKE) -f debian/rules $(unpacked) $(patched)
+ifndef TAR_DIR
+ diff -urN $(BUILD_TREE) $(BUILD_TREE).new > new.diff
+else
+ (cd $(SOURCE_DIR) && diff -urN $(TAR_DIR) $(TAR_DIR).new || true) > new.diff
+endif
+ rm -rf $(BUILD_TREE)
+ mv $(BUILD_TREE).new $(BUILD_TREE)
+ @echo; ls -l new.diff
+
+$(STAMP_DIR)/created:
+ test -d $(STAMP_DIR) || mkdir $(STAMP_DIR)
+ touch $(STAMP_DIR)/created
diff --git a/debian/scripts/dbs_split b/debian/scripts/dbs_split
new file mode 100644
index 0000000..13f4d82
--- /dev/null
+++ b/debian/scripts/dbs_split
@@ -0,0 +1,83 @@
+#!/usr/bin/perl
+
+$control = 'debian/control';
+if ( -d 'debian/packages.d' ) {
+ $dir = 'debian/packages.d';
+} else {
+ $dir = 'debian';
+}
+$needclean = 0;
+$needlist = 0;
+$needdeps = 0;
+
+if (defined($ENV{'DH_COMPAT'})) {
+ $dh = $ENV{'DH_COMPAT'};
+} else {
+ $dh = 0;
+}
+
+if (@ARGV) {
+ $temp = shift;
+ if ($temp eq "clean") { $needclean = 1; }
+ elsif ($temp eq "makedeps") { $needlist = 1; }
+ elsif ($temp eq "gendeps") { $needdeps = 1; }
+}
+
+@packages = ();
+$first_package = "";
+
+open (CONTROL, "< $control");
+
+while (<CONTROL>) {
+ if (m/^Package:/) {
+ $package = (split)[1];
+ if ($first_package eq "" and $dh < 2) {
+ $first_package = $package;
+ }
+ if ( -f "${dir}/${package}.in" ) {
+ push @packages, $package;
+ }
+ }
+}
+
+close CONTROL;
+
+while (@packages) {
+ $package = shift(@packages);
+ $inhead = 1;
+ $opened = 0;
+ if ($needdeps) {
+ print "${dir}/${package}.in ";
+ next;
+ }
+ open (IN, "< ${dir}/${package}.in");
+ while (<IN>) {
+ if (m/^\%(.*)\%$/) {
+ if ($needclean) {
+ if ($package ne $first_package) {
+ system("rm -f debian/${package}.${1}");
+ } else {
+ system("rm -f debian/${1}");
+ }
+ } elsif ($needlist) {
+ if ($package ne $first_package) {
+ print "debian/${package}.${1} ";
+ } else {
+ print "debian/${1} ";
+ }
+ } else {
+ $inhead = 0;
+ if ($opened) { close OUT; } else { $opened = 1; }
+ if ($package ne $first_package) {
+ open OUT, "> debian/${package}.${1}";
+ } else {
+ open OUT, "> debian/${1}";
+ }
+ }
+ } elsif (!$inhead) {
+ print OUT $_;
+ }
+ }
+ close OUT;
+ close IN;
+}
diff --git a/debian/scripts/dpkg-arch.mk b/debian/scripts/dpkg-arch.mk
new file mode 100644
index 0000000..4a3ab3d
--- /dev/null
+++ b/debian/scripts/dpkg-arch.mk
@@ -0,0 +1,7 @@
+# see dpkg-architecture(8)
+DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+DEB_BUILD_GNU_CPU := $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
+DEB_BUILD_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
+DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
+DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
diff --git a/debian/scripts/file2cat b/debian/scripts/file2cat
new file mode 100644
index 0000000..d95d77e
--- /dev/null
+++ b/debian/scripts/file2cat
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ "$1" = "" ]; then
+ echo "Usage: file2cat <file>"
+ exit 1
+fi
+
+case "$1" in
+ *.gz|*.Z|*.tgz) cmd=zcat;;
+ *.bz|*.bz2) cmd=bzcat;;
+ *) cmd=cat;;
+esac
+$cmd $1
diff --git a/debian/sendmail-FAQ.doc-base b/debian/sendmail-FAQ.doc-base
new file mode 100644
index 0000000..00c0713
--- /dev/null
+++ b/debian/sendmail-FAQ.doc-base
@@ -0,0 +1,12 @@
+Document: Sendmail
+Title: Sendmail Documentation
+Author: Various
+Abstract: Various tidbits of sendmail lore, both fact and fiction
+Section: mail
+
+Format: text
+Files: /usr/share/doc/sendmail/*.txt
+
+Format: HTML
+Index: /usr/share/doc/sendmail/index.html
+Files: /usr/share/doc/sendmail/*.html
diff --git a/debian/sendmail-doc.dirs.in b/debian/sendmail-doc.dirs.in
new file mode 100644
index 0000000..b301667
--- /dev/null
+++ b/debian/sendmail-doc.dirs.in
@@ -0,0 +1,5 @@
+@docdir@/sendmail-doc
+@docdir@/sendmail-doc/libmilter
+@docdir@/sendmail-doc/libmilter/html
+@docdir@/sendmail-doc/op
+@docdir@/sendmail-doc/sendmail
diff --git a/debian/sendmail-doc.docs b/debian/sendmail-doc.docs
new file mode 100644
index 0000000..58c806d
--- /dev/null
+++ b/debian/sendmail-doc.docs
@@ -0,0 +1,4 @@
+debian/README.Debian.sendmail-doc
+debian/sendmail.buildinfo.Debian
+debian/Debian-specific
+debian/build/site.config.m4
diff --git a/debian/sendmail-doc.postinst b/debian/sendmail-doc.postinst
new file mode 100644
index 0000000..bf0ac2a
--- /dev/null
+++ b/debian/sendmail-doc.postinst
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+#
+# Debian post installation script
+#
+# Install of already installed package:
+# 1) old-prerm upgrade new-version
+# *) new-prerm failed-upgrade old-version
+# *) old-postinst abort-upgrade new-version
+#
+# If a `conflicting' package is being removed at the same time:
+# 1) forall packages depending on conflicting package and --auto-deconfigure
+# deconfigured's-prerm deconfigure \
+# in-favour package-being-installed version \
+# removing conflicting-package version
+# *) deconfigured's-postinst abort-deconfigure \
+# in-favour package-being-installed-but-failed version \
+# removing conflicting-package version
+# 2) To prepare for removal of the conflicting package
+# conflictor's-prerm remove \
+# in-favour package new-version
+# *) conflictor's-postinst abort-remove \
+# in-favour package new-version
+#
+# Configuration of package:
+# postinst configure most-recently-configured-version
+#
+set -e;
+
+PACKAGE=`echo "$(basename $0)" | sed -e 's/\.postinst$//'`;
+
+case "$1" in
+ configure)
+ # continue below
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ exit 0;
+ ;;
+
+ *)
+ echo "$PACKAGE postinst called with unknown argument \`$1'" >&2;
+ exit 1;
+ ;;
+ esac;
+
+#DEBHELPER#
+exit 0;
diff --git a/debian/sendmail-doc.postrm.in b/debian/sendmail-doc.postrm.in
new file mode 100644
index 0000000..8b10744
--- /dev/null
+++ b/debian/sendmail-doc.postrm.in
@@ -0,0 +1,53 @@
+#!/bin/sh -e
+#
+# Debian post removal script
+#
+# Install of already installed package:
+# 1) Upgrade of package:
+# new-preinst upgrade old-version
+# *) new-postrm abort-upgrade old-version
+# 2) package had some configuration files from a previous version installed
+# new-preinst install old-version
+# *) new-postrm abort-install old-version
+# 3) Otherwise (i.e., the package was completely purged)
+# new-preinst install
+# *) new-postrm abort-install
+#
+# Removal of a package:
+# 1) prerm remove
+# 2) The package's files are removed (except conffiles).
+# 3) postrm remove
+# 4) All the maintainer scripts except the postrm are removed.
+# 5) The conffiles and any backup files
+# (~-files, #*# files, %-files, .dpkg-{old,new,tmp}, etc.) are removed.
+# 6) postrm purge
+# 7) The package's file list is removed
+#
+set -e;
+
+PACKAGE=`echo "$(basename $0)" | sed -e 's/\.postrm$//'`;
+
+case "$1" in
+ remove)
+ # /usr/share/doc/sendmail-doc is a symlink to /usr/share/doc/sendmail
+ rm -f @docdir@/sendmail-doc 2>/dev/null || true;
+ rmdir @docdir@/sendmail 2>/dev/null || true;
+ ;;
+
+ purge)
+ ;;
+
+ upgrade)
+ ;;
+
+ failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "$PACKAGE postrm called with unknown argument \`$1'" >&2;
+ exit 1;
+ ;;
+ esac;
+
+#DEBHELPER#
+exit 0;
diff --git a/debian/sendmail-doc.preinst.in b/debian/sendmail-doc.preinst.in
new file mode 100644
index 0000000..85a410b
--- /dev/null
+++ b/debian/sendmail-doc.preinst.in
@@ -0,0 +1,55 @@
+#!/bin/sh -e
+#
+# Debian pre install script
+#
+# Install of already installed package:
+# 1) Upgrade of package:
+# new-preinst upgrade old-version
+# *) new-postrm abort-upgrade old-version
+# 2) package had some configuration files from a previous version installed
+# new-preinst install old-version
+# *) new-postrm abort-install old-version
+# 3) Otherwise (i.e., the package was completely purged)
+# new-preinst install
+# *) new-postrm abort-install
+#
+set -e;
+
+PACKAGE=`echo "$(basename $0)" | sed -e 's/\.preinst$//'`;
+
+case "$1" in
+ install)
+ # DPKG doesn't overwrite directories with symlinks...
+ if [ -d @docdir@/sendmail-doc ]; then
+ rm -rf @docdir@/sendmail-doc;
+ fi;
+ if [ ! -d @docdir@/sendmail ]; then
+ mkdir -p @docdir@/sendmail;
+ chmod a+rx @docdir@/sendmail;
+ fi;
+ ln -sf sendmail @docdir@/sendmail-doc;
+ ;;
+
+ upgrade)
+ # DPKG doesn't overwrite directories with symlinks...
+ if [ -d @docdir@/sendmail-doc ]; then
+ rm -rf @docdir@/sendmail-doc;
+ fi;
+ if [ ! -d @docdir@/sendmail ]; then
+ mkdir -p @docdir@/sendmail;
+ chmod a+rx @docdir@/sendmail;
+ fi;
+ ln -sf sendmail @docdir@/sendmail-doc;
+ ;;
+
+ abort-upgrade)
+ ;;
+
+ *)
+ echo "$PACKAGE preinst called with unknown argument \`$1'" >&2;
+ exit 1;
+ ;;
+ esac;
+
+#DEBHELPER#
+exit 0;
diff --git a/debian/sendmail-doc.prerm b/debian/sendmail-doc.prerm
new file mode 100644
index 0000000..966dfdd
--- /dev/null
+++ b/debian/sendmail-doc.prerm
@@ -0,0 +1,54 @@
+#!/bin/sh -e
+#
+# Debian pre removal script
+#
+# Install of already installed package:
+# 1) old-prerm upgrade new-version
+# *) new-prerm failed-upgrade old-version
+# *) old-postinst abort-upgrade new-version
+#
+# If a `conflicting' package is being removed at the same time:
+# 1) forall packages depending on conflicting package and --auto-deconfigure
+# deconfigured's-prerm deconfigure \
+# in-favour package-being-installed version \
+# removing conflicting-package version
+# *) deconfigured's-postinst abort-deconfigure \
+# in-favour package-being-installed-but-failed version \
+# removing conflicting-package version
+# 2) To prepare for removal of the conflicting package
+# conflictor's-prerm remove \
+# in-favour package new-version
+# *) conflictor's-postinst abort-remove \
+# in-favour package new-version
+#
+# Removal of a package:
+# 1) prerm remove
+# 2) The package's files are removed (except conffiles).
+# 3) postrm remove
+# 4) All the maintainer scripts except the postrm are removed.
+#
+set -e;
+
+PACKAGE=`echo "$(basename $0)" | sed -e 's/\.prerm$//'`;
+
+case "$1" in
+ remove)
+ ;;
+
+ upgrade)
+ ;;
+
+ failed-upgrade)
+ ;;
+
+ deconfigure)
+ ;;
+
+ *)
+ echo "$PACKAGE prerm called with unknown argument \`$1'" >&2;
+ exit 1;
+ ;;
+ esac;
+
+#DEBHELPER#
+exit 0;
diff --git a/debian/sendmail.conffiles.in b/debian/sendmail.conffiles.in
new file mode 100644
index 0000000..729712d
--- /dev/null
+++ b/debian/sendmail.conffiles.in
@@ -0,0 +1,13 @@
+@sysconfdir@/cron.daily/sendmail
+@sysconfdir@/init.d/sendmail
+@sysconfdir@/logcheck/ignore.d.paranoid/sendmail
+@sysconfdir@/logcheck/ignore.d.server/sendmail
+@sysconfdir@/logcheck/ignore.d.workstation/sendmail
+@sysconfdir@/logcheck/violations.ignore.d/sendmail
+@sysconfdir@/mail/peers/provider
+@sysconfdir@/mail/helpfile
+@sysconfdir@/mail/service.switch
+@sysconfdir@/mail/service.switch-nodns
+@sysconfdir@/pam.d/smtp
+@sysconfdir@/ppp/ip-up.d/sendmail
+@sysconfdir@/ppp/ip-down.d/sendmail
diff --git a/debian/sendmail.cron.daily.in b/debian/sendmail.cron.daily.in
new file mode 100644
index 0000000..131f9a2
--- /dev/null
+++ b/debian/sendmail.cron.daily.in
@@ -0,0 +1,101 @@
+#!/bin/sh
+set +e;
+
+#------------------------------------------------------------------------------
+# Autoconf variables - in a form suitable for sh, perl
+# Generated automatically from autoconf.sh.in by configure.
+#------------------------------------------------------------------------------
+# Variables for, and by, Autoconf (Don't touch these! edit config step)
+PACKAGE_NAME="@PACKAGE_NAME@";
+PACKAGE_VERSION="@PACKAGE_VERSION@";
+prefix="@prefix@";
+exec_prefix="@exec_prefix@";
+bindir="@bindir@";
+sbindir="@sbindir@";
+libexecdir="@libexecdir@";
+datadir="@datadir@";
+sysconfdir="@sysconfdir@";
+sharedstatedir="@sharedstatedir@";
+localstatedir="@localstatedir@";
+libdir="@libdir@";
+includedir="@includedir@";
+infodir="@infodir@";
+mandir="@mandir@";
+docdir="@docdir@";
+srcdir="@srcdir@";
+
+copies=2;
+
+# backup "/etc/mail/sendmail.mc"
+if [ -f ${sysconfdir}/mail/sendmail.mc ]; then
+ if [ ! -f ${localstatedir}/backups/sendmail.mc.bak ]; then
+ cp -pf ${sysconfdir}/mail/sendmail.mc \
+ ${localstatedir}/backups/sendmail.mc.bak;
+ fi;
+ if ! cmp -s ${localstatedir}/backups/sendmail.mc.bak \
+ ${sysconfdir}/mail/sendmail.mc ; then
+ cd ${localstatedir}/backups;
+ /usr/bin/savelog -p -c $copies sendmail.mc.bak > /dev/null;
+ cp -pf ${sysconfdir}/mail/sendmail.mc \
+ ${localstatedir}/backups/sendmail.mc.bak;
+ fi;
+ fi;
+
+# backup "/etc/mail/submit.mc"
+if [ -f ${sysconfdir}/mail/submit.mc ]; then
+ if [ ! -f ${localstatedir}/backups/submit.mc.bak ]; then
+ cp -pf ${sysconfdir}/mail/submit.mc \
+ ${localstatedir}/backups/submit.mc.bak;
+ fi;
+ if ! cmp -s ${localstatedir}/backups/submit.mc.bak \
+ ${sysconfdir}/mail/submit.mc ; then
+ cd ${localstatedir}/backups;
+ /usr/bin/savelog -p -c $copies submit.mc.bak > /dev/null;
+ cp -pf ${sysconfdir}/mail/submit.mc \
+ ${localstatedir}/backups/submit.mc.bak;
+ fi;
+ fi;
+
+# while we're here, might as well do sendmail.cf
+if [ -f ${sysconfdir}/mail/sendmail.cf ]; then
+ if [ ! -f ${localstatedir}/backups/sendmail.cf.bak ]; then
+ cp -pf ${sysconfdir}/mail/sendmail.cf \
+ ${localstatedir}/backups/sendmail.cf.bak;
+ fi;
+ if ! cmp -s ${localstatedir}/backups/sendmail.cf.bak \
+ ${sysconfdir}/mail/sendmail.cf ; then
+ cd ${localstatedir}/backups;
+ # save previous generation only if differences are significant
+ diff -bBwI "^\#\#\#\#\# " \
+ ${localstatedir}/backups/sendmail.cf.bak \
+ ${sysconfdir}/mail/sendmail.cf > /dev/null;
+ if [ $? -ne 0 ]; then
+ /usr/bin/savelog -p -c $copies sendmail.cf.bak \
+ > /dev/null;
+ fi;
+ cp -pf ${sysconfdir}/mail/sendmail.cf \
+ ${localstatedir}/backups/sendmail.cf.bak;
+ fi;
+ fi;
+
+# while we're here, might as well do submit.cf
+if [ -f ${sysconfdir}/mail/submit.cf ]; then
+ if [ ! -f ${localstatedir}/backups/submit.cf.bak ]; then
+ cp -pf ${sysconfdir}/mail/submit.cf \
+ ${localstatedir}/backups/submit.cf.bak;
+ fi;
+ if ! cmp -s ${localstatedir}/backups/submit.cf.bak \
+ ${sysconfdir}/mail/submit.cf ; then
+ cd ${localstatedir}/backups;
+ # save previous generation only if differences are significant
+ diff -bBwI "^\#\#\#\#\# " \
+ ${localstatedir}/backups/submit.cf.bak \
+ ${sysconfdir}/mail/submit.cf > /dev/null;
+ if [ $? -ne 0 ]; then
+ /usr/bin/savelog -p -c $copies submit.cf.bak \
+ > /dev/null;
+ fi;
+ cp -pf ${sysconfdir}/mail/submit.cf \
+ ${localstatedir}/backups/submit.cf.bak;
+ fi;
+ fi;
diff --git a/debian/sendmail.dirs.in b/debian/sendmail.dirs.in
new file mode 100644
index 0000000..6d33f58
--- /dev/null
+++ b/debian/sendmail.dirs.in
@@ -0,0 +1,54 @@
+/DEBIAN
+@sysconfdir@/cron.d
+@sysconfdir@/cron.daily
+@sysconfdir@/default
+@sysconfdir@/init.d
+@sysconfdir@/logcheck
+@sysconfdir@/logcheck/ignore.d.paranoid
+@sysconfdir@/logcheck/ignore.d.server
+@sysconfdir@/logcheck/ignore.d.workstation
+@sysconfdir@/logcheck/violations.ignore.d
+@sysconfdir@/logrotate.d
+@sysconfdir@/mail
+@sysconfdir@/mail/peers
+@sysconfdir@/mail/smrsh
+@sysconfdir@/mail/sasl
+@sysconfdir@/mail/tls
+@sysconfdir@/pam.d
+@sysconfdir@/ppp/ip-up.d
+@sysconfdir@/ppp/ip-down.d
+@bindir@
+@sbindir@
+@libexecdir@
+@docdir@/sendmail
+@mandir@/man1
+@mandir@/man5
+@mandir@/man8
+@datadir@/sendmail
+@datadir@/sendmail/examples
+@datadir@/sendmail/examples/db
+@datadir@/sendmail/examples/dialup
+@datadir@/sendmail/examples/ldap
+@datadir@/sendmail/examples/logcheck
+@datadir@/sendmail/examples/logcheck/ignore.d.paranoid
+@datadir@/sendmail/examples/logcheck/ignore.d.server
+@datadir@/sendmail/examples/logcheck/ignore.d.workstation
+@datadir@/sendmail/examples/logcheck/violations.ignore.d
+@datadir@/sendmail/examples/milter
+@datadir@/sendmail/examples/pam
+@datadir@/sendmail/examples/sasl
+@datadir@/sendmail/examples/tls
+@datadir@/sendmail/cf/cf
+@datadir@/sendmail/cf/debian
+@datadir@/sendmail/cf/domain
+@datadir@/sendmail/cf/feature
+@datadir@/sendmail/cf/hack
+@datadir@/sendmail/cf/m4
+@datadir@/sendmail/cf/mailer
+@datadir@/sendmail/cf/ostype
+@datadir@/sendmail/cf/sh
+@localstatedir@/lib/sendmail
+@localstatedir@/run/sendmail
+@localstatedir@/run/sendmail/msp
+@localstatedir@/run/sendmail/mta
+@localstatedir@/run/sendmail/stampdir
diff --git a/debian/sendmail.docs b/debian/sendmail.docs
new file mode 100644
index 0000000..7f37dde
--- /dev/null
+++ b/debian/sendmail.docs
@@ -0,0 +1,3 @@
+debian/sendmail.buildinfo.Debian
+debian/Debian-specific
+debian/build/site.config.m4
diff --git a/debian/sendmail.init.d.in b/debian/sendmail.init.d.in
new file mode 100644
index 0000000..5e72517
--- /dev/null
+++ b/debian/sendmail.init.d.in
@@ -0,0 +1,42 @@
+#!/bin/sh -e
+#
+# $Sendmail: init.d,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Sendmail rc script for Debian (/etc/init.d/sendmail)
+#
+# Copyright (c) 2001-@SM_CPYRT@, Richard Nelson <cowboy@debian.org>.
+#
+# Notes (to all):
+# * *** Do not edit this file *** Instead edit /etc/mail/sendmail.conf
+#
+# Notes (to self):
+# *
+#
+set -e;
+PATH=/bin:/usr/bin:/sbin:/usr/sbin;
+
+# All the real work is done by helper functions defined herein (really!)
+if [ ! -x @datadir@/sendmail/sendmail ]; then
+ echo "@datadir@/sendmail/sendmail not found/executable, aborting.";
+ exit 1;
+ fi;
+. @datadir@/sendmail/sendmail;
+
+exit 0
+
+# Control never reaches here, but lets keep lintian from bitching...
+case "$1" in
+ start)
+ ;;
+ stop)
+ ;;
+ restart)
+ ;;
+ restart-if-running)
+ ;;
+ reload|force-reload)
+ ;;
+ *)
+ ;;
+ esac;
+exit 0;
diff --git a/debian/sendmail.links.in b/debian/sendmail.links.in
new file mode 100644
index 0000000..e465f5a
--- /dev/null
+++ b/debian/sendmail.links.in
@@ -0,0 +1 @@
+@datadir@/sendmail/examples @docdir@/sendmail/examples
diff --git a/debian/sendmail.lintian-overrides b/debian/sendmail.lintian-overrides
new file mode 100644
index 0000000..dd94f51
--- /dev/null
+++ b/debian/sendmail.lintian-overrides
@@ -0,0 +1,16 @@
+# I *really* wish the next two items worked !!!
+#sendmail source: dh_testversion-is-deprecated
+#.*.changes: bad-distribution-in-changes-file private
+# There's a dummy #DEBHELPER# at the bottom, can't use it directly
+sendmail: duplicate-updaterc.d-calls-in-postinst sendmail
+# suidregister conditionaly used to support older releases
+sendmail: suidregister-used-in-maintainer-script postinst
+# Expected, and required
+sendmail: setuid-binary usr/sbin/sendmail 4755 root/mail
+sendmail: setgid-binary usr/sbin/sendmail 2755 root/mail
+sendmail: setgid-binary usr/lib/sm.bin/mailstats 2755 root/mail
+# Not yet in lintian
+sendmail-doc: prerm-does-not-remove-usr-doc-link
+sendmail-doc: postinst-does-not-set-usr-doc-link
+libmilter-dev: prerm-does-not-remove-usr-doc-link
+libmilter-dev: postinst-does-not-set-usr-doc-link
diff --git a/debian/sendmail.logrotate b/debian/sendmail.logrotate
new file mode 100644
index 0000000..37f2537
--- /dev/null
+++ b/debian/sendmail.logrotate
@@ -0,0 +1,86 @@
+# Logrotate file for sendmail
+
+/var/log/mail/mail.alert {
+ notifempty
+ rotate 4
+ size 100k
+ weekly
+ compress
+ missingok
+}
+
+/var/log/mail/mail.crit {
+ notifempty
+ rotate 4
+ size 100k
+ weekly
+ compress
+ missingok
+}
+
+/var/log/mail/mail.debug {
+ notifempty
+ rotate 4
+ size 100k
+ weekly
+ compress
+ missingok
+}
+
+/var/log/mail/mail.emerg {
+ notifempty
+ rotate 4
+ size 100k
+ weekly
+ compress
+ missingok
+}
+
+/var/log/mail/mail.err {
+ notifempty
+ rotate 4
+ size 100k
+ weekly
+ compress
+ missingok
+}
+
+/var/log/mail/mail.info {
+ notifempty
+ rotate 4
+ size 100k
+ weekly
+ compress
+ missingok
+}
+
+/var/log/mail/mail.log {
+ create 0660 root mail
+ notifempty
+ rotate 4
+ size 100k
+ weekly
+ compress
+ missingok
+ postrotate
+ /etc/init.d/sysklogd reload
+ endscript
+}
+
+/var/log/mail/mail.notice {
+ notifempty
+ rotate 4
+ size 100k
+ weekly
+ compress
+ missingok
+}
+
+/var/log/mail/mail.warn {
+ notifempty
+ rotate 4
+ size 100k
+ weekly
+ compress
+ missingok
+}
diff --git a/debian/sendmail.menu.test b/debian/sendmail.menu.test
new file mode 100644
index 0000000..e86326c
--- /dev/null
+++ b/debian/sendmail.menu.test
@@ -0,0 +1,24 @@
+?package(sendmail):needs="text" \
+ section="Apps/Net/Sendmail" \
+ title="runq" \
+ longtitle="Send queued Mail" \
+ description="runq is a sendmail command that will process the mail queue, attempting to deliver each message." \
+ command="/usr/bin/runq"
+?package(sendmail):needs="x11" \
+ section="Apps/Net/Sendmail" \
+ title="runq" \
+ longtitle="Send queued Mail" \
+ description="runq is a sendmail command that will process the mail queue, attempting to deliver each message." \
+ command="/usr/bin/X11/xterm -e /usr/bin/runq"
+?package(sendmail):needs="text" \
+ section="Apps/Net/Sendmail" \
+ title="Mail Queue" \
+ longtitle="Display Mail Queue" \
+ description="mailq is a sendmail command that will display the mail queue, listing each message." \
+ command="/usr/bin/mailq"
+?package(sendmail):needs="text" \
+ section="Apps/Net/Sendmail" \
+ title="Mail Queue" \
+ longtitle="Display Mail Queue" \
+ description="mailq is a sendmail command that will display the mail queue, listing each message." \
+ command="/usr/bin/X11/xterm -e /usr/bin/mailq"
diff --git a/debian/sendmail.postinst.in b/debian/sendmail.postinst.in
new file mode 100644
index 0000000..d2cd445
--- /dev/null
+++ b/debian/sendmail.postinst.in
@@ -0,0 +1,356 @@
+#!/bin/sh -e
+#
+# Debian post installation script
+#
+# Install of already installed package:
+# 1) old-prerm upgrade new-version
+# *) new-prerm failed-upgrade old-version
+# *) old-postinst abort-upgrade new-version
+#
+# If a `conflicting' package is being removed at the same time:
+# 1) forall packages depending on conflicting package and --auto-deconfigure
+# deconfigured's-prerm deconfigure \
+# in-favour package-being-installed version \
+# removing conflicting-package version
+# *) deconfigured's-postinst abort-deconfigure \
+# in-favour package-being-installed-but-failed version \
+# removing conflicting-package version
+# 2) To prepare for removal of the conflicting package
+# conflictor's-prerm remove \
+# in-favour package new-version
+# *) conflictor's-postinst abort-remove \
+# in-favour package new-version
+#
+# Configuration of package:
+# postinst configure most-recently-configured-version
+#
+set -e;
+
+PACKAGE=`echo "$(basename $0)" | sed -e 's/\.postinst$//'`;
+
+# do we have debconf?
+if [ -f /usr/share/debconf/confmodule ]; then
+ DEBCONF=true;
+ #. /usr/share/debconf/confmodule;
+ #db_stop; # For testing
+else
+ DEBCONF='';
+ fi;
+
+case "$1" in
+ configure)
+ # continue below
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ exit 0;
+ ;;
+
+ *)
+ echo "$PACKAGE postinst called with unknown argument \`$1'" >&2;
+ exit 1;
+ ;;
+ esac;
+
+#--------------------------------------------------------------------
+# Continuation of "$1" = "configure"
+
+if [ "$2" = "" ]; then
+ echo " ";
+ echo "A new sendmail user, welcome!";
+ fi;
+
+# Note: can't use debhelper here because the actions aren't contiguous
+#xxxHELPER#
+
+# This would be done via debhelper, but the start of sendmail must be delayed
+
+if [ '@DEBIAN_DH@' != '4.1' ]; then
+# Automatically added by dh_installdocs
+if [ "$1" = "configure" ]; then
+ if [ -d /usr/doc -a ! -e /usr/doc/sendmail -a -d /usr/share/doc/sendmail ]; then
+ ln -sf ../share/doc/sendmail /usr/doc/sendmail
+ fi
+fi
+# End automatically added section
+fi;
+# Automatically added by dh_installinit
+if [ -x "@sysconfdir@/init.d/sendmail" ]; then
+ update-rc.d sendmail defaults >/dev/null
+ #/etc/init.d/sendmail start
+fi
+# End automatically added section
+# Automatically added by dh_installmenu
+#if test -x /usr/bin/update-menus ; then update-menus ; fi
+# End automatically added section
+
+#-----------------------------------------------------------
+# Tell users about new and interesting things...
+if [ -x @datadir@/sendmail/update_notices ]; then
+ @datadir@/sendmail/update_notices $2;
+ fi;
+
+
+#-----------------------------------------------------------
+if test ! -z "$version" && \
+ (dpkg --compare-versions "$version" lt 8.12.6-5); then
+ if [ -x /usr/sbin/deluser ]; then
+ deluser --quiet smmsp || true;
+ else
+ userdel smmsp || true;
+ fi;
+ if [ -x /usr/sbin/delgroup ]; then
+ delgroup --quiet smmsp || true;
+ else
+ groupdel smmsp || true;
+ fi;
+ fi;
+# Create group/user smmsp iff needed
+touch @sysconfdir@/mail/smmsp;
+if ! chown root:smmsp @sysconfdir@/mail/smmsp 2>/dev/null; then
+ addgroup --system --quiet smmsp;
+ fi;
+if ! chown smmsp:smmsp @sysconfdir@/mail/smmsp 2>/dev/null; then
+ adduser --system --ingroup smmsp --home "/var/lib/sendmail" \
+ --disabled-password \
+ --quiet --gecos 'Mail Submission Program' smmsp;
+ fi;
+rm @sysconfdir@/mail/smmsp;
+
+#-----------------------------------------------------------
+# With a dynamic uid/gid, have to set appropriate ownership herein
+if command -v suidregister >/dev/null 2>&1 && test -s /etc/suid.conf; then
+ suidregister -s sendmail @sbindir@/sendmail root smmsp 02755;
+ suidregister -s sendmail @libexecdir@/mailstats root smmsp 02755;
+elif [ -x @sbindir@/sendmail ]; then
+ chown root:smmsp @sbindir@/sendmail;
+ chmod 02755 @sbindir@/sendmail;
+ chown root:smmsp @libexecdir@/mailstats;
+ chmod 02755 @libexecdir@/mailstats;
+ fi;
+chown root:smmsp @sysconfdir@/mail/sasl;
+chown root:smmsp @sysconfdir@/mail/tls;
+
+#-----------------------------------------------------------
+# Make sure inetd.conf has sendmail in it (but disabled)
+if [ -x /usr/sbin/update-inetd ]; then
+ update-inetd --group MAIL --remove smtp;
+ update-inetd --group MAIL --remove smtps;
+ update-inetd --group MAIL --remove 587;
+ update-inetd --group MAIL --add \
+ "smtp \tstream\ttcp\tnowait\troot\t@sbindir@/sendmail sendmail -Am -bs";
+ update-inetd --group MAIL --add \
+ "587 \tstream\ttcp\tnowait\troot\t@sbindir@/sendmail sendmail -Am -bs";
+ update-inetd --group MAIL --add \
+ "smtps\tstream\ttcp\tnowait\troot\t@sbindir@/sendmail sendmail -Am -bs";
+ update-inetd --group MAIL --disable smtp,smtps,587;
+ fi;
+
+#-----------------------------------------------------------
+# Save the current configuration files in safe place...
+if [ -x @sysconfdir@/cron.daily/sendmail ]; then
+ echo "Saving current /etc/mail/sendmail.mc,cf to /var/backups";
+ @sysconfdir@/cron.daily/sendmail || true;
+ fi;
+
+#-----------------------------------------------------------
+#stop(): stop sendmail
+stop () {
+ # Account for varying PIDfile locations of older sendmail packages
+ if [ -f /var/run/sendmail/msp/sendmail.pid ]; then
+ start-stop-daemon --stop --oknodo --quiet \
+ --pidfile /var/run/sendmail/msp/sendmail.pid > /dev/null;
+ start-stop-daemon --stop --oknodo --quiet \
+ -pidfile /var/run/sendmail/mta/sendmail.pid > /dev/null;
+ elif [ -f /var/run/sendmail/sendmail.pid ]; then
+ start-stop-daemon --stop --oknodo --quiet \
+ --pidfile /var/run/sendmail/sendmail.pid > /dev/null;
+ elif [ -f /var/run/sendmail.pid ]; then
+ start-stop-daemon --stop --oknodo --quiet \
+ --pidfile /var/run/sendmail.pid > /dev/null;
+ fi;
+ if [ -x @sysconfdir@/init.d/sendmail ]; then
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ /usr/sbin/invoke-rc.d --quiet --force sendmail stop;
+ else
+ @sysconfdir@/init.d/sendmail stop;
+ fi;
+ fi;
+ };
+
+start_ask=0;
+
+#-----------------------------------------------------------
+#start(): start sendmail
+start () {
+ local enter;
+ if [ $start_ask -eq 1 ]; then
+ echo " ";
+ echo -n "Start sendmail now? (Y/n) ";
+ read yn;
+ yn=$(echo -n "$yn" | sed -e "s/^\ *//" -e "s/^\t*//");
+ test -n "$yn" || yn="Y";
+ case "$yn" in
+ [Yy]*)
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ /usr/sbin/invoke-rc.d sendmail start;
+ else
+ @sysconfdir@/init.d/sendmail start;
+ fi;
+ ;;
+ [Nn]*)
+ echo " ";
+ echo "Not started; to start later," \
+ "type: @sysconfdir@/init.d/sendmail start";
+ echo -n "Press [ENTER] ";
+ read enter;
+ ;;
+ esac;
+ fi;
+ };
+
+#-----------------------------------------------------------
+# configure(): save sendmail.cf, call sendmailconfig
+configure () {
+ local enter;
+ echo -n "Configure now ? (y/N) ";
+ read yn;
+ yn=$(echo -n "$yn" | sed -e "s/^\ *//" -e "s/^\t*//");
+ test -n "$yn" || yn="N";
+ case "$yn" in
+ [Yy]*)
+ if [ -f @sysconfdir@/mail/sendmail.cf ]; then
+ echo "Saving old /etc/mail/sendmail.cf" \
+ "as /etc/mail/sendmail.cf.old ...";
+ mv -f @sysconfdir@/mail/sendmail.cf \
+ @sysconfdir@/mail/sendmail.cf.old;
+ chown root:root @sysconfdir@/mail/sendmail.cf.old;
+ chmod 0644 @sysconfdir@/mail/sendmail.cf.old;
+ fi;
+ @sbindir@/sendmailconfig --no-reload;
+ start;
+ ;;
+
+ [Nn]*)
+ echo -e "\nTo configure sendmail later, type" \
+ "sendmailconfig";
+ echo "After configuring sendmail, you can" \
+ "start it via @sysconfdir@/init.d/sendmail start";
+ echo -n "Press [ENTER] ";
+ read enter;
+ ;;
+ esac;
+ };
+
+#-----------------------------------------------------------
+# Create /etc/mail/sendmail.mc if it doesn't exist
+if [ ! -f @sysconfdir@/mail/sendmail.mc ]; then
+ cat <<-EOT
+
+ You are doing a new install, or have erased /etc/mail/sendmail.mc.
+ If you've accidentaly erased /etc/mail/sendmail.mc, check /var/backups.
+
+ Sendmail will not start until it is configured.
+ Do you wish to configure sendmail now, or wait until later?
+
+ EOT
+ start_ask=1;
+ start_txt="";
+ configure;
+ exit 0;
+ fi;
+
+#-----------------------------------------------------------
+# See if we can do this automagically...
+cat <<-EOT
+
+It is a good idea to regenerate the sendmail configuration
+file with each new spin of the sendmail package.
+
+But, if you hand edit sendmail.cf instead of making changes through
+sendmail.mc, then you want to say no, save your old sendmail.cf, run
+sendmailconfig, then migrate your changes into the new version.
+
+EOT
+echo -n "Automagically regenerate the sendmail.cf configuration file? (Y/n) ";
+read yn;
+yn=$(echo -n "$yn" | sed -e "s/^\ *//" -e "s/^\t*//");
+test -n "$yn" || yn="Y";
+case "$yn" in
+ [Yy]*)
+ if [ -f @sysconfdir@/mail/sendmail.cf ]; then
+ echo "Saving old /etc/mail/sendmail.cf" \
+ "as /etc/mail/sendmail.cf.old ...";
+ cp -f @sysconfdir@/mail/sendmail.cf \
+ @sysconfdir@/mail/sendmail.cf.old;
+ chown root:root @sysconfdir@/mail/sendmail.cf.old;
+ chmod 0644 @sysconfdir@/mail/sendmail.cf.old;
+ fi;
+ if [ -x @datadir@/sendmail/update_sendmail ]; then
+ stop;
+ echo "Updating sendmail environment ...";
+ @datadir@/sendmail/update_sendmail || true;
+ fi;
+ ;;
+
+ [Nn]*)
+ cat <<-EOT
+
+ Your files (sendmail.mc,cf, etc) have *not* been altered.
+
+ *** Warning *** Warning *** Warning *** Warning *** Warning *** Warning ***
+
+ There have been changes in
+ * Paths of some databases and executables
+ * FEATUREs, DOMAIN, includes
+ * Internal Database storage
+
+ These changes were *NOT* made for you ... And will not be
+ until you run sendmailconfig!
+
+ Until you update /etc/mail/sendmail.cf via sendmailconfig,
+ you should expect to have problems running sendmail!
+
+ "Well, a pet peeve of mine is people who directly edit the
+ .cf file instead of using the m4 configuration files.
+ Don't do it! [laughs] I treat the .cf file as a binary
+ file - you should too."
+ -- Eric Allman 1999/10/18
+
+ *** Warning *** Warning *** Warning *** Warning *** Warning *** Warning ***
+
+ EOT
+ echo "Do you wish to run sendmailconfig now, or later";
+ start_ask=0;
+ stop;
+ configure;
+ case "$yn" in
+ [Yy]*)
+ cat <<-EOT
+
+ Do you wish to start sendmail with the new sendmail.cf,
+ or do you wish to delay until you can merge any changes
+ from your older sendmail.cf.old?
+ EOT
+ start_ask=1;
+ start;
+ ;;
+ esac;
+ exit 0;
+ esac;
+
+#-----------------------------------------------------------
+# If we're still here, we're going the automagic path...
+# Now, liberal application of smoke and mirrors
+if [ -f @sysconfdir@/mail/sendmail.mc ]; then
+ start_ask=1;
+ start;
+ fi;
+
+exit 0;
+
+#-----------------------------------------------------------
+#
+# List herein (for reference) what debhelper would've done:
+#DEBHELPER#
+exit 0;
diff --git a/debian/sendmail.postrm.in b/debian/sendmail.postrm.in
new file mode 100644
index 0000000..47451b4
--- /dev/null
+++ b/debian/sendmail.postrm.in
@@ -0,0 +1,119 @@
+#!/bin/sh -e
+#
+# Debian post removal script
+#
+# Install of already installed package:
+# 1) Upgrade of package:
+# new-preinst upgrade old-version
+# *) new-postrm abort-upgrade old-version
+# 2) package had some configuration files from a previous version installed
+# new-preinst install old-version
+# *) new-postrm abort-install old-version
+# 3) Otherwise (i.e., the package was completely purged)
+# new-preinst install
+# *) new-postrm abort-install
+#
+# Removal of a package:
+# 1) prerm remove
+# 2) The package's files are removed (except conffiles).
+# 3) postrm remove
+# 4) All the maintainer scripts except the postrm are removed.
+# 5) The conffiles and any backup files
+# (~-files, #*# files, %-files, .dpkg-{old,new,tmp}, etc.) are removed.
+# 6) postrm purge
+# 7) The package's file list is removed
+#
+set -e;
+
+PACKAGE=`echo "$(basename $0)" | sed -e 's/\.postrm$//'`;
+
+case "$1" in
+ remove)
+ if [ ! -z "$2" ]; then
+ echo "Removing $PACKAGE $2 $3($4)";
+ if [ "$PACKAGE" = 'sendmail' -a "$3" = 'sendmail-tls' ] || \
+ [ "$PACKAGE" = 'sendmail-tls' -a "$3" = 'sendmail' ]; then
+ echo '...Nothing to do...';
+ exit 0;
+ fi;
+ fi;
+ if [ -x /usr/sbin/update-inetd ]; then
+ update-inetd --remove smtp;
+ update-inetd --remove smtps;
+ update-inetd --remove 587;
+ fi;
+ ;;
+
+ purge)
+ # If postrm is called *AND* there are no files, exit quickly
+ # (This is a *GROSS* hack... beter use the test below)
+ #if [ ! -s `echo "$0" | sed -e 's/postrm$/list/'` ]; then
+ # echo "Purging replaced package $PACKAGE, nothing to do...";
+ # exit 0;
+ # fi;
+
+ # We're *really* purging; neither sendmail nor sendmail-tls
+ # is currently installed
+ if [ -f @libexecdir@/sendmail ]; then
+ echo "Purging replaced package $PACKAGE, nothing to do...";
+ exit 0;
+ fi;
+
+ # Currently, dh_installdebconf doesn't do db_stop... ensure it is done!
+ if [ "$1" = "purge" -a -e /usr/share/debconf/confmodule ]; then
+ # Source debconf library.
+ . /usr/share/debconf/confmodule;
+ # Make sure we're done
+ #db_stop;
+ # Remove my changes to the db.
+ db_purge;
+ fi;
+
+ # Remove user/group smmsp
+ if [ -x /usr/sbin/deluser ]; then
+ deluser --quiet smmsp || true;
+ fi;
+ userdel smmsp 2>/dev/null || true;
+ groupdel smmsp 2>/dev/null || true;
+
+ # Purge those files installed in other package directories
+ rm -f @libdir@/lib/sasl/Sendmail.conf;
+ rm -f @sysconfdir@/certs/sendmail.pem;
+ # Can't touch these as they may be included in slapd.conf
+ #rm -rf @sysconfdir@/ldap/schema/sendmail.schema;
+ #rm -rf @sysconfdir@/openldap/sendmail.schema;
+ #rm -rf @sysconfdir@/umich-ldap/sendmail.schema;
+ # Purge psuedo conffiles (managed by sendmail)
+ rm -f @sysconfdir@/mail/sendmail.conf;
+ # Purge sendmail configuration files
+ rm -f @sysconfdir@/mail/sendmail.mc \
+ @sysconfdir@/mail/submit.mc \
+ @sysconfdir@/mail/dialup.m4 \
+ @sysconfdir@/mail/provider.m4 \
+ @sysconfdir@/mail/local-host-names \
+ @sysconfdir@/mail/relay-domains \
+ @sysconfdir@/mail/trusted-users \
+ @sysconfdir@/mail/default-auth-info \
+ ;
+ rmdir @sysconfdir@/mail/peers 2>/dev/null || true;
+ rmdir @sysconfdir@/mail 2>/dev/null || true;
+ ;;
+
+ upgrade)
+ ;;
+
+ failed-upgrade|abort-install|abort-upgrade|disappear)
+ echo "$1 of $PACKAGE $2";
+ ;;
+
+ *)
+ echo "$PACKAGE postrm called with unknown argument \`$1'" >&2;
+ exit 1;
+ ;;
+ esac;
+
+# NOTE WELL: If we fall through here during purge, update-rc.d will be
+# called with remove... and /etc/init.d/$PACKAGE goes away!
+#DEBHELPER#
+
+exit 0;
diff --git a/debian/sendmail.preinst.in b/debian/sendmail.preinst.in
new file mode 100644
index 0000000..17d115d
--- /dev/null
+++ b/debian/sendmail.preinst.in
@@ -0,0 +1,61 @@
+#!/bin/sh -e
+#
+# Debian pre install script
+#
+# Install of already installed package:
+# 1) Upgrade of package:
+# new-preinst upgrade old-version
+# *) new-postrm abort-upgrade old-version
+# 2) package had some configuration files from a previous version installed
+# new-preinst install old-version
+# *) new-postrm abort-install old-version
+# 3) Otherwise (i.e., the package was completely purged)
+# new-preinst install
+# *) new-postrm abort-install
+#
+set -e;
+
+PACKAGE=`echo "$(basename $0)" | sed -e 's/\.preinst$//'`;
+
+# do we have debconf?
+if [ -f /usr/share/debconf/confmodule ]; then
+ DEBCONF=true;
+ . /usr/share/debconf/confmodule;
+else
+ DEBCONF='';
+ fi;
+
+case "$1" in
+ install)
+ ;;
+
+ upgrade)
+ # DPKG doesn't overwrite directories with symlinks...
+ rm -rf @docdir@/sendmail/examples 2>/dev/null || true;
+ rm -rf @libdir@/sendmail 2>/dev/null || true;
+
+ # Somehow, /etc/logrotate.d/sendmail didn't get erased !?!
+ rm -rf @sysconfdir@/logrotate.d/sendmail 2>/dev/null || true;
+
+ # Prevent cronjob from running during upgrade...
+ if [ -f /etc/cron.d/sendmail ]; then
+ echo "#preinst" > @sysconfdir@/cron.d/sendmail;
+ fi;
+
+ # Move files to new home
+ if [ -d @sysconfdir@/mail/ssl ]; then
+ mv -f @sysconfdir@/mail/ssl @sysconfdir@/mail/tls;
+ fi;
+ ;;
+
+ abort-upgrade)
+ ;;
+
+ *)
+ echo "$PACKAGE preinst called with unknown argument \`$1'" >&2;
+ exit 1;
+ ;;
+ esac;
+
+#DEBHELPER#
+exit 0;
diff --git a/debian/sendmail.prerm.in b/debian/sendmail.prerm.in
new file mode 100644
index 0000000..fdeae7d
--- /dev/null
+++ b/debian/sendmail.prerm.in
@@ -0,0 +1,153 @@
+#!/bin/sh -e
+#
+# Debian pre removal script
+#
+# Install of already installed package:
+# 1) old-prerm upgrade new-version
+# *) new-prerm failed-upgrade old-version
+# *) old-postinst abort-upgrade new-version
+#
+# If a `conflicting' package is being removed at the same time:
+# 1) forall packages depending on conflicting package and --auto-deconfigure
+# deconfigured's-prerm deconfigure \
+# in-favour package-being-installed version \
+# removing conflicting-package version
+# *) deconfigured's-postinst abort-deconfigure \
+# in-favour package-being-installed-but-failed version \
+# removing conflicting-package version
+# 2) To prepare for removal of the conflicting package
+# conflictor's-prerm remove \
+# in-favour package new-version
+# *) conflictor's-postinst abort-remove \
+# in-favour package new-version
+#
+# Removal of a package:
+# 1) prerm remove
+# 2) The package's files are removed (except conffiles).
+# 3) postrm remove
+# 4) All the maintainer scripts except the postrm are removed.
+#
+set -e;
+
+PACKAGE=`echo "$(basename $0)" | sed -e 's/\.prerm$//'`;
+
+case "$1" in
+ remove)
+ if [ ! -z "$2" ]; then
+ echo "Removing $PACKAGE $2 $3($4)";
+ if [ "$PACKAGE" = 'sendmail' -a "$3" = 'sendmail-tls' ] || \
+ [ "$PACKAGE" = 'sendmail-tls' -a "$3" = 'sendmail' ]; then
+ echo '...Nothing to do...';
+ exit 0;
+ fi;
+ fi;
+ if [ -x /usr/sbin/update-inetd ]; then
+ update-inetd --disable smtp;
+ fi;
+ if [ -x @sysconfdir@/init.d/sendmail ]; then
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ /usr/sbin/invoke-rc.d --quiet --force sendmail stop;
+ else
+ @sysconfdir@/init.d/sendmail stop;
+ fi;
+ fi;
+
+ # Make sure /etc/aliases is left (move it from /etc/mail if needed)
+ if [ -L @sysconfdir@/mail/aliases ]; then
+ rm -f @sysconfdir@/mail/aliases;
+ elif [ -f @sysconfdir@/mail/aliases -a \
+ -L /etc/aliases ]; then
+ mv @sysconfdir@/mail/aliases /etc/aliases;
+ fi;
+
+ # Remove psuedo conffiles (managed by sendmail)
+ if [ -f /etc/cron.d/sendmail ]; then
+ echo "#prerm" > @sysconfdir@/cron.d/sendmail;
+ fi;
+
+ # Remove files scattered across the system that
+ # happened to be created by sendmail
+ rm -f @libdir@/sasl/Sendmail.conf;
+
+ # Remove those files created by sendmail
+ rm -rf @localstatedir@/lib/sendmail;
+ rm -rf @localstatedir@/run/sendmail;
+ # Note: syslog really owns these files
+ #rm -f @localstatedir@/log/mail/*;
+ #rm -f @localstatedir@/log/mail.log;
+ # Note: these can lead to a loss of mail!!!!
+ @sysconfdir@/init.d/sendmail clean;
+ rmdir --ignore-fail-on-non-empty \
+ @localstatedir@/spool/mqueue;
+ rmdir --ignore-fail-on-non-empty \
+ @localstatedir@/spool/mqueue-client;
+
+ # Remove sendmail built configuration files
+ rm -f @sysconfdir@/mail/*.db \
+ @sysconfdir@/mail/*.dir \
+ @sysconfdir@/mail/*.pag;
+ rm -f @sysconfdir@/mail/sendmail.cf \
+ @sysconfdir@/mail/sendmail.cf.old \
+ @sysconfdir@/mail/sendmail.cf.errors \
+ @sysconfdir@/mail/sendmail.mc.old \
+ @sysconfdir@/mail/submit.cf \
+ @sysconfdir@/mail/submit.cf.errors \
+ @sysconfdir@/mail/submit.mc.old \
+ @sysconfdir@/mail/databases \
+ @sysconfdir@/mail/Makefile \
+ ;
+ rm -rf @sysconfdir@/mail/smrsh \
+ @sysconfdir@/mail/sasl \
+ @sysconfdir@/mail/tls;
+
+ # Remove empty files (probably touched databases)
+ find @sysconfdir@/mail -maxdepth 1 -size 0 | xargs -r rm;
+ ;;
+
+ upgrade)
+ # Potentially move the old configuration file to the new name -
+ # before it gets deleted (for not existing in the new package)
+ mv -f @sysconfdir@/default/sendmail \
+ @sysconfdir@/mail/sendmail.conf 2>/dev/null || true;
+ #
+ # 8.9.3- used sendmail.hf, we now use helpfile
+ mv -f @sysconfdir@/mail/sendmail.hf \
+ @sysconfdir@/mail/helpfile 2>/dev/null || true;
+
+ # Prevent cronjob from running during upgrade...
+ rm -f @sysconfdir@/cron.d/sendmail;
+ ;;
+
+ failed-upgrade)
+ ;;
+
+ deconfigure)
+ echo "Deconfigure of $PACKAGE $2 $3($4) $5 $6($7) ";
+ ;;
+
+ *)
+ echo "$PACKAGE prerm called with unknown argument \`$1'" >&2;
+ exit 1;
+ ;;
+ esac;
+
+# The @DEBHELPER@ stuff causes problems with upgrades because of the
+# length of time that Sendmail is stopped...
+
+# Automatically added by dh_installdocs
+if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/sendmail ]; then
+ rm -f /usr/doc/sendmail
+fi
+# End automatically added section
+# Automatically added by dh_installinit
+#if [ -x "@sysconfdir@/init.d/sendmail" ]; then
+# @sysconfdir@/init.d/sendmail stop
+#fi
+# End automatically added section
+exit 0;
+
+#
+# Included for sanity checks
+#
+#DEBHELPER#
+exit 0;
diff --git a/debian/sendmail.suid.in b/debian/sendmail.suid.in
new file mode 100644
index 0000000..32469ca
--- /dev/null
+++ b/debian/sendmail.suid.in
@@ -0,0 +1,2 @@
+@sbindir@/sendmail
+@libexecdir@/mailstats
diff --git a/debian/sensible_mda/Makefile.in b/debian/sensible_mda/Makefile.in
new file mode 100644
index 0000000..aa23f36
--- /dev/null
+++ b/debian/sensible_mda/Makefile.in
@@ -0,0 +1,61 @@
+#!/usr/bin/make -f
+#------------------------------------------------------------------------------
+# vim: syntax=make
+#
+# $Sendmail: Makefile,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+#
+# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
+#
+# @configure_input@
+#
+# Rules file for Sendmail @sm_version@@sm_revision@(@sm_version_math@)
+# on @sm_dist_name@ @sm_dist_vers@
+# via Debhelper V@DEBIAN_DH@
+#
+# Note: the .in file supports Sendmail @SM_MINVERS@ - @SM_MAXVERS@
+# on Debian slink, potato, woody, testing, sid, ...
+# but the generated file is customized to the version noted above.
+#
+# Richard Nelson <cowboy@debian.org> @sm_date@ @sm_time@ (@sm_utc@)
+#------------------------------------------------------------------------------
+#SHELL=/bin/sh -x
+
+# Include Debian Autoconf settings
+ifeq (yes, $(shell test -e ../build/autoconf.mk && echo 'yes'))
+ include ../build/autoconf.mk
+ endif
+
+all: sensible-mda
+
+clean:
+ rm -rf core *~ sensible-mda;
+
+setup: ;
+
+build-indep: setup
+build-arch: setup sensible-mda
+
+sensible-mda: sensible-mda.c
+ @rm -f $@;
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $? $(LIBS)
+
+install-indep: build-indep
+install-arch: build-arch
+ $(INSTALL) -d ${libexecdir};
+ $(INSTALL) -d ${mandir}/man8
+ $(INSTALL_PROGRAM) sensible-mda ${libexecdir};
+ $(INSTALL_DATA) sensible-mda.8 ${mandir}/man8;
+
+#-------------
+# Below here is fairly generic really
+
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+build: build-indep build-arch
+install: install-indep install-arch
+.PHONY: all
+.PHONY: setup
+.PHONY: clean build build-indep build-arch
+.PHONY: install install-indep install-arch
+.PHONY: source diff
diff --git a/debian/sensible_mda/sensible-mda.8 b/debian/sensible_mda/sensible-mda.8
new file mode 100644
index 0000000..622d50f
--- /dev/null
+++ b/debian/sensible_mda/sensible-mda.8
@@ -0,0 +1,85 @@
+.\" Copyright (c) 1998, 1999 Richard A Nelson <cowboy@debian.org>
+.\" All rights reserved.
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License
+.\"
+.\" $Id: sensible-mda.8,v 2.0 1999/10/21 11:30:00 cowboy Exp $
+.\"
+.TH SENSIBLE-MDA 8 "October 21 1999"
+.UC 4
+.SH NAME
+sensible\-mda \- a generic local MDA router for Debian systems
+.SH SYNOPSIS
+.B sensible\-mda
+.IR from
+.IR to
+.IR detail
+.IR client\-addr
+.br
+.SH DESCRIPTION
+.B sensible\-mda
+is used to simplify the installation and configuration of
+.BR sendmail (8)
+, or other MTAs for use on Debian systems. With sensible\-mda, sendmail
+can support a plethora of MDAs (procmail, maildrop, deliver, etc.) without
+having pick any
+.I one
+of them as required.
+.LP
+.SH FUNCTION
+.B sensible\-mda
+is called by sendmail as a local mailer when the following exists in
+sendmail.mc:
+.br
+.I define(`LOCAL_MAILER_ARGS', `sensible-mda $g $u $h ${client_addr}')dnl
+.LP
+sensible-mda
+will look for the following MDAs (in this order), and pass the mail
+on to the first SUID MDA found (Or first found MDA, if run w/euid=root):
+.BR procmail (1),
+.BR maildrop (1),
+.BR deliver (8),
+.BR mail.local (8)
+.LP
+.SH OPTIONS
+Available command line options are the following:
+.TP
+.I from
+The sender of this email
+(sendmail $g variable)
+.TP
+.I to
+The recipient of this email
+(sendmail $u variable)
+.TP
+.I detail
+The detail portion of the recipient userid
+(sendmail $h variable)
+\- ie:
+.br
+cowboy\+\fIsendmail\fP@debian.org
+.TP
+.I client\-addr
+TCP/IP address of the sender
+(sendmail ${client_addr} variable)
+Not used (for the nonce)
+.SH FILES
+.TP
+.I /etc/mail/sendmail.mc
+sendmail m4 input to generate sendmail.cf
+.TP
+.I /etc/mail/sendmail.cf
+actual sendmail configuration file (treated as a binary file)
+.SH "SEE ALSO"
+.BR sendmail (8),
+.BR procmail (1),
+.BR maildrop (1),
+.BR deliver (8),
+.BR mail.local (8)
+.br
+.SH BUGS
+None known so far.
+.SH AUTHOR
+Richard Nelson <cowboy@debian.org>
+.SH HISTORY
diff --git a/debian/sensible_mda/sensible-mda.c.in b/debian/sensible_mda/sensible-mda.c.in
new file mode 100644
index 0000000..a31c718
--- /dev/null
+++ b/debian/sensible_mda/sensible-mda.c.in
@@ -0,0 +1,351 @@
+/*
+ * $Sendmail: sensible-mda.c,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
+ *
+ * sensible-mda.c
+ * Copyright (c) 1998, Johnie Ingram.
+ * Copyright (c) 1998-@SM_CPYRT@ Richard Nelson <cowboy@debian.org>.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifndef lint
+static char id[] = "@(#)$Id: sensible-mda.c,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $";
+#endif /* ! lint */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <limits.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <grp.h>
+#include <sysexits.h>
+#include <string.h>
+#include <syslog.h>
+
+// TODO: declare -x TCPREMOTEIP="$3"
+
+# define min(a, b) ((a) < (b) ? (a) : (b))
+
+#ifndef DEBUG
+ #define DEBUG 0
+ #endif
+#ifndef TESTING
+ #define TESTING 0
+ #endif
+
+#define PROCMAIL "@sysconfdir@/mail/smrsh/procmail"
+#define MAILDROP "@sysconfdir@/mail/smrsh/maildrop"
+#define DELIVER "@sysconfdir@/mail/smrsh/deliver"
+#define MAIL_LOCAL "@sysconfdir@/mail/smrsh/mail.local"
+
+#define PROCMAILRCS "@sysconfdir@/procmailrcs/"
+
+static void help(void);
+static int drop_privs(char *, uid_t, gid_t);
+static void show_privs(void);
+static unsigned char program[PATH_MAX];
+
+static uid_t RealUid, RunAsUid;
+static gid_t RealGid, RunAsGid;
+
+extern int errno;
+
+int
+main (int argc, char *argv[]) {
+
+ struct stat MDA_stat;
+ int done = 1;
+ struct passwd* passwd_entry;
+
+ char *str_pos;
+ int exec_rc = EX_OK;
+
+ #if DEBUG
+ int arg_index;
+ int str_len;
+ #endif
+
+ (void) openlog( "sensible-mda", LOG_PID+LOG_PERROR, LOG_MAIL );
+
+ /*----------------------------------------------------------------
+ * Obtain program name
+ *----------------------------------------------------------------*/
+ str_pos = strrchr(argv[0], '/');
+ if ( str_pos )
+ str_pos++;
+ else
+ str_pos = argv[0];
+ (void) strncpy(program, str_pos,
+ min(strlen(str_pos), sizeof(program)-1));
+ program[sizeof(program)-1] = '\0';
+
+ #if DEBUG
+ str_len = 0;
+ for ( arg_index = 0; arg_index < argc; arg_index++ )
+ str_len += strlen( argv[arg_index] ) + 1;
+ str_pos = malloc( str_len + 1);
+ str_pos[0] = '\0';
+ for ( arg_index = 0; arg_index < argc; arg_index++ ) {
+ (void) strcat( str_pos, argv[arg_index] );
+ (void) strcat( str_pos, " " );
+ };
+ (void) syslog( LOG_INFO, "Parms: %s\n", str_pos );
+ (void) free(str_pos);
+ #endif
+
+ /*----------------------------------------------------------------
+ * Parse input to determine to whom to speak and who we are...
+ * Must have at least three parameters unless first is ?,-?,/?.
+ *----------------------------------------------------------------*/
+ if (argc >= 2 &&
+ (strcmp(argv[1],"?") == 0 || strcmp(argv[1],"-?") == 0 ||
+ strcmp(argv[1],"/?") == 0 || strcmp(argv[1],"\\?") == 0 ||
+ strcmp(argv[1],"-h") == 0 || strcmp(argv[1],"--help") == 0)) {
+ (void) printf( "%s - Help\n", program );
+ help();
+ (void) closelog();
+ return (EX_USAGE);
+ };
+ if (argc < 3) {
+ (void) syslog( LOG_ERR, "%s - Required parameters elided.\n",
+ program );
+ help();
+ (void) closelog();
+ return (EX_USAGE);
+ };
+
+ /*----------------------------------------------------------------
+ * Determine to whom we are delivering mail to, and set that
+ * as our real, effective, and saved {u,g}ids
+ *----------------------------------------------------------------*/
+ RealUid = RunAsUid = geteuid();
+ RealGid = RunAsGid = getegid();
+ passwd_entry=getpwnam(argv[2]);
+ if (passwd_entry) {
+ RunAsUid = passwd_entry->pw_uid;
+ RunAsGid = passwd_entry->pw_gid;
+ }
+ else {
+ (void) syslog( LOG_ERR, "User(%s) does not exist!\n",
+ argv[2]);
+ (void) closelog();
+ return (EX_TEMPFAIL);
+ };
+
+ /*----------------------------------------------------------------
+ * 1st: try delivery via PROCMAIL (Keep SUID, works better that way)
+ *----------------------------------------------------------------*/
+ if (!stat(PROCMAIL, &MDA_stat)) {
+ done = 0;
+ #if DEBUG
+ (void) syslog( LOG_INFO, "MDA: %s -t -f %s"
+ " -a %s -d %s\n",
+ PROCMAIL, argv[1], argv[3], argv[2]);
+ #endif
+ #if ! TESTING
+ exec_rc = execl (PROCMAIL, PROCMAIL, "-t",
+ "-f", argv[1],
+ "-a", argv[3],
+ "-d", argv[2], NULL);
+ (void) syslog( LOG_ERR, "%s did not execute %i,%i\n",
+ PROCMAIL, exec_rc, errno);
+ (void) closelog();
+ return (EX_TEMPFAIL);
+ #endif
+ done = 1;
+ };
+
+ /*----------------------------------------------------------------
+ * 2nd: try delivery via MAILDROP
+ *----------------------------------------------------------------*/
+ if (done && !stat(MAILDROP, &MDA_stat)) {
+ done = 0;
+ #if DEBUG
+ (void) syslog( LOG_INFO, "MDA: %s -f %s -d %s %s\n",
+ MAILDROP, argv[1], argv[2], argv[3]);
+ #endif
+ if (drop_privs( argv[2], RunAsUid, RunAsGid )) {
+ (void) closelog();
+ return (EX_TEMPFAIL);
+ };
+ #if ! TESTING
+ exec_rc = execl (MAILDROP, MAILDROP,
+ "-f", argv[1], "-d", argv[2], argv[3], NULL);
+ (void) syslog( LOG_ERR, "%s did not execute %i,%i\n",
+ MAILDROP, exec_rc, errno);
+ (void) closelog();
+ return (EX_TEMPFAIL);
+ #endif
+ done = 1;
+ };
+
+ /*----------------------------------------------------------------
+ * 3rd: try delivery via DELIVER
+ *----------------------------------------------------------------*/
+ if (done && !stat(DELIVER, &MDA_stat)) {
+ done = 0;
+ #if DEBUG
+ (void) syslog( LOG_INFO, "MDA: %s -r %s %s\n",
+ DELIVER, argv[1], argv[2]);
+ #endif
+ if (drop_privs( argv[2], RunAsUid, RunAsGid )) {
+ (void) closelog();
+ return (EX_TEMPFAIL);
+ };
+ #if ! TESTING
+ exec_rc = execl (DELIVER, DELIVER,
+ "-r", argv[1], argv[2], NULL);
+ (void) syslog( LOG_ERR, "%s did not execute %i,%i\n",
+ DELIVER, exec_rc, errno);
+ (void) closelog();
+ return (EX_TEMPFAIL);
+ #endif
+ done = 1;
+ };
+
+ /*----------------------------------------------------------------
+ * 4th: try delivery via MAIL.LOCAL (Needs SUID because of LMTP)
+ *----------------------------------------------------------------*/
+ if (done && !stat(MAIL_LOCAL, &MDA_stat)) {
+ done = 0;
+ #if DEBUG
+ (void) syslog( LOG_INFO, "MDA: %s -f %s %s\n",
+ MAIL_LOCAL, argv[1], argv[2]);
+ #endif
+ #if ! TESTING
+ exec_rc = execl (MAIL_LOCAL, MAIL_LOCAL,
+ "-f", argv[1], argv[2], NULL);
+ (void) syslog( LOG_ERR, "%s did not execute %i,%i\n",
+ MAIL_LOCAL, exec_rc, errno);
+ (void) closelog();
+ return (EX_TEMPFAIL);
+ #endif
+ done = 1;
+ };
+
+ (void) syslog( LOG_ERR, "No MDA was found! Tried: "
+ "%s, %s, %s, and %s.\n",
+ PROCMAIL, MAILDROP, DELIVER, MAIL_LOCAL );
+
+ (void) closelog();
+ return (EX_TEMPFAIL);
+ };
+
+/*-------------------------------------------------------------------
+ * drop_privs...
+ *-------------------------------------------------------------------*/
+static int
+drop_privs(char * luser, uid_t new_uid, gid_t new_gid) {
+ gid_t emptygidset[1];
+ uid_t EffUid;
+ gid_t EffGid;
+ int rval;
+
+ rval = EX_OK;
+ EffUid = geteuid();
+ EffGid = getegid();
+
+ /* reset group permissions; these can be set later */
+ emptygidset[0] = (RunAsGid != 0) ? RunAsGid : EffGid;
+ if (setgroups(1, emptygidset) == -1 && EffUid == 0) {
+ (void) syslog( LOG_ERR, "drop_privs: setgroups(1, %d) failed\n",
+ (int) emptygidset[0]);
+ rval = EX_OSERR;
+ };
+
+ /* reset primary group id */
+ if ((RunAsGid != 0) && EffGid != RunAsGid && setgid(RunAsGid) < 0) {
+ (void) syslog( LOG_ERR, "drop_privs: setgid(%d) failed\n",
+ (int) RunAsGid);
+ rval = EX_OSERR;
+ };
+
+ /* reset primary user id */
+ if ((RunAsUid != 0) && EffUid != RunAsUid && setuid(RunAsUid) < 0) {
+ (void) syslog( LOG_ERR, "drop_privs: setuid(%d) failed\n",
+ (int) RunAsUid);
+ rval = EX_OSERR;
+ };
+
+ #if DEBUG
+ show_privs();
+ (void) syslog( LOG_INFO, "drop_privs: rval = %d\n", rval);
+ #endif
+
+ if (rval) {
+ (void) syslog( LOG_ERR,
+ "Can not setreuid to %d:%d for user(%s)!\n",
+ RunAsUid, RunAsGid, luser);
+ show_privs();
+ };
+
+ return rval;
+ };
+
+/*-------------------------------------------------------------------
+ * show_privs...
+ *-------------------------------------------------------------------*/
+static void
+show_privs(void) {
+
+ (void) syslog( LOG_INFO, "show_privs: RealUser = %d:%d\n",
+ (int) RealUid, (int) RealGid);
+ (void) syslog( LOG_INFO, "show_privs: "
+ "get[ug]id=%d:%d, gete[ug]id=%d:%d\n",
+ (int) getuid(), (int) getgid(),
+ (int) geteuid(), (int) getegid());
+ (void) syslog( LOG_INFO, "show_privs: RunAsUser = %d:%d\n",
+ (int) RunAsUid, (int) RunAsGid);
+ return;
+ };
+
+/*-------------------------------------------------------------------
+ * Help...
+ *-------------------------------------------------------------------*/
+static void
+help(void) {
+
+ (void) printf("\n%s - Help information.\n\n"
+ "%s:\n"
+ "\tA general MTA->MDA wrapper to isolate the MTA from\n"
+ "\tthe vagaries of MDA installation and invocation.\n"
+ "\nSupported MTAs:\n"
+ "\tsendmail\n"
+ "\nSupported MDAs:\n"
+ "\tprocmail, maildrop, deliver, mail.local\n"
+ "\nCalled by:\n"
+ "\tSendmail: \n"
+ "\tYou: "
+ "Go directly to jail, do not pass GO, "
+ "do not collect $200!\n"
+ "\nSyntax:\n"
+ "\t%s <from:$g> <user:$u> [<detail:$h>]"
+ "[<client:${client_addr}>]\n"
+ "\nCalls:\n"
+ "\tprocmail:\t procmail -t"
+ " -f <from>"
+ " -a <detail> -d <to>\n"
+ "\tmaildrop:\t maildrop -f <from> -d <to> <detail>\n"
+ "\tdeliver:\t deliver -r <from> <to>\n"
+ "\tmail.local:\t mail.local -f <from> <to>\n"
+ "\n"
+ ,program, program, program
+ );
+ return;
+ };
+
diff --git a/debian/sensible_mda/sensible-mda.c.old b/debian/sensible_mda/sensible-mda.c.old
new file mode 100644
index 0000000..269efc0
--- /dev/null
+++ b/debian/sensible_mda/sensible-mda.c.old
@@ -0,0 +1,281 @@
+/*
+ * sensible-mda.c
+ * Copyright (c) 1998, Johnie Ingram.
+ * Copyright (c) 1998-2001 Richard Nelson <cowboy@debian.org>.
+ * Time-stamp: <2000/08/28 12:00:00 cowboy>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+# ifndef lint
+static char id[] = "@(#)$Id: sensible-mda.c,v 03.00.01 2001/08/24 12:00:00 cowboy Exp $";
+# endif /* ! lint */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <sys/types.h>
+#include <sysexits.h>
+#include <string.h>
+#include <syslog.h>
+
+// TODO: declare -x TCPREMOTEIP="$3"
+
+# define min(a, b) ((a) < (b) ? (a) : (b))
+
+#define DEBUG 0
+
+#define PROCMAIL "/usr/bin/procmail"
+#define MAILDROP "/usr/bin/maildrop"
+#define DELIVER "/usr/bin/deliver"
+#define MAIL_LOCAL "/usr/lib/sm.bin/mail.local"
+
+#define PROCMAILRCS "/etc/procmailrcs/"
+
+static void help(void);
+static unsigned char program[32];
+
+static struct stat MDA_stat;
+static struct stat procmailrc_stat;
+static int done = 1;
+static struct passwd* passwd_entry;
+static uid_t euid;
+
+extern int errno;
+
+int
+main (int argc, char *argv[])
+{
+
+ char *procmailrc;
+ char *str_pos;
+ int exec_rc;
+
+ (void) openlog( "sensible-mda", LOG_PID+LOG_PERROR, LOG_MAIL );
+
+ /*----------------------------------------------------------------
+ * Obtain program name
+ *----------------------------------------------------------------*/
+ str_pos = strrchr(argv[0], '/');
+ if ( str_pos )
+ str_pos++;
+ else
+ str_pos = argv[0];
+ (void) strncpy(program, str_pos,
+ min(strlen(str_pos), sizeof(program)-1));
+ program[sizeof(program)-1] = '\0';
+
+ #if DEBUG
+ int arg_index;
+ int str_len;
+ str_len = 0;
+ for ( arg_index = 0; arg_index < argc; arg_index++ )
+ str_len += strlen( argv[arg_index] ) + 1;
+ str_pos = malloc( str_len + 1);
+ str_pos[0] = '\0';
+ for ( arg_index = 0; arg_index < argc; arg_index++ ) {
+ (void) strcat( str_pos, argv[arg_index] );
+ (void) strcat( str_pos, " " );
+ };
+ (void) syslog( LOG_INFO, "Parms: %s\n", str_pos );
+ (void) free(str_pos);
+ #endif
+
+ /*----------------------------------------------------------------
+ * Parse input to determine to whom to speak and who we are...
+ * Must have at least three parameters unless first is ?,-?,/?.
+ *----------------------------------------------------------------*/
+ if (argc >= 2 &&
+ (strcmp(argv[1],"?") == 0 || strcmp(argv[1],"-?") == 0 ||
+ strcmp(argv[1],"/?") == 0 || strcmp(argv[1],"\\?") == 0 ||
+ strcmp(argv[1],"-h") == 0 || strcmp(argv[1],"--help") == 0)) {
+ (void) printf( "%s - Help\n", program );
+ help();
+ (void) closelog( );
+ return (EX_USAGE);
+ };
+ if (argc < 3) {
+ (void) syslog( LOG_ERR, "%s - Required parameters elided.\n",
+ program );
+ help();
+ (void) closelog( );
+ return (EX_USAGE);
+ };
+
+ euid = geteuid();
+
+ /*----------------------------------------------------------------
+ * 1st: try delivery via PROCMAIL
+ *----------------------------------------------------------------*/
+ if (!lstat(PROCMAIL, &MDA_stat)) {
+ if (MDA_stat.st_mode & S_ISUID) {
+ procmailrc=malloc(strlen(PROCMAILRCS)+strlen(argv[2])+1);
+ sprintf(procmailrc,"%s%s",PROCMAILRCS,argv[2]);
+ passwd_entry=getpwnam(argv[2]);
+ /*
+ * If argv[2] is a valid user &
+ * /etc/procmailrcs/argv[2] exists & is owned by argv[2]
+ */
+ if (passwd_entry &&
+ !stat(procmailrc, &procmailrc_stat) &&
+ procmailrc_stat.st_uid==passwd_entry->pw_uid) {
+ done = 0;
+ (void) syslog( LOG_INFO, "MDA: %s\n", PROCMAIL );
+ exec_rc = execl (PROCMAIL, PROCMAIL, "-t",
+ "-f", argv[1], "-m", procmailrc, "-a", argv[3], NULL);
+ (void) syslog( LOG_INFO, "%s did not execute %i,%i\n",
+ PROCMAIL,
+ exec_rc,
+ errno );
+ return (EX_TEMPFAIL);
+ }
+ else {
+ done = 0;
+ #if DEBUG
+ (void) syslog( LOG_INFO, "MDA: %s\n", PROCMAIL );
+ #endif
+ exec_rc = execl (PROCMAIL, PROCMAIL, "-t",
+ "-f", argv[1], "-a", argv[3], "-d", argv[2], NULL);
+ (void) syslog( LOG_INFO, "%s did not execute %i,%i\n",
+ PROCMAIL,
+ exec_rc,
+ errno );
+ return (EX_TEMPFAIL);
+ };
+ }
+ else
+ (void) syslog( LOG_INFO, "%s is not setuid!\n", PROCMAIL );
+ };
+
+ /*----------------------------------------------------------------
+ * 2nd: try delivery via MAILDROP
+ *----------------------------------------------------------------*/
+ if (done && !lstat(MAILDROP, &MDA_stat)) {
+ if ( (euid == 0) ||
+ (MDA_stat.st_mode & S_ISUID)
+ ) {
+ done = 0;
+ #if DEBUG
+ (void) syslog( LOG_INFO, "MDA: %s\n", MAILDROP );
+ #endif
+ exec_rc = execl (MAILDROP, MAILDROP,
+ "-f", argv[1], "-d", argv[2], NULL);
+ (void) syslog( LOG_INFO, "%s did not execute %i,%i\n",
+ MAILDROP,
+ exec_rc,
+ errno );
+ return (EX_TEMPFAIL);
+ }
+ else
+ (void) syslog( LOG_INFO, "%s is not setuid!\n", MAILDROP );
+ };
+
+
+ /*----------------------------------------------------------------
+ * 3rd: try delivery via DELIVER
+ *----------------------------------------------------------------*/
+ if (done && !lstat(DELIVER, &MDA_stat)) {
+ if ( (euid == 0) ||
+ (MDA_stat.st_mode & S_ISUID)
+ ) {
+ done = 0;
+ #if DEBUG
+ (void) syslog( LOG_INFO, "MDA: %s\n", DELIVER );
+ #endif
+ exec_rc = execl (DELIVER, DELIVER,
+ "-r", argv[1], argv[2], NULL);
+ (void) syslog( LOG_INFO, "%s did not execute %i,%i\n",
+ DELIVER,
+ exec_rc,
+ errno );
+ return (EX_TEMPFAIL);
+ }
+ else
+ (void) syslog( LOG_INFO, "%s is not setuid!\n", DELIVER );
+ };
+
+ /*----------------------------------------------------------------
+ * 4th: try delivery via MAIL.LOCAL
+ *----------------------------------------------------------------*/
+ if (done && !lstat(MAIL_LOCAL, &MDA_stat)) {
+ if ( (euid == 0) ||
+ (MDA_stat.st_mode & S_ISUID)
+ ) {
+ done = 0;
+ #if DEBUG
+ (void) syslog( LOG_INFO, "MDA: %s\n", MAIL_LOCAL );
+ #endif
+ exec_rc = execl (MAIL_LOCAL, MAIL_LOCAL,
+ "-f", argv[1], argv[2], NULL);
+ (void) syslog( LOG_INFO, "%s did not execute %i,%i\n",
+ MAIL_LOCAL,
+ exec_rc,
+ errno );
+ return (EX_TEMPFAIL);
+ }
+ else
+ (void) syslog( LOG_INFO, "%s is not setuid!\n", MAIL_LOCAL );
+ };
+
+ (void) syslog( LOG_ERR, "No MDA was found (or was suid)! Tried: "
+ "%s, %s, %s, and %s.\n",
+ PROCMAIL,
+ MAILDROP,
+ DELIVER,
+ MAIL_LOCAL
+ );
+
+ (void) closelog( );
+
+ return (EX_TEMPFAIL);
+ };
+
+
+/*-------------------------------------------------------------------
+ * Help...
+ *-------------------------------------------------------------------*/
+static void help(void) {
+
+ (void) printf("\n%s - Help information.\n\n"
+ "%s:\n"
+ "\tA general MTA->MDA wrapper to isolate the MTA from\n"
+ "\tthe vagaries of MDA installation and invocation.\n"
+ "\nSupported MTAs:\n"
+ "\tsendmail\n"
+ "\nSupported MDAs:\n"
+ "\tprocmail, maildrop, deliver, mail.local\n"
+ "\nCalled by:\n"
+ "\tSendmail\n"
+ "\tYou - "
+ "Go directly to jail, do not pass GO, "
+ "do not collect $200!\n"
+ "\nSyntax:\n"
+ "\t%s <from:$g> <user:$u> [<detail:$h>]"
+ "[<client:${client_addr}>]\n"
+ "\nCalls:\n"
+ "\tprocmail:\t procmail -t -f <from>"
+ "-a <detail> -d <to>\n"
+ "\tmaildrop:\t maildrop -f <from> -d <to>\n"
+ "\tdeliver:\t deliver -r <from> <to>\n"
+ "\tmail.local:\t mail.local -f <from> <to>\n"
+ "\n"
+ ,program, program, program
+ );
+ return;
+ };
+
diff --git a/debian/sources b/debian/sources
new file mode 100644
index 0000000..6005260
--- /dev/null
+++ b/debian/sources
@@ -0,0 +1 @@
+upstream tar sendmail.8.12.0.tar.gz