1

I have two mail-servers: A and B.

The server A is the official MX-handler for domain example.com and is configured to forward the entire @example.com to someuser@yahoo.com. This part works fine.

However, some times server B also gets e-mail intended for foo@example.com and I'd like it to deliver such mail directly to someuser@yahoo.com.

To this end I added the same record to /etc/mail/virtusertable on server B as I have on server A:

@example.com   someuser@yahoo.com

I rebuilt the databases and restarted sendmail on B, but I still see it hand off the e-mail for example.com to A -- instead of delivering it directly to Yahoo.

It is as if MX-record trumps over the virtusertable -- how do I reverse this and save one hop?

Mikhail T.
  • 2,272
  • 1
  • 22
  • 49

1 Answers1

1

Virtusertable domains

Sendmail consults virtusertable only for deliveries to local email domains ($=w) or special virtual doamins ($={VirtHost}).

To list of domains on both list as root use echo '$=w' |sendmail -bt and echo '$={VirtHost}' |sendmail -bt. By default list of local email domains is auto-configured/auto-filled.

To add example.com to $={VirtHost} you may use the following line in sendmail.mc file used to generate sendmail.cf file:

LOCAL_CONFIG
CP{VirtHost}example.com
divert(0)dnl comment: Turn off LOCAL_CONFIG
AnFi
  • 5,883
  • 1
  • 12
  • 26