Re: 1.5.20 and sidebar

2010-08-31 Thread Brian Ryans
Quoting fe...@crowfix.com on 2010-08-30 11:00:25, in Message-Id
20100830160025.ga23...@crowfix.com

[Snip: Several failed attempts, all of which I'd tried myself]

 Any suggestions?

mailboxes `find ~/mail -mindepth 1 -maxdepth 1 \( -type d -not -name 
'localhost' -not -name '.*' -printf +'%f'  \) , \( -type f -name 
'*_archive.gz' -printf +'%f'  \)`

Fairly convoluted, but automatically updates the mailboxes definition
[1]. Pretty quick to run, too.

What it does is prints just the name of every directory not named
'localhost', not having a name beginning with a dot, and the name of
every file ending in '_archive.gz' -- each with a + prepended.

[1] From reading Mutt manual section 3.13, I'm under the impression that
my mailboxes command is executed only upon mutt startup, or at any other
time that my muttrc is sourced. Adding appropriate beep commands to my
mailboxes command seems to confirm.

-- 
 _  Brian Ryans 8B2A 54C4 E275 8CFD 8A7D 5D0B 0AD0 B014 C112 13D0 .
( ) ICQ UIN: 43190205 | Mail/MSN/Jabber: brianlry...@gmail.com   ..:
 X  ASCII Ribbon Campaign Against HTML mail and v-cards: asciiribbon.org
/ \ The most powerful optimization tool . . . may be the Delete key.
  -- Eric S. Raymond


signature.asc
Description: Digital signature


Re: 1.5.20 and sidebar

2010-08-31 Thread Chris Bannister
On Tue, Aug 31, 2010 at 02:47:37AM +0200, Michelle Konzack wrote:
 
 macro generic F5  :set delete=yes\ns=.SPAM.sa-learn/\n\n:set 
 delete=ask-yes\n
 macro index   F5  :set delete=yes\ns=.SPAM.sa-learn/\n\n:set 
 delete=ask-yes\n
 macro pager   F5  :set delete=yes\ns=.SPAM.sa-learn/\n\n:set 
 delete=ask-yes\n
 
 :-D

Even shorter!
macro generic,index,pager F5  :set delete=yes\ns=.SPAM.sa-learn/\n\n:set 
delete=ask-yes\n

:-г

-- 
Religion is excellent stuff for keeping common people quiet.
   -- Napoleon Bonaparte




Re: 1.5.20 and sidebar

2010-08-31 Thread Chip Camden
Quoth E. Prom on Tuesday, 31 August 2010:
 On Monday, 30 August 2010, 17:39:44 -0700,
 Chip Camden sterl...@camdensoftware.com wrote:
  Quoth fe...@crowfix.com on Monday, 30 August 2010:
   Is there a way to assign an external command to a key which will be
   passed the path to the message?  For instance, if I write a dumb
   little shell script to move a message into the spam maildir ...
   
   #!/bin/sh
   mv -i $@ ~/Maildirs/junk/new
 
  If you just want to move the message, use save-message.  But you can
  always define a macro that pipes the message to a script, and then you
  can do whatever you want with it.
 
 I don't think you can get the name of the file in your maildir, but you
 can use save-message, or pipe-message followed by delete-message
 in a macro.
 
 Quite obvious, but I wanted E Prom to respond to Chip ;)

Heh -- we're almost the same, but I can be more volatile.  ;)

-- 
Sterling (Chip) Camden| sterl...@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipstips.com| http://chipsquips.com


pgpXW6NOxDSSU.pgp
Description: PGP signature


Re: 1.5.20 and sidebar

2010-08-31 Thread felix
I decided to get my toes wet.

I have my mail dirs under ~/Maildirs.

Under each mail dir is a .archiverc which controls a nightly automated
backup of interesting mail dirs.  This program moves old unflagged
seen files into an archive dir, or deletes them for the really boring
mail dirs.  There is one common .archiverc which th eboring ones have
a symlink to.  The interesting mail dirs have a custom .archiverc.

So here is my 'mudd' command which is used as

mailboxes `~/bin/mudd`

It returns the dirs in a specific order: those with fresh email first,
then those with custom archive files, then those with the canned
archive file, and lastly those with no archive file (I have a couple
of mail dirs where I put copies of mail).  I also have some jun* dirs
used for spam and such.


#!/usr/bin/perl -w
use strict;

