Re: How to re-procmail emails without modifying read/unread status

2010-08-07 Thread Erik Christiansen
On Fri, Aug 06, 2010 at 10:54:16PM +0200, Michelle Konzack wrote:
 Hello Christian Ebert,
 
 Am 2010-08-05 15:45:48, hacktest Du folgendes herunter:
  As Erik is using Maildir even that wouldn't help much as the
  messages would be delivered to Maildir/new/ .
 
 And if he had looked into the archive of the procmail list, he would
 know how to make files read.  Including modifying the courrierimapuidb

That is false attribution. Erik proposed a possible workaround.
It is in fact Yue Wu who has the problem, and therefore might wish to
consult the archives.

That can be seen in the archives, if one cares to look.

Erik
(Who is in fact using mbox.)

-- 
To err is humor.



Re: How to re-procmail emails without modifying read/unread status

2010-08-06 Thread Gregor Zattler
Hi Yue,
* Yue Wu vano...@gmail.com [06. Aug. 2010]:
 On Thu, Aug 05, 2010 at 03:45:48PM +0100, Christian Ebert wrote:
 * Erik Christiansen on Friday, August 06, 2010 at 00:38:37 +1000
 On Thu, Aug 05, 2010 at 09:18:45PM +0800, Yue Wu wrote:
  I don't only want to redeliver my emails, but also not let all redelivered
  mails become into the unread status. I'm using maildir format, and tried 
  with
  the following script:
  
 for j in $(find $2 -type d | grep cur) ; do (
 cd $j ;
 for i in * ;
 do cat $i | formail -ds procmail ;
 done) ;
 done
  
  But after redeliverd, all emails are new, i.e. unread in mutt, that's not 
  what
  I want.
 
 Since they have been redelivered, it's hard to blame mutt for indicating
 that. Since you are running a script over each one anyway, you could
 perhaps remember the value of the Status: header in each email, and
 restore it after redelivery.
 
 While formail will munge headers for you, I haven't tried fighting mutt
 to set the Status: header. You might need to do that faking post-delivery.
 
 As Erik is using Maildir even that wouldn't help much as the
 messages would be delivered to Maildir/new/ .
 
 
 But if I want to re-orgnize my emails with a different rule, how do you do it
 in such case? Orgnizing all mails to be unread then mark the old ones to be
 read is very tedious if mails is many.

I think there are three possible solutions:

a) don't refile with procmail, refile with mutt instead.  The
   pattern matching capabilities of mutt are very powerful but
   naturally limited to a single folder if you want zu refile
   from several folders this would be a problem.  But this is
   also scriptable.

b) refile with procmail *and* tag emails as refiled, for instance
   using the X-Label: -Header. 
   - The unread them 
 - in mutt 
   - manually: does not scale when many mail folders are
 involved
   - via a folder-hook and pattern matching.  May be slow for
 large mail folders and happens even when no refiling
 - once via a shell script

c) don't refile them use searching strategies on your emails via
   mairix and don't bother with the location of the emails.


Ciao, Gregor
-- 
 -... --- .-. . -.. ..--.. ...-.-


Re: How to re-procmail emails without modifying read/unread status

2010-08-06 Thread Ed Blackman

On Fri, Aug 06, 2010 at 10:48:05AM +0800, Yue Wu wrote:

In my case, after re-procmail, every email will be unread, I can't recorgnize
which are those I've read, I have to look those emails one by one and recall
if it's really read or unread by me.


In the script or procmail recipe that refiles them, read in the current 
read or unread status, and write another header with that status (eg, 
X-Refiled: read).  After you refile, use mutt header matching to 
update the status accordingly.


If you're going to do this more than once, you'll want to make a final 
pass to remove that header, so it doesn't mess you up on the next pass.


Ed


signature.txt
Description: Digital signature


Re: How to re-procmail emails without modifying read/unread status

2010-08-06 Thread Michelle Konzack
Hello Christian Ebert,

Am 2010-08-05 15:45:48, hacktest Du folgendes herunter:
 As Erik is using Maildir even that wouldn't help much as the
 messages would be delivered to Maildir/new/ .

And if he had looked into the archive of the procmail list, he would
know how to make files read.  Including modifying the courrierimapuidb

I have posted the solution several times...

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: How to re-procmail emails without modifying read/unread status

2010-08-06 Thread Michelle Konzack
Hello Yue Wu,

Am 2010-08-05 21:18:45, hacktest Du folgendes herunter:
 for j in $(find $2 -type d | grep cur) ; do (
 cd $j ;
 for i in * ;
 do cat $i | formail -ds procmail ;
 done) ;
 done
 
 But after redeliverd, all emails are new, i.e. unread in mutt, that's not what
 I want.

What about with:

for j in $(find $2 -type d | grep cur) ; do
cd ${j}
for i in * ; do
formail -I X-Re-Filter: true ${i} |procmail
done
done

and then in Procmail do at the beginning

   :0
   * ^X-Re-Filter: true
   {
 TRAP='DIR=$(dirname ${LASTFOLDER} |sed 's|/new$|/cur|') ; FILE=$(basename 
${LASTFOLDER}) ; mv ${LASTFOLDER} ${DIR}/${FILE}:2,S'
 :0fw
 | formail -I X-Re-Filter:
   }

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: How to re-procmail emails without modifying read/unread status

2010-08-05 Thread Patrick Shanahan
* Yue Wu vano...@gmail.com [08-05-10 08:39]:
 Sometimes I want to filter my emails with new rule of procmail, archived
 list has the way to re-procmail, but all re-procmailed mails will be at
 the new unread status. My question is, how to re-procmail without
 changing the read/unread status of emails?


You don't say the type of mail system, but I use mbox and the following
works for me.

formail -ds procmail  [mbox-file]

will redeliver your mbox-file based of the present procmail rules
splitting digest messages.  Use only -d if you do not want the splitting.

formail -ds procmail -m newrules.rc  mbox-file

will redeliver based on the rules contained in newrules.rc.  Prepend
paths where necessary.

I would use duplicate files or work inside a sandbox environment for
testing first.

gud luk,
-- 
Patrick Shanahan Plainfield, Indiana, USAHOG # US1244711
http://wahoo.no-ip.org Photo Album:  http://wahoo.no-ip.org/gallery2
Registered Linux User #207535@ http://counter.li.org


Re: How to re-procmail emails without modifying read/unread status

2010-08-05 Thread Yue Wu
On Thu, Aug 05, 2010 at 08:50:22AM -0400, Patrick Shanahan wrote:
 * Yue Wu vano...@gmail.com [08-05-10 08:39]:
  Sometimes I want to filter my emails with new rule of procmail, archived
  list has the way to re-procmail, but all re-procmailed mails will be at
  the new unread status. My question is, how to re-procmail without
  changing the read/unread status of emails?
 
 
 You don't say the type of mail system, but I use mbox and the following
 works for me.
 
 formail -ds procmail  [mbox-file]
 
 will redeliver your mbox-file based of the present procmail rules
 splitting digest messages.  Use only -d if you do not want the splitting.
 

I don't only want to redeliver my emails, but also not let all redelivered
mails become into the unread status. I'm using maildir format, and tried with
the following script:

for j in $(find $2 -type d | grep cur) ; do (
cd $j ;
for i in * ;
do cat $i | formail -ds procmail ;
done) ;
done

But after redeliverd, all emails are new, i.e. unread in mutt, that's not what
I want.

-- 
Regards,
Yue Wu

Key Laboratory of Modern Chinese Medicines
Department of Traditional Chinese Medicine
China Pharmaceutical University
No.24, Tongjia Xiang Street, Nanjing 210009, China


Re: How to re-procmail emails without modifying read/unread status

2010-08-05 Thread Erik Christiansen
On Thu, Aug 05, 2010 at 09:18:45PM +0800, Yue Wu wrote:
 I don't only want to redeliver my emails, but also not let all redelivered
 mails become into the unread status. I'm using maildir format, and tried with
 the following script:
 
 for j in $(find $2 -type d | grep cur) ; do (
 cd $j ;
 for i in * ;
 do cat $i | formail -ds procmail ;
 done) ;
 done
 
 But after redeliverd, all emails are new, i.e. unread in mutt, that's not what
 I want.

Since they have been redelivered, it's hard to blame mutt for indicating
that. Since you are running a script over each one anyway, you could
perhaps remember the value of the Status: header in each email, and
restore it after redelivery.

While formail will munge headers for you, I haven't tried fighting mutt
to set the Status: header. You might need to do that faking post-delivery.

Erik

-- 
Due to circumstances beyond our control, we regret to inform you that
circumstances are beyond our control.-Paul Benoit



Re: How to re-procmail emails without modifying read/unread status

