https://github.com/morgant/claws-mail-labels
Fast-ish Gmail-like "labels" support for claws-mail using mairix
https://github.com/morgant/claws-mail-labels
claws-mail email folder-management gmail google-workspace imap indexing labels mairix
Last synced: 5 months ago
JSON representation
Fast-ish Gmail-like "labels" support for claws-mail using mairix
- Host: GitHub
- URL: https://github.com/morgant/claws-mail-labels
- Owner: morgant
- License: mit
- Created: 2025-08-20T16:36:45.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-08-30T00:38:03.000Z (7 months ago)
- Last Synced: 2025-10-05T18:06:18.781Z (5 months ago)
- Topics: claws-mail, email, folder-management, gmail, google-workspace, imap, indexing, labels, mairix
- Language: Shell
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# claws-mail-labels
by Morgan Aldridge
## OVERVIEW
`claws-mail-labels` is a multi-function 'Action' script for [Claws Mail](https://claws-mail.org/) to aid in managing email message 'labels' (tags, essentially) within Gmail and/or Google Workspace IMAP accounts. It utilizes [mairix](https://github.com/vandry/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!_
### Prerequisites
* 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`
#### Suggested
* [zenity](https://gitlab.gnome.org/GNOME/zenity)
* Fast storage device to improve message indexing/re-indexing time
### Limitations
* 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
### Directory Structure
```
~/.claws-mail/
labelscache/
/
/
mairixrc
mairixrc-reindex
mairixdb
.../
../
```
## USAGE
### Initialize Mailbox
One can initialize `claws-mail-labels`'s mairix(1) configuration files for Google Gmail/Workspace IMAP account by executing (replacing `` with the email address, e.g. "some-fake-address@gmail.com"):
```
~/libexec/claws-mail-labels -m
```
### Mailbox Full Index
Once a mailbox has been initialized, one can perform a full index by executing (again, replacing ` -i
```
#### Full Index of All Mailboxes
Once one or more mailboxes have been initialized, one can perform a full index of all mailboxes as follows:
```
~/libexec/claws-mail-labels -a -i
```
### Configure Claws Mail Actions
#### Message Labels/Show
Add a "Shell command" Action:
* **Menu name:** `Message Labels/Show`
* **Command:** `~/libexec/claws-mail-labels -f %f -l`
##### With Zenity
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"
```
#### Message Labels/Reindexing
Add a "Shell command" Action:
* **Menu name:** `Message Labels/Re-index`
* **Command:** `~/libexec/claws-mail-labels -f %f -r`
## REFERENCE
* [Claws Mail FAQ: Actions](https://claws-mail.org/faq/index.php/Actions)
* [Claws Mail FAQ: Using Claws Mail with other programs](https://claws-mail.org/faq/index.php/Using_Claws_Mail_with_other_programs)
* [Claws Mail FAQ: Using Claws Mail with other programs (How can I use Claws Mail with mairix?](https://www.claws-mail.org/faq/index.php/Using_Claws_Mail_with_other_programs#How_can_I_use_Claws_Mail_with_mairix.3F)
* [Wikipedia: MH Message Handling System](https://en.wikipedia.org/wiki/MH_Message_Handling_System)
* [Zenity Manual](https://help.gnome.org/users/zenity/stable/index.html.en)
## LICENSE
Released under the [MIT License](LICENSE).