Re: [exim] how can get user group

Top Page
Delete this message
Reply to this message
Author: Heiko Schlittermann
Date:  
To: exim-users
Subject: Re: [exim] how can get user group
Heiko Schlittermann <hs@???> (Di 15 Sep 2009 15:32:52 CEST):
> Vasiliy G Tolstov <v.tolstov@???> (Di 15 Sep 2009 14:23:49 CEST):
> > Hello!
> > I'm try to get user group in non_smtp acl by
> >
> > deny condition = ${if =
> > {${extract{4}{:}{${lookup{$local_part}lsearch{/etc/passwd}{$value}fail}}}}{601}{yes}{no}}
> >
> > (if user group id = 601 deny send e-mail)
>
> I'd check „getent“ output, not /etc/passwd directly:
>
> exim -be '${extract{4}{:}{${run{/usr/bin/getent passwd heiko}{$value}}}}'
>
> If you use the lookup as above, the key (local_part) will not be
> returned, thus you need to extract the 3rd field, not the 4th one:
>
> exim -be '${extract{3}{:}{${lookup{heiko}lsearch{/etc/passwd}}}}'


Even better:

exim4 -be '${extract{3}{:}{${lookup passwd {heiko}}}}

    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
-- 
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann HS12-RIPE -----------------------------------------
 gnupg encrypted messages are welcome - key ID: 48D0359B ---------------
 gnupg fingerprint: 3061 CFBF 2D88 F034 E8D2  7E92 EE4E AC98 48D0 359B -