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 NeoMutt in 2000, a number of other approaches to what we now call tagging have 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 NeoMutt'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 NeoMutt users who have set x-labels containing spaces, and should be regarded with suspicion. The advantages are significant, though.

Next we allow NeoMutt 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). NeoMutt 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 NeoMutt, its only known implementation. X-Labels have been used both as a tagging device, probably with space delimiting, and as a memo field, where space-delimited parsing would ruin the semantics of the memo. By default NeoMutt 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, NeoMutt will always save keyword to whatever original header it came from. When $keywords_standard=true, NeoMutt will save to the Keywords: header. If both are true NeoMutt saves to both; if neither is true, NeoMutt 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 NeoMutt 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 NeoMutt. 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. neomuttrc

# Example NeoMutt config file for the keywords feature.

# --------------------------------------------------------------------------
# VARIABLES - shown with their default values
# --------------------------------------------------------------------------
# Should NeoMutt save the keywords to whatever keyword it came from?
set keywords_legacy = yes
# Should NeoMutt 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=neomuttrc

8. Known Bugs

None

9. Credits