Subject: Re: simple sendmail hub
To: James K. Lowden <jklowden@lowden.schemamania.org>
From: Andrew Brown <atatat@atatdot.net>
List: netbsd-help
Date: 07/11/2001 11:13:48
>I'm sure I have a simple sendmail question, but hours of reading the docs
>don't make it look easy.
>
>If someone will tell me just what to do, I'll submit a FAQ item for it.
>
>My main box is named "lowden" and runs NetBSD 1.5 in my living room
>at 192.168.1.1. I think of it as being in the tiny domain I have here
>called "schemamania.org".
>
>It's running an unmodified sendmail (uses the default configuration), so
>mail from mutt carries a "from" address of
>jklowden@lowden.schemamania.org. You can't send mail there because
>it's a non-routed ip address behind a NAT firewall.
>
>I want to "rewrite" (I think) the from address to
>read: jklowden@schemamania.org.
then you want this:
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
FEATURE(masquerade_envelope)dnl
MASQUERADE_AS(`schemamania.org')dnl
MAILER(local)dnl
MAILER(smtp)dnl
as your mc file. you say the sendmail is unmodified and uses the
default configuration, so i assume you mean you're using the default
installed sendmail.cf which has a bunch of features (ipv6 and a bunch
of tables) enabled that i didn't list above. if you're not using
those, this should be it.
>In a related question, I do receive mail @schemamania.org (on a host
>called "home"), but that sendmail plunks the mail into its local spool
>instead of forwarding it to "lowden". I get around this with a .forward file,
>but I'd like to know what the right way is.
hmm...that one's tricky. i'd be tempted to toss a couple of lines
like this at the end of the the .mc file:
LOCAL_RULE_0
R $+ < @ $* schemamania.org. > $* $#smtp $@ lowden.schemamania.org $: $1 < @ $2 luddite.org. > $3
which is sort of a brute force way of forwarding it without involving
dns or smart relays, etc.
>Do I really have to learn m4 and build a half dozen files to do this?
not really, but it's definitely worth playing with and cultivating an
understanding of it. m4 is used for lots of things. sendmail uses it
more extensively that you think, but building the cf files is now an
very easy process. a four line file will start most people off and
then you just add bits as you go, with the ability to upgrade your cf
file easily as you upgrade your sendmail installation.
>I'm guessing that as DSL gains adherents, more people will want to do
>this sort of thing. That's why I'm volunteering to document the easy
>answer, assuming there is one.
possibly...yes. :)
>Thanks for any help. I realize this isn't a netbsd question and I know
>sendmail is a very big tool for such a simple job, but I like its
>granddaddiness and I *know* it can do this. If only I don't go cross-eyed
>in the process.
it's not that difficult. it only has a reputation for being difficult.
--
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org * "ah! i see you have the internet
twofsonet@graffiti.com (Andrew Brown) that goes *ping*!"
andrew@crossbar.com * "information is power -- share the wealth."