procmail
[Top] [All Lists]

force maximum mailbox size limit

2000-11-07 04:17:43
At 11:40 PM 3/11/2000, David Stern wrote:
On Fri, 3 Nov 2000, Stuart Clark wrote:

> Hey,
>
> I was wondering how to bounce a message that was delivered to a mailbox
> that had exceeded a certain size.  I am delivering mail into
> /var/spool/mail/m/a/mailbox so the quota feature in procmail (from
> filesystem) will not apply.

Aside from the procmail method, you could also modify /etc/mail/sendmail.cf
O MaxMessageSize=100000000. I mention this simply because it's more expensive
(CPU-wise) to have it go thru sendmail and procmail before it gets rejected.


Thanks to those who pointed out the MaxMessageSize option in Sendmail. I do use this.

Perhaps I did not explain my problem correctly, I apologise.
I am interested in testing the size of the mailbox itself, not the incoming message. If the mailbox exceeds a certain size (40MB) then an error will be sent and the mailbox will not be appended to.

My testing.rc file has:

MAILBOX_=`echo ${LOGNAME} | sed 's/^\(.\)\(.\)\(.*\)$/\/var\/spool\/mail\/\1\/\2\/\1\2\3/'`
MAILBOX_SIZE_=`ls -l ${MAILBOX_} | awk '{print $5}'`
LOG="--- Logging ${LOGFILE} for ${LOGNAME}, Mailbox=${MAILBOX_}, Size=${MAILBOX_SIZE_}
"


Which will log the following fine:

procmail: Assigning "INCLUDERC=/etc/procmail/testing.rc"
procmail: Executing "echo ${LOGNAME} | sed 's/^\(.\)\(.\)\(.*\)$/\/var\/spool\/mail\/\1\/\2\/\1\2\3/'"
procmail: Assigning "MAILBOX_=/var/spool/mail/m/i/miltest"
procmail: Executing "ls -l ${MAILBOX_} | awk '{print $5}'"
procmail: Assigning "MAILBOX_SIZE_=23702"
procmail: Assigning "LOG=--- Logging /etc/procmail/log for miltest, Mailbox=/var/spool/mail/m/i/miltest, Size=23702
"
--- Logging /etc/procmail/log for miltest, Mailbox=/var/spool/mail/m/i/miltest, Size=23702
procmail: No match on "^Subject:.*test"
procmail: Assigning "PATH=/bin:/bin:/usr/bin:/usr/local/bin:/usr/bin/X11"
From root(_at_)milly-test(_dot_)tpgi(_dot_)com(_dot_)au  Tue Nov  7 19:56:47 
2000
Folder: /var/spool/mail/m/i/miltest 386


How can I do a conditional test, not on the header or body, but on the variable ${MAILBOX_SIZE_}, then reject the message if ${MAILBOX_SIZE_} is greater than 40000000 bytes?


Thanks again,  Stuart.


P.S. filesystem quota will not work since all users share the same UID and GID (If this is not correct please let me know :)

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>