[Mimedefang] RE:Email attachment size

Fernando Gleiser fgleiser at cactus.fi.uba.ar
Fri Sep 9 20:06:45 EDT 2005


On Fri, 9 Sep 2005, Pramod Anugu wrote:

> The below does limit for every users. But I need to limit for certain users
> 5 MB, For some users 20 MB and for some 50MB.
> thanks


I do the following on one of my customer's mailservers. It isn't exactly
what you want (I limit by attach size, not whole message) but it may
give you a starting point. Users rick and jack aren't allowed to receive
attachements bigger than $maxsize, so I add the following lines to
filter() just before the last 'return action_accept();':



     $size = (stat($entity->bodyhandle->path))[7];
     if ($size > $maxsize) {
             foreach $user (@Recipients) {
                     if ( ($user =~ /^rick/) || ($user =~ /^jack/)) {
                             return action_bounce("Message size exceeds maximum".
                                 "allowed");
                     }
              }
      }

Those are from the top of my head, I may be getting something wrong, it's 
Friday night and I've had a terrible week :)


 			Fer



More information about the MIMEDefang mailing list