[Users] Actions: moving the message to a relative folder

Milan Obuch claws-mail-users at dino.sk
Mon Dec 18 09:27:13 UTC 2023


On Sat, 9 Dec 2023 15:03:05 +0100
François Poulain <fpoulain at metrodore.fr> wrote:

> Salut,
> 
> Le Fri, 8 Dec 2023 01:05:29 +0100,
> wwp <wwp at claws-mail.org> a écrit:
> 
> > What do you mean exactly, saying "a relative path"? An example
> > would help understanding what's on your mind.  
> 
> I have a few IMAP accounts on the same server. On this server, I have
> setup spam learning via message move (from Inbox to Junk). I would
> like to add a "Spam" action which simply moves the email from current
> directory to the Junk sub-folder of the current directory. And I would
> like the action to be the same between accounts.
> 
> That's what I have in mind. :)
> 
> The action builder allows to select a given directory, with an
> absolute path (i.e. #imap/<accountname>/INBOX/Junk). I would like
> something like ./Junk (relatively to current dir). But different
> tests I made didn't succeeded.
> 

Hi François,

just to make sure I understand you right, I think you should probably
write folder instead of directory - nit-picking a bit, but still...
Also, is all your mail delivered into Inbox for all your accounts? Do
you have user created folders in use?

In my case, I have many folders for various topics, be it mailing lists
messages, selected person communication etc. and mail message is being
delivered into some folder directly on mail server, so my perspective
is probably a bit different.

I am not sure about ./Junk, if taken literally, a Junk sub-folder
should be add to every non-Junk folder... I think just one Junk folder
per account is what you mean.

If all your attempts failed and nobody else offered any mathod to solve
this task, I'd like to propose scripting plugin. You could probably use
Python plugin, which allows you to add something to your Claws Mail
specially crafted for you. More info and some examples could be found at
https://www.claws-mail.org/plugin.php?plugin=python page.

I'd create a button in main window's toolbar - see in menu
'Configuration' - 'Preferences...' - 'Toolbars' - 'Main Window' how
toolbar is set up. If you did not already, play a bit with it, but make
sure you make no damage to it, making backup of your toolbar_main.xml
file is good idea, just in case...

When you load Python plugin, you could use scripts as action available
as menu items or toolbar buttons. Assuming it is attached to toolbar
button, script (in some gross pseudo code, no actual example here) looks
like

current_folder = get_current_folder()
junk_folder = main_folder(current_folder) .. '/Junk'
for (msg in get_list_of_selected_messages())
    move_message(msg,junk_folder)
end

I know this is just an idea, but if you decide to go this route and
need more help, just let me know.

Regards,
Milan



More information about the Users mailing list