[Mimedefang] maintaining state - per message custom variables
Yizhar Hurwitz
yizhar at mail.com
Tue Oct 10 16:56:20 EDT 2006
HI.
I would like to start using my custom variables in mimedefang-filter.
I have read "man mimedefang-filter => MAINTAINING STATE" section,
and I would like to ask your confirmation if I got it right.
I plan to use a custom array, that I will:
1. clear in "filter_begin".
2. Optionally write something to it in "filter".
3. Check in "filter_end" if it is not empty, and do something.
As far as I understand, this is OK because all those functions will run
by the same process - is it right?
What I plan to do is my custom replacement to "action_replace_with_url",
which will do something like that:
filter_begin:
=======
@detached_files = ();
sub filter:
======
if (......) {
# copy the file to someplace...
push (@detached_files, 'link to the file');
}
filter:
====
if (@detached_files > 0) {
# Use append_text_boilerplate + append_html_boilerplate to add links
to the detached files.
}
I need the links to files that I detach, to be visible *and clickable*
in MS Outlook 2003 clients,
and I have tested both "action_replace_with_url" and
"action_drop_with_warning" to find that they don't produce a clickable
inline link,
so I'm trying to do it my own way.
Did I understand correctly the "maintaining state" section, and does my
sample code look OK?
Thanks,
Yizhar Hurwitz
http://yizhar.mvps.org
More information about the MIMEDefang
mailing list