Freeman wrote:
Thanks guys. I had read something that, on revisiting, seems rather unclear.
I have a text file of lists for spam-bouncer/procmail which muttrc grep's
for 'subscribe' .
Of course, that doesn't get me aliases and recipes. Seems I could approach
your py elegance with a bash script, which I have been studying of late.
With all your mailboxes in ~/mail/lists, you could set up something
basic like
this in ~/.muttrc:
#--------------------------------------------------------------------------
# Define mailing lists
#--------------------------------------------------------------------------
unsubscribe * # clean slate
subscribe `cd ~/mail/lists&& echo *` #all mailing lists
#--------------------------------------------------------------------------
# Dynamically generate entries for each mbox in ~/mail/lists folder
#--------------------------------------------------------------------------
mailboxes `for file in $(ls ~/mail/lists); do \
echo -n "+lists/$file "; \
done`
#--------------------------------------------------------------------------
# Initialize mailing lists' alias file
#--------------------------------------------------------------------------
set my_dummyvar=`ls -1 ~/mail/lists | \
grep @ | \
awk -F@ '{print "alias" " " $1 " " "<" $1 "@" $2">"}' \
> ~/.mutt/lstal`
#--------------------------------------------------------------------------
# Source mailing lists aliases
#--------------------------------------------------------------------------
source ~/.mutt/lstal # source aliases
Since procmail automatically creates a new mailbox in ~/mail/lists when I
receive the first message from a newly-subscribed mailing list, the above
is 100% maintenance-free.
Note that my_dummyvar is not set to anything. I needed something where I
could plug my alias file creation mini-script. Access is not serialized,
so this might break if several instances of mutt are started concurrently.
I never type my mailing list aliases, only the shortest non-ambiguous
string and hit the<Tab> key:
I am subscribed to 'fontcon...@lists.freedesktop.org', the alias generated is
the still too long 'fontconfig' but since I know I have not other alias that
starts with 'f', I only have to enter 'f<Tab>' at the To: prompt.
Gen-Paul.