[Users] Use entered email address in action

Milan Obuch claws-mail-users at dino.sk
Sat Mar 12 08:05:42 CET 2022


On Sat, 12 Mar 2022 07:39:25 +0100
Christoph Klassen <christoph.klassen at intevation.de> wrote:

> On Fri, 11 Mar 2022 18:09:53 +0100
> Milan Obuch <claws-mail-users at dino.sk> wrote:
> 
> > could you write more about required behavior? When you look in
> > action configuration page (menu Configuration -> Action), there is
> > 'Information' button. There are some variables with hints, no idea
> > if it is of any help for you. Is it actually the action you are
> > writing about?
> > 
> > Actually, there is no single 'To:' field, it is expandable array of
> > header/value pairs... I think this should be considered as well.  
> 
> I will try to explain it a little bit better. I want to create an
> action that will call the command "gpg locate-keys" which takes an
> email address as a parameter.
> This action would be used in the compose window. When I entered the
> email addresses of all recipients (actually it doesn't matter if the
> addresses are in a "To", "CC", or a "BCC" field) I want to start the
> action so that it gets all addresses as parameter.
> For example: I enter the address users at lists.claws-mail.org in the
> "To" field. When I start the action it should call "gpg --locate-keys
> users at lists.claws-mail.org"
> 
> I hope this explains better what I meant :)
>

OK, I think it is clear now.

I see three options here:

1. adding some new parameter for actions, say %A - list of addresses,
you can then define new action. No idea how much work that is.

2. use Python plugin and write a script using get_header_list() method
of class ComposeWindow to extract required info and invoke command(s)
as required. Easy if Python plugin is available in your distribution or
you are able to build it yourself and write some scripts in Python.

3. use Lua plugin and write a script using headers property of table
with compose_window metatable. Lua plugin is not yet in official
repository, I am doing the development and providing help necessary on
request. After getting plugin into working shape, easy (equally as
option 2, just using another language).

Others can comment more, maybe one can create a new plugin for this
(but I think this would be an overkill)... Hopefully you can get some
ideas from this mail.

Regards,
Milan


More information about the Users mailing list