On 04/Jun/10 15:48, Michelle Konzack wrote:
> Am 2010-06-04 11:41:21, hacktest Du folgendes herunter:
>>  However, I have no idea how to set the filename. I don't think you
>>  mean a maildrop script. How about hacking deliverquota? Then the setup
>>  would become, e.g.
>>
>>     echo '|deliverquota -S ./Maildir/.Sent'>  .courier-sent

(that still seems the simplest solution to me, except that I'm not 
going to maintain a patch for it, so it needs Sam's blessing.)

>>  Won't I break any Maildir++ assumptions delivering that way?
>
> If I wan to mark messages as read and not let detect an IMAP client  the
> new message I do in procmail:

procmail? What's that ;-)

> and the script is:
>
> ----[ '~/bin/move_mail_to_seen' ]---------------------------------------
> #!/bin/bash
>
> MSG_SIZE=$(wc --bytes <${LASTFOLDER})
>
> MSG_NAME=$(basename ${LASTFOLDER})
> MSG_DIR=$(dirname   ${LASTFOLDER}} |sed -e 's|/new/$||')
>
> MSG_SAVE="${MSG_NAME},S=${MSG_SIZE}:2,S"
>
> MSG_LAST=$(head -n1 ${MSG_DIR}/courierimapuigdb |cut -d ' ' -f3)
> MSG_NEW=$((MSG_LAST+1))
>
> DATE_NOW=$(date +%s)
>
> echo "1 ${DATE_NOW} ${MSG_NEW}"          >${MSG_DIR}/courierimapuigdb.tmp
> sed '1,1d' <${MSG_DIR}/courierimapuigdb >>${MSG_DIR}/courierimapuigdb.tmp
> echo "${MSG_LAST} ${MSG_SAVE}"          >>${MSG_DIR}/courierimapuigdb.tmp
>
> mv -f ${MSG_DIR}/courierimapuigdb.tmp ${MSG_DIR}/courierimapuigdb
> mv ${LASTFOLDER} ${MSG_DIR}/cur/${MSG_SAVE}
> ------------------------------------------------------------------------

Thank you for the script, Michelle. That LASTFOLDER variable is not 
clear to me. However, I'd only do it for .Sent, and can use the last 
line(s) of courierimapuiddb to get the filename(s), or read /new/.

> And yes, YOU MUST LOCK the delivery recipe and  YOU  MUST  RE-WRITE  the
> courierimapuigdb because otherwise you will run into some weird results.

Yeah, the script is concurrent with itself and with the imap server.

A clean overkill solution would be to launch an imap client so "see" 
any new message(s).

Back to the simple solution, browsing courier sources I've found 
snippets like these, in webmail

   if (dest_shared)
   /* We need to copy it directly into /cur of the dest folder */
   {
       memcpy(strrchr(createInfo.newname, '/')-3, "cur", 3);
                               /* HACK!!!!!!!!!!!! */
   }

  and in imap

   memcpy(strrchr(p, '/')-3, "cur", 3); /* HACK OF THE MILLENIA */

I propose to allow citizenship to deliver-to-cur, if it is consistent 
with the Maildir++ analysis --as it seemingly is. Besides possibly 
updating docs, that boils down to factoring out those two lines (sort 
of) and make that available as a regular option of maildir_tmpcreate. 
While rewriting those two lines is of little interest, it may avoid 
further hacks, and adding the above option to deliverquota would then 
come smoothly.



























-- 

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to