Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Masquerade multiple domains

261 views
Skip to first unread message

G G Papazoglou

unread,
Apr 29, 2003, 9:26:12 AM4/29/03
to
Hello. I have a single server serving mydomain.com and want to start serving
otherdomain.com as well. The problem is that I can't have the two domains be
masqueraded properly. That is, for example, when I send mail using mailx
from inside the server (mx.mydomain com), it appears as sent by
m...@mx.mydomain.com and not m...@mydomain.com.
I tried to use MASQUERADE_AS, but then both domains are masqueraded as
mydomain.com.

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


Per Hedeland

unread,
Apr 29, 2003, 4:22:00 PM4/29/03
to
In article <b8luhf$nq5$1...@nic.grnet.gr> "G G Papazoglou" <g...@med.uoc.gr>
writes:

>Hello. I have a single server serving mydomain.com and want to start serving
>otherdomain.com as well. The problem is that I can't have the two domains be
>masqueraded properly. That is, for example, when I send mail using mailx
>from inside the server (mx.mydomain com), it appears as sent by
>m...@mx.mydomain.com and not m...@mydomain.com.
>I tried to use MASQUERADE_AS, but then both domains are masqueraded as
>mydomain.com.
>
>1. Here is my main sendmail.mc:
[snip]
>MASQUERADE_DOMAIN(`mydomain.com')dnl

>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

G G Papazoglou

unread,
Apr 29, 2003, 7:48:47 PM4/29/03
to
> 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.
>

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


Per Hedeland

unread,
Apr 29, 2003, 9:27:42 PM4/29/03
to
In article <b8n30p$b7f$1...@nic.grnet.gr> "G G Papazoglou" <g...@med.uoc.gr>
writes:

>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.

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

G G Papazoglou

unread,
Apr 30, 2003, 3:20:02 AM4/30/03
to
> 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.

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


Per Hedeland

unread,
Apr 30, 2003, 3:44:12 AM4/30/03
to
In article <b8ntf9$nhn$1...@nic.grnet.gr> "G G Papazoglou" <g...@med.uoc.gr>
writes:
>[ I wrote: ]

>> 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.
>
>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.

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

G G Papazoglou

unread,
Apr 30, 2003, 3:50:01 AM4/30/03
to
> >> 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).

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.


Per Hedeland

unread,
Apr 30, 2003, 4:25:06 PM4/30/03
to
In article <b8nv8p$og6$1...@nic.grnet.gr> "G G Papazoglou" <g...@med.uoc.gr>
writes:

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

0 new messages