Re: [exim] mime_part_count acl

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Michael Haardt
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] mime_part_count acl
On Wed, Jul 27, 2005 at 04:30:42PM -0400, Jeff wrote:
> mime_part_count:
>
> deny
>   condition   = ${if >{$mime_part_count}{5}{yes}{no}}
>   message     = Too many MIME parts (max 5)
>   log_message = DENY: MIME Error (Too many MIME parts: $mime_part_count)


See section 40.3:

$mime_part_count: This variable is a counter that is raised for each
processed MIME part. It starts at zero for the very first part (which is
usually a multipart). The counter is per-message, so it is reset when
processing RFC822 attachments (see $mime_is_rfc822). The counter stays
set after acl_smtp_mime is complete, so you can use it in the DATA ACL to
determine the number of MIME parts of a message. For non-MIME messages,
this variable contains the value -1.

This acl rule should work, using a ACL variable to count parts:

  deny    set acl_c1 = ${eval: $acl_c1+1}
          message = "Too many attachments"
          condition = ${if >= {$acl_c1}{200}{1}{0}}


Two additional variables for the total number of parts and the nesting
depth would be helpful indeed.

Michael