[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Multiple virtualusertables



I actually started putting something together to do this a few days ago. 
See the attached .m4 file (it's a work in progress).  Are you using a
stock Debian sendmail install? If so, save the file as
/usr/share/sendmail.cf/feature/class_virtusertable.m4 (or, if your
sendmail isn't stock Debian, save it into your sendmail cf/feature/ tree
as class_virtusertable.m4).

In your sendmail.mc file, include

  FEATURE(class_virtusertable) 

Set up individual virtual tables as

  CLASS_VIRTUSER(XX, YY) 

where XX will be used to define a class and name a virtual users hash and
hash location and some Sendmail rules, and YY is a space separated list of
machines that belong to the class defined earlier.  By default, the table
is expected to be in hash format and located in /usr/local/etc/mail/.  You
can specify an optional third argument to CLASS_VIRTUSER() which specifies
the type and location of the table (see the documentation for VIRTUSER()
for the format).  This has been minimally tested with 8.9.1a and 8.9.3

-Chris

On Thu, 30 Dec 1999, Brock Rozen wrote:

> Somebody told me this should do it:
> 
> To do this with the M4 config, you need a like like:
> 
> FEATURE(virtusertable, sequence virtuser0 virtuser1 virtuser2)
> 
> and then, at the very end of the .mc file, use a LOCAL_CONFIG section to
> add some code verbatim into the .mc file:
> 
> LOCAL_CONFIG
> #
> # Add additional virtusertable files
> #
> Kvirtuser0 dbm -o /etc/virtusertable
> Kvirtuser1 dbm -o /path/to/lists/ALIASES/mj-vut-domain1
> Kvirtuser2 dbm -o /path/to/lists/ALIASES/mj-vut-domain2
> 
> or something like that....it didn't work for me though. :(
> 
> BR
> 
> On Thu, 30 Dec 1999 at 09:40, aphro wrote about "Re: Multiple...":
> 
> > i just looked around a few sites to see if there was a way and i didnt see
> > anything that looked like it would work :<
> > 
> > nate
> > 
> > On Thu, 30 Dec 1999, Brock Rozen wrote:
> > 
> > brozen >Well, for starters I have 108 domains on my machine -- and to have all the
> > brozen >catch-alls and the various other vut junk for all the domains makes it a
> > brozen >massive file (close to 700 lines).
> > brozen >
> > brozen >I'd like to place the catch-alls in one file, just to make it easier (now
> > brozen >they're at the top, but it's still unwieldy).
> > brozen >
> > brozen >In addition, Majordomo 2 maintains it's own vut and alias files -- one for
> > brozen >each domain. So to use that properly, I need to be able to use more than
> > brozen >one vut file.
> > brozen >
> > brozen >Any idea on how to do it?
> > brozen >
> > brozen >Thanks
> > brozen >
> > brozen >BR
> > brozen >
> > brozen >
> > brozen >On Thu, 30 Dec 1999 at 02:15, aphro wrote about "Re: Multiple...":
> > brozen >
> > brozen >> curious as to why you'd want multiple files in the first place ?? i got
> > brozen >> about 65 domains im hosting and i cant see a need for another virtual
> > brozen >> users table ..at least for my needs..what are yours?
> > brozen >> 
> > brozen >> nate
> > brozen >> 
> > brozen >> 
> > brozen >> On Thu, 30 Dec 1999, Brock Rozen wrote:
> > brozen >> 
> > brozen >> brozen >Hi,
> > brozen >> brozen >
> > brozen >> brozen >Does anybody know how to do this?
> > brozen >> brozen >
> > brozen >> brozen >Getting one to work is easy, getting multiple alias files is easy -- but
> > brozen >> brozen >multiple virtualusertables (vut) ??
> > brozen >> brozen >
> > brozen >> brozen >Thanks!
> > brozen >> brozen >
> > brozen >> brozen >-- 
> > brozen >> brozen >Brock Rozen                                              brozen@torah.org
> > brozen >> brozen >Director of Technical Services                             (410) 602-1350
> > brozen >> brozen >Project Genesis                                     http://www.torah.org/ 
> > brozen >> brozen >
> > brozen >> brozen >
> > brozen >> brozen >
> > brozen >> brozen >-- 
> > brozen >> brozen >Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
> > brozen >> brozen >
> > brozen >> 
> > brozen >> ----------------------------------------[mailto:aphro@aphroland.org ]--
> > brozen >>    Vice President Network Operations       http://www.firetrail.com/
> > brozen >>   Firetrail Internet Services Limited      http://www.aphroland.org/
> > brozen >>        Everett, WA 425-348-7336            http://www.linuxpowered.net/
> > brozen >>             Powered By:                    http://comedy.aphroland.org/
> > brozen >>     Debian 2.1 Linux 2.0.36 SMP            http://yahoo.aphroland.org/
> > brozen >> -----------------------------------------[mailto:aphro@netquest.net ]--
> > brozen >> 2:11am up 132 days, 14:05, 3 users, load average: 1.63, 1.65, 1.63
> > brozen >> 
> > brozen >
> > brozen >-- 
> > brozen >Brock Rozen                                              brozen@torah.org
> > brozen >Director of Technical Services                             (410) 602-1350
> > brozen >Project Genesis                                     http://www.torah.org/ 
> > brozen >
> > 
> > ----------------------------------------[mailto:aphro@aphroland.org ]--
> >    Vice President Network Operations       http://www.firetrail.com/
> >   Firetrail Internet Services Limited      http://www.aphroland.org/
> >        Everett, WA 425-348-7336            http://www.linuxpowered.net/
> >             Powered By:                    http://comedy.aphroland.org/
> >     Debian 2.1 Linux 2.0.36 SMP            http://yahoo.aphroland.org/
> > -----------------------------------------[mailto:aphro@netquest.net ]--
> > 9:24am up 132 days, 21:18, 3 users, load average: 2.27, 1.75, 1.61
> > 
> 
> -- 
> Brock Rozen                                              brozen@torah.org
> Director of Technical Services                             (410) 602-1350
> Project Genesis                                     http://www.torah.org/ 
> 
> 
> -- 
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
> 
divert(-1)
#
# cbs 1999-12-28
# stromsoe@ix.netcom.com
#
divert(0)
VERSIONID(`@(#)class_virtusertable.m4 1999-12-28')
divert(-1)

define(upper,`ABCDEFGHIJKLMNOPQRSTUVWXYZ')dnl
define(lower,`abcdefghijklmnopqrstuvwxyz')dnl
define(`upcase',`translit($1,'lower`,'upper`)')dnl
define(`downcase',`translit($1,'upper`,'lower`)')dnl
define(`CLASS_VIRTUSER',dnl
`LOCAL_CONFIG
C{`'upcase($1)`'CLASS} $2
K`'downcase($1) ifelse($3,`',hash -o /usr/local/etc/mail/`'downcase($1)`'table,$3)
dnl
LOCAL_RULE_0
# handle lookups for $1 users
R$+ < @ $={`'upcase($1)`'CLASS} . >
			$: $>upcase($1) < $(downcase($1) $`'1 @ $`'2 $`'@ $`'1 $: @ $) > $`'1 < @ $`'2 . >
dnl
LOCAL_RULESETS
S`'upcase($1)
R<@> $+ + $`'* < @ $`'* . >
			$: < $(downcase($1) $`'1 + * @ $`'3 $`'@ $`'1 $: @ $) > $`'1 + $`'2 < @ $`'3 . >
R<@> $+ + $`'* < @ $`'* . >
			$: < $(downcase($1) $`'1 @ $`'3 $`'@ $`'1 $: @ $) > $`'1 + $`'2 < @ $`'3 . >
R<@> $+ < @ $+ . >	$: < $(downcase($1) @ $`'2 $`'@ $`'1 $: @ $) > $`'1 < @ $`'2 . >
R<@> $+			$: $`'1
R< error : $- $+ > $`'*	$`'#error $`'@ $(dequote $`'1 $) $: $`'2
R< $+ > $+ < @ $+ >	$: $>97 $`'1
')dnl
undefine(upper)dnl
undefine(lower)dnl
undefine(upcase)dnl
undefine(downcase)dnl

Reply to: