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

Re: Batch Individual Save?



On 09:03 Fri 06 Mar     , Paul E Condon wrote:
> I find myself in possession of an email folder in which there are
> close to a thousand emails. These emails are from many different
> senders. I want to create folders according to sender email address
> just as would happen if I were to press 's' on each email
> individually. But when I press 's' I get two prompts that I need to
> respond to before Mutt actually saves the email into the folder that
> it has suggested. This is tedious.
> 
> But if I tag the whole lot and do ';' and 's', all the emails
> go to a single folder, based on the sender of ONE of the emails.
> This is OK for solving some other problem, but not the problem
> that I have now.
> 
> Is there some way of automating what happens when I type
> 's','\n','\n' over and over again?
> 
> FYI, it may make a difference: I am using a maildir format repository
> for the folders, with no subfolders, either real or apparent. 
> 
> TIA
> 
> -- 
> Paul E Condon           
> pecondon@xxxxxxxxxxxxxxxx
> 
If you really wanted to automate it to the extent of being sorted into separate
folders even before reading it, I would suggest using Procmail to file them.
For mails already in an mbox I use a script like the following (which is 
based on procmail being in place with rules for sorting incoming mail into
folders).

Raj
--------
#!/bin/sh

ORGMAIL=/var/mail/$LOGNAME

if cd $HOME &&
        test -s $ORGMAIL &&
        lockfile -r0 -l1024 .newmail.lock 2>/dev/null
then
        trap "rm -f .newmail.lock" 1 2 3 13 15
        umask 077
        lockfile -l1024 -ml
        cat $ORGMAIL >>.newmail &&
        cat /dev/null >$ORGMAIL
        lockfile -mu
        formail -s procmail <.newmail &&
        rm -f .newmail
        rm -f .newmail.lock
fi
exit 0


---------
# Rajarajan Rajamani : r.rajamani@xxxxxxxxx : r.rajamani@xxxxxxxxxxx