chdir($ENV{HOME}/Maildirs) or die Can't chdir to maildirs: $!;
my @fresh = ();
my @junk = ();
my @custom = ();
my @archived = ();
my @holding = ();
opendir(my $dh, '.') or die .: $!;
my @all = sort grep { -d $_/new } readdir($dh);
closedir($dh);
foreach my $subdir (@all) {
opendir(my $dh, $subdir/new) or die $subdir/new: $!;
my @new = readdir($dh);
closedir($dh);
if (@new != 2) {
if ($subdir =~ /^jun/) {
push(@junk, $subdir);
} else {
push(@fresh, $subdir);
}
} elsif (-l $subdir/.archiverc) {
push(@archived, $subdir);
} elsif (-f $subdir/.archiverc) {
push(@custom, $subdir);
} else {
push(@holding, $subdir);
}
}

print join(' ', @fresh, @junk, @custom, @archived, @holding), \n;
exit 0;


I figure this is a nice safe way to start.  The more I use this
sidebar patch, the more I like it.

Which brings up the question of why hasn't it been added to mutt itself?

-- 
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
 Felix Finch: scarecrow repairman  rocket surgeon / fe...@crowfix.com
  GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o


Re: 1.5.20 and sidebar

2010-08-31 Thread David Champion
* On 31 Aug 2010, fe...@crowfix.com wrote: 
 
 So here is my 'mudd' command which is used as
 
 mailboxes `~/bin/mudd`

Tangent: I don't have this exact need, but I have similar requirements
for building dynamic configuration.  A trick I use is to create a script
whose output is a (partial) mutt configuration file.  In your case, the
script could be a slight modification of 'mudd' which outputs:

mailboxes =folder1
mailboxes =folder2
mailboxes =folderN
...

then I source it from .muttrc as:

source ~/bin/myscript |

The | at the end makes mutt execute the script and interpret its
output as if it appeared right there in .muttrc.  It's very much like
using backquotes, but you can make the script much simpler because any
config command can be emitted at any time, with less need for tracking
state information or compiling arrays.

-- 
David Champion  *  d...@uchicago.edu  *  IT Services  *  University of Chicago


Re: 1.5.20 and sidebar

