Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

virtusertable not being accessed

57 views
Skip to first unread message

Gregory Carvalho

unread,
Sep 19, 1999, 3:00:00 AM9/19/99
to
On FreeBSD 3.2 with sendmail 8.9.3, the problem I am encountering is
that the virtusertable and genericstalbe are not accessed by sendmail.
/etc/virtusertable.db and /etc/genericstable.db exist and were created
with:
makemap -fv hash /etc/virtusertable <
/usr/home/mailuser/virtusertable.source
makemap -fv hash /etc/genericstable <
/usr/home/mailuser/genericstable.source

***** START OF /map RULE TEST *****
# echo \/map virtusertable friend | sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> Map named "virtusertable" not found
> #
***** END OF /map RULE TEST *****

If I /map against aliases, it resolves properly, but I use newaliases as
the command to create the /etc/aliases.db file.

***** START EXCERPT FROM mailserver.mc *****
FEATURE(`virtusertable')
FEATURE(`genericstable')
GENERICS_DOMAIN_FILE(`/etc/sendmail.cG')dnl
***** END EXCERPT FROM mailserver.mc *****

***** START EXCERPT FROM /etc/sendmail.cf *****
Kgenerics hash -o /etc/genericstable
Kvirtuser hash -o /etc/virtusertable
FG/etc/sendmail.cG
***** END EXCERPT FROM /etc/sendmail.cf *****

Cordially,
Gregory Carvalho Greg...@stcinc.com
Simplified Technology Company http://www.stcinc.com
In God I Trust!

Per Hedeland

unread,
Sep 19, 1999, 3:00:00 AM9/19/99
to
In article <37E49639...@stcinc.com> Gregory Carvalho

<Greg...@stcinc.com> writes:
>On FreeBSD 3.2 with sendmail 8.9.3, the problem I am encountering is
>that the virtusertable and genericstalbe are not accessed by sendmail.
>/etc/virtusertable.db and /etc/genericstable.db exist and were created
>with:
>makemap -fv hash /etc/virtusertable <
>/usr/home/mailuser/virtusertable.source
>makemap -fv hash /etc/genericstable <
>/usr/home/mailuser/genericstable.source
>
>***** START OF /map RULE TEST *****
># echo \/map virtusertable friend | sendmail -bt
>ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
>Enter <ruleset> <address>
>> Map named "virtusertable" not found
>> #
>***** END OF /map RULE TEST *****

The name used by the sendmail.cf is actually "virtuser", not
"virtusertable", as you can see on the K line below.

>If I /map against aliases, it resolves properly, but I use newaliases as
>the command to create the /etc/aliases.db file.
>
>***** START EXCERPT FROM mailserver.mc *****
>FEATURE(`virtusertable')
>FEATURE(`genericstable')
>GENERICS_DOMAIN_FILE(`/etc/sendmail.cG')dnl
>***** END EXCERPT FROM mailserver.mc *****
>
>***** START EXCERPT FROM /etc/sendmail.cf *****
>Kgenerics hash -o /etc/genericstable
>Kvirtuser hash -o /etc/virtusertable
>FG/etc/sendmail.cG
>***** END EXCERPT FROM /etc/sendmail.cf *****

It is better to use a definition that avoids the '-o' - this stands for
"optional", and means that any problems (permissions etc) with the file
causes it to be silently ignored - without -o, you'll instead get an
error message in those cases. I.e. use

FEATURE(`virtusertable', `hash /etc/virtusertable')
FEATURE(`genericstable', `hash /etc/genericstable')

in the .mc file.

--Per Hedeland
p...@erix.ericsson.se

Gregory Carvalho

unread,
Sep 19, 1999, 3:00:00 AM9/19/99
to
Per Hedeland wrote:
> It is better to use a definition that avoids the '-o' - this stands for
> "optional", and means that any problems (permissions etc) with the file
> causes it to be silently ignored - without -o, you'll instead get an
> error message in those cases. I.e. use
>
> FEATURE(`virtusertable', `hash /etc/virtusertable')
> FEATURE(`genericstable', `hash /etc/genericstable')
>
> in the .mc file.

Thanks, virtuser and generics work, sort of.

# echo \/map generics gregoryc | sendmail -bt


ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>

> map_lookup: generics (gregoryc) returns Greg...@simplifiedtechnology.com (0)
> #

It finds the mapping, but when I send email from user gregoryc using
pine, the receiving MUA displays
Greg...@internet.simplifiedtechnology.com not
Greg...@simplifiedtechnology.com. Please advise on corrective action
(or sections of the book I should re-read).

Thanks,
Gregory

Per Hedeland

unread,
Sep 19, 1999, 3:00:00 AM9/19/99
to
In article <37E52045...@stcinc.com> Gregory Carvalho

<Greg...@stcinc.com> writes:
>Thanks, virtuser and generics work, sort of.
>
># echo \/map generics gregoryc | sendmail -bt

No need to escape the '/' with '\', only the '\'.:-)

>It finds the mapping, but when I send email from user gregoryc using
>pine, the receiving MUA displays
>Greg...@internet.simplifiedtechnology.com not
>Greg...@simplifiedtechnology.com. Please advise on corrective action
>(or sections of the book I should re-read).

simplifiedtechnology.com is apparently an alias (CNAME record in the
DNS):

Name: internet.simplifiedtechnology.com
Address: 207.21.31.250
Aliases: simplifiedtechnology.com

You're not allowed to use aliases in mail addresses (per RFC 821, 1123),
thus it gets rewritten to the canonical name
internet.simplifiedtechnology.com. Furthermore, you mustn't use a CNAME
record and another type of record for any name per the DNS standards,
and as anything.com has to have SOA and NS records per the .com rules,
you're violating that as well (and your name server software should have
told you this). Use an MX and/or A record to point
simplifiedtechnology.com to internet.simplifiedtechnology.com.

--Per Hedeland
p...@erix.ericsson.se


Gregory Carvalho

unread,
Sep 19, 1999, 3:00:00 AM9/19/99
to
Per Hedeland wrote:
> simplifiedtechnology.com is apparently an alias (CNAME record in the
> DNS):
>
> Name: internet.simplifiedtechnology.com
> Address: 207.21.31.250
> Aliases: simplifiedtechnology.com
>
> You're not allowed to use aliases in mail addresses (per RFC 821, 1123),
> thus it gets rewritten to the canonical name
> internet.simplifiedtechnology.com. Furthermore, you mustn't use a CNAME
> record and another type of record for any name per the DNS standards,
> and as anything.com has to have SOA and NS records per the .com rules,
> you're violating that as well (and your name server software should have
> told you this). Use an MX and/or A record to point
> simplifiedtechnology.com to internet.simplifiedtechnology.com.

Actually the SOA and NS are defined. I merely added the alias
simplifiedtechnology.com yesterday in an attempt to enable
Greg...@simplifiedtechnology.com (this is in the genericstable) to
appear in the From field. Today, I deleted the alias, and now it works.
Yesterday without the alias it didn't work. Although, I did rerun
makemap.

Thank you very much for your assistance and direction, Per Hedeland.

casb...@my-deja.com

unread,
Sep 20, 1999, 3:00:00 AM9/20/99
to
Help! I am running Redhat Linux 5.2 and sendmail
8.8.7 and can't receive email for a virtual
domain. I can test the virtusertable with
sendmail -bt and doing a /map...etc, and it
resolves fine. But when I try to send mail to a
virtual user, it says, "user unknown" and dies.
My virtusertable is simply:
virt...@virtdomain.com localuser
When I send email to virt...@virtdomain.com, it
fails and says, "unknown user". When I send
email to "loca...@virtdomain.com", it works
great. I have checked all FAQ's, pretty much
read the entire sendmail book, and am stuck on
this one thing. Any help would be awesome!


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

Per Hedeland

unread,
Sep 20, 1999, 3:00:00 AM9/20/99
to
In article <7s60h6$u6c$1...@nnrp1.deja.com> casb...@my-deja.com writes:
>Help! I am running Redhat Linux 5.2 and sendmail
>8.8.7 and can't receive email for a virtual
>domain. I can test the virtusertable with
>sendmail -bt and doing a /map...etc, and it
>resolves fine. But when I try to send mail to a
>virtual user, it says, "user unknown" and dies.
>My virtusertable is simply:
>virt...@virtdomain.com localuser
>When I send email to virt...@virtdomain.com, it
>fails and says, "unknown user". When I send
>email to "loca...@virtdomain.com", it works
>great. I have checked all FAQ's, pretty much
>read the entire sendmail book, and am stuck on
>this one thing. Any help would be awesome!

Did you follow *all* the instructions at
http://www.sendmail.org/virtual-hosting.html (which you've of course
read, as there are several references to it from the FAQ)? In
particular, a) building your sendmail.cf from a .mc file with
FEATURE(virtusertable), and b) restarting the sendmail daemon after
installing the new sendmail.cf?

--Per Hedeland
p...@erix.ericsson.se

casb...@my-deja.com

unread,
Sep 21, 1999, 3:00:00 AM9/21/99
to
In article <7s6493$pg1$1...@news.du.etx.ericsson.se>,

Yes! Several times. It is driving me crazy.

Cas Milewski
c...@cinteract.com

Per Hedeland

unread,
Sep 22, 1999, 3:00:00 AM9/22/99
to

Then I assume you also have put virtdomain.com in sendmail.cw or
equivalent, which I forgot to specifically mention. OK, here's what to
test in -bt mode:

$=w

- should give a list of "local" domains, including virtdomain.com.

/map virtuser virt...@virtdomain.com

- well you said you already did that, I think, the result should be the
coresponding RHS from the table of course.

/parse virt...@virtdomain.com

- should show a lot of processing, including the virt...@virtdomain.com
getting replaced with the RHS from the virtusertable and the process
restarted, finaly resolving to a mailer[/host]/user tuple. If it
doesn't, post the result (only if the previous two tests were OK
though).

If all of these work, it *has* to be a problem with sendmail daemon vs
command-line invocation - if you hav restarted the daemon, make sure
you're really using the same binary and sendmail.cf for the daemon and
command-line.

--Per Hedeland
p...@erix.ericsson.se

dave

unread,
Sep 22, 1999, 3:00:00 AM9/22/99
to

i'm having the same problems (and others) i think..

On 22 Sep 1999 08:05:58 GMT, p...@erix.ericsson.se (Per Hedeland)
wrote:

>In article <7s90p8$33o$1...@nnrp1.deja.com> casb...@my-deja.com writes:
>>In article <7s6493$pg1$1...@news.du.etx.ericsson.se>,
>> p...@erix.ericsson.se (Per Hedeland) wrote:
>>> Did you follow *all* the instructions at
>>> http://www.sendmail.org/virtual-hosting.html (which you've of course
>>> read, as there are several references to it from the FAQ)? In
>>> particular, a) building your sendmail.cf from a .mc file with
>>> FEATURE(virtusertable), and b) restarting the sendmail daemon after
>>> installing the new sendmail.cf?
>>>
>>> --Per Hedeland
>>> p...@erix.ericsson.se
>>>
>>
>>Yes! Several times. It is driving me crazy.
>

