From: Kendall Carpenter on
Hello,

I have researched into how to configure the mailertable, but would like
some help confirming the process before I begin. Also, if you could tell
me if it is possible to undo this process that would be helpful. I am
trying to have email from a local (private ip) SMTP server delivered to
a local (private ip) pop server. This way I can eliminate a private
RFC1918 non-compliant ip address in my external DNS servers MX records.

Would anyone be willing to look over my checklist items and confirm my
thinking and/or the steps? Thanks in advance.

What I think I might have to do is this:

(1.) Check to be certain sendmail is setup to use mailertable, which
might require a sendmail.mc file; but I do not seem to have a
sendmail.mc file. I think I am using sendmail v8.11. However, if i grep
for mailertable in /etc/sendmail.cf I get the following:

##### $Id: mailertable.m4,v 8.18 1999/07/22 17:55:35 gshapiro Exp $ #####
Kmailertable hash -o /etc/mail/mailertable.db
R< $+ > $* $: < $(mailertable $1 $) > $2 lookup
### Ruleset 90 -- try domain part of mailertable entry ###
R$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4
R$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "."
R< $* > $* $@ $2 no mailertable match

Does this mean I can use mailertable? BTW, there is already an
/etc/mail/mailertable file. So, maybe I can just move on to step two.

(2.) Next I will edit the /etc/mail/mailertable to include the line
mydomain.com smtp:[10.0.0.7]
In addition I can include similar lines for the other domains that now
have 10.0.0.7 MX entries. My understandsing is that this will allow the
SMTP server to deliver email to anyone(a)mydomain.com directly to 10.0.0.7
without querying a DNS server. Is this correct?

(3.) I will have to rebuild the hash map afterwards by using the
following command:
/usr/sbin/makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable

(4.) Next I will edit /etc/mail/relay-domains and include the following
line:
mydomain.com
In addition, I would include here all of the domains I had added to the
mailertable. Then restart sendmail.

As of right now, I have quite a few relay_hosts_only entries in my
/etc/mail/relay-domains file. Many of these are host1.mydomain.com,
host2.mydomain.com, host3.mydomain.com, etc. Would I now be able to
replace all of these relay_hosts_only entries with a single
'mydoamin.com' entry?

On my SMTP server, the /etc/hosts file has entries for each of
host1.mydomain.com, host2.mydomain.com, host3.mydomain.com, etc. I think
we did this so our local workstations and servers (with only private
ip's) could use the SMTP server for relaying mail to outside our
network. But it seems as though I may be able to remove these entries
now. I dont think it hurts to have them there, but they would now go
unused, yes?

Please do not feel obligated to take lots of time to explain or teach to
me how this all works. But if anyone would even just confirm the steps
that I must accomplish in order for the mailertable to work that would
be great. I wanted to include all this information in case it was useful.

Would that be all that has to be done?

Thank you for any help,
Kendall
From: Per Hedeland on
In article <425c2ee2$1(a)news2.lightlink.com> Kendall Carpenter
<kmc(a)promtech.com> writes:
>
>I have researched into how to configure the mailertable, but would like
>some help confirming the process before I begin. Also, if you could tell
>me if it is possible to undo this process that would be helpful.

How could it not be possible? You're only modifying files on a computer,
to undo you just need to put the original versions back again (and
perhaps restart a daemon or two).

>(1.) Check to be certain sendmail is setup to use mailertable, which
>might require a sendmail.mc file; but I do not seem to have a
>sendmail.mc file. I think I am using sendmail v8.11. However, if i grep
>for mailertable in /etc/sendmail.cf I get the following:
>
>##### $Id: mailertable.m4,v 8.18 1999/07/22 17:55:35 gshapiro Exp $ #####
>Kmailertable hash -o /etc/mail/mailertable.db
>R< $+ > $* $: < $(mailertable $1 $) > $2 lookup
>### Ruleset 90 -- try domain part of mailertable entry ###
>R$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4
>R$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "."
>R< $* > $* $@ $2 no mailertable match
>
>Does this mean I can use mailertable?

Seems likely - i.e. assuming your sendmail.cf was built from a .mc file
at all, and not just randomly hacked. But you should really try to find
the .mc file, or if it's really gone, re-create it.

> BTW, there is already an
>/etc/mail/mailertable file.

Pretty much irrelevant.

>(2.) Next I will edit the /etc/mail/mailertable to include the line
> mydomain.com smtp:[10.0.0.7]
>In addition I can include similar lines for the other domains that now
>have 10.0.0.7 MX entries. My understandsing is that this will allow the
>SMTP server to deliver email to anyone(a)mydomain.com directly to 10.0.0.7
>without querying a DNS server. Is this correct?

Yes.

>(3.) I will have to rebuild the hash map afterwards by using the
>following command:
>/usr/sbin/makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable

That works, but you should really drop the ".db" part.

>(4.) Next I will edit /etc/mail/relay-domains and include the following
>line:
> mydomain.com
>In addition, I would include here all of the domains I had added to the
>mailertable. Then restart sendmail.

This will allow relaying to destination addresses of the form
user(a)mydomain.com, and possibly user@*.mydomain.com (see below), as well
as relaying from hosts that have an IP address that reverse-resolves to
mydomain.com, and possibly *.domain.com (see below).

>As of right now, I have quite a few relay_hosts_only entries in my
>/etc/mail/relay-domains file. Many of these are host1.mydomain.com,
>host2.mydomain.com, host3.mydomain.com, etc. Would I now be able to
>replace all of these relay_hosts_only entries with a single
>'mydoamin.com' entry?

There's no such thing as "relay_hosts_only entries" - the entries are
what they are, relay_hosts_only is a FEATURE() that you specify in the
..mc file, that affects how entries in relay-domains (and access db) are
interpreted. With relay_hosts_only, a 'mydomain.com' entry matches only
the exact mydomain.com as domain-part in a recipient address or result
of reverse-resolution of an IP address - without relay_hosts_only it
matches also *.mydomain.com.

Since we don't know what you wanted to achieve with those
host1.mydomain.com etc entries, nor whether you are using
relay_hosts_only, we can't tell whether a single mydomain.com entry will
work as replacement. What we can say is that they have no relevance for
a recipient address like user(a)mydomain.com per se, nor do they have any
relation to your change from MX records to mailertable entries. So it
seems that if you needed them before you will still need them, if not
you won't need them in the future either.

>On my SMTP server, the /etc/hosts file has entries for each of
>host1.mydomain.com, host2.mydomain.com, host3.mydomain.com, etc. I think
>we did this so our local workstations and servers (with only private
>ip's) could use the SMTP server for relaying mail to outside our
>network. But it seems as though I may be able to remove these entries
>now. I dont think it hurts to have them there, but they would now go
>unused, yes?

Pretty much the same as above - they're certainly not needed for your
mailertable entry, but maybe for something else.

>Would that be all that has to be done?

For routing based on mailertable instead of DNS, all that is needed is
the mailertable entry in a mailertable that is actually used by
sendmail.

--Per Hedeland
per(a)hedeland.org