sendmail/mailertable question

stan stanb at panix.com
Mon Oct 24 15:38:11 PDT 2005


I'm trying to get sendmail to do something that I think it should be
able to do, but I can't quite get working.

I have a machine that hosts several virtual domains. The domains
have wildcarded DNS records.

I want mail recived for say "foo at listmaint.samp.ivosite.com" to get passed
on downstream like that without striping out the "listmaint" part.
I think I can do this with mailertable.

Here's what I've got:

.mc file:


divert(-1)
#
# Copyright (c) 1983 Eric P. Allman
# Copyright (c) 1988, 1993
#	The Regents of the University of California.  All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#	This product includes software developed by the University of
#	California, Berkeley and its contributors.
# 4. Neither the name of the University nor the names of its contributors
#    may be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#

#
#  This is a generic configuration file for FreeBSD 4.X and later systems.
#  If you want to customize it, copy it to a name appropriate for your
#  environment and do the modifications there.
#
#  The best documentation for this .mc file is:
#  /usr/share/sendmail/cf/README or
#  /usr/src/contrib/sendmail/cf/README
#

divert(0)
VERSIONID(`$FreeBSD: src/etc/sendmail/freebsd.mc,v 1.10.2.19 2003/12/31 17:42:16 gshapiro Exp $')
OSTYPE(freebsd4)
DOMAIN(generic)

FEATURE(local_lmtp)
FEATURE(virtusertable, `hash /etc/mail/virtusertable')
FEATURE(local_procmail)dnl
FEATURE(mailertable, `hash -o /etc/mail/mailertable')


dnl Uncomment to allow relaying based on your MX records.
dnl NOTE: This can allow sites to use your server as a backup MX without
dnl       your permission.
dnl FEATURE(relay_based_on_MX)

dnl DNS based black hole lists
dnl --------------------------------
dnl DNS based black hole lists come and go on a regular basis
dnl so this file will not serve as a database of the available servers.
dnl For that, visit
dnl http://directory.google.com/Top/Computers/Internet/Abuse/Spam/Blacklists/

dnl Uncomment to activate Realtime Blackhole List
dnl information available at http://www.mail-abuse.com/
dnl NOTE: This is a subscription service as of July 31, 2001
dnl FEATURE(dnsbl)
dnl Alternatively, you can provide your own server and rejection message:
dnl FEATURE(dnsbl, `blackholes.mail-abuse.org', `"550 Mail from " $&{client_addr} " rejected, see http://mail-abuse.org/cgi-bin/lookup?" $&{client_addr}')

dnl Dialup users should uncomment and define this appropriately
dnl define(`SMART_HOST', `your.isp.mail.server')

dnl Uncomment the first line to change the location of the default
dnl /etc/mail/local-host-names and comment out the second line.
dnl define(`confCW_FILE', `-o /etc/mail/sendmail.cw')
define(`confCW_FILE', `-o /etc/mail/local-host-names')

dnl Enable for both IPv4 and IPv6 (optional)
DAEMON_OPTIONS(`Name=IPv4, Family=inet')
dnl DAEMON_OPTIONS(`Name=IPv6, Family=inet6, Modifiers=O')

define(`confBIND_OPTS', `WorkAroundBrokenAAAA')
define(`confNO_RCPT_ACTION', `add-to-undisclosed')
define(`confPRIVACY_FLAGS', `authwarnings,noexpn,novrfy')
dnl MAILER(local)
MAILER(smtp)
MAILER(procmail)
INPUT_MAIL_FILTER(`sid-filter', `S=local:/var/run/sid-filter')
INPUT_MAIL_FILTER(`spamassassin', `S=local:/var/run/spamass-milter.sock, F=, T=C:15m;S:4m;R:4m;E:10m')
define(`confMILTER_MACROS_CONNECT',`b, j, _, {daemon_name}, {if_name}, {if_addr}')dnl

dnl set SASL options
TRUST_AUTH_MECH(`GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl
define(`confAUTH_MECHANISMS', `GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl
define(`confDEF_AUTH_INFO', `/etc/mail/auth-info')dnl

mailertable:


# $FreeBSD: src/etc/mail/mailertable.sample,v 1.1.2.1 2000/03/20 12:21:05 peter Exp $
#
# List of domains (possibly wildcarded) and destination mailers
#
admin.samp.ivosite.com		smtp:admin.samp.ivosite.com
listmaint.samp.ivosite.com	smtp:listmaint.samp.ivosite.com
samp.ivosite.com		smtp:samp.ivosite.com
.samp.ivosite.com		smtp:samp.ivosite.com

But when I test this here is what happens:


Script started on Mon Oct 24 18:25:54 2005

prod1 as stan# echo "3,0 foo at listmaint.samp.ivosite.com" | sendmail -bt -d0
Version 8.13.1
 Compiled with: DNSMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7
		NAMED_BIND NETINET NETINET6 NETUNIX NEWDB NIS PIPELINING SASL
		SCANF STARTTLS TCPWRAPPERS USERDB XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = prod1
  (canonical domain name) $j = prod1.ivo.net
         (subdomain name) $m = ivo.net
              (node name) $k = prod1.ivo.net
========================================================

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> canonify           input: foo @ listmaint . samp . ivosite . com
Canonify2          input: foo < @ listmaint . samp . ivosite . com >
Canonify2        returns: foo < @ ivosite . com . >
canonify         returns: foo < @ ivosite . com . >
parse              input: foo < @ ivosite . com . >
Parse0             input: foo < @ ivosite . com . >
Parse0           returns: foo < @ ivosite . com . >
ParseLocal         input: foo < @ ivosite . com . >
ParseLocal       returns: foo < @ ivosite . com . >
Parse1             input: foo < @ ivosite . com . >
Mailertable        input: < ivosite . com > foo < @ ivosite . com . >
Mailertable        input: ivosite . < com > foo < @ ivosite . com . >
Mailertable      returns: foo < @ ivosite . com . >
Mailertable      returns: foo < @ ivosite . com . >
MailerToTriple     input: < > foo < @ ivosite . com . >
MailerToTriple   returns: foo < @ ivosite . com . >
Parse1           returns: $# esmtp $@ ivosite . com . $: foo < @ ivosite . com . >
parse            returns: $# esmtp $@ ivosite . com . $: foo < @ ivosite . com . >
> prod1 as stan# ^Dexit

Script done on Mon Oct 24 18:26:15 2005

As you can see, the Canonify routine is striping off the "listmaint" part.

What am I doing wrong here?

Thanks for any sugestions.

-- 
U.S. Encouraged by Vietnam Vote - Officials Cite 83% Turnout Despite Vietcong Terror 
- New York Times 9/3/1967


More information about the freebsd-questions mailing list