Hi Jason and All,

Late last year I posted an email to the list stating a problem I was having
with TMDA and how it worked with our system which has a quota limits in
place on our NetApp filer. (see
http://mla.libertine.org/tmda-users/2003-12/msg00073.html)

The problem being if a user was over quota (used up all their disk space),
TMDA would barf an error into logfile.debug, and the incoming email would go
back into the mail queue, until it could be delivered (when the user had
gone back down under quota - deleted some stuff).

This was causing the load on our mailservers to increase rapidly (ie: up to
6-7 every time the queue was being processed full off these emails that
couldn't be sent to over-quota mailboxes).

Now I've got around this but modifying the code in 3 files, tmda-rfilter,
Util.py, and MessageLogger.py , and fixed it so that when TMDA either tries
to write to a log entry (and fails cause the disk is full), or tries to
write the email to the pending folder (and fails cause the disk is full),
then TMDA sends a bounce message back to the sender using TMDA's bouncegen()
function in tmda-rfilter.

Although if TMDA barfs an error if it can't open a file for writing, this
might not mean the disk is full / quota used. But this is the only
workaround I can see. As it was not possible to put some type of "disk
quota" check script that was called before tmda was called in .procmailrc
or in .forward. As the filer runs NetApp quota system.

If anyone is interested, here are the diff's on those 3 files, from the
current TMDA version 1.0 . It maybe of use to someone, or Jason you might
want to take these changes and make something a little bit more usuable be
everyone. ( I could help with this). Maybe write another check function,
that acts upon different error msgs, like the one I use to get in my
logfile.debug: [Errno 122] Disk quota exceeded


Diffs:
redsky:/local/tmda-1.0# diff -w
~mike/work/tmda_1.0/tmda-1.0/bin/tmda-rfilter bin/tmda-rfilter
348c348,352
<         logger.write()
---
>         quota_exceeded = logger.write()
>         if quota_exceeded == 'yes':
>             bouncetext = 'User has exceeded their disk usage'
>             bouncegen('bounce', bouncetext)
>             mta.stop()
678c682,686
<     Util.writefile(pending_contents, fn)
---
>     quotaexceeded = Util.writefile(pending_contents, fn)
>     if quotaexceeded == 'yes':
>         bouncetext = 'User has exceeded their disk usage'
>         bouncegen('bounce', bouncetext)
>         mta.stop()


redsky:/local/tmda-1.0# diff -w ~mike/work/tmda_1.0/tmda-1.0/TMDA/Util.py
TMDA/Util.py
402a403
>         try:
405a407,409
>         except:
>             quota_exceeded = 'yes'
>             return quota_exceeded



redsky:/local/tmda-1.0# diff -w
~mike/work/tmda_1.0/tmda-1.0/TMDA/MessageLogger.py TMDA/MessageLogger.py
44a45
>         try:
45a47,49
>         except:
>             # just to fill in - does nothing
>             quota_exceeded = 'yes'
59a64
>       try:
81a87,89
>       except:
>             quota_exceeded = 'yes'
>             return quota_exceeded




Regards
Mike Usmar
Web Developer
Actrix Networks Ltd
[EMAIL PROTECTED]
0800 ACTRIX (228749) - ext 411
____________________________

_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users

Reply via email to