Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jul 1997 18:39:39 -0700 (PDT)
From:      "Jonathan M. Bresler" <jmb>
To:        dkelly@HiWAAY.net
Cc:        questions@FreeBSD.ORG
Subject:   Re: Sendmail and mail hub
Message-ID:  <199707210139.SAA13814@hub.freebsd.org>
In-Reply-To: <199707202357.SAA24276@nexgen.hiwaay.net> from "dkelly@HiWAAY.net" at Jul 20, 97 06:57:27 pm

next in thread | previous in thread | raw e-mail | index | archive | help
dkelly@HiWAAY.net wrote:
> 
> I'm using a dialup PPP connection and dynamic IP address for my FreeBSD 
> system. Have been running sendmail "stock" with the /etc/sendmail.cf for 
> quite a while now with moderate success. Sendmail makes direct connections 
> with remote sites and delivers the mail.
> 
> Finally many sites are clamping down their sendmails to ward off spam. This 
> bites me as my machine thinks its 10.1.0.1 and ID's as such. And with an 
> unresolvable address like that many sites refuse mail from me. However at 
> this moment I'm also tnt1-47.HiWAAY.net. If sendmail knew to use that net 
> name then I think my problem will be solved.
> 
> The other option is to forward all outgoing mail to my ISP at 
> mail.hiwaay.net and let them handle delivery. Studying the bat book, 
> http://www.sendmail.org, the docs in /usr/src/usr.sbin/sendmail, FreeBSD 
> FAQ and handbook, etc., my head is spinning.
> 
> So I've started hacking on /etc/sendmail.cf just to see what kind of 
> trouble I can get into (I'm the only user of this system, so I can only 
> hurt myself, right?). This looked interesting in /etc/sendmail.cf:

	rather than hack sendmail.cf, use m4 to create a sendmail.cf 
	for you.  you can use /usr/src/usr.sbin/sendmail/cf/cf/freebsd.mc
	as a template.  try this:  (call it dave_kelly.mc)

divert(0)dnl
VERSIONID(`@(#)dave_kelly.mc $Revision: 1.1$')
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
MAILER(smtp)dnl
MASQUERADE_AS(mail.hiwaay.net)dnl
FEATURE(nouucp)dnl
undefine(`UUCP_RELAY')dnl
undefine(`BITNET_RELAY')dnl
undefine(`DECNET_RELAY')dnl
undefine(`FAX_RELAY')dnl
define(`SMART_HOST', `mail.hiwaay.net')dnl
define(`confCW_FILE', `-o /etc/sendmail.cw')dnl

	create your sendmail.cf with
	"m4 /usr/src/usr.sbin/sendmail/cf/m4/cf.m4 dave_kelly.mc \
		> /tmp/sendmail.cf"

> # "Smart" relay host (may be null)
> DS
> 
> So I changed it to:
> 
> # "Smart" relay host (may be null)
> #DS
> DSmail.hiwaay.net
> 
> Elsewhere I did the same thing for:
> 
> # who I masquerade as (null for no masquerading) (see also $=M)
> DMmail.hiwaay.net
> 
> And now it appears to do exactly what I wanted. Fly.hiwaay.net (a.k.a. 
> mail.hiwaay.net) relays my outgoing mail. It appears to leave local mail 
> alone. But the modem flashes on send, apparently a DNS lookup (which will 
> fail for nexgen.hiwaay.net).

	to turn of DNS use "FEATURE(nocanonify)dnl"
	from /usr/src/usr.sbin/sendmail/cf/README:

nocanonify      Don't pass addresses to $[ ... $] for canonification.
                This would generally only be used by sites that only
                act as mail gateways or which have user agents that do
                full canonification themselves.  You may also want to
                use "define(`confBIND_OPTS',`-DNSRCH -DEFNAMES')" to
                turn off the usual resolver options that do a similar
                thing.  

> 
> So that's the background. The Real Question(s) are:
> 
> 1) Is "Smart" relay host the Right Way to handle my problem? Have I done 
> something that will bite me later?

	sound like the right way to do it
	from /usr/src/usr.sbin/sendmail/cf/README:
[discussion about incoming mail delivery]
If you want all outgoing mail to go to a central relay site, define
SMART_HOST as well.  Briefly:

        LOCAL_RELAY applies to unqualifed names (e.g., "eric").
        MAIL_HUB applies to names qualified with the name of the
                local host (e.g., "eric@mastodon.CS.Berkeley.EDU").
        SMART_HOST applies to names qualified with other hosts.

However, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY,
DECNET_RELAY, and FAX_RELAY) take precedence over SMART_HOST, so if you
really want absolutely everything to go to a single central site you will
need to unset all the other relays -- or better yet, find or build a
minimal config file that does this.

> 
> 2) How should I name my FreeBSD box which is not a full time system in the 
> hiwaay.net domain?

	hmm...good question.

	read /usr/src/usr.sbin/sendmail/cf/README
	there is a wealth of information in there.

	consider using "FEATURE(masquerade_envelope)" to hide
	your machine in the envelope (smtp conversation)
	as well as the headers
jmb



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707210139.SAA13814>