[Mimedefang] Change "warning1.txt" attachment name when using action_replace_with_url
Renaud PASCAL
renaud.pascal at atosorigin.com
Thu Dec 16 10:56:54 EST 2004
Le Jeudi 16 Décembre 2004 16:32, Administrador DyR a écrit :
> El jue, 16-12-2004 a las 15:12 +0100, Renaud PASCAL escribió:
> > Le Jeudi 16 Décembre 2004 13:58, Administrador DyR a écrit :
> > > In my firm, we would like to introduce HTML in the
> > > replacing-attachment,
> >
> > Ouch !
> >
> > > and translating the name (some of our customers don't open
> > > "warning1.txt" thinking it's a mail-virus, or something so).
> >
> > Hum, and these `customers' wouldn't mind to open an HTML,
> > let's say <DrinkMe.html> or <EatMe.html> ???
>
> They are two different issues: the name of the attachment, and the type
> of it.
>
> First: the name. Actually i want to translate the name "warning1.txt"
> into Spanish, and improve it a bit: instead of "Warning1.txt" it could
> be "Link to filtered attached file.txt" (in Spanish).
OK, then I guess you'll have to adapt a bit this part of mimedefang.pl :
where it dwells with the mime parms of the added part,
(check yours, this one's form 2.48) :
sub action_replace_with_warning ($) {
my($msg) = @_;
return 0 if (!in_filter_context("action_replace_with_warning"));
$Actions{'replace_with_warning'}++;
$Action = "replace";
$ReplacementEntity = MIME::Entity->build(Type => "text/plain",
Encoding => "-suggest",
Data => [ "$msg\n" ]);
$WarningCounter++;
$ReplacementEntity->head->mime_attr("Content-Type.name" => "MY_SPANISH_NEW_WARNING_NAME$WarningCounter.txt");
$ReplacementEntity->head->mime_attr("Content-Disposition" => "inline");
$ReplacementEntity->head->mime_attr("Content-Disposition.filename" => "MY_SPANISH_NEW_WARNING_NAME$WarningCounter.txt");
return 1;
}
More information about the MIMEDefang
mailing list