by Morgan Aldridge [email protected]
claws-mail-labels
is a multi-function 'Action' script for Claws Mail to aid in managing email message 'labels' (tags, essentially) within Gmail and/or Google Workspace IMAP accounts. It utilizes mairix for performant indexing & searching email messages in the claws-mail(1) local IMAP cache, bending the rules a bit to perform fast re-indexing of individual labels.
IMPORTANT: This project is very much a work-in-progress and developed specifically for my needs. Use at your own risk!
- perl(1)
- mairix(1)
- An IMAP account synchronized for offline use
- Claws Mail 'Actions' configured to execute
claws-mail-labels
:- "Show Message Labels":
~/libexec/claws-mail-actions -f %f -l
- "Reindex Message Labels":
~/libexec/claws-mail-actions -f %f -r
- "Show Message Labels":
- zenity
- Fast storage device to improve message indexing/re-indexing time
- It can only search for labels of a single message
- It only supports IMAP accounts (though could be modified to support POP & local MH accounts)
- It cannot find messages that have not yet been downloaded from the IMAP server and stored locally
- It cannot [yet] search across multiple accounts
~/.claws-mail/
labelscache/
<server>/
<mailbox>/
mairixrc
mairixrc-reindex
mairixdb
.../
../
One can initialize claws-mail-labels
's mairix(1) configuration files for Google Gmail/Workspace IMAP account by executing (replacing <mailbox>
with the email address, e.g. "[email protected]"):
~/libexec/claws-mail-labels -m <mailbox>
Once a mailbox has been initialized, one can perform a full index by executing (again, replacing <mailbox
with the email address, e.g. "[email protected]"):
~/libexec/claws-mail-labels -m <mailbox> -i
Add a "Shell command" Action:
- Menu name:
Message Labels/Show
- Command:
~/libexec/claws-mail-labels -f %f -l
If you'd like a nicer GUI display, use the following command instead:
~/libexec/claws-mail-labels -f %f -l | zenity --list --title="Labels" --text="%f" --hide-header --column="Label"
Add a "Shell command" Action:
- Menu name:
Message Labels/Re-index
- Command:
~/libexec/claws-mail-labels -f %f -r
- Claws Mail FAQ: Actions
- Claws Mail FAQ: Using Claws Mail with other programs
- Wikipedia: MH Message Handling System
- Zenity Manual
Released under the MIT License.