2010-08-30 Thread E. Prom
On Monday, 30 August 2010, 09:00:25 -0700,
fe...@crowfix.com wrote:
 I have maildirs, a bunch of them, all under ~/Maildirs.  I was hoping
 to be able to use something like this:
 
 mailboxes ~/Maildirs/*
 
 but that's nae working.

Have you tried something like this (untested) :
mailboxes `/bin/ls ~/Maildirs/*`


Re: 1.5.20 and sidebar

2010-08-30 Thread E. Prom
On Monday, 30 August 2010, 18:19:30 +0200,
E. Prom e3p...@gmail.com wrote:

 mailboxes `/bin/ls ~/Maildirs/*`

It doesn't work, and I don't manage to correct it.

Less elegant, but works :
mutt -e mailboxes $(/bin/ls -d ~/Maildirs/*)


Re: 1.5.20 and sidebar

2010-08-30 Thread j...@telefonica.net
Hi, Felix.

Please try:
mailboxes ~/mail
mailboxes ~/mail/another

See that they do no finish with / only the name and Mutt will look
inside them.


El 10.08.30 09:00:25 -- fe...@crowfix.com dijo:
 I was curious about the sidebar and recompiled mutt with that option.
 Some questions.
 
 What is the status of this patch?  I gather it is not official and
 probably never will be.  Is this because it conflicts with plans for
 mutt, or it is too hoaky, or not well written, or ...
 
 I have maildirs, a bunch of them, all under ~/Maildirs.  I was hoping
 to be able to use something like this:
 
 mailboxes ~/Maildirs/*
 
 but that's nae working.  I'd rather not list them all explicitly,
 otherwise changing the dirs under ~/Maildirs requires the extra and
 easy-to-forget step of editing the mutt config.  I also thought to
 make an alias, something like this
 
 mutt $(cd ~/Maildirs; for i in echo *; do echo  -f =$i/; done)
 
 but it looks like mutt ignores all but one.
 
 I tried
 
 mailboxes ~/Maildirs/
 
 hoping I could try to open that dir and see the maildirs, but it
 merely complined that ~/Maildirs was not a mail dir.
 
 I didn't experiment a lot, since this particular system is behind a
 slow laggy connection, so I may have missed some easy things to try.
 
 Any suggestions?
 
 -- 
 ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
  Felix Finch: scarecrow repairman  rocket surgeon / fe...@crowfix.com
   GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
 I've found a solution to Fermat's Last Theorem but I see I've run out of room 
 o

-- 
Jose Angel Navarro Cortes
email: j...@telefonica.net
web: http://janc.es/
Usuario Linux: #49178


Re: 1.5.20 and sidebar

2010-08-30 Thread E. Prom
On Monday, 30 August 2010, 18:35:23 +0200,
E. Prom e3p...@gmail.com wrote:
 On Monday, 30 August 2010, 18:19:30 +0200,
 E. Prom e3p...@gmail.com wrote:
 
  mailboxes `/bin/ls ~/Maildirs/*`
 
 It doesn't work, and I don't manage to correct it.

Finally :
mailboxes `/bin/ls -d ~/Maildirs/*|xargs`

Sorry for the noise.


Re: 1.5.20 and sidebar

2010-08-30 Thread Tim Gray

On Aug 30, 2010 at 09:00 AM -0700, fe...@crowfix.com wrote:

I have maildirs, a bunch of them, all under ~/Maildirs.  I was hoping
to be able to use something like this:


I use a Python script to list my boxes.  I'm sure you could do the same with 
a shell script of shell command, but I'm more comfortable with Python.


In my muttrc, I have:
mailboxes `~/bin/listbox.py ~/Maildirs`

I've attached listbox.py.  It has a list defined, ignore, that lets you 
ignore certain folders if you wish.  It works for Maildirs.  I cleaned up 
the code a bit for public consumption and removed some extra stuff that I 
have it do.#!/usr/bin/env python


__author__ = Tim Gray
__version__ = 1.0

import os, sys

try:
fpath = sys.argv[1]
except:
sys.exit(1)

tmp, parentdir = os.path.split(fpath)
# path to boxes to ignore, relative to input file path  
ignore = ['.DS_Store', 'boxes', 'to', 'remove']

s = os.path.expanduser(fpath)
s1, s2 = os.path.split(s)
os.chdir(s1)

dirs = []
for root,wdirs,files in os.walk(s2):
if 'cur' in wdirs:
wdirs.remove('cur')
wdirs.remove('tmp')
wdirs.remove('new')
dirs.append(root)

# remove dirs to ignore
for i in ignore:
removedir = parentdir + '/' + i
if removedir in dirs:
dirs.remove(removedir)

# print out dirs
for i in dirs:
print '+%s' % i,



Re: 1.5.20 and sidebar

2010-08-30 Thread felix
On Mon, Aug 30, 2010 at 06:51:03PM +0200, E. Prom wrote:
 mailboxes `/bin/ls -d ~/Maildirs/*|xargs`

Works!  In my case, I only have maildirs there, so it can be simpler.

I had not realized I could use backqoutes inside .muttrc.
Wh!  All sorts of possibilities there.  Maybe I ought to read up
on mutt again, been a long time since I set it up.

 Sorry for the noise.

There's enough signal :-)

-- 
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
 Felix Finch: scarecrow repairman  rocket surgeon / fe...@crowfix.com
  GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o


Re: 1.5.20 and sidebar

2010-08-30 Thread E. Prom
On Monday, 30 August 2010, 10:37:49 -0700,
fe...@crowfix.com wrote:
 I had not realized I could use backqoutes inside .muttrc.
 Wh!  All sorts of possibilities there.

Yep, very powerful!

I use or have used :

source  ~/.mutt/muttrc_`hostname`
set mbox=+mbox-`date +%Y`
mailboxes =mbox-`date +%Y --date 1 year ago` =mbox-`date +%Y`
my_hdr  X-Operating-System: `uname -o`


Re: 1.5.20 and sidebar

2010-08-30 Thread Chip Camden
Quoth E. Prom on Monday, 30 August 2010:
 On Monday, 30 August 2010, 10:37:49 -0700,
 fe...@crowfix.com wrote:
  I had not realized I could use backqoutes inside .muttrc.
  Wh!  All sorts of possibilities there.
 
 Yep, very powerful!
 
 I use or have used :
 
 source  ~/.mutt/muttrc_`hostname`
 set mbox=+mbox-`date +%Y`
 mailboxes =mbox-`date +%Y --date 1 year ago` =mbox-`date +%Y`
 my_hdr  X-Operating-System: `uname -o`

I use the following to set colors based on the number of colors supported
by my terminal:

source ~/.mutt-color`tput Co`

I have a .mutt-color256 and a .mutt-color8 for when I'm using
rxvt-256color or (console|ssh), respectively.

-- 
Sterling (Chip) Camden| sterl...@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipstips.com| http://chipsquips.com


pgp59bCt5sIQ7.pgp
Description: PGP signature


Re: 1.5.20 and sidebar [Way OT]

2010-08-30 Thread felix
On Mon, Aug 30, 2010 at 12:52:33PM -0700, Chip Camden wrote:
 Quoth E. Prom on Monday, 30 August 2010:

I find it fascinating that Chip is responding to E Prom.

-- 
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
 Felix Finch: scarecrow repairman  rocket surgeon / fe...@crowfix.com
  GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o


Re: 1.5.20 and sidebar

2010-08-30 Thread Michelle Konzack
Hello fe...@crowfix.com,

Am 2010-08-30 09:00:25, hacktest Du folgendes herunter:
 I was curious about the sidebar and recompiled mutt with that option.
 Some questions.
 
 What is the status of this patch?  I gather it is not official and
 probably never will be.  Is this because it conflicts with plans for
 mutt, or it is too hoaky, or not well written, or ...
 
 I have maildirs, a bunch of them, all under ~/Maildirs.  I was hoping
 to be able to use something like this:
 
 mailboxes ~/Maildirs/*
 
 but that's nae working.  I'd rather not list them all explicitly,
 otherwise changing the dirs under ~/Maildirs requires the extra and
 easy-to-forget step of editing the mutt config.  I also thought to
 make an alias, something like this

I have a tool which does this:

[ '~/.mutt/mailboxes' ]-

set xterm_icon  = 'ML_mail [%n] %f'
set xterm_title = 'ML_mail [%n] %f'

unmailboxes *

mailboxes =.ML_mail.ADMIN/
mailboxes =.ML_mail/

`tdmuttmailboxes --folder=.ML_mail.* |grep -v ADMIN`



which assume,  you  are  using  Courier  style  Maildir  and  it  output
for example following:

mailboxes =.ml_mail.clamav-us...@lists_clamav_net
mailboxes =.ml_mail.courier-us...@lists_sourceforge_net
mailboxes =.ml_mail.exim-us...@exim_org
mailboxes =.ml_mail.fetchmail-us...@lists_berlios_de
mailboxes =.ml_mail.imapproxy-i...@lists_andrew_cmu_edu
mailboxes =.ml_mail.mutt-us...@mutt_org
mailboxes =.ml_mail.perdition-us...@vergenet_net
mailboxes =.ml_mail.procm...@lists_rwth-aachen_de
mailboxes =.ml_mail.squirrelmail-annou...@lists_sourceforge_net
mailboxes =.ml_mail.squirrelmail-imappr...@lists_sourceforge_net
mailboxes =.ml_mail.squirrelmail-us...@lists_sourceforge_net
mailboxes =.ml_mail.us...@spamassassin_apache_org


which is automaticaly read by mutt. This has the advantage, if I like to
remove one of them manualy, I can simlply use

unmailboxes =.ml_mail.squirrelmail-annou...@lists_sourceforge_net

because if you put ALL folders in ONE mailboxes directive, you have to
use

unmailboxes *

to get rid of them, BUT AT ONCE!

Oh, tdmuttmailboxes2 is currently a BASH script, but I like  to  switch
to perl, because the I can activate the option

--server=mail.example.com

to get the list of the directories on the IMAP server...

Thanks, Greetings and nice Day/Evening
Michelle Konzack

-- 
# Debian GNU/Linux Consultant ##
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsyst...@tdnet France EURL   itsyst...@tdnet UG (limited liability)
Owner Michelle KonzackOwner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz Kinzigstraße 17
67100 Strasbourg/France   77694 Kehl/Germany
Tel: +33-6-61925193 mobil Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

http://www.itsystems.tamay-dogan.net/  http://www.flexray4linux.org/
http://www.debian.tamay-dogan.net/ http://www.can4linux.org/

Jabber linux4miche...@jabber.ccc.de
ICQ#328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/


signature.pgp
Description: Digital signature


Re: 1.5.20 and sidebar

2010-08-30 Thread felix
I've just started thinking on all this capability which I did not know
existed in mutt.  Is there a way to assign an external command to a
key which will be passed the path to the message?  For instance, if I
write a dumb little shell script to move a message into the spam
maildir ...

#!/bin/sh
mv -i $@ ~/Maildirs/junk/new

can I assign that command to a key so that when I hit the key, it
invokes the command with the path to the message on that line?

Mutt has so much more capability than I realized that I may be
fantasizing a bit much here.

I also realize that this path passing is only useful for maildirs, not
mailboxes or imap/pop.  But that's fine with me.

-- 
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
 Felix Finch: scarecrow repairman  rocket surgeon / fe...@crowfix.com
  GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o


Re: 1.5.20 and sidebar

2010-08-30 Thread Chip Camden
Quoth fe...@crowfix.com on Monday, 30 August 2010:
 I've just started thinking on all this capability which I did not know
 existed in mutt.  Is there a way to assign an external command to a
 key which will be passed the path to the message?  For instance, if I
 write a dumb little shell script to move a message into the spam
 maildir ...
 
 #!/bin/sh
 mv -i $@ ~/Maildirs/junk/new
 
 can I assign that command to a key so that when I hit the key, it
 invokes the command with the path to the message on that line?
 
 Mutt has so much more capability than I realized that I may be
 fantasizing a bit much here.
 
 I also realize that this path passing is only useful for maildirs, not
 mailboxes or imap/pop.  But that's fine with me.
 
 -- 
 ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
  Felix Finch: scarecrow repairman  rocket surgeon / fe...@crowfix.com
   GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
 I've found a solution to Fermat's Last Theorem but I see I've run out of room 
 o

If you just want to move the message, use save-message.  But you can
always define a macro that pipes the message to a script, and then you
can do whatever you want with it.  If it needs to be passed as a file to
another script, you can write it to a tmp file and pass that.  I have a
script called 'farg' for that purpose:

#!/bin/sh
file=`mktemp /tmp/farg.XX`
cat  $file
`printf $1 $file`
if [ `echo $1 | cut -c 1-6` = spawn  ]
then
  sleep 5
fi
rm $file

The first argument is a printf format for the command to launch, where %s
will be replaced by the tmp file generated from stdin.

If the process is being spawned, then I wait five seconds so the spawned
process can pick it up before I delete it.  Here's spawn:

#!/bin/sh
$* 

-- 
Sterling (Chip) Camden| sterl...@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipstips.com| http://chipsquips.com


pgpSTEhtApEDc.pgp
Description: PGP signature


Re: 1.5.20 and sidebar

2010-08-30 Thread Michelle Konzack
Hello fe...@crowfix.com,

Am 2010-08-30 17:13:25, hacktest Du folgendes herunter:
 #!/bin/sh
 mv -i $@ ~/Maildirs/junk/new
 
 can I assign that command to a key so that when I hit the key, it
 invokes the command with the path to the message on that line?

macro generic F5  :set delete=yes\ns=.SPAM.sa-learn/\n\n:set 
delete=ask-yes\n
macro index   F5  :set delete=yes\ns=.SPAM.sa-learn/\n\n:set 
delete=ask-yes\n
macro pager   F5  :set delete=yes\ns=.SPAM.sa-learn/\n\n:set 
delete=ask-yes\n

:-D

If I hit F5 the current mesage is moved to the spamfolder.

Thanks, Greetings and nice Day/Evening
Michelle Konzack

-- 
# Debian GNU/Linux Consultant ##
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsyst...@tdnet France EURL   itsyst...@tdnet UG (limited liability)
Owner Michelle KonzackOwner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz Kinzigstraße 17
67100 Strasbourg/France   77694 Kehl/Germany
Tel: +33-6-61925193 mobil Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

http://www.itsystems.tamay-dogan.net/  http://www.flexray4linux.org/
http://www.debian.tamay-dogan.net/ http://www.can4linux.org/

Jabber linux4miche...@jabber.ccc.de
ICQ#328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/


signature.pgp
Description: Digital signature


Re: 1.5.20 and sidebar

2010-08-30 Thread E. Prom
On Monday, 30 August 2010, 17:39:44 -0700,
Chip Camden sterl...@camdensoftware.com wrote:
 Quoth fe...@crowfix.com on Monday, 30 August 2010:
  Is there a way to assign an external command to a key which will be
  passed the path to the message?  For instance, if I write a dumb
  little shell script to move a message into the spam maildir ...
  
  #!/bin/sh
  mv -i $@ ~/Maildirs/junk/new

 If you just want to move the message, use save-message.  But you can
 always define a macro that pipes the message to a script, and then you
 can do whatever you want with it.

I don't think you can get the name of the file in your maildir, but you
can use save-message, or pipe-message followed by delete-message
in a macro.

Quite obvious, but I wanted E Prom to respond to Chip ;)