On Sun, Dec 21, 2003 at 12:49:00PM -0800, Gary Kline wrote:

>       I've been wondring if there is a way of tweaking sendmail
>       to send mail from the outside to my internal//private hosts--
>       with the same username and the FQDN.
> 
>       E.g.:  Outside thought.org, "[EMAIL PROTECTED]" bounces
>       while "[EMAIL PROTECTED]" is recognized because 
>       ns1.thought.org is 216.231.43.140.   Likewise with mail
>       to "[EMAIL PROTECTED]" or "[EMAIL PROTECTED]".
> 
>       Anybody know what magic incantations are necessary to make
>       my mail server aware of my internal hosts??  If this is a
>       DNS matter, I didn't catch it in DNS AND BIND (4th ed).

It's do-able.  First step is that you will need DNS records for all of
the addresses you want visible in the Internet.  You can just setup MX
records pointing at your gateway machine: eg.

    $ORIGIN thought.org
    [...]

    tao    MX 10 ns1
    ethic  MX 10 ns1
    plato  MX 10 ns1

which tells the outside world that ns1.thought.org handles the e-mail
for {tao,ethic,plato}.thought.org[*] If ns1 will do final delivery of
this e-mail, then as another poster said, you just need to add those
hostnames to /etc/mail/local-host-names.  On the other hand, if you
want your the messages forwarded from ns1 to those internal machines,
leave local-host-names alone and put the following line in
/etc/mail/mailertable:

    .thought.org        relay:[%1.thought.org]

Then just run 'make' in /etc/mail (Nb. mailertable support is in the
default freebsd.mc config, so no config tweaking required.)  (Nb.2 the
[square brackets] suppress sendmail's looking up MX records when it
tries to relay the messages.  This stops ns1 trying to relay the
messages back to itself.)

        Cheers,

        Matthew

[*] It's possible, but nasty, to use a wildcard record, so that
[EMAIL PROTECTED] gets delivered to your mail server.
However, use of wildcards in the DNS is not recommended as that way
madness lies.  

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to