Problem with SpamAssassin and LDAP

Hi,

I try to integrate Messaging Server with SpamAssassin.

I need to load white lists and required scores from LDAP.

In debug output from spamd I have:

ldap: entering handle_user_ldap(nobody)

config: load_scoreonly_ldap(nobody)

ldap: URL is ldap://192.168.90.116:2389/ou=People,o=eranet.pl,o=eranet.pl?spamassassin?sub?u id=__USERNAME__

ldap: host=192.168.90.116, port=2389, base='ou=People,o=eranet.pl,o=eranet.pl', attr=spamassassin, scope=sub, filter='uid=nobody'

In spamd.log is:

info: spamd: checking message <fcf9f351df6.44be03d0@eranet.pl> for (unknown):0

Why username is 'nobody' and not mail-to user?

What I need to configure to get proper username?

Any ideas?

Best regards,

e4rd

[803 byte] By [e4rd] at [2007-11-26 9:50:52]
# 1
It might help if you gave versions, and the basic setup you have.As far as I know, if you use the built-in integration of SpamAssassin, you cannot use the ldap callout for whitelists and such.
jay_plesset at 2007-7-7 1:02:47 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 2

Hi,

I'm using Messaging Server version 6.2-6.01.

I send you my basic setup.

What information do you need more?

option.dat

! MTA configuration options

!

! This sets the alias resolution order

!8 = Use ALIAS_URL0

!7 = Use ALIAS_URL1

!6 = Use ALIAS_URL2

!4 = Use the alias file

ALIAS_MAGIC=8764

ALIAS_URL0=ldap:///$V?*?sub?$R

USE_REVERSE_DATABASE=4

REVERSE_URL=ldap:///$V?$N?sub?$R

USE_DOMAIN_DATABASE=0

! MISSING_RECIPIENT_POLICY controls how illegal headers that don't

! contain any To:, Cc:, or Bcc: fields are handled for channels that

! do not have their own explicit missingrecipientpolicy keyword set.

! The default of 0 means that the envelope addresses are used to

! construct a valid To: header field. This default behavior tends

! to be especially appropriate for the tcp_local channel.

MISSING_RECIPIENT_POLICY=0

MISSING_RECIPIENT_GROUP_TEXT=Undisclosed recipients

ALIAS_DOMAINS=6

!

LDAP_SCHEMALEVEL=1

!

VACATION_TEMPLATE=file:///opt/SUNWmsgsr/data/vacation/$3I/$1U/$2U/$U.vac

! for Spamassassin

spamfilter1_config_file=/opt/SUNWmsgsr/config/spamassassin.opt

spamfilter1_library=/opt/SUNWmsgsr/lib/libspamass.so

spamfilter1_optional=1

spamfilter1_string_action=data:,require "fileinto"; fileinto "$U";

LDAP_OPTIN1=SpamAssassin

- -

spamassassin.opt

host=127.0.0.1

port=783

mode=0

verdict=spam

debug=1

-

local.cf

# This is the right place to customize your installation of SpamAssassin.

#

# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be

# tweaked.

#

# Only a small subset of options are listed below

#

###########################################################################

#Add *****SPAM***** to the Subject header of spam e-mails

#

rewrite_header Subject *****SPAM_TEST*****

#Save spam messages as a message/rfc822 MIME attachment instead of

#modifying the original message (0: off, 2: use text/plain instead)

#

# report_safe 1

#Set which networks or hosts are considered 'trusted' by your mail

#server (i.e. not spammers)

#

# trusted_networks 212.17.35.

#Set file-locking method (flock is not safe over NFS, but is faster)

#

# lock_method flock

#Set the threshold at which a message is considered spam (default: 5.0)

#

required_score 5.5

#Use Bayesian classifier (default: 1)

#

# use_bayes 1

#Bayesian classifier auto-learning (default: 1)

#

# bayes_auto_learn 1

#Set headers which may provide inappropriate cues to the Bayesian

#classifier

#

# bayes_ignore_header X-Bogosity

# bayes_ignore_header X-Spam-Flag

# bayes_ignore_header X-Spam-Status

user_scores_dsn

ldap://192.168.90.116:2389/ou=People,o=eranet.pl,o=eranet.pl?spamassassin?sub?u id=__USERNAME__

user_scores_ldap_usernamecn=Directory Manager

user_scores_ldap_passwordpass

e2rd at 2007-7-7 1:02:47 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 3

Due to the way Messaging presents mail to SA (a list of names getting a mail is only given to SA one time), there really isn't a way to configure our integration to do ANYTHING specific, based on ldap attributes, or anything else in SA.

You can configure sieve filters to work on headers, after SA runs, and adds headers, though.

What you're describing just cannot be done. The performance penalty would be too severe to be acceptable, in the opinion of our developers.

jay_plesset at 2007-7-7 1:02:47 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...