Keywords Feature

Labels/Tagging for emails

1. Support

Since: NeoMutt 2016-05-30

Dependencies: None

2. Introduction

Unify label/keyword handling.

Since x-labels were added to mutt in 2000, a number of other approaches to what we now call tagginghave also emerged. One of them was even made standard in RFC 2822. This update unifies the handling of all these strategies.

We start by changing mutt's internal keyword storage from a single string which may contain whitespace to a list of discrete keywords. This has advantages for keyword completion as well as for portability among varying "standards" for keyword storage. This may represent a significant change for existing mutt users who have set x-labels containing spaces, and should be regarded with suspicion. The advantages are significant, though.

Next we allow mutt to parse keywords into this internal list from any of the following headers: X-Label (freeform), X-Keywords (space-delimited), X-Mozilla-Keys (space-delimited), and Keywords (RFC 2822, comma-space-delimited). Mutt remembers which headers it sourced keywords from, and can rewrite those headers when saving messages for compatibility with the mailer of origin.

(X-Label was specified as freeform text by mutt, its only known implementation. X-Labels have been used both as a taggingdevice, probably with space delimiting, and as a memofield, where space-delimited parsing would ruin the semantics of the memo. By default mutt will not split X-Labels at all. Set $xlabel_delimiter if your needs vary.)

Finally we add two booleans: $keywords_legacy=true and $keywords_standard=FALSE. When $keywords_legacy is true, mutt will always save keyword to whatever original header it came from. When $keywords_standard=true, mutt will save to the Keywords: header. If both are true mutt saves to both; if neither is true, mutt saves only to legacy headers to avoid complete loss of keywords.

Overall this represents convergence path for all competing labelling/tagging/keywording systems toward one that is specified by RFC.

You can change or delete the X-Label: field within Mutt using the edit-label command. This works for tagged messages, too.

3. Variables

Table 18.1. Keywords Variables

Name Type Default
keywords_legacy boolean yes
keywords_standard boolean no
xlabel_delimiter string (empty)

4. Functions

Keywords adds the following function to Mutt. By default, it is not bound to a key.

Table 18.2. Keyword Functions

Menus Function Description
index,pager <edit-label> add, change, or delete a message's label

5. Sort

Table 18.3. Keywords Sort

Sort Description
label Sort by label

6. Muttrc

# Example NeoMutt config file for the keywords feature.

# --------------------------------------------------------------------------
# VARIABLES - shown with their default values
# --------------------------------------------------------------------------

# Should Mutt save the keywords to whatever keyword it came from?
set keywords_legacy = yes

# Should Mutt use the "Keywords:" header?
set keywords_standard = no

# How should the keywords be separated?
set xlabel_delimiter = ""

# --------------------------------------------------------------------------
# FUNCTIONS - shown with an example mapping
# --------------------------------------------------------------------------

# Bind 'y' to edit labels/keywords
bind index,pager y edit-label

# vim: syntax=muttrc

8. Known Bugs

None

9. Credits