next up previous
Next: Changes In Sendmail-8.10.0 Up: Extending Internet Services Via Previous: Sample SENDMAIL #2 LDAP

Sample Sendmail Coding

Five basic additions are made to the sendmail.cf configuration file:
  1. DLluser ($L (LUSER_RELAY) macro)
  2. Sendmail LDAP ``map'' declaration. The LDAP search key and attribute to return are specified with the -k and -v parms:
    Kluser ldap
    -h""
    -k"cn=%s" -vmail
    -b"o=,c=US"
    
  3. in Ruleset 5, the ``send unrecognized local users to a relay host'' rule is activated and the following rule is added following it, which tells Sendmail to make an LDAP connection and search if the ``local'' user is not found in the server password file/user database (luser is the LDAP ``map'').
    R< $L > 	$+ $: < $L > $(luser $1 $)
    
  4. in Rulest 98, two rules are added: one for the ``local'' mailing lists, the other for the dotted ``local'' userids:
    # look for any (rfc822mailgroup)
    # .mlist, via Mail500
    R$- . mlist <@ $=w .>	 $* $#mail500 $@$2 $: <$1>
    
    # anything like .
    # at  send to MAIL500
    R$- . $- <@ $=w .>	 $* $#mail500 $@$3 $: <$1.$2>
    
  5. lastly, the MAIL500 definition which specifies the location of the executable
    Mmail500, 	P=/usr/local/libexec/mail500, F=DFMSmnXuh,
    		A=mail500 -f $f -h $h -m $n@$w $u
    
Some of the benefits and caveats:

Jim Dutton
2000-05-07