Grabbed this from an old post in 2004. I'm wondering if it will work in the current 7.X SME?
--
DancesWithWords
#!/bin/sh
#
# Update the spamassassin whitelist with the contents of our ldap addessbook
#
cd /etc/e-smith/templates-custom/etc/mail/spamassassin/local.cf
if [ -e 60ldap_whitelist ]; then
rm -f 60ldap_whitelist
fi
touch 60ldap_whitelist
echo "#" >> 60ldap_whitelist
echo "# whitelist derives from the LDAP directory" >> 60ldap_whitelist
echo "#" >> 60ldap_whitelist
ldapsearch -x -h localhost -b "dc=<UPDATE_THIS>,dc=<UPDATE_THIS>,dc=<UPDATE_THIS>" -S "mail" \
'mail=*' | grep mail: | sed 's/mail: /whitelist_from /' >> 60ldap_whitelist
echo "#" >> 60ldap_whitelist
echo "# ldap whitelist finished" >> 60ldap_whitelist
echo "#" >> 60ldap_whitelist
echo "" >> 60ldap_whitelist
# expand the spamassassin local.cf
/sbin/e-smith/expand-template /etc/mail/spamassassin/local.cf
# restart spamassassin
service spamassassin restart