[Users] "Global" action to move message within acct

Trevor Carey-Smith trev at highwater.co.nz
Mon Sep 19 00:39:52 CEST 2016

Hi Holger,

On Fri, Sep 16, 2016 at 11:38:52PM +0200, Holger Berndt wrote:
> On Di, 13.09.2016 20:51, Trevor Carey-Smith wrote:
> >I am trying to set up an action that can be used across multiple
> >accounts that will move a message to a specific folder within the
> >*current* account.
> Scripting this kind of stuff is possible with the Python plugin. A
> corresponding quick&dirty script could look like this:

Thanks very much. I had a sneaking suspicion the python plugin would be
the way to go!

> #======================================================================================
> mailbox_folder_map = {
> 	"mail" : "#mh/mail/foo",
> 	"gmail (imap)" : "#imap/gmail (imap)/bar"
> 	}
> msgs = clawsmail.get_summaryview_selected_message_list()
> if msgs:
> 	mailbox_name = msgs[0].Folder.mailbox.name
> 	if mailbox_name in mailbox_folder_map:
> 		target_folder = clawsmail.Folder(mailbox_folder_map[mailbox_name])
> 		clawsmail.move_messages(msgs, target_folder)
> #======================================================================================

I've managed to get a working script going, but for some reason
msgs[0].Folder.mailbox.name returned an error. I ended up using the
clawsmail.get_folderview_selected_folder() function to get the folder
instead. Is the Folder attribute of the MessageInfo class a new
addition (I'm only on 3.12.0)?

Thanks again,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20160919/1deff1b7/attachment.sig>

More information about the Users mailing list