0

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.

0
0

virtusertable debug commands for user root

Look for @oldomain.com entry in virtusertable

echo '/map virtusertable xxx@oldomain.com' | sendmail -bt

Check if sendmail checks virtusertable for olddomain.com email addresses

echo '3,0 john.doe@olddomain.com' | sendmail -d60.5 -bt

-d60.5 tracks maps' lookups (also virtusertable lookups).


More hints:

  1. m4 expects another quoting

    FEATURE(virtusertable,`hash /etc/mail/virtusertable')
    
  2. Do not make virtusertable optional. Remove -o from the FEATURE line.
    With -o sendmail ignores missing virtusertable.

  3. Sendmail uses compiled version of virtusertable. Use makemap to compile virtusertable.

  4. virtusertable is consulted only for local email domains ($=w) and $={VirtHost} domains.

    Use the command below as root to get both list of domains

    echo '$=w' | sendmail -bt
    echo '$={VirtHost}' | sendmail -bt
    
6
  • I had the funky ' quoting around virtusertable in the FEATURE line. I think this site ate the "" character. As your line didn't have that I removed that. I also removed the -o. I had done makemap for the virtualusertable to produce virtusertable.db in /etc/mail. $ echo '/map hn06511@gdc4s.com' | sendmail -bt ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> No key specified > – Andrew DeFaria Sep 4 '18 at 20:12
  • This comment system sucks. Doesn't honor markups, limits me to way too few characters. I'll just tack on my response to the original OP I guess... – Andrew DeFaria Sep 4 '18 at 20:21
  • I'd love to post the output of some of these commands but I don't see a way to do that! Here's what I can post: $ echo '$=w' | sendmail -bt ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> > [IPv6:::1] [10.100.13.21] loghost mailhost.gddsi.com localhost rdeadm1 [127.0.0.1] mailhost $ echo '$={VirtHost}' | sendmail -bt ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> > > Wizard Rdeadm1: – Andrew DeFaria Sep 4 '18 at 20:23
  • echo '3,0 hn06511@gdc4s.com' | sendmail -d60.5 -bt ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> > canonify input: hn06511 @ gdc4s . com Canonify2 input: hn06511 < @ gdc4s . com > map_lookup(host, gdc4s.com, %0=gdc4s.com) => gdc4s.com: Name server timeout NOT FOUND (75) map_lookup(host, gdc4s.com) tempfail: errno=0 Canonify2 returns: hn06511 < @ gdc4s . com > canonify returns: hn06511 < @ gdc4s . com > == Ruleset 3,0 (3) status 75 – Andrew DeFaria Sep 4 '18 at 20:23
  • Continued... parse input: hn06511 < @ gdc4s . com > Parse0 input: hn06511 < @ gdc4s . com > Parse0 returns: hn06511 < @ gdc4s . com > ParseLocal input: hn06511 < @ gdc4s . com > ParseLocal returns: hn06511 < @ gdc4s . com > Parse1 input: hn06511 < @ gdc4s . com > MailerToTriple input: < smtp-west . gd-ms . us . > hn06511 < @ gdc4s . com > – Andrew DeFaria Sep 4 '18 at 20:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.