Solaris sendmail not paying attention to virtusertable

I'm on Solaris 5.11 running sendmail. Local usernames are of the form <letters><numbers> (e.g. hn06511). In the past we used aliases to make point to <username>@olddomain.com.

<username> <username>@olddomain.com

Now there's a new email address scheme and a new domain. Now email addresses are of the form <firstname>.<lastname>@newdomain.com.

So I changed the aliases to be:

<username> <firstname>.<lastname>@newdomain.com

This works, however <username>@olddomain.com no longer works. To add insult to injury, there are many scripts with hardcoded email addresses to the old style.

So I want to change <username>@olddomain.com -> <firstname><lastname>@newdomain.com. I thought I could use virtusertables to accomplish this so I made a virtusertable that contains:

@olddomain.com %1

Supposedly that should take <anybody>@olddomain.com and route it to just the username (%1). I hoped that then the aliases I have defined would translate <username> -> <firstname>.<lastname>@newdomain.com. But as far as I can see sendmail is ignoring this virtusertable completely and attempting delivery to <username>@olddomain.com and, of course, failing.

AFAICT I formated the virtusertable properly and ran makemap (should I be using dbm or hash? I've seen both). AFAICT I have put in the proper FEATURE and done the make and made sure the generated sendmail.cf is in the proper place. I've seen FEATURE expressed as both

FEATURE(virtusertable',dbm -o /etc/mail/virtusertable')

and

FEATURE(virtusertable',hash -o /etc/mail/virtusertable')

But neither work.

What kind of debugging or other info can I provide and try?

Thanks in advance.

Perhaps try newaliases

Did you recreate sendmail.cf with the m4/make command, according to the README in /usr/lib/mail?
Also you need to create the binary index files for the virtusertable.
The commands mught hide in /usr/ccs/bin; put that into the PATH.

newaliases is not the answer. If I put %lt;username>@newdomain.com newaliases complains that it's not a local email address.

------ Post updated at 06:28 PM ------

Yes, I used make. Yes I created the maps for virtusertable.db.

Not sure what you mean by commands hiding in /usr/ccs/bin. What commands? Who needs to know about them?

In Solaris 10 the make and m4 commands are in /usr/ccs/bin/
Maybe Solaris 11 is different.?

Don't know about differences with 10 and 11. I do know the make succeeds.

What the hell is wrong with this site not allowing email addresses or URLs?!? Why oh why?!? How can you ask a question about sendmail without email addresses or references?!?

------ Post updated at 08:51 PM ------

Upping my post count...

What the hell is wrong with this site not allowing email addresses or URLs?!? Why oh why?!? How can you ask a question about sendmail without email addresses or references?!?

------ Post updated at 08:56 PM ------

One more!

------ Post updated at 08:56 PM ------

What the hell is wrong with this site not allowing email addresses or URLs?!? Why oh why?!? How can you ask a question about sendmail without email addresses or references?!?

------ Post updated at 08:57 PM ------

Another reply...

------ Post updated at 08:58 PM ------

Why isn't this upping my post count?

------ Post updated at 09:00 PM ------

More craziness. It seems that sendmail/virtusertable on Solaris does not act like sendmail/virtusertable on other systems. Specifically it never matches a "@domain" LHS and does not expand %1 to the username. I've seen many pages on the Internet say that if you have something like "@example.com %1@my-isp.com" then an email address such as user@example.com would be translated to user@my-isp.com. But this doesn't happen.

Looking at Sendmail 8.12.3 cf/README - Features I read:

virtusertable                 A domain-specific form of aliasing, allowing multiple 		virtual domains to be hosted on one machine.  For example, 		if the virtuser table contained:info@foo.com	foo-info info@bar.com	bar-info joe@bar.com	error:nouser 550 No such user here jax@bar.com	error:5.7.0:550 Address invalid @baz.org	jane@example.net 		 		then mail addressed to info@foo.com will be sent to the 		address foo-info, mail addressed to info@bar.com will be 		delivered to bar-info, and mail addressed to anyone@baz.org 		will be sent to jane@example.net, mail to joe!bar.com will 		be rejected with the specified error message, and mail to 		jax@bar.com will also have a RFC 1893 		compliant error code 5.7.0. 		
 		The username from the original address is passed 		as %1 allowing:
@foo.org	%1@example.com                  		meaning someone@foo.org will be sent to someone@example.com.

I've configured my virtusertable largely like the above:

info@foo.com    foo-info
info@bar.com    bar-info
joe@bar.com     error:nouser 550 No such user here
jax@bar.com     error:5.7.0:550 Address invalid
foobar@foo.com  %1@foobar.com
@baz.org        jane@example.net

Next I ran sendmail -bt to test these entries:

sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> /map virtuser info@foo.com
map_lookup: virtuser (info@foo.com) returns foo-info (0)
> /map virtuser info@bar.com
map_lookup: virtuser (info@bar.com) returns bar-info (0)
> /map virtuser joe@bar.com
map_lookup: virtuser (joe@bar.com) returns error:nouser 550 No such user here (0)
> /map virtuser jax@bar.com
map_lookup: virtuser (jax@bar.com) returns error:5.7.0:550 Address invalid (0)
> /map virtuser foobar@foo.com
map_lookup: virtuser (foobar@foo.com) returns @foobar.com (0)
> /map virtuser user@baz.org
map_lookup: virtuser (user@baz.org) no match (0)
>

So I am looking up stuff in /etc/mail/virtusertable (virtusertable.db?) however the last two maps failed. For foobar@foo.com the "%1" is not being expanded properly and for the user@baz.org sendmail doesn't even match. Why is this? This directly contradicts the documentation which says that "The username from the original address is passed as %1". That's not happening.

sendmail generally uses hash tables so;

makemap hash virtusertable.db <virtusertable

to convert the text file that you created to a database that sendmail can use.

BDTD - yes I've done that already (and after every modification). Honestly if I hadn't done that the /map virtuser wouldn't work at all.