[Users] Configuring Subject field
Milan Obuch
claws-mail-users at dino.sk
Sat Mar 6 10:18:50 CET 2021
On Sat, 6 Mar 2021 09:04:34 -0000, Paul <claws at thewildbeast.co.uk>
wrote:
> On Sat, 6 Mar 2021 09:09:20 +0300
> <ml at shadrinden.ru> wrote:
>
> > Is it possible to set up Claws Mail in such a way that if I try to
> > send a message with empty subject, it still would ask me whether I
> > want to do this (like it normally does), but if I choose "Send", it
> > would fill the Subject field with a predefined string (for example,
> > "No subject") (to avoid sending a message with subject being
> > actually empty)?
> >
> > So, I want to a) be given a chance to fill in the subject myself,
> > in case I simply forgot to fill this field, b) to have at least
> > some subject if I can't come up with one, c) don't have to input
> > this "standard subject" by hand each time.
>
> No, this is not possible. One way of working around it is to set "No
> subject" in the Subject field of the Account's Template. Then, if you
> forget to change it, (which is not far from forgetting to set it),
> you will have "No subject" as the Subject value.
>
Well, yes and no.
Yes, unless you consider using some plugin. Creating plugin just for
this purpose would be surely overkill.
And no, if you can use some scripting plugin. There are Perl plugin and
Python plugin, both should be made to support this functionality, but I
think as released they lask it.
<shameless self advertisement>
However, my Lua plugin does support this, just anybody needs to compile
it self. Sources were sent to claws-mail-devel mailing list in message
Subject: Lua plugin goes public (preliminary)
Date: Fri, 12 Feb 2021 00:25:10 +0100
with some instructions how to build, Ricardo Mones converted then into
git patches in response. You can try it if you like.
</shameless self advertisement>
To OP:
In my Lua plugin, just put following code
----------------------------------------------------------------------
local compose_window = ...
if (compose_window.subject == '')
then compose_window.subject = 'Subject originally empty' end
----------------------------------------------------------------------
into $HOME/.claws-mail/lua/hook/compose_check_before_send file and it
does what you want.
In a nutshell, Claws Mail's overall design with scripting capabilities
added via some plugin provides you endless possibilities for tweaking
client's behavior to your likes.
Regards,
Milan
More information about the Users
mailing list