Change "root" to "root.admin" in outgoing e-mails

Our AIX servers send e-mails which have the "from" address set to "root@company.com" for our root user ("C{M}company.com" in /etc/sendmail.cf). The problem is that when bad e-mails are sent out or rejected by remote servers, they are being returned and delivered to e-mail box of "Mary Root".

How can I change/alias/masquerade out going e-mails to look like they are coming from "root.admin@company.com" when root sends e-mails?

Is your smtp server/client sendmail/mailx?

AIX does support sendmail:

sendmail -f 'root.admin'

sets the from name to root.admin, since you are sending as root an X-authentication warning header will not be added to the email

I'm using "mailx" in almost all of my scripts so instead of changing each one of them individually, I'd rather setup something in the sendmail.cf to change "root" to "root.admin".

---------- Post updated at 11:21 AM ---------- Previous update was at 09:44 AM ----------

I think we figured it out.

First create your genericstable.db file

echo �root root.admin� > /etc/mail/genericstable
makemap -r hash /etc/mail/genericstable.db < /etc/mail/genericstable

Then add this to the sendmail.cf:

Kgenerics hash /etc/mail/genericstable

If the "Kgenerics" entry was not already in sendmail.cf, sendmail will need to be restarted:

stopsrc -s sendmail
startsrc -s sendmail -a "-bd -q30"