Sean Kennedy wrote:
I am setting up an anti-spam layer for my users. Each user has
preferences stored in LDAP. Individual users should be able to control
turning spam filtering on/off, virus filtering on/off, message handling
(tagged or quarantined?), the aggressiveness of spamassassin, and have
white/black lists.
What happens when a given e-mail contains two users within your system
with extremely different configured options? What you are describing is
very difficult to handle [efficiently] at the MTA level, but may be more
tenable at the MDA (Delivery Agent) level (where each delivery is to a
single address). Gavin Carr has developed a per user config plugin, but
I don't think it is current (it targets 0.28 or 0.27.1):
http://www.openfusion.com.au/labs/qpsmtpd/
so this may give you some ideas. If I remember correctly, he gets
around the issue I mention above by forcing the remote MTA to send
messages one RCPT at a time (using 4xx errors).
But anyway... something else I'd kinda like to do is have my plug-in
somehow make a persistent connection to LDAP so that connections aren't
created/destroyed for EVERY message coming through. Would that be
possible?
It depends completely on which server mode you are running Qpsmtpd
under: tcpserver creates a new instance for each connection (so you
can't have a persistent connection there); fork-server creates a new
forked object for each connection (so you could have a persistent
connection at the parent level, but then how to you handle contention);
under Qpsmtpd::Apache, the LDAP object could be loaded by the Apache
server (but again I don't know about contention issues).
John