Re: Writing attachments

2013-11-11 Thread Konrad Szkudlarczyk
Hello, Loek

 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.

 I  can find the needed directory names also in the mails themselves,
 but SETPATTREGEXP etc. don't seem to work either.

 Anything else I can do?

Look at this template (version for testing and understanding):

%_TOREPLACE='te'sta':tor::%-
%_illchars=`\\\:\\/\\\|\'`%-
%SETPATTREGEXP=(?ms)^([^%_illchars]*)([%_illchars]*|\z)([^%_illchars]*)([%_illchars]*|\z)([^%_illchars]*)([%_illchars]*|\z)([^%_illchars]*)([%_illchars]*|\z)%-
%REGEXPBLINDMATCH(%_TOREPLACE)%-
%_OUTPUT=%SUBPATT(1)%SUBPATT(3)%SUBPATT(5)%SUBPATT(7)%-
TOREPLACE: %_TOREPLACE
OUTPUT: %_OUTPUT
%_LONGTEXT=1234567890123%-
%_LIMIT=5%-
%SETPATTREGEXP=(?ms)^(.{0,%_LIMIT})%-
%REGEXPBLINDMATCH(%_LONGTEXT)%-
%_SHORTTEXT=%SUBPATT(1)%-
LONGTEXT: %_LONGTEXT
LIMIT: %_LIMIT
SHORTTEXT: %_SHORTTEXT

First Regexp remove 4 illegal characters from %_TOREPLACE (or more, if
those characters are together). If You want to remove more, You'll need
add new  ([^%_illchars]*)([%_illchars]*|\z)  in %SETPATTREGEXP and
new %SUBPATT(9/11/13...) in %_OUTPUT. You could also use %XMP_StrRepl
from XMP plugin - this is a better version, but You must to install
this plugin

