SUMMARY: tricky sendmail problem

From: Marina Daniels (
Date: Wed Aug 14 1996 - 19:07:47 CDT

Thanks to Claus Assmann, Mike, Cathy Hargrave for their help.

The comment that actually pointed me in the right direction was from Claus - I
decided not to change the rules as I could make it work without that.
How did you achieve to accept
Did you hack some rules?
Normally, you have to list all hosts in
I had an MX record for "a.pbox1.newdomain" which sent it straight to
"" bypassing the unix box,
and another for "a.pbox1.olddomain" which did the same thing.

"" (MS mail) would only accept email for people in "newdomain".
I changed the MX record for "a.pbox1.olddomain" to send it to
"unixbox.newdomain" and changed the /etc/ file to accept mail for all
these postbox addresses. This means sendmail on the unix box now looks up these
users in /etc/aliases where I have an alias for each person pointing to
"person@a.pbox1.newdomain" which then forwards the mail onto ""
and this works.

I know this is very complicated but it is only for a couple of months :-)

I've included the replies below:

> So, can anybody think of a way (rewriting sendmail rule? - sunos 4.1.3) that I
> can change any mail sent to
> > a.pbox1@olddomain to be a.pbox1@newdomain

If that's all you need :-)
R$*<@olddomain>$* $: $1 < @ newdomain > $2
R$*a.pbox1<@olddomain>$* $: $1 a.pbox1< @ newdomain > $2

(placed in S3, if you want to change all headers this way).
But I'm not sure whether that will help...
Claus Assmann


2) Dunno if this is what you want, but try it. You must place it in the correct ruleset *and* in the correct part of that rulese -- perhaps ruleset 0? (depends on your config file).

R$-.$-<@$=w>$* $:$1.$2<@$w>$3

This assumes you have CW set to olddomain and newdomain (which you have in /etc/ and that you've set DW to newdomain (you've either done this explicitly or sendmail does it implicitly -- you'll have to check, but it's probably happening anyway). It'll map the likes of a.pbox1@olddomain to a.pbox1@newdomain Mike -

3) there is a class macro, Cw, which can be used to define other names for your mailhost:

# This node's local host name # DwYourDefaultHostName if not correctly determined by sendmail. # CwYourDefaultHostName if not correctly determined by sendmail. aplo1 localhost digi.UUCP


new domain name: old domain name:

that's how we worked that problem.


Original Question:

*************************************************************************** I have rather a tricky problem (well tricky for me, at any rate :-)) with sendmail now that I have changed the domain for an organisation.

The unix box which accepts mail from the outside world is called:


It then sends this mail to "msmail.newdomain" which runs microsoft mail - there is a configuration menu where you tell it which domain it is in and I've set this to be "newdomain". "msmail.newdomain" has a whole heap of mailboxes, eg: a.pbox1, b.pbox1, c.pbox1, .... and "z.pbox2", "y.pbox2", ....

I don't know much about MS mail and I don't really want to touch it because it will be replaced with a new package in a couple of months.

Before I made the DNS change, mail could go to:


Now, mail can go to person@olddomain person@newdomain person@unixbox.olddomain person@unixbox.newdomain

person@a.pbox1.newdomain but not person@a.pbox1.olddomain

I really would like to make that last address possible so that mail will keep workiing for a while until all those people realize that the person they are writing to has a new email address, ie: person@newdomain (which is currently the reply-to address). Does anybody know how I can do this?

I have MX records for a.pbox1.newdomain gets sent to msmail.newdomain (bypassing unixbox.newdomain)

a.pbox1.olddomain gets sent to msmail.newdomain (bypassing unixbox.newdomain)

/etc/ on "unixbox.newdomain" says it accepts mail for olddomain newdomain

If something gets sent to person@unixbox then due to the /etc/aliases it is translated to


and gets forwarded on to "msmail.newdomain"

I know this is very convoluted but it's not possible just to send mail to person@msmail.newdomain - the mail is rejected because the user does not exist.

It seems to strip the "newdomain" part off the email address and then look to see if it has a user called "person@msmail" which it doesn't. It seems to have to be in the format "person@a.pbox1".

I think this is why sending mail to "person@olddomain" doesn't work - because it actually gets forwarded to the msmail.newdomain" machine which says "olddomain - that's not me, I don't want this message".

So, can anybody think of a way (rewriting sendmail rule? - sunos 4.1.3) that I can change any mail sent to

a.pbox1@olddomain to be a.pbox1@newdomain

I know this is very convoluted and revolting but it's only meant to work for a couple of months before the new mail system comes in and the whole thing is streamlined. By that time everybody should have worked out that they're meant to send mail only to:


Hopefully there is some sendmail guru out there that has managed to keep reading to the end of this very long and complicated message :-)


This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:08 CDT