[Users] Unintended addresses

Holger Berndt berndth at gmx.de
Sat Jan 7 16:00:15 CET 2017


Hallo Abrolag,

On Fr, 06.01.2017 21:15, Abrolag wrote:

>Checking back through my mail history *every* occasion when this has happened
>I've been writing to one of the other developers, so it's very likely the same
>or similar situation. Quite frankly I see no possibility of preventing that
>from happening *unless* I can get a warning that I'm sending to two recipients.

If you really feel hard about it, you can script such a warning yourself
using the Python plugin.

One option would be to create a visual indicator when a newly created
compose window has certain headers pre-set. For example, you could use
this snipped in the compose_any script to make the text body have a
yellow background color in this case:
#===========================================================================================
# Make body colored if there is a recipient pre-set
headers = clawsmail.compose_window.get_header_list()
num_recipients = 0
for field, value in headers:
    if field.strip().lower() in ("to:", "cc:", "bcc:"):
        num_recipients += 1
if num_recipients > 0:
    clawsmail.compose_window.text.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse("#FFF0AA"))
#===========================================================================================

Another option would be to use a python script instead of Claws Mail's
own actions when sending a message. That script would do the sanity
checking according to your needs, and then either invoke Claws Mail's
actions for sending or ignore the request. I attached an example for
replacing "Send later". Note that these scripts can be assigned keyboard
shortcuts and put into the toolbar at will.

>As I said before I still use a number or newsgroups too (all technically
>orientated) and such a warning would be a great help preventing propagation of
>cross-posts.

The examples I gave don't cover newgroup headers, but should be easy to
extend.

Holger
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Send with check for multiple recipients
Type: application/octet-stream
Size: 1189 bytes
Desc: not available
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20170107/b09c586c/attachment.obj>


More information about the Users mailing list