From: Harry Putnam on
Setup: OS: Gentoo Linux
sendmail: version 8.14.4
Single user machine on home lan - No actual domain resolvable from the
internet for the home lan.
Inside home lan the domain resolves as `local.lan' so the various
machines are seen as HOST.local.lan
------- --------- ---=--- --------- --------

I've used sendmail for a good while, probably ought not to say how
long since I'm still a neophyte with it after all this time

I've used my ISP as Smart Host and I've used `masquerading' to
masquerade as my pop servers domain, to avoid having my mail rejected.

ISP is comcast and pop server is newsguy.com

define(`SMART_HOST',`smtp.comcast.net')dnl
MASQUERADE_AS(`newsguy.com')dnl
MASQUERADE_DOMAIN(`local.lan')dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(masquerade_envelope)dnl

That has worked fine over several versions of sendmail and is still
working, however there is one thing I'd like to fix.

When root sends mail to local users the address comes up:
root(a)newsguy.com
Which is of course .. untrue. And if any mail actually escaped to the
Internet, might actually cause some problems.

Even locally it just bugs me....

I realize sendmail has no way to tell local from internet so it may be
a bit difficult to do this... but I'd like to know if there is a way to
make mail from root show as root(a)reader.local.lan

I've experimented with FEATURE(`genericstable ...
But I don't see any change. Mail from root still shows up as
From: root(a)newsguy.com.

Also I suspect using masquerading and genericstable in this way is
sort of working at counter purposes.

But anyway, here is the config I tried so far. (full test.mc is posted
at the end).

MASQUERADE_AS(`newsguy.com')dnl
MASQUERADE_DOMAIN(`local.lan')dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(masquerade_envelope)dnl

FEATURE(`genericstable', `hash /etc/mail/genericstable')dnl
GENERICS_DOMAIN(`localhost.localdomain')dnl

I've just added the last two lines to my existing config that has
worked for a good while, and added a `genericstable', trying to rewrite
outgoing mail from root..

genericstable looks like:

root root(a)reader.local.lan
root(a)newsguy.com root(a)reader.local.lan
------- --------- ---=--- --------- --------

and makemap was ran on it:
makemap hash /etc/mail/genericstable < /etc/mail/genericstable

On sendmail restart:

It hasn't changed anything. At least not how roots mail shows up.
I still see:
root(a)newsguy.com

So is there a way to make roots mail show as being from my little fake
domain?

------- --------- ---=--- --------- --------
Full test.mc

divert(-1)
divert(0) dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`$Id: test.mc,v 1.3 2010/03/29 reader Exp $')dnl
OSTYPE(linux)dnl
define(`confDONT_EXPAND_CNAMES'.`True')dnl
FEATURE(`authinfo') dnl
FEATURE(`access_db',`hash -T<TMPF> /etc/mail/access')dnl
define(`confAUTH_MECHANISMS',`LOGIN PLAIN')dnl
define(`SMART_HOST',`smtp.comcast.net')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
MASQUERADE_AS(`newsguy.com')dnl
MASQUERADE_DOMAIN(`local.lan')dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(relay_hosts_only) dnl relay exact hosts in /etc/mail/access dnl
FEATURE(`genericstable', `hash /etc/mail/genericstable')dnl
GENERICS_DOMAIN(`localhost.localdomain')dnl
MAILER(procmail)dnl
MAILER(smtp)dnl
From: ska on
Harry Putnam wrote:
> define(`SMART_HOST',`smtp.comcast.net')dnl
> MASQUERADE_AS(`newsguy.com')dnl
> MASQUERADE_DOMAIN(`local.lan')dnl
> FEATURE(masquerade_entire_domain)dnl
> FEATURE(masquerade_envelope)dnl

> When root sends mail to local users the address comes up:
> root(a)newsguy.com
> Which is of course .. untrue. And if any mail actually escaped to the
> Internet, might actually cause some problems.
>
> Even locally it just bugs me....

> FEATURE(`genericstable', `hash /etc/mail/genericstable')dnl
> GENERICS_DOMAIN(`localhost.localdomain')dnl

Shouldn't the domain be `local.lan', too?

===

Anyway, http://www.sendmail.org/m4/masquerading.html

See: MASQUERADE_EXCEPTION(`host.domain')
using `reader.local.lan'

See: EXPOSED_USER(`usernames')
using `root'.

Regards,

-ska
From: Harry Putnam on
ska <skg(a)mail.inf.fh-brs.de> writes:

> Harry Putnam wrote:
>> define(`SMART_HOST',`smtp.comcast.net')dnl
>> MASQUERADE_AS(`newsguy.com')dnl
>> MASQUERADE_DOMAIN(`local.lan')dnl
>> FEATURE(masquerade_entire_domain)dnl
>> FEATURE(masquerade_envelope)dnl
>
>> When root sends mail to local users the address comes up:
>> root(a)newsguy.com
>> Which is of course .. untrue. And if any mail actually escaped to the
>> Internet, might actually cause some problems.
>>
>> Even locally it just bugs me....
>
>> FEATURE(`genericstable', `hash /etc/mail/genericstable')dnl
>> GENERICS_DOMAIN(`localhost.localdomain')dnl
>
> Shouldn't the domain be `local.lan', too?

I've tried it both ways, it didn't appear to make any difference at all.
> ===
>
> Anyway, http://www.sendmail.org/m4/masquerading.html
>
> See: MASQUERADE_EXCEPTION(`host.domain')
> using `reader.local.lan'

Well, no. That host is actually the main one that needs masquerading.

> See: EXPOSED_USER(`usernames')
> using `root'.

Yeah, that always looks promising, but the 10 or so times I tried
it. It had no effect on my problem.

Testing again just now, restart of sendmail... and nope no change.

Mail from root still appears as root(a)newsguy.com (newsguy is who I
masquerade as(.