Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Nov 2002 21:09:55 -0500
From:      Ray Kohler <ataraxia@cox.net>
To:        Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc:        "Gary W. Swearingen" <swear@attbi.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: sendmail without (real) hostname?
Message-ID:  <3DC9CB73.5040502@cox.net>
In-Reply-To: <3DC9A3B4.1030303@cox.net>
References:  <3DC9A3B4.1030303@cox.net> <omn0omnpzf.0om@localhost.localdomain> <20021107012453.GA695@gray.sea.gr>

next in thread | previous in thread | raw e-mail | index | archive | help
Giorgos Keramidas wrote:

> On 2002-11-06 17:11, "Gary W. Swearingen"  wrote:
>
> >Ray Kohler  writes:
> >
> >>Is there any way to get outgoing mail working on a system with a dynamic
> >>IP and no DNS entries? Mail is sent as it is but of course no one will
> >>relay it.
> >>
> >>All I really want is the ability to use send-pr so I can send patches
> >>without having them mangled by line-wrapping.
> >
> >If I understand the question, change the default /etc/mail/freebsd.mc:
> >
> >< dnl define(`SMART_HOST', `your.isp.mail.server')
> >---
> >
> >>define(`SMART_HOST', `yourISPsMailHost.yourISP.net')
> >
> >And rebuild the two sendmail .cf files in that dir following the README
> >and maybe the sendmail manpage.  You'll probably have to use "sendmail"
> >vars from /etc/default/rc.conf and (re)start some sendmail daemons.
> >It's nasty and I didn't take notes.
> >
> >And I doubt if send-pr will work without your deciphering the script
> >to see if it can be fooled with environmental vars or you could modify
> >it.  I've always just edited a copy of a template PR and then mailed it.
>
>
> That's one solution.  It still depends on having a working mail user
> agent and mail transfer agent somewhere (not necessarily in the same
> machine).  It does have good things too though.  One can edit the PR
> template locally, and then transfer the edited report practically
> anywhere and mail it using their mailer at work, at a friend's house,
> or wherever.
>
> Another solution is to set things up so that Sendmail will masquerade
> properly, and convert local addresses (including envelope sender
> addresses) to "real" addresses.  I customarily do this with the
> genericstable and masquerade features.  The following directives in my
> freebsd.mc file work together to do this:
>
> 	FEATURE(`masquerade_envelope')dnl
> 	FEATURE(`masquerade_entire_domain')dnl
> 	MASQUERADE_DOMAIN(`sea.gr')
> 	MASQUERADE_AS(`sea.gr')dnl
>
> 	FEATURE(`genericstable', `btree -o /etc/mail/genericstable')dnl
> 	FEATURE(`generics_entire_domain')dnl
> 	GENERICS_DOMAIN(`sea.gr')dnl
>
> The first four take care of masquerading all the email that comes from
> hosts in the *.sea.gr domain to `sea.gr' and then the last three take
> over, converting my local address using /etc/mail/genericstable.db
> that is generated from /etc/mail/genericstable:
>
> 	% cat /etc/mail/genericstable
> 	keramida@gray.sea.gr		keramida@ceid.upatras.gr
>
> Then, I can use send-pr(1), mail(1) or whatever.  It doesn't matter
> that my sea.gr local domain doesn't exist, since I am using the proper
> SMART_HOST for my ISP and the envelope address contains an address
> that does exist: keramida@ceid.upatras.gr.


This seems to have worked, so far as my testing can determine. I've been 
struggling with this problem off and on for years now, too. Sendmail is 
so enormously complicated that I never could get to the bottom of it. I 
once before thought I had gotten it to work but somehow all mail 
destined for this host was going to the host I masqueraded as. This got 
me in trouble when `periodic daily' ran that night and the output got 
sent to root@somebody_elses_box...

- @



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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