I was curious if anyone has implemented a mechanism in sendmail to determine
if a user is over their Cyrus quota before attempting LMTP delivery of the
message. If so, how was it impemented?
You can use the Sendmail Socket Map Daemon (smmapd) that I wrote for Cyrus. It should be part of 2.2.3. In order to use this, you'll have to be running Sendmail 8.13 or get the patch for 8.12:
http://www.sendmail.org/~ca/email/patches/sendmail-8.12.7-socketmap-v4.patch
The daemon verifies the existence of the rcpt, the ACL and the quota at the RCPT TO time of the SMTP exchange. For me, its cut down on a HUGE amount of garbage destined for non-existent users, thus eliminating the outgoing bounce messages.
In our environment, I would have to say that easily, 3/4ths of all our e-mail
hitting the LMTP server is over-quota'd e-mail.
What I have done is to create a new hash file called /etc/mail/overquota.db that gets updated periodically (once an hour or maybe even less) with the list of users currently over their quota's. I then modified the sendmail queuegroup rules to check for the existence of a user in that hash file and move then to the overquota queue if so.
I find this better than dumping all e-mail destined for local delivery to
the cyrus queue, and then using a queue mover to find all the messages that
had attempted LMTP delivery, but failed with an "Over quota" message. That
turns out to be very expensive with regards to disk I/O and CPU utilization.
Also, if anyone else has other interesting ideas on how they handle lots
of over quota e-mail (besides shortening the time that e-mail is kept on the
server or rejecting that e-mail outright), I would be interested in hearing
about it.
Scott
-- Kenneth Murchison Oceana Matrix Ltd. Software Engineer 21 Princeton Place 716-662-8973 x26 Orchard Park, NY 14127 --PGP Public Key-- http://www.oceana.com/~ken/ksm.pgp --- Cyrus Home Page: http://asg.web.cmu.edu/cyrus Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html