Forum

Or log in with
 
Current User: Guest Login Register
Please consider registering


Register? | Lost Your Password?

Run File only runs for the first mail?

Reply to Post Add a New Topic
UserPost

3:41 am
December 9, 2009


Andreas

Guest

Hi, thanks for this great extension! I set up a filter which lauches a bat file which pipes it to a python script. This works great, but I have to run it for every match in a folder.

For example, I would like to run the bat with ervery mail which matches a specific topic. Lets say I would like to match all emails from ebay – do some regex and save the end-date of the auction to my (Google) calendar. Running it for every mail that comes in is cool, but processing (all) already received mails (at least as an option) would be also great. Is there a way to do it?

bye bye

Andreas

9:50 am
December 9, 2009


rkent

Admin

posts 279

We are somewhat limited by the way that filters are applied in the core code. Although the calls to perform a custom action are given a list of messages rather than a single message, in most cases in core the call to actions is actually made one message at a time. But there is an exception, and that is in the new "after classification" context (or the closely-related cases where filters are applied manually).

There is also a difference in the FiltaQuilla Run and Launch actions. Launch is called once per batch, Run is called per message. So I think (but have not tested) that if you try to apply the Launch command with the "after classification" context, it will only get called once per batch.

But there is no way to get any information about the message to the external program in Launch at the moment. But if you are a programmer, you could perhaps look at the implementation of Launch and Run in the extension code, and adapt it for your needs.

6:02 pm
December 9, 2009


Andreas

Guest

Thanks for the reply, I played a litte bit with your code (I never did any Mozilla development before). I found two ways to achive my goal :)

1) when I pull up the for-loop which loops over the messages to the top of self.runFile it will create a new process for every message – my *.bat File gets called with the updated parameters  and does what I want. But creating a new process for ervery message "feels" wrong…

2) If I set the "blocking" in theProcess.run(); to true, it calls the batch file for every message with the updated params after the previous process finished. I think I will use this way and add a new Filter Methode "Run File (blocking)" to the Extension.

thanks again,

Andreas

Reply to Post

Reply to Topic:
Run File only runs for the first mail?

Guest Name (Required):

Guest Email (Required):

NOTE: New Posts are subject to administrator approval before being displayed

Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
3 + 11
   


 
Share