14 Feb
2007
14 Feb
'07
6:59 p.m.
n Wed, 2007-02-14 at 11:42 -0500, Charles Marcus wrote:
With maildir I suppose it's possible with hardlinks, but that's a bit kludgy.
Do you know if that is how cyrus does it?
I think Cyrus also uses hardlinks. Well, the only problem is what to do when the destination users have different UIDs. Deliver would pretty much have to deliver the mail as root, or use some kludgy approaches. In any case the file would then probably have to be owned by root (or another specified user) and be read-only to the destination users.
I suppose it wouldn't be _too_ difficult to implement this though. Something like:
- save the file to some temporary file in a directory where only deliver has access
- change effective UID to destination user (keep the deliver group effective) and hardlink the file to the user's maildir
- change effective UID back to root
- process next user, goto 2
- Unlink the temporary file
This would however mean that there wouldn't be any Delivered-To header since all the mails will be identical.