Pages: 1
RSS
TheBat crashes when filtering email, Crash after a few moments of filter use
 
Hello!
I am evaluating TheBat Professional 4.0.24 (the newest one, downloaded 2 days ago from the official site).
I needed a filter which would change the %TEXT of the received message, leaving everything else intact. I tried to use the following filter to my incoming mail:

1) "CREATE NEW MESSAGE IN FOLDER 'ABC'"
%From="%OFromName <%OFromAddr>"
%To="%OToName <%OToAddr>"
%ReplyTo="%OReplyAddr"
%Subj="%OSubj"

%SetPattRegExp='A VALID REGEX HERE'%-
%RegExpBlindMatch='%Text'%-
%SubPatt='1'%SubPatt='2' {end so forth}

2) Move message to folder 'DEF'

This is one among many filters, all of them have 'continue running other filters' turned ON. Only this one causes problems.

EXPECTED BEHAVIOR:
A new mail should be created with only its text changed by the RegEx.
CURRENT BEHAVIOR: Access Violation after about 10 seconds. Moreover creates messages with empty text. Some messages are created properly. This is *NOT* a RegEx fault (checked). The same messages sometimes filter OK.
Edited: Jarek - 05 June 2008 19:42:17
 
I can't help you with this, I'd suggest that you send a description of the problem together with the relevant part of your thebat_Exceptions.log and ex_log.txt files to the Ritlabs.
You can open that site by selecting in The Bat!:
Help -> Feedbak -> Bug Report

I guess that's something for the developers.

However, What you want to achieve can't be done the way you're doing it.
You can't create a new message in a defined folder. All new mesages are created per default in the Outbox.
Furthermore I don't understand what message ytou want to move  to DEF, the received message or the newly created one, in the latter case that won't work either as the filter will continue to process the received message.

The way I'd handle this would be to export the message to a text file (called something fancy like export.msg) and use a template that starts with the the macro %Headers followed by an empty line. Next you can place your regexp.
As next action in your filter you place an external command that imports the message you just created. The command to do that would look like this:
"C:\Program Files\The Bat!\thebat.exe"  /ImportU=accountname;F=foldername;IN=Filename.
Account, folder or filenames that include spaces ought to be included between quotation marks " ".
Yes, it is possible to start TB as an external application from a filter line. The command issued via the command line will be executed even though there won't be running a second instance of The bat!

It's even possible that this other filter won't cause an AV. That your filter causes an AV still is a bug though and needs to be reported.

One final note.
You mentioned that you enabled 'continue processing with other filters' for all of your filters.
The way the sorting office is designed shouldn't make that necessary. To the contrary, I'd say. I haven't enabled that option for any filter at all.

When a filter condition is compared to a message there are two possibilities, you've got a match or you don't.
In case there's a match the filter actions will be executed and the message won't be processed by other filters.
In case there's no match, the message will be processed by the next filter and the next and the next.... until you've run out of filters or you've got a match.
To give an example. I do a lot of filtering on address book groups and my brother is in three groups I use for filtering. my first address book group filter checks whether the sender is in the group relatives and moves the message to the corresponding folder. Now it stops processing the message as it has a match. With the 'continue...' option checked for all filters it ould next move the message to the local users folder and to a club folder and it would be left at the folder that I deem least important (as the filter is placed at the bottom of the sorting office)
So without the 'continue processing...' option enabled you need to place the most important filter on top, whereas you need to place the most important at the bottom when you enable the option, but in that case the message might be processed by several filters each filter taking a tiny bit of processing time and thus burden your computer more.
I don't know how many filters you've got, but I've got over a hundred incoming filters and I wouldn't care for all messages to be matched against all of them. The filters that handle most messages are located at the top of the sorting office (as far as a logical sorting of the conditions is allowing that)

Well, that was rather long for a final note, but I guess that shows how importnt I think it is. :-)
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
First of all, thank you very much for the answer!!!

As advised, I submitted a new bug report - ticket #26889.
I did not know that I could submit bug reports if I did not have a registered TheBat (as I told you I am evaluating 4.0.24; still about 20 days to go)...

Now your questions:
> You can't create a new message in a defined folder.

If you add a "Create new FORMATTED message in" you can select a folder. It can be Outbox or any other folder. CAUTION: there are TWO SIMILAR options!!! The keyword here is "formatted". If you used "Create new message" instead, you would be creating a new message to send to someone else and so it would be put in the Outbox. Please test it out (the name of the option might be different, I am using a Polish version. The needed option is the 4th from the top of "Add" in the filter operations dialog (the 3rd one is "Export message" or something similar).

>[...] what message you want to move to DEF?
I would like to move the original, unaltered message there. This works perfectly! I would like to have the altered version in ABC and the original in DEF.

>"continue processing"

About the "continue processing" option: I have about 5 or 6 filters, so speed is not a problem. I prefered to use one filter for "coloring" the interesting mails (regardless of sender). Unfortunately one of the senders needed "special attention" and I did not like to create a copy of the "coloring" filter just for this user. So to sum it all up - one general filter for "coloring" and one as a special case for just one sender. It is perfectly OK if both filters matched the same email (one would color it, the second one would alter the contents).

Your idea of exporting and then importing back the message is very interesting. I will test it out (maybe then TheBat would stop crashing :) ) I however think that TheBat should be able to do it without so much fuss (considering the fact that the necessary option is already there) :).

Once again thank you very much for a very detailed answer, Roelof
 
Well, I didn't know about the 'formatted message' option, that wasn't possible in the past and I tend to rely on my memory when commenting on these things. What you don't use you don't notice. :-)

I noticed that you use these macros to rebuild the headers of the message:
%From="%OFromName <%OFromAddr>"
%To="%OToName <%OToAddr>"
%ReplyTo="%OReplyAddr"
%Subj="%OSubj"
Is there any reason why you don't uncheck the option
'Do not preserve header of the original message'? That would take away the need to recreate those headers.

About the 'continue processing...' option. It's not only the speed of processing but it makes it more difficult to hunt any bugs in your sorting system as any message gets checked against every filter.
You had several options to take care of this and in my opinion you picked the very worst. :-)
1 - Enable 'continue processing..' for all filters, you picked that one.
2 - Place the 'create formatted message' filter immediately above the colouring filter and only enable 'continue processing...' for the 'create formatted message' filter.
3 - Place the 'create formatted message' filter somewhere above the colouring and add a colouring action to the 'create formatted message' filter and don't use 'continue processing...' anywhere.
4 - Set the 'create formatted message' filter as subfilter of the colouring filter and don't use 'continue processing...' anywhere.
Personally I'd prefer #3 or #4 with a slight preference for the latter.
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
Quote
Roelof Otten wrote:
'Do not preserve header of the original message'
This option had no effect in The Bat! versions up until 9.1.6 (the result was the same regardless of the option being on or off). In the subsequent versions of the program if the option "Do not preserve header of the original messages" is turned off for the "Create formatted message" action in the Sorting Office, then the RFC-822 headers of original message are added as an attachment (with Content-type "text/rfc822-headers", as described in RFC-1892) to the newly created message
Pages: 1