So this is what i found out. Hope this can help someone else.
How to enable sendmail masquerading on sendmail 8.14 and later
1) Back up current sendmail.cf file
# cd /etc/mail
# cp sendmail.cf sendmail.cf.<date>
Then, edit the sendmail.cf file as follows:
2) Set the DM macro to the preferred domain, ie:
DMmydomain.com
-- This is the domain that will appear for the sender's email address,
user@mydomain.com
3) Remove root from C{E} macro if desired
By default, you have this C{E} macro in sendmail.cf
C{E}root
The above entry means to NOT masquerade the root user.
If you want to also masq. root user, then change it to this:
C{E}
4) Find Ruleset 93 and 94 in sendmail.cf file and edit them to look exactly as shown below.
Important: Replace <TAB> with actual TAB character!
###################################################################
### Ruleset 93 -- convert header names to masqueraded form ###
###################################################################
SMasqHdr=93
# handle generics database
#R$+ < @ $=G . > $: < $1@$2 > $1 < @ $2 . > @ mark
#R$+ < @ *LOCAL* > $: < $1@$j > $1 < @ *LOCAL* > @ mark
#R< $+ > $+ < $* > @ $: < $(generics $1 $: @ $1 $) > $2 < $3 >
#R<@$+ + $* @ $+> $+ < @ $+ >
# $: < $(generics $1+*@$3 $@ $2 $:@$1 + $2@$3 $) > $4 < @ $5 >
#R<@$+ + $* @ $+> $+ < @ $+ >
# $: < $(generics $1@$3 $: $) > $4 < @ $5 >
#R<@$+ > $+ < @ $+ > $: < > $2 < @ $3 >
#R< > $+ < @ $+ . > $: < $(generics @$2 $@ $1 $: $) > $1 < @ $2 . >
#R< > $+ < @ $+ > $: < $(generics $1 $: $) > $1 < @ $2 >
#R< > $+ + $* < @ $+ > $: < $(generics $1+* $@ $2 $: $) > $1 + $2 < @ $3 >
#R< > $+ + $* < @ $+ > $: < $(generics $1 $: $) > $1 + $2 < @ $3 >
#R< $* @ $* > $* < $* > $@ $>canonify $1 @ $2 found qualified
#R< $+ > $* < $* > $: $>canonify $1 @ *LOCAL* found unqualified
#R< > $* $: $1 not found
# do not masquerade anything in class N
R$* < @ $* $=N . ><TAB>$@ $1 < @ $2 $3 . >
#R$* < @ *LOCAL* > $@ $1 < @ $j . >
# special case the users that should be exposed
R$=E < @ *LOCAL* > <TAB>$@ $1 < @ $j . >
R$=E < @ $=M . > <TAB>$@ $1 < @ $2 . >
R$=E < @ $=w . > <TAB>$@ $1 < @ $2 . >
# handle domain-specific masquerading
R$* < @ $=M . > $* <TAB>$: $1 < @ $2 . @ $M > $3
R$* < @ $=w . > $* <TAB>$: $1 < @ $2 . @ $M > $3
R$* < @ *LOCAL* > $* <TAB>$: $1 < @ $j . @ $M > $2
R$* < @ $+ @ > $* <TAB>$: $1 < @ $2 > $3
R$* < @ $+ @ $+ > $* <TAB>$: $1 < @ $3 . > $4
###################################################################
### Ruleset 94 -- convert envelope names to masqueraded form<TAB>###
###################################################################
SMasqEnv=94
#R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
R$+<TAB><TAB><TAB>$@ $>93 $1
5) Refresh sendmail (if sendmail is running)
# refresh -s sendmail
6) Try to send a test email to confirm that masquerading is working