read it all many times, followed the
FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable')dnl
and the after m4'ing the .mc file copied thre resulting .cf file to
/etc/sendmail.cf

>Then I assume you also have put virtdomain.com in sendmail.cw or
>equivalent, which I forgot to specifically mention. OK, here's what to
>test in -bt mode:
>
>$=w
>
> - should give a list of "local" domains, including virtdomain.com.

yes, but...
her's what i got:

my.domain.com
[xxx.xxx.xxx.xxx] (my ip address)
my
virtdomain.com
localhost
[127.0.0.1]
domain.com
[10.10.10.1] (i think this may be my problem, but how do
i change this??)

when i restart sendmail i get the error "restart... User unknown"
after looking at the log it says "Sep 22 07.21.99 localhost
sendmail[6000]: gethostbyaddr(10.10.10.1): failed: 1"


>
>/map virtuser virt...@virtdomain.com
>

i did this too and got "map named virtuser not fund"

> - well you said you already did that, I think, the result should be the
> coresponding RHS from the table of course.
>
>/parse virt...@virtdomain.com
>
> - should show a lot of processing, including the virt...@virtdomain.com
> getting replaced with the RHS from the virtusertable and the process
> restarted, finaly resolving to a mailer[/host]/user tuple. If it
> doesn't, post the result (only if the previous two tests were OK
> though).
>

