diff options
author | dm <dm@cvs.openbsd.org> | 1996-01-29 01:42:46 +0000 |
---|---|---|
committer | dm <dm@cvs.openbsd.org> | 1996-01-29 01:42:46 +0000 |
commit | e3ba3bc873e356bbf1d0fd1c90c4b02cfdb74fad (patch) | |
tree | 661540fd4e7e9ede8f620ed01cf9bd10ee8c98ff | |
parent | 66fb751a5e0356114f5b96c728bbf748cf61b62c (diff) |
sendmail 8.9.1
20 files changed, 1459 insertions, 0 deletions
diff --git a/usr.sbin/sendmail/cf/domain/Berkeley.EDU.m4 b/usr.sbin/sendmail/cf/domain/Berkeley.EDU.m4 new file mode 100644 index 00000000000..2bad42bc306 --- /dev/null +++ b/usr.sbin/sendmail/cf/domain/Berkeley.EDU.m4 @@ -0,0 +1,45 @@ +divert(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +divert(0) +VERSIONID(`@(#)Berkeley.EDU.m4 8.9 (Berkeley) 10/5/95') +DOMAIN(berkeley-only)dnl +define(`BITNET_RELAY', `bitnet-relay.Berkeley.EDU')dnl +define(`UUCP_RELAY', `uucp-relay.Berkeley.EDU')dnl +define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')dnl +define(`confCW_FILE', `-o /etc/sendmail.cw')dnl +define(`confDONT_INIT_GROUPS', True)dnl +FEATURE(redirect)dnl +FEATURE(use_cw_file)dnl +FEATURE(stickyhost)dnl diff --git a/usr.sbin/sendmail/cf/domain/CS.Berkeley.EDU.m4 b/usr.sbin/sendmail/cf/domain/CS.Berkeley.EDU.m4 new file mode 100644 index 00000000000..97ccfb20899 --- /dev/null +++ b/usr.sbin/sendmail/cf/domain/CS.Berkeley.EDU.m4 @@ -0,0 +1,40 @@ +divert(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +divert(0) +VERSIONID(`@(#)CS.Berkeley.EDU.m4 8.2 (Berkeley) 4/21/95') +DOMAIN(Berkeley.EDU)dnl +HACK(cssubdomain)dnl +define(`confUSERDB_SPEC', + `/usr/sww/share/lib/users.cs.db,/usr/sww/share/lib/users.eecs.db')dnl diff --git a/usr.sbin/sendmail/cf/domain/EECS.Berkeley.EDU.m4 b/usr.sbin/sendmail/cf/domain/EECS.Berkeley.EDU.m4 new file mode 100644 index 00000000000..a41fc7ed823 --- /dev/null +++ b/usr.sbin/sendmail/cf/domain/EECS.Berkeley.EDU.m4 @@ -0,0 +1,38 @@ +divert(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +divert(0) +VERSIONID(`@(#)EECS.Berkeley.EDU.m4 8.2 (Berkeley) 4/21/95') +DOMAIN(Berkeley.EDU)dnl +MASQUERADE_AS(EECS.Berkeley.EDU)dnl diff --git a/usr.sbin/sendmail/cf/domain/S2K.Berkeley.EDU.m4 b/usr.sbin/sendmail/cf/domain/S2K.Berkeley.EDU.m4 new file mode 100644 index 00000000000..4aed130b7ba --- /dev/null +++ b/usr.sbin/sendmail/cf/domain/S2K.Berkeley.EDU.m4 @@ -0,0 +1,38 @@ +divert(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +divert(0) +VERSIONID(`@(#)S2K.Berkeley.EDU.m4 8.2 (Berkeley) 4/21/95') +DOMAIN(CS.Berkeley.EDU)dnl +MASQUERADE_AS(postgres.Berkeley.EDU)dnl diff --git a/usr.sbin/sendmail/cf/domain/berkeley-only.m4 b/usr.sbin/sendmail/cf/domain/berkeley-only.m4 new file mode 100644 index 00000000000..ef710714ea9 --- /dev/null +++ b/usr.sbin/sendmail/cf/domain/berkeley-only.m4 @@ -0,0 +1,40 @@ +divert(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +divert(0) +VERSIONID(`@(#)unspecified-domain.m4 8.2 (Berkeley) 4/21/95') +errprint(`*** ERROR: You are trying to use the Berkeley sample configuration') +errprint(` files outside of the Computer Science Division at Berkeley.') +errprint(` The configuration (.mc) files must be customized to reference') +errprint(` domain files appropriate for your environment.') diff --git a/usr.sbin/sendmail/cf/domain/generic.m4 b/usr.sbin/sendmail/cf/domain/generic.m4 new file mode 100644 index 00000000000..6799ff89522 --- /dev/null +++ b/usr.sbin/sendmail/cf/domain/generic.m4 @@ -0,0 +1,48 @@ +divert(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# +# The following is a generic domain file. You should be able to +# use it anywhere. If you want to customize it, copy it to a file +# named with your domain and make the edits; then, copy the appropriate +# .mc files and change `DOMAIN(generic)' to reference your updated domain +# files. +# +divert(0) +VERSIONID(`@(#)generic.m4 8.2 (Berkeley) 4/21/95') +define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')dnl +define(`confCW_FILE', `-o /etc/sendmail.cw')dnl +FEATURE(redirect)dnl +FEATURE(use_cw_file)dnl diff --git a/usr.sbin/sendmail/cf/feature/bestmx_is_local.m4 b/usr.sbin/sendmail/cf/feature/bestmx_is_local.m4 new file mode 100644 index 00000000000..23dff8c93ee --- /dev/null +++ b/usr.sbin/sendmail/cf/feature/bestmx_is_local.m4 @@ -0,0 +1,58 @@ +divert(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +divert(0) +VERSIONID(`@(#)bestmx_is_local.m4 8.2 (Berkeley) 10/29/95') +divert(-1) + +LOCAL_CONFIG +Kbestmx bestmx + +LOCAL_NET_CONFIG + +# If we are the best MX for a site, then we want to accept +# its mail as local. We assume we've already weeded out mail to +# UUCP sites which are connected to us, which should also have +# listed us as their best MX. +# +# Warning: this may generate a lot of extra DNS traffic -- a +# lower cost method is to list all the expected best MX hosts +# in $=w. This should be fine (and easier to administer) for +# low to medium traffic hosts. + +R$* < @ $* > $* $: $1 < @ $2 @@ $(bestmx $2 $) > $3 +R$* $=O $* < @ $* @@ $=w . > $* $@ $>97 $1 $2 $3 +R$* < @ $* @@ $=w . > $* $#local $: $1 +R$* < @ $* @@ $* > $* $: $1 < @ $2 > $4 diff --git a/usr.sbin/sendmail/cf/feature/local_procmail.m4 b/usr.sbin/sendmail/cf/feature/local_procmail.m4 new file mode 100644 index 00000000000..9087a690d08 --- /dev/null +++ b/usr.sbin/sendmail/cf/feature/local_procmail.m4 @@ -0,0 +1,44 @@ +divert(-1) +# +# Copyright (c) 1994 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +divert(0) +VERSIONID(`@(#)local_procmail.m4 8.3 (Berkeley) 10/29/95') +divert(-1) + +define(`PROCMAIL_PATH', + ifelse(_ARG_, `', `/usr/local/bin/procmail', `_ARG_')) +define(`LOCAL_MAILER_FLAGS', `SPfhn') +define(`LOCAL_MAILER_PATH', PROCMAIL_PATH) +define(`LOCAL_MAILER_ARGS', `procmail -Y -a $h -d $u') diff --git a/usr.sbin/sendmail/cf/feature/masquerade_envelope.m4 b/usr.sbin/sendmail/cf/feature/masquerade_envelope.m4 new file mode 100644 index 00000000000..1e6010856ea --- /dev/null +++ b/usr.sbin/sendmail/cf/feature/masquerade_envelope.m4 @@ -0,0 +1,40 @@ +divert(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +divert(0) +VERSIONID(`@(#)masquerade_envelope.m4 8.1 (Berkeley) 7/9/95') +divert(-1) + +define(`_MASQUERADE_ENVELOPE_', 1) diff --git a/usr.sbin/sendmail/cf/feature/smrsh.m4 b/usr.sbin/sendmail/cf/feature/smrsh.m4 new file mode 100644 index 00000000000..6b4faab2526 --- /dev/null +++ b/usr.sbin/sendmail/cf/feature/smrsh.m4 @@ -0,0 +1,42 @@ +divert(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +divert(0) +VERSIONID(`@(#)smrsh.m4 8.2 (Berkeley) 11/11/95') +divert(-1) + +ifdef(`_MAILER_local_', + `errprint(`*** FEATURE(smrsh) must occur before MAILER(local)')')dnl +define(`LOCAL_SHELL_PATH', ifelse(_ARG_, `', `/usr/local/etc/smrsh', _ARG_)) diff --git a/usr.sbin/sendmail/cf/feature/stickyhost.m4 b/usr.sbin/sendmail/cf/feature/stickyhost.m4 new file mode 100644 index 00000000000..bdd9c9a729f --- /dev/null +++ b/usr.sbin/sendmail/cf/feature/stickyhost.m4 @@ -0,0 +1,40 @@ +divert(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +divert(0) +VERSIONID(`@(#)stickyhost.m4 8.1 (Berkeley) 11/12/94') +divert(-1) + +define(`_STICKY_LOCAL_DOMAIN_', 1) diff --git a/usr.sbin/sendmail/cf/feature/use_ct_file.m4 b/usr.sbin/sendmail/cf/feature/use_ct_file.m4 new file mode 100644 index 00000000000..c33bbfd7833 --- /dev/null +++ b/usr.sbin/sendmail/cf/feature/use_ct_file.m4 @@ -0,0 +1,46 @@ +divert(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +divert(0) +VERSIONID(`@(#)use_ct_file.m4 8.1 (Berkeley) 9/17/95') +divert(-1) + +# if defined, the sendmail.cf will read the /etc/sendmail.ct file +# to find the names of trusted users. There should only be a few +# of these, and normally this is done directly in the .cf file. + +define(`_USE_CT_FILE_', `') + +divert(0) diff --git a/usr.sbin/sendmail/cf/m4/cfhead.m4 b/usr.sbin/sendmail/cf/m4/cfhead.m4 new file mode 100644 index 00000000000..46605e7e34c --- /dev/null +++ b/usr.sbin/sendmail/cf/m4/cfhead.m4 @@ -0,0 +1,147 @@ +# +# Copyright (c) 1983, 1995 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +###################################################################### +###################################################################### +##### +##### SENDMAIL CONFIGURATION FILE +##### +define(`TEMPFILE', maketemp(/tmp/cfXXXXXX))dnl +syscmd(sh _CF_DIR_`'sh/makeinfo.sh _CF_DIR_ > TEMPFILE)dnl +include(TEMPFILE)dnl +syscmd(rm -f TEMPFILE)dnl +##### +###################################################################### +###################################################################### + +divert(-1) + +changecom() +undefine(`format') +undefine(`hpux') +ifdef(`pushdef', `', + `errprint(`You need a newer version of M4, at least as new as +System V or GNU') + include(NoSuchFile)') +define(`PUSHDIVERT', `pushdef(`__D__', divnum)divert($1)') +define(`POPDIVERT', `divert(__D__)popdef(`__D__')') +define(`OSTYPE', + `PUSHDIVERT(-1) + ifdef(`__OSTYPE__', `errprint(`duplicate OSTYPE'($1))') + define(`__OSTYPE__', $1) + define(`_ARG_', $2) + include(_CF_DIR_`'ostype/$1.m4)POPDIVERT`'') +define(`MAILER', +`ifdef(`_MAILER_$1_', `dnl`'', +`define(`_MAILER_$1_', `')PUSHDIVERT(7)include(_CF_DIR_`'mailer/$1.m4)POPDIVERT`'')') +define(`DOMAIN', `PUSHDIVERT(-1)define(`_ARG_', $2)include(_CF_DIR_`'domain/$1.m4)POPDIVERT`'') +define(`FEATURE', `PUSHDIVERT(-1)define(`_ARG_', $2)include(_CF_DIR_`'feature/$1.m4)POPDIVERT`'') +define(`HACK', `PUSHDIVERT(-1)define(`_ARG_', $2)include(_CF_DIR_`'hack/$1.m4)POPDIVERT`'') +define(`VERSIONID', ``##### $1 #####'') +define(`LOCAL_RULE_0', `divert(3)') +define(`LOCAL_RULE_1', +`divert(9)dnl +####################################### +### Ruleset 1 -- Sender Rewriting ### +####################################### + +S1 +') +define(`LOCAL_RULE_2', +`divert(9)dnl +########################################## +### Ruleset 2 -- Recipient Rewriting ### +########################################## + +S2 +') +define(`LOCAL_RULE_3', `divert(2)') +define(`LOCAL_CONFIG', `divert(6)') +define(`LOCAL_NET_CONFIG', `define(`_LOCAL_RULES_', 1)divert(1)') +define(`UUCPSMTP', `R DOL(*) < @ $1 .UUCP > DOL(*) DOL(1) < @ $2 > DOL(2)') +define(`CONCAT', `$1$2$3$4$5$6$7') +define(`DOL', ``$'$1') +define(`SITECONFIG', +`CONCAT(D, $3, $2) +define(`_CLASS_$3_', `')dnl +ifelse($3, U, Cw$2 $2.UUCP, `dnl') +define(`SITE', `ifelse(CONCAT($'2`, $3), SU, + CONCAT(CY, $'1`), + CONCAT(C, $3, $'1`))') +sinclude(_CF_DIR_`'siteconfig/$1.m4)') +define(`EXPOSED_USER', `PUSHDIVERT(5)CE$1 +POPDIVERT`'dnl') +define(`LOCAL_USER', `PUSHDIVERT(5)CL$1 +POPDIVERT`'dnl') +define(`MASQUERADE_AS', `define(`MASQUERADE_NAME', $1)') +define(`MASQUERADE_DOMAIN', `PUSHDIVERT(5)CM$1 +POPDIVERT`'dnl') +define(`MASQUERADE_DOMAIN_FILE', `PUSHDIVERT(5)FM$1 +POPDIVERT`'dnl') +define(`_OPTINS', `ifdef(`$1', `$2$1$3')') + +m4wrap(`include(_CF_DIR_`m4/proto.m4')') + +# set up default values for options +define(`confMAILER_NAME', ``MAILER-DAEMON'') +define(`confFROM_LINE', `From $g $d') +define(`confOPERATORS', `.:%@!^/[]+') +define(`confSMTP_LOGIN_MSG', `$j Sendmail $v/$Z; $b') +define(`confRECEIVED_HEADER', `$?sfrom $s $.$?_($?s$|from $.$_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b') +define(`confSEVEN_BIT_INPUT', `False') +define(`confEIGHT_BIT_HANDLING', `pass8') +define(`confALIAS_WAIT', `10') +define(`confMIN_FREE_BLOCKS', `100') +define(`confBLANK_SUB', `.') +define(`confCON_EXPENSIVE', `False') +define(`confDELIVERY_MODE', `background') +define(`confTEMP_FILE_MODE', `0600') +define(`confMCI_CACHE_SIZE', `2') +define(`confMCI_CACHE_TIMEOUT', `5m') +define(`confUSE_ERRORS_TO', `False') +define(`confLOG_LEVEL', `9') +define(`confCHECK_ALIASES', `False') +define(`confOLD_STYLE_HEADERS', `True') +define(`confPRIVACY_FLAGS', `authwarnings') +define(`confSAFE_QUEUE', `True') +define(`confTO_QUEUERETURN', `5d') +define(`confTO_QUEUEWARN', `4h') +define(`confTIME_ZONE', `USE_SYSTEM') +define(`confDEF_USER_ID', `1:1') +define(`confCW_FILE', `/etc/sendmail.cw') +define(`confMIME_FORMAT_ERRORS', `True') +define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward') + +divert(0)dnl +VERSIONID(`@(#)cfhead.m4 8.3 (Berkeley) 9/15/95') diff --git a/usr.sbin/sendmail/cf/mailer/cyrus.m4 b/usr.sbin/sendmail/cf/mailer/cyrus.m4 new file mode 100644 index 00000000000..f5311371b53 --- /dev/null +++ b/usr.sbin/sendmail/cf/mailer/cyrus.m4 @@ -0,0 +1,44 @@ +PUSHDIVERT(-1) +# +# (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>. +# + +ifdef(`CYRUS_MAILER_FLAGS',, `define(`CYRUS_MAILER_FLAGS', `A5@')') +ifdef(`CYRUS_MAILER_PATH',, `define(`CYRUS_MAILER_PATH', /usr/cyrus/bin/deliver)') +ifdef(`CYRUS_MAILER_ARGS',, `define(`CYRUS_MAILER_ARGS', `deliver -e -m $h -- $u')') +ifdef(`CYRUS_BB_MAILER_FLAGS',, `define(`CYRUS_BB_MAILER_FLAGS', `')') +ifdef(`CYRUS_BB_MAILER_ARGS',, `define(`CYRUS_BB_MAILER_ARGS', `deliver -e -m $u')') + +POPDIVERT + +################################################## +### Cyrus Mailer specification ### +################################################## + +VERSIONID(`@(#)cyrus.m4 8.2 (Carnegie Mellon) 9/12/95') + +Mcyrus, P=CYRUS_MAILER_PATH, F=CONCAT(`lsDFMnP', CYRUS_MAILER_FLAGS), S=10, R=20/40, T=X-Unix, + ifdef(`CYRUS_MAILER_MAX', `M=CYRUS_MAILER_MAX, ')A=CYRUS_MAILER_ARGS + +Mcyrusbb, P=CYRUS_MAILER_PATH, F=CONCAT(`lsDFMnP', CYRUS_MAILER_FLAGS), S=10, R=20/40, T=X-Unix, + ifdef(`CYRUS_MAILER_MAX', `M=CYRUS_MAILER_MAX, ')A=CYRUS_BB_MAILER_ARGS diff --git a/usr.sbin/sendmail/cf/mailer/mail11.m4 b/usr.sbin/sendmail/cf/mailer/mail11.m4 new file mode 100644 index 00000000000..21e05dd19fd --- /dev/null +++ b/usr.sbin/sendmail/cf/mailer/mail11.m4 @@ -0,0 +1,50 @@ +PUSHDIVERT(-1) +# +# Not exciting enough to bother with copyrights and most of the +# rulesets are based from those provided by DEC. +# Barb Dijker, Labyrinth Computer Services, barb@labyrinth.com +# +# This mailer is only useful if you have DECNET and the +# mail11 program - gatekeeper.dec.com:/pub/DEC/gwtools. +# +# For local delivery of DECNET style addresses to the local +# DECNET node, you will need feature(use_cw_file) and put +# your DECNET nodename in in the cw file. +# +ifdef(`MAIL11_MAILER_PATH',, `define(`MAIL11_MAILER_PATH', /usr/etc/mail11)') +ifdef(`MAIL11_MAILER_FLAGS',, `define(`MAIL11_MAILER_FLAGS', nsFx)') +ifdef(`MAIL11_MAILER_ARGS',, `define(`MAIL11_MAILER_ARGS', mail11 $g $x $h $u)') +define(`_USE_DECNET_SYNTAX_') + +POPDIVERT + +PUSHDIVERT(3) +# DECNET delivery +R$* < @ $=w .DECNET. > $#local $: $1 local DECnet +R$+ < @ $+ .DECNET. > $#mail11 $@ $2 $: $1 DECnet user +POPDIVERT + +PUSHDIVERT(6) +CPDECNET +POPDIVERT + +########################################### +### UTK-MAIL11 Mailer specification ### +########################################### + +VERSIONID(`@(#)mail11.m4 8.1 (Berkeley) 5/23/95') + +Mmail11, P=MAIL11_MAILER_PATH, F=MAIL11_MAILER_FLAGS, S=15, R=25, + A=MAIL11_MAILER_ARGS + +S15 +R$+ $: $>25 $1 preprocess +R$w :: $+ $@ $w :: $1 ready to go + +S25 +R$+ < @ $- .UUCP > $: $2 ! $1 back to old style +R$+ < @ $- .DECNET > $: $2 :: $1 convert to DECnet style +R$+ < @ $- .LOCAL > $: $2 :: $1 convert to DECnet style +R$+ < @ $=w. > $: $2 :: $1 convert to DECnet style +R$=w :: $+ $2 strip local names +R$+ :: $+ $@ $1 :: $2 already qualified diff --git a/usr.sbin/sendmail/cf/mailer/phquery.m4 b/usr.sbin/sendmail/cf/mailer/phquery.m4 new file mode 100644 index 00000000000..ee359e09e53 --- /dev/null +++ b/usr.sbin/sendmail/cf/mailer/phquery.m4 @@ -0,0 +1,51 @@ +PUSHDIVERT(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# Contributed by Kimmo Suominen <kim@tac.nyc.ny.us>. +# + +ifdef(`PH_MAILER_PATH',, `define(`PH_MAILER_PATH', /usr/local/etc/phquery)') +ifdef(`PH_MAILER_FLAGS',, `define(`PH_MAILER_FLAGS', `ehmu')') +ifdef(`PH_MAILER_ARGS',, `define(`PH_MAILER_ARGS', `phquery -- $u')') + +POPDIVERT + +#################################### +### PH Mailer specification ### +#################################### + +VERSIONID(`@(#)phquery.m4 8.1 (Berkeley) 8/1/95') + +Mph, P=PH_MAILER_PATH, F=CONCAT(`nrDFM', PH_MAILER_FLAGS), S=10, R=20/40, + A=PH_MAILER_ARGS diff --git a/usr.sbin/sendmail/cf/mailer/procmail.m4 b/usr.sbin/sendmail/cf/mailer/procmail.m4 new file mode 100644 index 00000000000..d1293b9ceff --- /dev/null +++ b/usr.sbin/sendmail/cf/mailer/procmail.m4 @@ -0,0 +1,52 @@ +PUSHDIVERT(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +ifdef(`PROCMAIL_PATH',, + `define(`PROCMAIL_PATH', /usr/local/bin/procmail)') +ifdef(`PROCMAIL_MAILER_FLAGS',, + `define(`PROCMAIL_MAILER_FLAGS', `Shu')') +ifdef(`PROCMAIL_MAILER_ARGS',, + `define(`PROCMAIL_MAILER_ARGS', `procmail -m $h $f $u')') + +POPDIVERT + +######################*****############## +### PROCMAIL Mailer specification ### +##################*****################## + +VERSIONID(`@(#)procmail.m4 8.4 (Berkeley) 4/23/95') + +Mprocmail, P=PROCMAIL_PATH, F=CONCAT(`DFMm', PROCMAIL_MAILER_FLAGS), S=11/31, R=21/31, T=DNS/RFC822/X-Unix, + ifdef(`PROCMAIL_MAILER_MAX', `M=PROCMAIL_MAILER_MAX, ')A=PROCMAIL_MAILER_ARGS diff --git a/usr.sbin/sendmail/contrib/bsdi.mc b/usr.sbin/sendmail/contrib/bsdi.mc new file mode 100644 index 00000000000..7c7553f48e3 --- /dev/null +++ b/usr.sbin/sendmail/contrib/bsdi.mc @@ -0,0 +1,191 @@ +Return-Path: sanders@austin.BSDI.COM +Received: from hofmann.CS.Berkeley.EDU (hofmann.CS.Berkeley.EDU [128.32.34.35]) by orodruin.CS.Berkeley.EDU (8.6.9/8.7.0.Beta0) with ESMTP id KAA28278 for <eric@orodruin.CS.Berkeley.EDU>; Sat, 10 Dec 1994 10:49:08 -0800 +Received: from austin.BSDI.COM (austin.BSDI.COM [137.39.95.2]) by hofmann.CS.Berkeley.EDU (8.6.9/8.6.6.Beta11) with ESMTP id KAA09482 for <eric@cs.berkeley.edu>; Sat, 10 Dec 1994 10:49:03 -0800 +Received: from austin.BSDI.COM (sanders@localhost [127.0.0.1]) by austin.BSDI.COM (8.6.9/8.6.9) with ESMTP id MAA14919 for <eric@cs.berkeley.edu>; Sat, 10 Dec 1994 12:49:01 -0600 +Message-Id: <199412101849.MAA14919@austin.BSDI.COM> +To: Eric Allman <eric@cs.berkeley.edu> +Subject: Re: sorting mailings lists with fastest delivery users first +In-reply-to: Your message of Sat, 10 Dec 1994 08:25:30 PST. +References: <199412101625.IAA15407@mastodon.CS.Berkeley.EDU> +From: Tony Sanders <sanders@bsdi.com> +Organization: Berkeley Software Design, Inc. +Date: Sat, 10 Dec 1994 12:49:00 -0600 +Sender: sanders@austin.BSDI.COM + +(some random text deleted) + +I'll send you something else I've hacked up. You are free to use this +or do with it as you like (I hereby make all my parts public domain). +It's a sample .mc file that has comments (mostly taken from the README) +and examples describing most of the common things people need to setup. + +# +# /usr/share/sendmail/cf/sample.mc +# +# Do not edit /etc/sendmail.cf directly unless you cannot do what you +# want in the master config file (/usr/share/sendmail/cf/sample.mc). +# To create /etc/sendmail.cf from the master: +# cd /usr/share/sendmail/cf +# mv /etc/sendmail.cf /etc/sendmail.cf.save +# m4 < sample.mc > /etc/sendmail.cf +# +# Then kill and restart sendmail: +# sh -c 'set `cat /var/run/sendmail.pid`; kill $1; shift; eval "$@"' +# +# See /usr/share/sendmail/README for help in building a configuration file. +# +include(`../m4/cf.m4') +VERSIONID(`@(#)$Id: bsdi.mc,v 1.1 1996/01/29 01:42:36 dm Exp $') + +dnl # Specify your OS type below +OSTYPE(`bsd4.4') + +dnl # NOTE: `dnl' is the m4 command for delete-to-newline; these are +dnl # used to prevent those lines from appearing in the sendmail.cf. +dnl # +dnl # UUCP-only sites should configure FEATURE(`nodns') and SMART_HOST. +dnl # The uucp-dom mailer requires MAILER(smtp). For more info, see +dnl # `UUCP Config' at the end of this file. + +dnl # If you are not running DNS at all, it is important to use +dnl # FEATURE(nodns) to avoid having sendmail queue everything +dnl # waiting for the name server to come up. +dnl # Example: +dnl FEATURE(`nodns') + +dnl # Use FEATURE(`nocanonify') to skip address canonification via $[ ... $]. +dnl # This would generally only be used by sites that only act as mail gateways +dnl # or which have user agents that do full canonification themselves. +dnl # You may also want to use: +dnl # define(`confBIND_OPTS',`-DNSRCH -DEFNAMES') +dnl # to turn off the usual resolver options that do a similar thing. +dnl # Examples: +dnl FEATURE(`nocanonify') +dnl define(`confBIND_OPTS',`-DNSRCH -DEFNAMES') + +dnl # If /bin/hostname is not set to the FQDN (Full Qualified Domain Name; +dnl # for example, foo.bar.com) *and* you are not running a nameserver +dnl # (that is, you do not have an /etc/resolv.conf and are not running +dnl # named) *and* the canonical name for your machine in /etc/hosts +dnl # (the canonical name is the first name listed for a given IP Address) +dnl # is not the FQDN version then define NEED_DOMAIN and specify your +dnl # domain using `DD' (for example, if your hostname is `foo.bar.com' +dnl # then use DDbar.com). If in doubt, just define it anyway; doesn't hurt. +dnl # Examples: +dnl define(`NEED_DOMAIN', `1') +dnl DDyour.site.domain + +dnl # Define SMART_HOST if you want all outgoing mail to go to a central +dnl # site. SMART_HOST applies to names qualified with non-local names. +dnl # Example: +dnl define(`SMART_HOST', `smtp:firewall.bar.com') + +dnl # Define MAIL_HUB if you want all incoming mail sent to a +dnl # centralized hub, as for a shared /var/spool/mail scheme. +dnl # MAIL_HUB applies to names qualified with the name of the +dnl # local host (e.g., "eric@foo.bar.com"). +dnl # Example: +dnl define(`MAIL_HUB', `smtp:mailhub.bar.com') + +dnl # LOCAL_RELAY is a site that will handle unqualified names, this is +dnl # basically for site/company/department wide alias forwarding. By +dnl # default mail is delivered on the local host. +dnl # Example: +dnl define(`LOCAL_RELAY', `smtp:mailgate.bar.com') + +dnl # Relay hosts for fake domains: .UUCP .BITNET .CSNET +dnl # Examples: +dnl define(`UUCP_RELAY', `mailer:your_relay_host') +dnl define(`BITNET_RELAY', `mailer:your_relay_host') +dnl define(`CSNET_RELAY', `mailer:your_relay_host') + +dnl # Define `MASQUERADE_AS' is used to hide behind a gateway. +dnl # add any accounts you wish to be exposed (i.e., not hidden) to the +dnl # `EXPOSED_USER' list. +dnl # Example: +dnl MASQUERADE_AS(`some.other.host') + +dnl # If masquerading, EXPOSED_USER defines the list of accounts +dnl # that retain the local hostname in their address. +dnl # Example: +dnl EXPOSED_USER(`postmaster hostmaster webmaster') + +dnl # If masquerading is enabled (using MASQUERADE_AS above) then +dnl # FEATURE(allmasquerade) will cause recipient addresses to +dnl # masquerade as being from the masquerade host instead of +dnl # getting the local hostname. Although this may be right for +dnl # ordinary users, it breaks local aliases that aren't exposed +dnl # using EXPOSED_USER. +dnl # Example: +dnl FEATURE(allmasquerade) + +dnl # Include any required mailers +MAILER(local) +MAILER(smtp) +MAILER(uucp) + +LOCAL_CONFIG +# If this machine should be accepting mail as local for other hostnames +# that are MXed to this hostname then add those hostnames below using +# a line like: +# Cw bar.com +# The most common case where you need this is if this machine is supposed +# to be accepting mail for the domain. That is, if this machine is +# foo.bar.com and you have an MX record in the DNS that looks like: +# bar.com. IN MX 0 foo.bar.com. +# Then you will need to add `Cw bar.com' to the config file for foo.bar.com. +# DO NOT add Cw entries for hosts whom you simply store and forward mail +# for or else it will attempt local delivery. So just because bubba.bar.com +# is MXed to your machine you should not add a `Cw bubba.bar.com' entry +# unless you want local delivery and your machine is the highest-priority +# MX entry (that is is has the lowest preference value in the DNS. + +LOCAL_RULE_0 +# `LOCAL_RULE_0' can be used to introduce alternate delivery rules. +# For example, let's say you accept mail via an MX record for widgets.com +# (don't forget to add widgets.com to your Cw list, as above). +# +# If wigets.com only has an AOL address (widgetsinc) then you could use: +# R$+ <@ widgets.com.> $#smtp $@aol.com. $:widgetsinc<@aol.com.> +# +# Or, if widgets.com was connected to you via UUCP as the UUCP host +# widgets you might have: +# R$+ <@ widgets.com.> $#uucp $@widgets $:$1<@widgets.com.> + +dnl ### +dnl ### UUCP Config +dnl ### + +dnl # `SITECONFIG(site_config_file, name_of_site, connection)' +dnl # site_config_file the name of a file in the cf/siteconfig +dnl # directory (less the `.m4') +dnl # name_of_site the actual name of your UUCP site +dnl # connection one of U, W, X, or Y; where U means the sites listed +dnl # in the config file are connected locally; W, X, and Y +dnl # build remote UUCP hub classes ($=W, etc). +dnl # You will need to create the specific site_config_file in +dnl # /usr/share/sendmail/siteconfig/site_config_file.m4 +dnl # The site_config_file contains a list of directly connected UUCP hosts, +dnl # e.g., if you only connect to UUCP site gargoyle then you could just: +dnl # echo 'SITE(gargoyle)' > /usr/share/sendmail/siteconfig/uucp.foobar.m4 +dnl # Example: +dnl SITECONFIG(`uucp.foobar', `foobar', U) + +dnl # If you are on a local SMTP-based net that connects to the outside +dnl # world via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules. +dnl # For example: +dnl # define(`SMART_HOST', suucp:uunet) +dnl # LOCAL_NET_CONFIG +dnl # R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 +dnl # This will cause all names that end in your domain name ($m) to be sent +dnl # via SMTP; anything else will be sent via suucp (smart UUCP) to uunet. +dnl # If you have FEATURE(nocanonify), you may need to omit the dots after +dnl # the $m. +dnl # +dnl # If you are running a local DNS inside your domain which is not +dnl # otherwise connected to the outside world, you probably want to use: +dnl # define(`SMART_HOST', smtp:fire.wall.com) +dnl # LOCAL_NET_CONFIG +dnl # R$* < @ $* . > $* $#smtp $@ $2. $: $1 < @ $2. > $3 +dnl # That is, send directly only to things you found in your DNS lookup; +dnl # anything else goes through SMART_HOST. diff --git a/usr.sbin/sendmail/contrib/mailprio b/usr.sbin/sendmail/contrib/mailprio new file mode 100644 index 00000000000..cdbc3b06c26 --- /dev/null +++ b/usr.sbin/sendmail/contrib/mailprio @@ -0,0 +1,297 @@ +Message-Id: <199412081919.NAA23234@austin.BSDI.COM> +To: Eric Allman <eric@cs.berkeley.edu> +Subject: Re: sorting mailings lists with fastest delivery users first +In-reply-to: Your message of Thu, 08 Dec 1994 06:08:33 PST. +References: <199412081408.GAA06210@mastodon.CS.Berkeley.EDU> +From: Tony Sanders <sanders@bsdi.com> +Organization: Berkeley Software Design, Inc. +Date: Thu, 08 Dec 1994 13:19:39 -0600 +Sender: sanders@austin.BSDI.COM + +Eric Allman writes: +> Nope, that's a new one, so far as I know. Any interest in +> contributing it? For small lists it seems overkill, but for +> large lists it could be a major win. + +Sure, I will contribute it; after I sent you mail last night I went ahead +and finished up what I thought needed to be done. I would like to get +some feedback from you on a few items, if you have time. + +There are two programs, mailprio_mkdb and mailprio (source below). + +mailprio_mkdb reads maillog files and creates a DB file of address vs. +delay. I'm not too happy with how it does the averages right now but this +is just a quick hack. However, it should at least order sites that take +days vs. those that deliver on the first pass through. One thing that +would make this information a lot more accurate is if sendmail could log +a "transaction delay" (on failures also), as well as total delivery delay. +Perhaps, as an option, it could maintain the DB file itself? + +mailprio then simply reads a list of addresses from stdin (the mailing +list), and tries to prioritize them according to the info the database. +It collects comment lines and other junk at the top of the file; all +mailprio does is reorder lines, the actual text of the file should +be unchanged to the extent that you can verify it with: + sort sorted_list > checkit; sort mailing-list | diff - checkit +Users with no delay information are put next. The prioritized list is last. +Of course, this function could also be built-into sendmail (eventually). + +Putting "new account" info at the top with the current averaging function +probably adversly affects the prioritized list (at least in the short +term), but putting it at the bottom would not really give the new accounts +a fair chance. I suspect this isn't that big of a problem. I'm running +this here on a list with 461 accounts and about 10 messages per day so +I'll see how it goes. I'll keep some stats on delay times and see what +happens. + +Another thing that would help this situation, is if sendmail had the queue +ordered by site (but you already know this). If you ever get to do per +site queuing you should consider "blocking" a queue for some short period +of time if a connection fails to that site [sendmail does this inside a +single process on a per account basis now right?]; this would allow multiple +sendmails to quickly skip over those sites for people like me that run: + + for i in 1 2 3 4 5 6 7 8 ; do daemon sendmail -q; done + +to flush a queue that has gotten behind. You could also do this inside +sendmail with a parallelism option (when it is time to run the queue, how +many processes to start). + +#! /bin/sh +# This is a shell archive. Remove anything before this line, then unpack +# it by saving it into a file and typing "sh file". To overwrite existing +# files, type "sh file -c". You can also feed this as standard input via +# unshar, or by typing "sh <file", e.g.. If this archive is complete, you +# will see the following message at the end: +# "End of shell archive." +# Contents: mailprio mailprio_mkdb +# Wrapped by sanders@austin.BSDI.COM on Fri Dec 9 18:07:02 1994 +PATH=/bin:/usr/bin:/usr/ucb ; export PATH +if test -f 'mailprio' -a "${1}" != "-c" ; then + echo shar: Will not clobber existing file \"'mailprio'\" +else +echo shar: Extracting \"'mailprio'\" \(3093 characters\) +sed "s/^X//" >'mailprio' <<'END_OF_FILE' +X#!/usr/bin/perl +X# +X# mailprio -- setup mail priorities for a mailing list +X# +X# Sort mailing list by mailprio database: +X# mailprio < mailing-list > sorted_list +X# Double check against orig: +X# sort sorted_list > checkit; sort mailing-list | diff - checkit +X# If it checks out, install it. +X# +X# TODO: +X# option to process mqueue files so we can reorder files in the queue! +X$usage = "Usage: mailprio [-p priodb]\n"; +X$home = "/home/sanders/lists"; +X$priodb = "$home/mailprio"; +X +Xif ($main'ARGV[0] =~ /^-/) { +X $args = shift; +X if ($args =~ m/\?/) { print $usage; exit 0; } +X if ($args =~ m/p/) { +X $priodb = shift || die $usage, "-p requires argument\n"; } +X} +X +X# In shell script, it goes something like this: +X# old_mailprio > /tmp/a +X# fgrep -f lists/inet-access /tmp/a | sed -e 's/^.......//' > /tmp/b +X# ; /tmp/b contains list of known users, faster delivery first +X# fgrep -v -f /tmp/b lists/inet-access > /tmp/c +X# ; put all unknown stuff at the top of new list for now +X# echo '# -----' >> /tmp/c +X# cat /tmp/b >> /tmp/c +X +X# Setup %list and @list +Xlocal($addr, $canon); +Xwhile ($addr = <STDIN>) { +X chop $addr; +X next if $addr =~ /^# ----- /; # that's our line +X push(@list, $addr), next if $addr =~ /^\s*#/; # save comments +X $canon = &canonicalize((&simplify_address($addr))[0]); +X unless (defined $canon) { +X warn "no address found: $addr\n"; +X push(@list, $addr); # save it anyway +X next; +X } +X if (defined $list{$canon}) { +X warn "duplicate: ``$addr -> $canon''\n"; +X push(@list, $addr); # save it anyway +X next; +X } +X $list{$canon} = $addr; +X} +X +Xlocal(*prio); +Xdbmopen(%prio, $priodb, 0644) || die "$priodb: $!\n"; +Xforeach $to (keys %list) { +X if (defined $prio{$to}) { +X # add to list of found users (%userprio) and remove from %list +X # so that we know what users were not yet prioritized +X $userprio{$to} = $prio{$to}; # priority +X $useracct{$to} = $list{$to}; # string +X delete $list{$to}; +X } +X} +Xdbmclose(%prio); +X +X# Put all the junk we found at the very top +X# (this might not always be a feature) +Xprint join("\n", @list), "\n"; +X +X# unprioritized users go next, slow accounts will get moved down quickly +Xprint '# ----- unprioritized users', "\n"; +Xforeach $to (keys %list) { print $list{$to}, "\n"; } +X +X# finally, our prioritized list of users +Xprint '# ----- prioritized users', "\n"; +Xforeach $to (sort { $userprio{$a} <=> $userprio{$b}; } keys %userprio) { +X die "Opps! Something is seriously wrong with useracct: $to\n" +X unless defined $useracct{$to}; +X print $useracct{$to}, "\n"; +X} +X +Xexit(0); +X +X# REPL-LIB --------------------------------------------------------------- +X +Xsub canonicalize { +X local($addr) = @_; +X # lowercase, strip leading/trailing whitespace +X $addr =~ y/A-Z/a-z/; $addr =~ s/^\s+//; $addr =~ s/\s+$//; $addr; +X} +X +X# @addrs = simplify_address($addr); +Xsub simplify_address { +X local($_) = shift; +X 1 while s/\([^\(\)]*\)//g; # strip comments +X 1 while s/"[^"]*"//g; # strip comments +X split(/,/); # split into parts +X foreach (@_) { +X 1 while s/.*<(.*)>.*/\1/; +X s/^\s+//; +X s/\s+$//; +X } +X @_; +X} +END_OF_FILE +if test 3093 -ne `wc -c <'mailprio'`; then + echo shar: \"'mailprio'\" unpacked with wrong size! +fi +chmod +x 'mailprio' +# end of 'mailprio' +fi +if test -f 'mailprio_mkdb' -a "${1}" != "-c" ; then + echo shar: Will not clobber existing file \"'mailprio_mkdb'\" +else +echo shar: Extracting \"'mailprio_mkdb'\" \(3504 characters\) +sed "s/^X//" >'mailprio_mkdb' <<'END_OF_FILE' +X#!/usr/bin/perl +X# +X# mailprio_mkdb -- make mail priority database based on delay times +X# +X$usage = "Usage: mailprio_mkdb [-l maillog] [-p priodb]\n"; +X$home = "/home/sanders/lists"; +X$maillog = "/var/log/maillog"; +X$priodb = "$home/mailprio"; +X +Xif ($main'ARGV[0] =~ /^-/) { +X $args = shift; +X if ($args =~ m/\?/) { print $usage; exit 0; } +X if ($args =~ m/l/) { +X $maillog = shift || die $usage, "-l requires argument\n"; } +X if ($args =~ m/p/) { +X $priodb = shift || die $usage, "-p requires argument\n"; } +X} +X +Xlocal(*prio); +X# We'll merge with existing information if it's already there. +Xdbmopen(%prio, $priodb, 0644) || die "$priodb: $!\n"; +X&getlog_stats($maillog, *prio); +X# foreach $addr (sort { $prio{$a} <=> $prio{$b}; } keys %prio) { +X# printf("%06d %s\n", $prio{$addr}, $addr); } +Xdbmclose(%prio); +Xexit(0); +X +Xsub getlog_stats { +X local($maillog, *stats) = @_; +X local($to, $delay); +X local($h, $m, $s); +X open(MAILLOG, "< $maillog") || die "$maillog: $!\n"; +X while (<MAILLOG>) { +X ($delay) = (m/, delay=([^,]*), /); +X $delay || next; +X ($h, $m, $s) = split(/:/, $delay); +X $delay = ($h * 60 * 60) + ($m * 60) + $s; +X +X # deleting everything after ", " seems safe enough, though +X # it is possible that it was inside "..."'s and that we will +X # miss some addresses because of it. However, I'm not willing +X # to do full parsing just for that case. If this bothers you +X # you could do something like: s/, (delay|ctladdr)=.*//; +X # but you have to make sure you catch all the possible names. +X $to = $_; $to =~ s/^.* to=//; $to =~ s/, .*//; +X foreach $addr (&simplify_address($to)) { +X next unless $addr; +X $addr = &canonicalize($addr); +X # print $delay, " ", $addr, "\n"; +X $stats{$addr} = $delay unless defined $stats{$addr}; # init +X +X # This average function moves the value around quite rapidly +X # which may or may not be a feature. +X # +X # This has at least one odd behavior because we currently only +X # use the delay information from maillog which is only logged +X # on actual delivery. This works backwards from what we really +X # want to happen when a fast host goes down for a while and then +X # comes back up. +X # +X # I spoke with Eric and he suggested adding an xdelay statistic +X # for a per transaction delay which would help that situation +X # a lot. What I believe you want in that cases something like: +X # delay fast, xdelay fast: smokin', these hosts go first +X # delay slow, xdelay fast: put host high on the list (back up?) +X # delay fast, xdelay slow: host is down/having problems/slow +X # delay slow, xdelay slow: poorly connected sites, very last +X # Of course, you have to reorder the distribution list fairly +X # often for that to help. Come to think of it, you should +X # also reorder /var/spool/mqueue files also (if they aren't +X # locked of course). Hmmm.... +X $stats{$addr} = int(($stats{$addr} + $delay) / 2); +X } +X } +X close(MAILLOG); +X} +X +X# REPL-LIB --------------------------------------------------------------- +X +Xsub canonicalize { +X local($addr) = @_; +X # lowercase, strip leading/trailing whitespace +X $addr =~ y/A-Z/a-z/; $addr =~ s/^\s+//; $addr =~ s/\s+$//; $addr; +X} +X +X# @addrs = simplify_address($addr); +Xsub simplify_address { +X local($_) = shift; +X 1 while s/\([^\(\)]*\)//g; # strip comments +X 1 while s/"[^"]*"//g; # strip comments +X split(/,/); # split into parts +X foreach (@_) { +X 1 while s/.*<(.*)>.*/\1/; +X s/^\s+//; +X s/\s+$//; +X } +X @_; +X} +END_OF_FILE +if test 3504 -ne `wc -c <'mailprio_mkdb'`; then + echo shar: \"'mailprio_mkdb'\" unpacked with wrong size! +fi +chmod +x 'mailprio_mkdb' +# end of 'mailprio_mkdb' +fi +echo shar: End of shell archive. +exit 0 diff --git a/usr.sbin/sendmail/contrib/rmail.oldsys.patch b/usr.sbin/sendmail/contrib/rmail.oldsys.patch new file mode 100644 index 00000000000..856fcf1f93e --- /dev/null +++ b/usr.sbin/sendmail/contrib/rmail.oldsys.patch @@ -0,0 +1,108 @@ +From: Bill Gianopoulos <wag@sccux1.msd.ray.com> +Message-Id: <199405191527.LAA03463@sccux1.msd.ray.com> +Subject: Patch to rmail to elliminate need for snprintf +To: sendmail@CS.Berkeley.EDU +Date: Thu, 19 May 1994 11:27:16 -0400 (EDT) + +I have written the following patch to rmail which removes the requirement +for snprintf while maintaining the protection from buffer overruns. It also +fixes it to compile with compilers which don't understand ANSI function +prototypes. Perhaps this should be included in the next version? + +*** rmail/rmail.c.orig Mon May 31 18:10:44 1993 +--- rmail/rmail.c Thu May 19 11:04:50 1994 +*************** +*** 78,86 **** +--- 78,109 ---- + #include <sysexits.h> + #include <unistd.h> + ++ #ifdef __STDC__ + void err __P((int, const char *, ...)); + void usage __P((void)); ++ #else ++ void err (); ++ void usage (); ++ #endif + ++ #define strdup(s) strcpy(xalloc(strlen(s) + 1), s) ++ ++ char * ++ xalloc(sz) ++ register int sz; ++ { ++ register char *p; ++ ++ /* some systems can't handle size zero mallocs */ ++ if (sz <= 0) ++ sz = 1; ++ ++ p = malloc((unsigned) sz); ++ if (p == NULL) ++ err(EX_UNAVAILABLE, "Out of memory!!"); ++ return (p); ++ } ++ + int + main(argc, argv) + int argc; +*************** +*** 230,250 **** + args[i++] = "-oi"; /* Ignore '.' on a line by itself. */ + + if (from_sys != NULL) { /* Set sender's host name. */ +! if (strchr(from_sys, '.') == NULL) +! (void)snprintf(buf, sizeof(buf), + "-oMs%s.%s", from_sys, domain); +! else +! (void)snprintf(buf, sizeof(buf), "-oMs%s", from_sys); + if ((args[i++] = strdup(buf)) == NULL) + err(EX_TEMPFAIL, NULL); + } + /* Set protocol used. */ +! (void)snprintf(buf, sizeof(buf), "-oMr%s", domain); + if ((args[i++] = strdup(buf)) == NULL) + err(EX_TEMPFAIL, NULL); + + /* Set name of ``from'' person. */ +! (void)snprintf(buf, sizeof(buf), "-f%s%s", + from_path ? from_path : "", from_user); + if ((args[i++] = strdup(buf)) == NULL) + err(EX_TEMPFAIL, NULL); +--- 253,285 ---- + args[i++] = "-oi"; /* Ignore '.' on a line by itself. */ + + if (from_sys != NULL) { /* Set sender's host name. */ +! if (strchr(from_sys, '.') == NULL) { +! if ((strlen(from_sys) + strlen(domain) + 6) +! > sizeof(buf)) +! err(EX_DATAERR, "sender hostname too long"); +! (void)sprintf(buf, + "-oMs%s.%s", from_sys, domain); +! } +! else { +! if ((strlen(from_sys) + 5) > sizeof(buf)) +! err(EX_DATAERR ,"sender hostname too long"); +! (void)sprintf(buf, "-oMs%s", from_sys); +! } + if ((args[i++] = strdup(buf)) == NULL) + err(EX_TEMPFAIL, NULL); + } + /* Set protocol used. */ +! if ((strlen(domain) + 5) > sizeof(buf)) +! err(EX_DATAERR, "protocol name too long"); +! (void)sprintf(buf, "-oMr%s", domain); + if ((args[i++] = strdup(buf)) == NULL) + err(EX_TEMPFAIL, NULL); + + /* Set name of ``from'' person. */ +! if (((from_path ? strlen(from_path) : 0) + strlen(from_user) + 3) +! > sizeof(buf)) +! err(EX_DATAERR, "from address too long"); +! (void)sprintf(buf, "-f%s%s", + from_path ? from_path : "", from_user); + if ((args[i++] = strdup(buf)) == NULL) + err(EX_TEMPFAIL, NULL); +-- +William A. Gianopoulos; Raytheon Missile Systems Division +wag@sccux1.msd.ray.com |