procmail
[Top] [All Lists]

Re: Scanning IMAP mail (first solution)

2009-11-16 13:42:45
On Mon, 2009-11-16 at 11:07 -0700, LuKreme wrote:
On 16-Nov-2009, at 10:47, JW Simpson wrote:


       | /bin/echo -e "Subject: $UNREAD unread mail(s)\n\n$NEWMAIL" |
       $SENDMAIL $MYAD

pretty sure when I tried that I lost the linefeeds on $NEWMAIL again.

That should work, as long as you have it inside the double-quote marks.
Give it another shot.  It may be that you are using a "builtin" echo?

for i in `ls -A $HOME/Maildir/ | grep '[0-9]-*'`;

You don't need the call to grep.

       for i in `ls -A $HOME/Maildir/[0-9]-*`;

No, that doesn't work because $i will contain

/home/usr/Maildir/.mailbox.2009-11

with the grep, $i contains

.mailbox.2009-11

True ... I've run into that before.



do ls −1 $HOME/Maildir/$i/{cur,new}/*, 2>/dev/null >>/tmp/$UNAME.$DATE.$i;

Don't use a tmp file.

       TMP=`ls −1 $HOME/Maildir/$i/{cur,new}/*, 2>/dev/null`

But that will result in a TMP that looks like this:

/home/kremels/Maildir/./cur/1258392839.2072_0.mail.covisp.net:2,
/home/kremels/Maildir/./cur/1258394552.M376650P6437V00000053I008E5E75_0.mail.covisp.net,S=381:2,
/home/kremels/Maildir/.applescript-users.2009-11/cur/1258389049.90346_0.mail.covisp.net:2,
/home/kremels/Maildir/.applescript-users.2009-11/cur/1258389482.92154_0.mail.covisp.net:2,
/home/kremels/Maildir/.applescript-users.2009-11/cur/1258389727.93154_0.mail.covisp.net:2,
/home/kremels/Maildir/.applescript-users.2009-11/cur/1258390041.93935_0.mail.covisp.net:2,
/home/kremels/Maildir/.applescript-users.2009-11/cur/1258391831.99023_0.mail.covisp.net:2,
/home/kremels/Maildir/.applescript-users.2009-11/cur/1258393220.3763_0.mail.covisp.net:2,
/home/kremels/Maildir/.iphone-talk.2009-11/cur/1258392161.347_0.mail.covisp.net:2,


You should stop there.  The rest can be handled by procmail "scoring".
Come to think of it... I think you can probably do the whole process
without the script.

I certainly don't see how.


Well I don't have the same mailbox setup that you have.
I've developed enough interest in your project though, that if you want
to zip up your Maildir ( with any sensitive info purged, of course ),
and e-mail it to me, I'd be happy to experiment and see what I can come
up with.

Also, it's just too slow.

The only reason I'm nitpicking ... is because you included that
statement.  :-D

Appreciated, believe me.

That's nice to hear/read once in a while!  :D 


-- 
JW Simpson <john(_at_)swajime(_dot_)com>
SwaJime's Cove℠

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail