Help with LOCAL_CONFIG with LDAP setup

700x23 at gmail.com 700x23 at gmail.com
Wed Jul 11 01:53:32 CEST 2012


I have been using the following LOCAL_CONFIG to validate local addresses
and aliases but am switching to LDAP to manage users and aliases and am
having troubles getting this to work.  I am using a dual-sendmail
environment with amavisd and need the rx-side to validate local users and
aliases before sending to amavisd.

Old sendmail-rx.mc:
**********
LOCAL_CONFIG
Kaliasp hash -m /etc/aliases
Kuserp user -m

LOCAL_RULESETS
SLocal_check_rcpt
R$*             $: <?> $&{rcpt_addr}
R<?> $+ @ $=w   $: <@> $1                               mark local address
R<?> $* @ $*    $@ OK                                   ignore remote
address
R<?> $+         $: <@> $1                               mark unqualified
user
R<@> $+ + $*    $: < $(aliasp $1+$2 $: @ $) > $1 + *    plussed alias?
R<@> $+ + $*    $: < $(aliasp $1+$2 $: @ $) > $1        +* alias?
R<@> $+         $: < $(aliasp $1 $: @ $) > $1           normal alias?
R<@> $+         $: < $(userp $1 $: @ $) > $1            system user?
R<@> $+         $#error $@ 5.1.1 $: "550 User unknown"  nope, go away
**********

New sendmail-rx.mc:
**********
LOCAL_CONFIG
Kaliasp ldap -1 -T<TMPF> -v mailRoutingAddress -k
(&(objectClass=nisMailAlias)(cn=%0))
Kuserp ldap -1 -T<TMPF> -v mailRoutingAddress -k
(&(objectClass=person)(uid=%0))

LOCAL_RULESETS
SLocal_check_rcpt
R$*             $: <?> $&{rcpt_addr}
R<?> $+ @ $=w   $: <@> $1                               mark local address
R<?> $* @ $*    $@ OK                                   ignore remote
address
R<?> $+         $: <@> $1                               mark unqualified
user
R<@> $+ + $*    $: < $(aliasp $1+$2 $: @ $) > $1 + *    plussed alias?
R<@> $+ + $*    $: < $(aliasp $1+$2 $: @ $) > $1        +* alias?
R<@> $+         $: < $(aliasp $1 $: @ $) > $1           normal alias?
R<@> $+         $: < $(userp $1 $: @ $) > $1            system user?
R<@> $+         $#error $@ 5.1.1 $: "550 User unknown"  nope, go away
**********

I am using LAM to manage users and email aliases on the LDAP server (read:
default schema), so aliases have objectClass=nisMailAlias with
cn=aliasname.  Users have objectClass=person with uid=username and mail=
username at domainname.com, and possibly (multiple) mailLocalAddress=
useralias at domainname.com.

Any ideas on how to get the ruleset to work with LDAP?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.amavis.org/pipermail/amavis-users/attachments/20120710/044b7a71/attachment.html>


More information about the amavis-users mailing list