Operating System - Linux
1821980 Members
3537 Online
109638 Solutions
New Discussion юеВ

virtusertable syntax -- plz help

 
SOLVED
Go to solution
Maaz
Valued Contributor

virtusertable syntax -- plz help

I want that every mail to john will go to james.
I have achieve this from /etc/alias file, as:
#vi /etc/aliases
john: james
#newaliases

But I have heard and read also that it can also be done via virtusertable
#vi virtusertable
john@ james
#make

But when I mail to john...instead of james, john received the mail.
from /var/log/maillog
May 10 22:43:59 mail sendmail[2594]: k4AHhxgi002594: from=, size=312, class=0, nrcpts=1, msgid=<1147283028.2415.2.camel@mail>, proto=ESMTP, daemon=MTA, relay=pcact.test.net [10.100.200.15]
May 10 22:43:59 mail sendmail[2594]: k4AHhxgi002594: to=, delay=00:00:00, mailer=local, pri=30312, dsn=4.4.3, stat=sent

why ?

Regards
Maaz
5 REPLIES 5
Sung Oh
Respected Contributor
Solution

Re: virtusertable syntax -- plz help

Hello,

here is virtusertable syntax example. I would recommnad that you use full email address rather then just aliases. Also you must restart sendmail to read updated table.

http://www.defcon1.org/html/Software_Articles/File-Share/Qmail-install/Story/virtusertable.html

Regards,
Sung
Rajeev  Shukla
Honored Contributor

Re: virtusertable syntax -- plz help

Make sure your sendmail is configured to handle virtusertable. Your sendmail.mc file should have this line uncommented (meaning no "dnl" in front of it) and create sendmail.cf file.
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl

have a look at the README.cf file in /usr/share/doc/sendmail this explains the use of virtusertable in a very detailed way, here is some part of it

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 at 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.

Cheers
Rajeev
Alexander Chuzhoy
Honored Contributor

Re: virtusertable syntax -- plz help

I suggest you to use the /etc/aliases file
for local users address translation.

Read here for more info:
http://www.yak.net/fqa/190.html
Ivan Ferreira
Honored Contributor

Re: virtusertable syntax -- plz help

Virtualusertable is normally used when you host multiple domains in your server, it allows you to specify the domain part in the table. You can also do something like this:

# All messages to ha goes to testha
ha@test-virtual.com testha

# All mesages to domain test-virtual.com goes to root
@test-virtual.com root

# All messages to domain test2-virtual.com goest to the same user but in the domain test-same-si.com
@test2-virtual.com %1@test-same-si.com
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: virtusertable syntax -- plz help

Thanks All ;)