[Dovecot] deliver saving mails with hard linking

Karsten Bräckelmann guenther at rudersport.de
Sun Jun 1 23:59:19 EEST 2008

On Sun, 2008-06-01 at 22:32 +0300, Timo Sirainen wrote:
> http://dovecot.org/tmp/deliver-multiple.diff for Dovecot v1.1 implements
> -p <path> parameter for deliver, which reads the input mail from the
> specified path instead of stdin. With maildir and hardlink copying
> enabled, it also tries to hard link the file to destination instead of
> copying it.

Wow. ;)

>  - Am I forgetting something?..

Cleaning up?  Quoting the part from option (2) of your previous mail,
which this seems to implement:

> All messages could be then stored in some global
> directory and hard linked from there to users' mailboxes.

When reading that I already wondered about cleaning up and freeing disk
space. If every recipient deleted their own "copy of the mail", the
inodes link count will go down to 1 due to the still existing global
copy. But it will survive despite being "deleted" (from the collective
users POV), occupying disk space -- and possibly keeping data around
that is assumed to be removed.

Of course, one could periodically check the link counts in yet another
external script, carefully ensuring deliver is not currently doing its
job, and get rid of the stale copies...


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