%_TOREPLACE(%OSUBJ)%-
%_TOREPLACE(%XMP_StrRepl(%_TOREPLACE,'',))%-
%_TOREPLACE(%XMP_StrRepl(%_TOREPLACE,'',))%-
%_TOREPLACE(%XMP_StrRepl(%_TOREPLACE,':',))%-
%_TOREPLACE(%XMP_StrRepl(%_TOREPLACE,'',))%-
%_TOREPLACE(%XMP_StrRepl(%_TOREPLACE,'/',))%-
%_TOREPLACE(%XMP_StrRepl(%_TOREPLACE,'\',))%-
%_TOREPLACE(%XMP_StrRepl(%_TOREPLACE,'|',))%-
%_TOREPLACE(%XMP_StrRepl(%_TOREPLACE,',))%-
Done: %_TOREPLACE%-


In the second half of template is a regexp to limit the length of
output (based on variable %_LIMIT).

Now all You must to do is to create a quick template with handle - for
example - 'spsubj' and with this content:

%_TOREPLACE=%OSUBJ%-
%_illchars=`\\\:\\/\\\|\'`%-
%SETPATTREGEXP=(?ms)^([^%_illchars]*)([%_illchars]*|\z)([^%_illchars]*)([%_illchars]*|\z)([^%_illchars]*)([%_illchars]*|\z)([^%_illchars]*)([%_illchars]*|\z)%-
%REGEXPBLINDMATCH(%_TOREPLACE)%-
%_OUTPUT=%SUBPATT(1)%SUBPATT(3)%SUBPATT(5)%SUBPATT(7)%-
%_LIMIT=40%-
%SETPATTREGEXP=(?ms)^(.{0,%_LIMIT})%-
%REGEXPBLINDMATCH(%_OUTPUT)%-
%SUBPATT(1)%-

This template will remove illegal characters from %OSUBJ (if not all
of them, then add more parenthesis to regexp, as I described above, or
use XMP) and will truncate a length of %OSUBJ to 40 characters. Now
all You must to do is to add %QINCLUDE(spsubj) to path in Extract
Attachments action in filter, from blablabla/%OSUBJ to
blablabla/%QINCLUDE(spsubj).

-- 
Pozdrowienia,
 Konrad Szkudlarczyk



Current version is 5.2.2 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: txt2html.regexps

2006-09-30 Thread Konrad Szkudlarczyk
Hello, Peter. On the thirtieth September 2006 You wrote:

 This  is  kind  of neat. One problem, I see bold correctly and also
 underlined, but I see italics with the slashes before and after.

Stuart, look at my reply to Richard.

 Neat  indeed.  And  available  for almost a year now, judging by the
 post date on http://www.batboard.net/index.php?topic=5329.0.

 Ok, what I did:
 -  grab thefilefrom
http://www.batboard.net/index.php?topic=5329.0
 -  added the lines Konrad posted to the end of the file

You are mixed two files, each of them making a serious changes in
message. txt2html.regexps should be created very carefully.

But - maybe You found a bug in my idea. Please, send Your file
txt2html.regexps. My ambition is to create text styles steady as rock.

-- 
Regards
Konrad Szkudlarczyk


--
Dziewczyny Paryza  http://link.interia.pl/f19a3 



Current version is 3.85.03 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: txt2html.regexps

2006-09-30 Thread Konrad Szkudlarczyk
Hello, Richard. On the thirtieth September 2006 You wrote:

 I  don't  have  white  as my background colour but couldn't find the
 colour  designation  so just left the white bit in and my background
 colour is still there.

Many programs for webmasters and graphic programs (or plain dec=hex
conventer) could help to find a value of colour. But You could simply
add to the file txt2html.regexps two lines for a moment:

\=lt;
\=gt;

You will see, that displayed text will change to the html source, and
will find a style definition for the BODY, with specified
background-color.

 In  your  example  (and mine on looking at it in the outbox) the /
 are still either side of the /italics/ word, even though the word is
 shown in italics. The *bold* and _underline_ work fine though.

When TB! displays italics sometime last letter is cut. If You want see
that, change the last line from my first mail to this:

(?i)((?![a-z\d\\:\/])\/(?![\s\/]|[\*\_]\s)(.*?[a-z\d].*?)(?![\\:\/\s])\/(?![a-z\d\\]))=span
 class=onpx//spani\2/ispan class=onpx//span


/bad/ /P/ /Q/ /w/

For me this is unacceptable disadvantage, so i kept slashes.

-- 
Regards
Konrad Szkudlarczyk


--
Jestes kierowca? To poczytaj!  http://link.interia.pl/f199e



Current version is 3.85.03 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: txt2html.regexps

2006-09-30 Thread Konrad Szkudlarczyk
Hello, MAU. On the thirtieth September 2006 You wrote:

 The file I use is much simpler:

 ([\s']*)\*([\w\s\+/\-\.\:\\_']*)\*(\s)=\1b\2/b\3
 ([\s']*)/([\w\s\+\-\.\:\\_']*)/(\s)=\1i\2/i\3
 ([\s']*)_([\w\s\+/\-\.\:\\']*)_(\s)=\1u\2/u\3

 and it works just the same for italics, bold and underline.

Simpler, but has many shortcomings:
1) doesn't works with national characters;
2) when You copypaste text with control characters they would gone,
   that means before You copypaste any code, content of TB's filter,
   or simple regexp as above, You must to disable smileys. My solution
   is, I hope, safer;
3) before first control character must be space or quotation marks,
   and after must be space;
4) some */nested/* tags doesn't works;
5) ascii-art in Leif Gregory's signature is displayed incorrect (final
   test :-)).

-- 
Regards
Konrad Szkudlarczyk


--
Dziewczyny Paryza  http://link.interia.pl/f19a3 



Current version is 3.85.03 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: txt2html.regexps

2006-09-30 Thread Konrad Szkudlarczyk
On the thirtieth September 2006 I wrote:

 If You have comments or ideas, and especially when You find any bug,
 please give me an info.

First errors appears (thank You, Alexander):
mid:[EMAIL PROTECTED] and
mid:[EMAIL PROTECTED], problem with nested
special characters. _First _second third_ - I want to underline
second third. To do this I must be sure, that between special
characters don't appears the same special character.

Because in htmltags are used slashes, we must remember to put line
with regexp for underlines above lines for * and _. If between
slashes is link, this regexp will not works.

Below is corrected version of my txt2html.regexps file.


First line, as always, is style:

(\STYLE type.\text\/css\\)=\1 span.onpx{font-size:1px;color:white}


*Second* line (italics), if we want to *hide slashes*:

(?i)((?![a-z\d\\:\/])\/(?![\s\/]|[\*\_]\s)([^\/\n]*?[a-z\d][^\/\n]*?)(?![\\:\/\s])\/(?![a-z\d\\]))=span
 class=onpx//spani\2/ispan class=onpx//span


*Second* line (italics), if we want to *see slashes*:

(?i)((?![a-z\d\\:\/])\/(?![\s\/]|[\*\_]\s)([^\/\n]*?[a-z\d][^\/\n]*?)(?![\\:\/\s])\/(?![a-z\d\\]))=i\1/i


Third and fourth lines (underline and bold):

(?i)((?![a-z\d\\:])\*(?![\s\*]|[\_\/]\s)([^\*\n]*?[a-z\d][^\*\n]*?)(?![\\:\*\s])\*(?![a-z\d\\]))=span
 class=onpx*/spanb\2/bspan class=onpx*/span
