sendmail/mail masquerade problem

I have a SCO 5.06 box running sendmail 8.11. I have set up sendmail to masquerade the domainname as bar.com.

ie in the sendmail.cf file the directive
DMbar.com is set.

When I send mail using mail/mailx, it appends the local hostname "foo" to the masquerade address and inserts this into the "from field" in the envelope header, instead of the masquerade address by itself.

Thus the reply address is xxx@foo.bar.com when I want it to be xxx@bar.com

at first I thought it was sendmail but then i discovered that
if I use a different mail program such as pine, I get the correct repoly address of xxx@bar.com.

I suspect that it is mail/mailx that is not writing the header correctly, however I have tried to replicate this on an identical SCO installation and I can't.

Not sure what the hell is going on, perhaps someone out there is better at this than I am.

Can anyone offer any advice?

Thanks

Mark

This link has good info on sendmail and masquerading:

http://www.connact.com/~esj/sendmail/masquerade.html

Also, check out:

(when the link is back up and working)

The general concensus on the net is to use the MC file to configure masquerading and not to edit the sendmail.cf file directly.

Also, see this thread:

http://lantech.geekvenue.net/chucktips/jason/chuck/1035559944/index_html