LMTP with hardlinks ?

Vladislav Kurz vladislav.kurz at webstep.net
Tue May 25 01:31:20 EEST 2021


I'm looking for deduplication of mails via hardlinks during delivery. I.e. a 
mail that is sent to multiple recipients (to, cc, bcc) should be stored only 

I did some search and found only some non-complete information.

dovecot-lda has a "-p path" option that does the delivery using symlinks if 
possible (i.e. same uid/gid and same filesystem). This is working by hand, but 
could not find any hints how to use this with postfix. Found only suggestion of 
a wrapper, that was probably never implemented - in this thread:

In this message: https://dovecot.org/list/dovecot/2013-February/088540.html
there is statement that: LMTP always delivers the mail to the first user. Then 
it tries to copy the first mail to the second user, because in some setups this 
can be done using hard links. 

I was not able to get this in my setup, and I'd like to know if this statement 
is really true. I have all mail in /var/vmail, all owned by vmail user, but 
still mail delivered to multiple users is duplicated.

If this is really supposed to make hardlinks (which would be great), is there 
any way to debug it? E.g. see if the hardlink was attempted but failed for 
some reason, or if the message was delivered in the same LMTP session ?

Best Regards
        Vladislav Kurz

More information about the dovecot mailing list