i did get results like this:

"cracked address = &g
parsing enveleope reciepient address
rewrite: ruleset 3 input: virtuser @ virtdomain . com
rewrite: ruleset 96 input: virtuser < @ virtdomain . com >
<SNIP>
rewrite: ruleset 4 returns: virtuser
mailer local, user virtuser


is this looking right?

Per Hedeland

unread,
Sep 22, 1999, 3:00:00 AM9/22/99
to
In article <37e8ef1...@news.pacbell.net>,

dy...@pacbell.net (dave) writes:
>i'm having the same problems (and others) i think..

>>>In article <7s6493$pg1$1...@news.du.etx.ericsson.se>,


>>> p...@erix.ericsson.se (Per Hedeland) wrote:
>>>> Did you follow *all* the instructions at
>>>> http://www.sendmail.org/virtual-hosting.html (which you've of course

>read it all many times, followed the

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

And just exactly *what* did you *follow* by using that line? There is
most certainly no '-o' in the line on the abovementioned page.

>>/map virtuser virt...@virtdomain.com
>>
>
>i did this too and got "map named virtuser not fund"

Small wonder it doesn't work then. Take out the -o above and sendmail
will tell you what the problem is. Check dejanews for a gazillion other
posts that tell you what -o means and why you shouldn't use it.