(?i)((?![a-z\d\\:])\_(?![\s\_]|[\*\/]\s)([^\_\n]*?[a-z\d][^\_\n]*?)(?![\\:\_\s])\_(?![a-z\d\\]))=span
 class=onpx_/spanu\2/uspan class=onpx_/span

-- 
Regards
Konrad Szkudlarczyk


--
Dziewczyny Paryza  http://link.interia.pl/f19a3 



Current version is 3.85.03 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


txt2html.regexps

2006-09-29 Thread Konrad Szkudlarczyk
Hello

Since a few days Alexander S. Kunz and me exchanging mails about file
txt2html.regexps and undocumented feature in The Bat!. Three days ago
Alexander sent an info and this file to the TBOT.
http://tech.groups.yahoo.com/group/tbot/message/65065 My English is
poor, so I simple copypaste heart of the matter:

 When you're using the rich text viewer, TB uses an
 optional  file txt2html.regexps (in TB's program
 dir) that contains parsing information in the form
 of  regular  expressions.  This  can be used to do
 render  the text on-screen differently. And it can
 be   used  to  render  *bold*  and  /italics/  and
 _underlined_ just like that.

(BTW, to take advantage of this feature You must enable the smileys
too - and if You don't like them, delete the directory Images\Default
and the file Images\default.msl).

He sent this file to TBOT little to fast, I was still adding some
corrections (ascii-arts bug, html-messages rendering). So please
upgrade, if You use file from TBOT.

As far as I remember we cannot send files to this list, so I must
paste content of this file:

(\STYLE type.\text\/css\\)=\1 span.onpx{font-size:1px;color:white}
(?i)((?![a-z\d\\:])\*(?![\s\*]|[\_\/]\s)(.*?[a-z\d].*?)(?![\\:\*\s])\*(?![a-z\d\\]))=span
 class=onpx*/spanb\2/bspan class=onpx*/span
(?i)((?![a-z\d\\:])\_(?![\s\_]|[\*\_]\s)(.*?[a-z\d].*?)(?![\\:\_\s])\_(?![a-z\d\\]))=span
 class=onpx_/spanu\2/uspan class=onpx_/span
(?i)((?![a-z\d\\:\/])\/(?![\s\/]|[\*\/]\s).*?[a-z\d].*?(?![\\:\/\s])\/(?![a-z\d\\]))=i\1/i

Copy this four lines to the text file called txt2html.regexps (not
txt2html.regexps.txt!), place that file in main TB's! directory,
turn on smileys and admire.

In the first line are words color:white - this must be Your
background's colour (Options / Preferences / HTML/Windows editor /
Item - Background), for example my colour is color:#A7B3B4. White
is most common.

If You have comments or ideas, and especially when You find any bug,
please give me an info.

BTW the whole idea was discovered by Atlantoff, information was spread
by Stanislav V. Mikov, who wrote small program HLAM (Highlight
Manager), to help in using this feature (it's unnecessary).
Personally, I'd familiarize with this possibility thanks to lazik_s
and the polish discussion list thebat-l.

-- 
Regards
Konrad Szkudlarczyk


--
Dziewczyny Paryza  http://link.interia.pl/f19a3 



Current version is 3.85.03 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: HTML Templates

2006-03-13 Thread Konrad Szkudlarczyk
Hello, Sebastian. On the thirteenth March 2006 You wrote:

 I know only one possibility
 http://republika.pl/konrad_sz/tb/htmltempl.htm

I don't think it's useful for unexperienced users. And in versions
above 3.5.22 it doesn't works because of bug
https://www.ritlabs.com/bt/view.php?id=5690

I must add a note about this...

-- 
Pozdrawiam
Konrad Szkudlarczyk



Nosi betonowe majtki z hartowana gumka.
KIM JEST STEFAN?!? | http://www.stefan.pl/



Current version is 3.71.03 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html