2010-08-05 Thread Christian Ebert
* Erik Christiansen on Friday, August 06, 2010 at 00:38:37 +1000
 On Thu, Aug 05, 2010 at 09:18:45PM +0800, Yue Wu wrote:
 I don't only want to redeliver my emails, but also not let all redelivered
 mails become into the unread status. I'm using maildir format, and tried with
 the following script:
 
for j in $(find $2 -type d | grep cur) ; do (
cd $j ;
for i in * ;
do cat $i | formail -ds procmail ;
done) ;
done
 
 But after redeliverd, all emails are new, i.e. unread in mutt, that's not 
 what
 I want.
 
 Since they have been redelivered, it's hard to blame mutt for indicating
 that. Since you are running a script over each one anyway, you could
 perhaps remember the value of the Status: header in each email, and
 restore it after redelivery.
 
 While formail will munge headers for you, I haven't tried fighting mutt
 to set the Status: header. You might need to do that faking post-delivery.

As Erik is using Maildir even that wouldn't help much as the
messages would be delivered to Maildir/new/ .

c
-- 
theatre - books - texts - movies
Black Trash Productions at home: http://www.blacktrash.org/
Black Trash Productions on Facebook:
http://www.facebook.com/blacktrashproductions


Re: How to re-procmail emails without modifying read/unread status

2010-08-05 Thread Yue Wu
On Thu, Aug 05, 2010 at 03:45:48PM +0100, Christian Ebert wrote:
 * Erik Christiansen on Friday, August 06, 2010 at 00:38:37 +1000
  On Thu, Aug 05, 2010 at 09:18:45PM +0800, Yue Wu wrote:
  I don't only want to redeliver my emails, but also not let all redelivered
  mails become into the unread status. I'm using maildir format, and tried 
  with
  the following script:
  
 for j in $(find $2 -type d | grep cur) ; do (
 cd $j ;
 for i in * ;
 do cat $i | formail -ds procmail ;
 done) ;
 done
  
  But after redeliverd, all emails are new, i.e. unread in mutt, that's not 
  what
  I want.
  
  Since they have been redelivered, it's hard to blame mutt for indicating
  that. Since you are running a script over each one anyway, you could
  perhaps remember the value of the Status: header in each email, and
  restore it after redelivery.
  
  While formail will munge headers for you, I haven't tried fighting mutt
  to set the Status: header. You might need to do that faking post-delivery.
 
 As Erik is using Maildir even that wouldn't help much as the
 messages would be delivered to Maildir/new/ .
 

But if I want to re-orgnize my emails with a different rule, how do you do it
in such case? Orgnizing all mails to be unread then mark the old ones to be
read is very tedious if mails is many.

-- 
Regards,
Yue Wu

Key Laboratory of Modern Chinese Medicines
Department of Traditional Chinese Medicine
China Pharmaceutical University
No.24, Tongjia Xiang Street, Nanjing 210009, China


Re: How to re-procmail emails without modifying read/unread status

2010-08-05 Thread Monte Stevens
On Fri, Aug 06, 2010 at 08:34:01AM +0800, Yue Wu wrote:
 Orgnizing all mails to be unread then mark the old ones to be read is
 very tedious if mails is many.

Really?

How about T ~N ;N ?

Or in long form:
tag-pattern
pattern = new messages = ~N
tag-prefixtoggle-new

Optionally use ~O for old messages.

-- 
Monte


Re: How to re-procmail emails without modifying read/unread status

2010-08-05 Thread Yue Wu
On Thu, Aug 05, 2010 at 10:51:28PM -0300, Monte Stevens wrote:
 On Fri, Aug 06, 2010 at 08:34:01AM +0800, Yue Wu wrote:
  Orgnizing all mails to be unread then mark the old ones to be read is
  very tedious if mails is many.
 
 Really?
 
 How about T ~N ;N ?
 
 Or in long form:
 tag-pattern
 pattern = new messages = ~N
 tag-prefixtoggle-new
 
 Optionally use ~O for old messages.

In my case, after re-procmail, every email will be unread, I can't recorgnize
which are those I've read, I have to look those emails one by one and recall
if it's really read or unread by me.

-- 
Regards,
Yue Wu

Key Laboratory of Modern Chinese Medicines
Department of Traditional Chinese Medicine
China Pharmaceutical University
No.24, Tongjia Xiang Street, Nanjing 210009, China