On Thu, 15 Jan 2004 13:35:30 +0100 (Romance Standard Time) Xavier Nodet <[EMAIL 
PROTECTED]> wrote:

XN> Now that the Python module in M seems back, I'd like to know if I could
XN> do the following:
XN> 
XN> 1. Run a script from the menu (i.e. a script not tied to an event such
XN>    as a folder opening or a new message).

 Yes, there is "Mail|Run script" command.

XN> 2. Iterate with a script over all sub-folders of a folder

 I'm afraid not because MFolder is not wrapped, i.e. there is no
include/interface/MFolder.i. However it should be trivial (i.e. it is
trivial unless some completely unexpected problem pops up) to add it.

XN> 3. Iterate with a script over all the messages in the current folder,
XN>    and potentially move them into another folder.

 Yes, this should be possible. I didn't try it but I did try other things
with Python and at least the possibility to write custom filters is very
useful and they do work. I used this to write a filter to catch all this
gibberish spam with 3 lines of random words in each message. It is quite
simple to detect in Python after getting the msg text using MailFolder
methods and it doesn't make sense to add a test for this to C++ code as in
a few months such spams probably will have disappeared anyhow.

XN> My goal is actually to set up an archive system so that my whole folder
XN> hierarchy gets duplicated under an 'Archive' hierarchy and messages
XN> older than a given threshold are moved to the corresponding folder in
XN> the 'Archive' part...
XN> 
XN> Is this doable ?

 I think it is. It risks to be rather slow however :-(

 Bye,
VZ



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Mahogany-Developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-developers

Reply via email to