Jeff Abrahamson on 22 Jan 2005 12:47:15 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] mutt close-hook advice


On Thu, Jan 20, 2005 at 04:19:35PM -0500, Flint Heart wrote:
>   [19 lines, 104 words, 794 characters]  Top characters: _tnilosh
> 
> On Thu, Jan 20, 2005 at 04:02:43PM -0500, sean finney wrote:
> > On Thu, Jan 20, 2005 at 03:50:18PM -0500, Flint Heart wrote:
> > > mbox-hook +ML.plug "+lists/ML.plug-`date +%Y-%m`"
> > 
> > ooh, now that's a nice trick.   i didn't realize that you could
> > call system commands like that. 
> > 
> > 
> > 	sean
> 
> The only problem with this is that its only changed every time you start up
> mutt. ( unless I'm missing a config option someplace ) So I just restart
> mutt at the begining of a month...

I think you have missed something.  From the mutt manual:

  3.11.  Using Multiple spool mailboxes

  Usage: mbox-hook [!]pattern mailbox

  This command is used to move read messages from a specified mailbox to
  a different mailbox automatically when you quit or change folders.
  pattern is a regular expression specifying the mailbox to treat as a
  ``spool'' mailbox and mailbox specifies where mail should be saved
  when read.

  Unlike some of the other hook commands, only the first matching
  pattern is used (it is not possible to save read mail in more than a
  single mailbox).

So you should get a move every time you leave the ML.plug mbox
(above).


Alternatively, you could put create a special config file that looks
like this:

    source normal-muttrc
    mbox-hook +mailbox-that-grows +mailbox-that-grows=`date...`

and then put this in cron:

    mutt -F special-config-file -f mailbox-that-grows -e ':quit'

Then mutt would run with the special mbox-hook, load the mailbox in
question, and then quit.  But on closing the mailbox, it would
transfer everything in it to the archive mbox.

I haven't tested this, maybe you'd have to use 'push' instead of ''e'
to get the right behavior.

-- 
 Jeff

 Jeff Abrahamson  <http://www.purple.com/jeff/>    +1 215/837-2287
 GPG fingerprint: 1A1A BA95 D082 A558 A276  63C6 16BF 8C4C 0D1D AE4B

Attachment: signature.asc
Description: Digital signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug