Timo Sirainen wrote:
I think that could anyway be a good idea, but how about hash collisions? I could just ignore that since they would practically never happen. Hash that'd just slow it down unneededly.. Perhaps it should be an option.
- attachment size would be even safer. The only truly safe way would be to read the whole attachment from disk and compare it byte-by-byte, but
Collisions won't be a big problem if you use something like SHA, but it would be slow. You have to generate a checksum for both sides of the comparison, meaning you have to generate it at least once per message. Generating it always means reading every byte of it.
A better solution might be for the LDA to detect which messages are being delivered locally to more than one user. I could then make the message file shared (in the case of Maildir anyway), for example by hard-linking the files. The message would then exist on disk in one copy until each client have removed it (bringing the link count to 0).
Just an idea.
- Tore