--Per Hedeland
p...@erix.ericsson.se

G. Roderick Singleton

unread,
Sep 22, 1999, 3:00:00 AM9/22/99
to
Per Hedeland wrote:
>
...

> >read it all many times, followed the
> >FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable')dnl
>
> And just exactly *what* did you *follow* by using that line? There is
> most certainly no '-o' in the line on the abovementioned page.
>erix.ericsson.se


It's in <path_to_sendmail_source/cf/README.
line 706: hash -o /etc/virtusertable
711: FEATURE(`virtusertable', `dbm -o /etc/mail/virtusers')

Seems RTFM is sometimes the wrong thing to do, eh?
--
________________________________________________________________________________
G. Roderick Singleton, <gsing...@home.com> PATH tech,
71 Underhill Drive, Unit 159, Toronto, ON M3A 2J8
Voice : 416-452-4583 Fax: 416-452-0036
________________________________________________________________________________

*** Notice To Bulk Emailers: Attention! Pursant to US Code, Title 47,
Chapter 5, Subchapter II, 227, any & all unsolicited commercial e-mail
sent to this address is subject to a download and archival fee in the
amount of the $1500 US and copies will be forwarded to domain
administrators. Emailing denotes acceptance of said terms!

casb...@my-deja.com

unread,
Sep 23, 1999, 3:00:00 AM9/23/99
to
In article <7sa2l6$8p8$1...@news.du.etx.ericsson.se>,

p...@erix.ericsson.se (Per Hedeland) wrote:
> In article <7s90p8$33o$1...@nnrp1.deja.com> casb...@my-deja.com writes:
> >In article <7s6493$pg1$1...@news.du.etx.ericsson.se>,
> > p...@erix.ericsson.se (Per Hedeland) wrote:
> >> Did you follow *all* the instructions at
> >> http://www.sendmail.org/virtual-hosting.html (which you've of
course
> >> read, as there are several references to it from the FAQ)? In
> >> particular, a) building your sendmail.cf from a .mc file with
> >> FEATURE(virtusertable), and b) restarting the sendmail daemon after
> >> installing the new sendmail.cf?
> >>
> >> --Per Hedeland
> >> p...@erix.ericsson.se
> >>
> >
> >Yes! Several times. It is driving me crazy.
>
> Then I assume you also have put virtdomain.com in sendmail.cw or
> equivalent, which I forgot to specifically mention. OK, here's what to
> test in -bt mode:
>
> $=w
>
> - should give a list of "local" domains, including virtdomain.com.
>
> /map virtuser virt...@virtdomain.com

