<<< Date Index >>>     <<< Thread Index >>>

Re: hooks from aliases



> For my personal needs I've written a script to generate hooks from aliases:

> Output:
> fcc-hook '~C a1-email@example\.org ~C a2-email@example\.org' +a1a2
> save-hook '~L a1-email@example\.org ~L a2-email@example\.org' +a1a2
> fcc-save-hook a1-email@example\.org +a1
> fcc-save-hook a2-email@example\.org +a2
> fcc-save-hook a3-email@example\.org +a3
> fcc-save-hook a3-email@example\.org +a3
> fcc-save-hook a4-very-very-very-very-long-email@example\.org +a4
> fcc-save-hook a5-email@example\.org +a5
> set my_list_folders = /list1$|/list2$
> mailboxes =list1 =list2
> subscribe list1@xxxxxxxxxxx list2@xxxxxxxxxxx

Nice. What exactly are your settings doing? What my_list_folders does?

Over time I developed my approach to subscribing lists. I wanted
 - to be 'subscribe'd to the list
 - everything to be stored in .muttrc, no external files
 - pressing 'm' for new mail automatically offers list address
 - pressing 'r' for reply is redefined to <list-reply>
 - sorting is threads

I don't set up 'mailboxes' automatically, since I want to set the order
in which they are reported to have new mail according to my taste. This
is because I'm subscribed to many aliases, but usually only few are
significant to me, so I want them to be reported first.

I put this definitions somewhere in the .muttrc. For mutt theese lines
are just comments:
=========================== List definitions ===========================
# LIST vim-dev            vim_dev@xxxxxxxxxxxxxxxx
# LIST dtrace-discuss     dtrace-discuss@xxxxxxxxxxxxxxx
# LIST mutt-users         mutt-users@xxxxxxxx
...
========================================================================

And at the end of .muttrc this perl script which parses .muttrc for
# LIST. $x is chr(39) is single quote "'".
========================================================================
`cat $HOME/.muttrc | perl -e '                                   \
  $x=chr(39);                                                    \
  map { $list{$1}=$2 if /^# LIST\s*(\S*)\s*(\S*)/ } <>;          \
  print "subscribe ", (join " ",  keys %list), " ; ";            \
  if (keys %list)                                                \
  {                                                              \
    for (keys %list)                                             \
    {                                                            \
      $mail =  $list{$_};                                        \
      print "folder-hook =$_ ${x}";                              \
      print "macro index,pager,attach \"m\" \"<mail>$mail\" ; "; \
      print "set sort=threads ; ";                               \
      print "macro index,pager,attach \"r\" \"<list-reply>\"";   \
      print "${x};";                                             \
    }                                                            \
  }                                                              \
  print "\n";'`
========================================================================

Hopefully that will be useful to someone. Thanks for starting this
thread :)

-- 
        Vlad

Attachment: pgp7SdvhJVSsG.pgp
Description: PGP signature