Pages: 1
RSS
Filtering symbols in file names when writing attachments, How to filter symbols in %OSUBJ when using said parameter for naming directories?
 
I have a filter defined that writes attachments to directory blablabla/%OSUBJ if certain messages from certain clients contain attachments. This works, except when %OSUBJ contains symbols that are not allowed in directory names, like : and '

How do I filter these symbols? I'll need to put something around %OSUBJ, but what?

Also, I need to make sure the directory names do not become too long, so an instruction to truncate the directory name to say 50 characters would be welcome.
Edited: Loek van Kooten - 04 November 2013 11:00:15
 
For the filtering, although you cannot iterate regular expressions, if you have a maximum number of offenders, you could accomplish the same thing as follows.  Create a quick template called "test2" as shown below.
Code
%_rc2=#%SETPATTREGEXP="(.*?)(%_rre)(.*)"%REGEXPBLINDMATCH="%_rc1"%SUBPATT="1"%SUBPATT="3"#%-
%IF:"%_rc2">"":%_rc1=%_rc2%-
You can then accomplish your task with the following quick template.
Code
%_rre="[^\w\d ]"%-
%_rc1="%OSUBJ"%-
%QINCLUDE="test2"%-
%QINCLUDE="test2"%-
%QINCLUDE="test2"%-
%QINCLUDE="test2"%-
%QINCLUDE="test2"%-
%QINCLUDE="test2"%-
%QINCLUDE="test2"%-
%_rc1
Mike
Pages: 1