[Dovecot] (Single instance) attachment storage

Timo Sirainen tss at iki.fi
Thu Sep 16 21:20:37 EEST 2010


On Tue, 2010-08-31 at 20:16 +0100, Timo Sirainen wrote:
> > Can you append some "trivial" information from the data file to the hash 
> > in generating the file name to help ensure uniqueness?  Like filesize, 
> 
> I guess size could be there at least optionally, I'm not sure about as
> default.

Now there's a mail_attachment_hash setting, where default is %{sha1} and
you can use variables:

 - %{md4}, %{md5}, %{sha1}, %{sha256}, %{sha512}
 - %{size} = 64bit size as hex
 - %X{size} = size with leading zeroes dropped
 - %{method:n} = include only first n bits of the hash (e.g.
%{sha256:128}
 - %B{method} = base64 encode instead of hex encode, don't include
trailing '=' chars

So you could have for example:

mail_attachment_size = %{sha512:128}-%{md5}-%X{size}

I think the SIS code is now just about done. Maybe after some more
testing I'll copy it to dovecot-2.0 branch.



More information about the dovecot mailing list