procmail
[Top] [All Lists]

Re: Size restrictions?

2001-08-31 08:46:38
On Wed, Aug 29, 2001 at 10:26:30AM -0700, Ashley M. Kirchner wrote:

    Can procmail be used to restrict the size email a particular user
can receive?  I can't do it through sendmail (I don't think) unless it
gets applied to the entire domain, which I don't want to do.  Some
accounts has to be able to receive large files, but for almost everyone
else, I need to restrict it.

    What I'd like to do is have system wide recipe that checks for a)
users whose email are restricted (possibly through some flat file), b)
if a match is made, a message be returned to the sender, explaining that
their message got rejected due to the size, and at the same time,
redirect the original (large) message to /dev/null, and c) on no match,
allow the message through to the final recipient.

Here's an idea (untested, of course):

# if email account isn't allowed to receive big messages,
# generate an autoreply
:0h
* > 200000
* ! ^X-Loop: some(_at_)where
* ! ? $FORMAIL -XFrom: -XSender: | $FGREP -i .restricted.accounts
| (formail -r -A "X-Loop: some(_at_)where"; \
   echo "Angry SysAdmin says: Message too big!") \
   | $SENDMAIL $SENDMAILFLAGS -t

-- 
- Matt Dunford <> zoot(_at_)zotikos(_dot_)com ..
-. www.zotikos.com -- o,;-
        
The enemy's spies who have come to spy on us
must be sought out, tempted with bribes, led away and
comfortably housed.  Thus they will become converted
spies and available for our service.
   -- Sun Tzu, Art of War
--
_______________________________________________
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>