[Dovecot] deliver saving mails with hard linking

Karsten Bräckelmann guenther at rudersport.de
Mon Jun 2 00:15:40 EEST 2008


On Mon, 2008-06-02 at 00:06 +0300, Timo Sirainen wrote:
> I think my previous mail about it described some persistent uniqueness  
> checks. This patch is only about delivery-time hard linking. If two  
> different deliveries sent the same message they would be stored using  
> different files. So the deliver wrapper script would be like:
> 
> cat > tempfile
> deliver -p tempfile -d user1
> deliver -p tempfile -d user2
> rm -f tempfile
> 
> The result would be that user1 and user2 had the same file with link  
> count 2 and the file is gone when both of them delete it.

Right. Coincidentally, I just got back to check the patch for unlink...
Walking around indeed does help thinking, even though I guess you got
more space than me. ;-)

If either deliver right before finishing or the wrapper script deletes
the source, cleaning up will not be an issue.

  guenther


-- 
char *t="\10pse\0r\0dtu\0. at ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}



More information about the dovecot mailing list