1. Here is my main sendmail.mc:
Divert(-1)
divert(0)dnl
VERSIONID(`Sendmail.mc - (C) 2003')
OSTYPE(solaris8)dnl
DOMAIN(otherdomain.com)dnl
FEATURE(`use_cw_file')dnl
FEATURE(access_db)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(`dnsbl', `relays.ordb.org', `"550 Email rejected due to sending
server misconfiguration."')dnl
define(`confDEF_USER_ID',`6:6')dnl
define(`confTRUSTED_USER', `smmsp')dnl
define(`confSMTP_LOGIN_MSG', `mydomain.com SMTP Gateway')dnl
define(`confPRIVACY_FLAGS',
`needmailhelo,noexpn,novrfy,noetrn,noverb,noreceipts,restrictmailq,restrictq
run,authwarnings')dnl
MASQUERADE_DOMAIN(`mydomain.com')dnl
MAILER(local)dnl
MAILER(smtp)dnl
and here is my cf/domain/otherdomain.com.m4:
Divert(-1)
divert(0)dnl
VERSIONID(`otherdomain.com.m4 - (C) 2003')
FEATURE(`use_cw_file')dnl
FEATURE(access_db, `hash /etc/mail/access.otherdomain.com')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(`dnsbl', `relays.ordb.org', `"550 Email rejected due to sending
server misconfiguration."')dnl
define(`confDEF_USER_ID',`6:6')dnl
define(`confTRUSTED_USER', `smmsp')dnl
define(`confSMTP_LOGIN_MSG', `otherdomain.com SMTP Gateway')dnl
define(`confPRIVACY_FLAGS',
`needmailhelo,noexpn,novrfy,noetrn,noverb,noreceipts,restrictmailq,restrictq
run,authwarnings')dnl
MASQUERADE_DOMAIN(`otherdomain.com')dnl
MAILER(local)dnl
MAILER(smtp)dnl
I have tried to use FEATURE(limited_masquerade)dnl with no luck. Both
mydomain.com and otherdomain.com are listed in local-host-names.
Any help would be greatly appreciated.
Regards,
Grigorios
>and here is my cf/domain/otherdomain.com.m4:
[snip]
>MASQUERADE_DOMAIN(`otherdomain.com')dnl
>I have tried to use FEATURE(limited_masquerade)dnl with no luck.
Of course - limited_masquerade means "masquerade only the domains that
you specifically ask for" (plus domain-less addresses) rather than the
default of all "local" domains, and you've specifically asked for both
domains to be masqueraded. Drop the latter MASQUERADE_DOMAIN above if
you don't want otherdomain.com masqueraded.
--Per Hedeland
p...@hedeland.org
I didn't say I knew what I was doing when I tried limited_masquerade.I used
it
only because I found in the documentation that it is used when hosting
multiple
domains on the same machine.
I repeat that otherdomain.com is my virtual domain.
To re-state my question: I want BOTH domains to be masqueraded like this:
- Say we have two machines, mx.mydomain.com and mx.otherdomain.com.
If I use mailx to send mail eg. to m...@yahoo.com from each machine
respectively,
mail will appear as coming from m...@mx.mydomain.com and m...@mx.otherdomain.com
respectively. What I want is to masquerade each domain as its own name, ie
get
rid of any hostname appearing. So in my case, I would like mail to be sent
as
m...@mydomain.com or m...@otherdomain.com. If I use only a single
MASQUERADE_AS(mydomain.com) statement in my main sendmail.mc, ALL virtual
domains would be masqueraded like this. That is, mail sent from
m...@otherdomain.com
will be delivered as coming from m...@mydomain.com. To be clear in one line, I
want
each domain served to have its own masquerading.
Sorry but my novice level does not permit me to be clear enough.
Regards,
Grigorios
OK - I think the best solution is to use a more capable MUA than mailx,
that allows you to set the sender adress to the desired one, for at
least one of the domains - sendmail config isn't the answer to every
mail-related issue.
But if that is not feasible, you'll need to use the genericstable - in
current versions of sendmail, you can "wildcard" the user-part and have
entries like
@mx.mydomain.com %1...@mydomain.com
@mx.otherdomain.com %1...@otherdomain.com
- see cf/README (and note that mx.mydomain.com and mx.otherdomain.com
need to be listed via GENERICS_DOMAIN[_FILE]()).
> If I use only a single
>MASQUERADE_AS(mydomain.com) statement in my main sendmail.mc, ALL virtual
>domains would be masqueraded like this.
Yes, MASQUERADE_AS is by definition singular - you cannot do what you
want with plain masquerading.
--Per Hedeland
p...@hedeland.org
Actually, I am not using mailx at all. I just used it because I knew it
appends
also the hostname to the e-mail address, so I wanted to check if
masquerading
works.
> But if that is not feasible, you'll need to use the genericstable - in
> current versions of sendmail, you can "wildcard" the user-part and have
> entries like
>
> @mx.mydomain.com %1...@mydomain.com
> @mx.otherdomain.com %1...@otherdomain.com
> Yes, MASQUERADE_AS is by definition singular - you cannot do what you
> want with plain masquerading.
Any suggestion on where should I look?
Thanks again
Grigorios
Actually mailx doesn't provide any sender address at all to sendmail,
but lets sendmail figure it out based on the userid of the invoking user
- which means that it will be 'username'@'local.host.name' by default.
>> But if that is not feasible, you'll need to use the genericstable - in
>> current versions of sendmail, you can "wildcard" the user-part and have
>> entries like
>>
>> @mx.mydomain.com %1...@mydomain.com
>> @mx.otherdomain.com %1...@otherdomain.com
>
>> Yes, MASQUERADE_AS is by definition singular - you cannot do what you
>> want with plain masquerading.
>
>Any suggestion on where should I look?
For what? The genericstable is described in cf/README, as I wrote in the
part you snipped (the file is part of the sendmail distribution).
--Per Hedeland
p...@hedeland.org
What I mean, since you mention "plain masquerading" and "you cannot do
what you want", I concluded that you have something else in mind that
perhaps
is more flexible than plain masquerading. I couldn't tell if you meant
genericstable.
If so, please forgive me. If not, I would appreciate it if you explained
what you
mean.
I meant genericstable. Basically, masquerading is many-to-one,
genericstable is (potentially) many-to-many. And as I wrote before, the
sendmail config is perhaps not the best place to solve the problem at
all.
--Per Hedeland
p...@hedeland.org