On 03Nov2011 10:05, Edward Morbius <dredmorb...@gmail.com> wrote:
| Is there any facility similar to Gmail's named tags (other than
| folders) for mutt?
| 
| I'd like to be able to add (multiple) labels to a given message,
| possible automatically (procmail, some imap tool, mutt folder hooks),
| have mutt be aware of defined labels, and be able to quickly filter
| messages by labels (including and/or/not Boolean logic).

The X-Label: header is the usual convention for this in mutt-land.

Mutts which are aware of it have a ~y operator in the pattern syntax
(see the PATTERNS heading in "man muttrc"), but otherwise a more
cumbersome header check on "X-Label: blah" with be needed in patterns.

I insert stuff into the X-Label header with procmail at filing time, as
with the formail line in this procmail rule:

  # cats/home: zsh     Zsh-Users       zsh-us...@zsh.org
  :0
  * ^(to|cc|bcc):.*\<(zsh-us...@zsh.org)\>
  {
   DEFAULT=/dev/null
   :0c:.lock-global-procmail
   {
    LOG=`datecode`" "`email-summary-line 2>&1 || :`
    :0whf
    | formail -f -A 'X-Cats2Procmailrc-Rule: cats/home: zsh Zsh-Users 
zsh-us...@zsh.org'
    :0whf
    | formail -f -A 'X-Label: Zsh-Users'
    :0
    /home/cameron/mail/zsh/
   }
  }

(Yes, I write procmail rules using a program. The source for the above
rule is in its opening comment:-)

Anyway, that inserts an X-Label into the message headers before filing.

The X-Labels are displayed in my mutt index using the %y format:

  set index_format="%D %-15.15F %S %?M?(%M) ?%?H?[%H] ?%s%>  %y %4c"

I haven't tried using multiple X-Labels (which would probably be one
header with multiple labels, but maybe not...).

| That and/or a global search tool (and yes I'm aware that several of
| these exist) would be great adds for mutt.

I use mairix myself, via a simple shell wrapper to make the invocation
easy. I have not yet investigated searching X-Label headers with it;
currently I mostly use X-Labels to identify multiple lists filed in a
single folder.

| If there are existing tricks / tools that accomplish same, I'd
| appreciate seeing them.

Me too.

Cheers,
-- 
Cameron Simpson <c...@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

The most annoying thing about being without my files after our disc crash was
discovering once again how widespread BLINK was on the web.

Reply via email to