Re: sendmail and re-writing addresses



In article <slrnf5jtgp.3rv.oudeis@xxxxxxxxxxxxxxxxxxxxx> Will Parsons
<oudeis@xxxxxxxxxxxxxxxx> writes:
I am using ADSL to connect to the interet via my ISP. Using the default
sendmail configuration, I can send mail fine using sylpheed, but I would
like to be able to send mail using Emacs, or simply mail(1). This fails,
however, because the remote mail host rejects my mail on the grounds that
the domain "my.local.network" doesn't exist (which of course is true,
since "my.local.network" is a purely local domain unknown to the outside
world). After considerable googling, I've reached a partial solution,
by adding to the sendmail .mc config file:

FEATURE(genericstable, `hash -o -T<TMPF> /etc/mail/genericstable')
FEATURE(masquerade_entire_domain)
FEATURE(masquerade_envelope)
MASQUERADE_AS(`myisp.com')
MASQUERADE_DOMAIN(`my.local.network')

and creating /etc/mail/genericstable containing:

william myispname@xxxxxxxxx

(or
william@xxxxxxxxxxxxxxxx myispname@xxxxxxxxx
- I've tried both.)

This works, as far as now being able to actually get mail delivered,
but it still is lacking in that the mail shows up as being from
william@xxxxxxxxx rather than myispname@xxxxxxxxx

so I'm still missing something.

GENERICS_DOMAIN(`my.local.network')

- You have to specify which domains should be looked up in the
genericstable. And you don't need the MASQUERADE_AS() and
MASQUERADE_DOMAIN() when using (only) genericstable, and probably
shouldn't use the MASQUERADE_AS(`myisp.com') in any case, since (as you
noted) it will generate incorrect addresses in your case - in principle
william@xxxxxxxxx could be a valid address, just not yours.

--Per Hedeland
per@xxxxxxxxxxxx
.