[Mimedefang] Change "warning1.txt" attachment name when using	action_replace_with_url
    David F. Skoll 
    dfs at roaringpenguin.com
       
    Thu Dec 16 11:00:58 EST 2004
    
    
  
On Thu, 16 Dec 2004, Administrador DyR wrote:
> We, as a small ISP, would like to insert some kind of rich text in this
> message,
Please don't do this.  Rich text in e-mail is only helpful to spammers
who want to evade filters.
> These are two different problems (the name of the message replacing the
> attachment, and the type of the attachment). The first one is more
> important than the second...
Here's an evil way to do it -- evil because you are fooling around with
internals of MIMEDefang that might change...
sub filter {
   # .. whatever
   if (condition) {
      action_replace_with_url(...);
      $ReplacementEntity->mime_attr("Content-Type.name" => "Your Name Here");
      $ReplacementEntity->mime_attr("Content-Disposition.filename" => "Your Name Here");
      return;
   }
   # ...
}
This uses the UNDOCUMENTED fact that action_replace_with_url just sets
a flag and builds an entity in the global variable $ReplacementEntity.
Regards,
David.
    
    
More information about the MIMEDefang
mailing list