On Tue, Mar 20, 2001 at 10:32:35AM -0800, Enoch Wu wrote:
> Using Mutt to do the job is stretching it quite a bit. Sometimes you have
> to use the right tool (like procmail) to do the job. However, the .muttrc
> snippet below should work but it does require you to hold down the "y" key
> while viewing the index page. The "save-hook" method gets around an
> occasional problem you would have if you use the "tag-pattern" method.
> 
> save-hook  "~h cygwin@"  +cygwin
> save-hook  "~h cygwin-apps@"  +cygwin-apps
> save-hook  "~h cygwin-digest-help@"  +cygwin-digest-help
> save-hook  "~h mutt-users@"  +mutt-users
> save-hook  "~h yourlogin@ | ~h yourlogin2@ | ~f someperson@" +To.Me
> save-hook  "~h *"  +other
> 
> macro index "y"       "<save-message><return>"  "Hold down y key to move
> messages
> 
> On Tue, 20 Mar 2001, Malcolm Boekhoff wrote:
> 
> > I want to retrieve messages from a POP3 mailbox and move them into folders (using 
>Mutt's pattern recognition expression operator
> > "~C") depending upon their To: or Cc: headers.
> > 
> > N.B. I don't want to read the messages before they are moved. I want them moved 
>into separate folders, so that I can switch to those
> > folders to read the messages.
> > 
> > Once they have been moved into such folders, I don't want them moved again.
> > 
> > Can somebody please tell me what I should set up to do this? I have been lead to 
>believe that I can use a macro to switch the
> > "spoolfile", use the 'G' <fetch-mail> command then switch the spoolfile back to 
>$MAIL, however, I don't really understand what I
> > should set "spoolfile", "mbox" to. I thought I could maybe use "save-hook"s to do 
>this, but the documentation is not very helpful on
> > these, for simple-minds like mine.
> > 
> > What I want is:
> > 
> > +mutt
> > +cygwin
> > +mbox
> > 
> > I want all messages downloaded from the POP3 server to go into +mbox, but those 
>matching "~C *cygwin*" to go into +cygwin and those
> > matching "~C *mutt*" to go into +mutt. I want the messages moved before I read 
>them.
> > 

Hi....

I'm new to Mutt, so what follows may need some fine-tuning! I've set up
the following macros in my /etc/muttrc file. In the "main index" where
you first see the contents of your "spoolfile", I simply run each macro.
So far, I haven't had a problem. Each "logical message groupings" - be
they mailing lists; personal mail, etc. is "saved" each in their
"mailbox".

mailboxes `echo $HOME/mutt/folders/[A-Z]*`
macro index "\cy" "<tag-pattern>~C 
questions@<enter><tag-prefix><save-message>=IN.freebsd<enter><delete-message><sync-mailbox><enter>"
macro index "\ey" "<tag-pattern>~C 
php-db<enter><tag-prefix><save-message>=IN.php-db<enter><delete-message><sync-mailbox><enter>"
macro index "\ez" "<tag-pattern>~C 
mutt-users<enter><tag-prefix><save-message>=IN.mutt<enter><delete-message><sync-mailbox><enter>"
macro index "\ex" "<tag-pattern>~C 
mercury@<enter><tag-prefix><save-message>=IN.mercury<enter><delete-message><sync-mailbox><enter>"
macro index "\ec" "<tag-pattern>(~C cygwin@)|(~C 
@cygwin)<enter><tag-prefix><save-message>=IN.cygwin<enter><delete-message><sync-mailbox><enter>"

Works for me, and it's an easy way to "filter" your spoolfile. What's
left over is usually spam or misc. "acceptable" stuff.

If there's any MMMs ( Mutt Macro Maestro ) ;,) reading this post, I'm
wondering how I could combine all of the above macros, into one huge one?
If that's possible, would it then be possible to load the huge macro into
a "push"? I'm thinking of a "push" command at the bottom of my
/etc/muttrc file.

Anyway Malcolm --- HTH! Later....
-- 
-duke
Calgary, Alberta, Canada


Reply via email to