[Mimedefang] howto add another recpient when email's size bigger that X vale

Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de
Wed Sep 28 09:39:53 EDT 2005

On Wed, 28 Sep 2005, Anton Kudris wrote:

> I think I need to add few lines to filter_end() like these
> my $x = 5120; #bytes
> if (message_size() >= $x) {
>  add_recipient('bigemails at mailbox.ru');
> }
> but I don't know how to write message_size() function... Or is there
> any $MsgSize variable avialable?

Check out the sample filter, esp. the code snippet:

     # Spam checks if SpamAssassin is installed
     if ($Features{"SpamAssassin"}) {
         if (-s "./INPUTMSG" < 100*1024) {
             # Only scan messages smaller than 100kB.  Larger messages
             # are extremely unlikely to be spam, and SpamAssassin is
             # dreadfully slow on very large messages.

2nd if() probes the message size.


Steffen Kaiser

More information about the MIMEDefang mailing list