sendmail aliases not being honored

Running sendmail Version 8.12.10+Sun on Solaris 9.

I need to send mail from this server (serverA) to the mail server (Mserver), which will relay the message to the correct user. If I specify the user specifically, as in:

mailx -s"test" John.Doe@company.com
test
.

It works perfectly and the message is delivered. But if I try to use an alias, sendmail never expands the alias and just tries to send the mail as the alias. For example, in /etc/mail/aliases I have an entry that says:

But it gets sent out like this:

Probably you have already doen this, but did you remember to rebuild the alias database after updating the aliases file?

Yes, I have run newaliases.

Check your access database (/etc/mail/access*) - you probably have to 'tell' sendmail you will accept mail from serverA. You can verify this by running the same command you posted and use harrypotter@notrealdomain.com as the rcpt (I doubt that is in your /etc/mail/access file since it isn't a real domain)

From some old notes I have, you would update the /etc/mail/access file, then run makemap hash /etc/mail/access < /etc/mail/access to build the /etc/mail/access.db. Then restart sendmail. This would be done on your Mserver.

I dont have access to the mail relay server. But I do know that it accepts email from my server (serverA), because if I send an email to a specific address, such as John.Doe@company.com, it works. The only problem is the aliases. My server doesnt honor aliases and instead tries to send to Mserver as root@company.com.

One update:

 /usr/lib/sendmail -bv root
root... deliverable: mailer relay, host Mserver.company.com, user root@Mserver.company.com

So I can see that the problem is on my machine, serverA. I just can't figure out why the aliases wont work.

What does "ls -l /etc/mail/alias* /usr/lib/sendmail" give you?

ls -l /etc/mail/alias* /usr/lib/sendmail
-rw-r--r--   1 root     bin          399 Jan 10 14:56 /etc/mail/aliases
-rw-r-----   1 root     smmsp      40960 Jan 10 14:55 /etc/mail/aliases.db
-r-xr-sr-x   1 root     smmsp     976724 Sep 23  2003 /usr/lib/sendmail*

Then check /etc/mail/sendmail.cf - O AliasFile=/etc/aliases
or O AliasFile=/etc/mail/aliases

If it's /etc/aliases, make sure there is a link for it to /etc/mail/aliases.

Those file permissions match what I have. How about:
grep aliases /etc/nsswitch.conf

I think youre onto something. I thought that sendmail checks the /etc/mail/aliases file by default. Anyways I looked and it was commented out, so I uncommented it and saved the file. Then I ran newaliases and got this. I must have something misconfigured.

/etc/mail/aliases: line 11: MAILER-DAEMON... cannot alias non-local names
/etc/mail/aliases: line 12: postmaster... cannot alias non-local names
/etc/mail/aliases: line 13: nobody... cannot alias non-local names
/etc/mail/aliases: line 15: root... cannot alias non-local names
/etc/mail/aliases: line 17: some-admins... cannot alias non-local names
/etc/mail/aliases: 0 aliases, longest 0 bytes, 0 bytes total

# grep aliases /etc/nsswitch.conf
aliases: files

OK so I found this on the sendmail FAQ:

So I added A to the flags after F=.

It now looks like this:

Mlocal,         P=/bin/mail, F=lsDFM5qPrmn9A, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
                T=DNS/RFC822/X-Unix,
                A=mail -d $u

Ran newaliases and it worked fine. Sent an email to root and I got the same error. However:

 /usr/lib/sendmail -bv root
John.Doe@company.com... deliverable: mailer relay, host Mserver.company.com, user John.Doe@company.com
Jim.Bob@company.com... deliverable: mailer relay, host Mserver.company.com, user Jim.Bob@company.com

Replying to myself once again.

I was reading up on sunsolve and found that I cannot use aliases unless I am running the sendmail daemon. I neglected to mention earlier on in the thread that I was not running the daemon, which probably would have tipped you guys off. My apologies for that. Here's a link to the Sunsolve article