>
> - well you said you already did that, I think, the result should be
the
> coresponding RHS from the table of course.
>
> /parse virt...@virtdomain.com
>
> - should show a lot of processing, including the
virt...@virtdomain.com
> getting replaced with the RHS from the virtusertable and the
process
> restarted, finaly resolving to a mailer[/host]/user tuple. If it
> doesn't, post the result (only if the previous two tests were OK
> though).
>
> If all of these work, it *has* to be a problem with sendmail daemon vs
> command-line invocation - if you hav restarted the daemon, make sure
> you're really using the same binary and sendmail.cf for the daemon and
> command-line.
>
> --Per Hedeland
> p...@erix.ericsson.se
>
Ok.. $=w is fine. It shows the domain name pighini.com. '/map
virtuser x...@pighini.com' resolves perfectly to a local user of another
name. This has always worked. Here is the output of '/parse
x...@pighini.com':

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> Cracked address = $g
Parsing envelope recipient address
rewrite: ruleset 3 input: xxx @ pighini . com
rewrite: ruleset 96 input: xxx < @ pighini . com >
rewrite: ruleset 96 returns: xxx < @ pighini . com . >
rewrite: ruleset 3 returns: xxx < @ pighini . com . >
rewrite: ruleset 0 input: xxx < @ pighini . com . >
rewrite: ruleset 199 input: xxx < @ pighini . com . >
rewrite: ruleset 199 returns: xxx < @ pighini . com . >
rewrite: ruleset 98 input: xxx < @ pighini . com . >
rewrite: ruleset 98 returns: xxx < @ pighini . com . >
rewrite: ruleset 198 input: xxx < @ pighini . com . >
rewrite: ruleset 198 returns: $# local $: xxx
rewrite: ruleset 0 returns: $# local $: xxx
rewrite: ruleset 2 input: xxx
rewrite: ruleset 2 returns: xxx
rewrite: ruleset 20 input: xxx
rewrite: ruleset 20 returns: xxx
rewrite: ruleset 4 input: xxx
rewrite: ruleset 4 returns: xxx
mailer local, user xxx

This does not seem to be resolving in the way that you had written in
your reply. BTW, I also tried making an entirely new sendmail.cf using
m4, etc. with the same results, and always restarting the sendmail
daemon, even tried to reboot the system completely. What does
the /parse results above tell you?

Thanks!

casb...@my-deja.com

unread,
Sep 23, 1999, 3:00:00 AM9/23/99
to
Yes, the '$=w' shows the pighini.com domain fine. Also, the '/map
vituser x...@pighini.com' resolves to a local user of another name
perfectly. This has always worked. Then I tried '/parse
x...@pighini.com' and here is the output:

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> Cracked address = $g
Parsing envelope recipient address
rewrite: ruleset 3 input: xxx @ pighini . com
rewrite: ruleset 96 input: xxx < @ pighini . com >
rewrite: ruleset 96 returns: xxx < @ pighini . com . >
rewrite: ruleset 3 returns: xxx < @ pighini . com . >
rewrite: ruleset 0 input: xxx < @ pighini . com . >
rewrite: ruleset 199 input: xxx < @ pighini . com . >
rewrite: ruleset 199 returns: xxx < @ pighini . com . >
rewrite: ruleset 98 input: xxx < @ pighini . com . >
rewrite: ruleset 98 returns: xxx < @ pighini . com . >
rewrite: ruleset 198 input: xxx < @ pighini . com . >
rewrite: ruleset 198 returns: $# local $: xxx
rewrite: ruleset 0 returns: $# local $: xxx
rewrite: ruleset 2 input: xxx
rewrite: ruleset 2 returns: xxx
rewrite: ruleset 20 input: xxx
rewrite: ruleset 20 returns: xxx
rewrite: ruleset 4 input: xxx
rewrite: ruleset 4 returns: xxx
mailer local, user xxx

This does not seem to look the way you said it should. What could it
be?

Thanks, again!

Per Hedeland

unread,
Sep 23, 1999, 3:00:00 AM9/23/99
to
In article <37E939...@home.com> "G. Roderick Singleton"

<gsing...@home.com> writes:
>Per Hedeland wrote:
>>
>...
>> >read it all many times, followed the
>> >FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable')dnl
>>
>> And just exactly *what* did you *follow* by using that line? There is
>> most certainly no '-o' in the line on the abovementioned page.
>>erix.ericsson.se
>
>
>It's in <path_to_sendmail_source/cf/README.
>line 706: hash -o /etc/virtusertable
>711: FEATURE(`virtusertable', `dbm -o /etc/mail/virtusers')
>
>Seems RTFM is sometimes the wrong thing to do, eh?

Well, the first is a just a statement of fact, the default definition
*does* include '-o', and the second is an example - admittedly both are
badly chosen. The idea was probably that you could have a "generic"
sendmail.cf that would use the virtusertable (etc) if it existed, but
especially with the stricter permissions checks in recent versions and
issues like DB version mismatch, using -o creates far more problems than
it solves, and you're much better off using a .mc file that just
specifies the features that you actually intend to use - or rather,
multiple .mc files.

This is planned to change in 8.10 (no release date known), the intent is
that neither the defaults nor the above example in cf/README will have
-o. And there is definitely no usage of -o on the virtual-hosting web
page, which I specifically referred to.:-)

--Per Hedeland
p...@erix.ericsson.se


Per Hedeland

unread,
Sep 23, 1999, 3:00:00 AM9/23/99
to
In article <7sdmcp$ekn$1...@nnrp1.deja.com>,

casb...@my-deja.com writes:
>This does not seem to be resolving in the way that you had written in
>your reply. BTW, I also tried making an entirely new sendmail.cf using
>m4, etc. with the same results, and always restarting the sendmail
>daemon, even tried to reboot the system completely. What does
>the /parse results above tell you?

They tell me that (or rather I interpret them as:-) either you don't
have the virtuser lookup rules in your sendmail.cf - which is a very
common error if you hand-edit it (it's even one of the top-5 FAQs,
3.28), but shouldn't happen if you built it with m4 - or the actual
lookup fails for some reason - which shouldn't happen if the /map works.

More things to test in -bt mode:

=SParse1

- This should simply list the ruleset where the virtusertable lookups
are done - if you don't see a number of rules with "virtuser" in them,
your sendmail.cf is wrong per above, no point doing the next one.

-d21.12,38.20
Parse1 xxx<@pighini.com.>

- (note they must be given in one session) - This will feed the
pre-parsed address per your previous session into the above ruleset
(Parse1 is actually shown as 198) and produce a *lot* of debugging
output, showing both how each rule is tried and the actual table
lookup (if any).

--Per Hedeland
p...@erix.ericsson.se

0 new messages