On Thu, Jul 22, 2010 at 09:24:52PM +0200, Ralf Hildebrandt wrote:

> * Victor Duchovni <victor.ducho...@morganstanley.com>:
> 
> > Note, if rsync propagates file permissions before it copies file contents,
> > an incomplete queue file could be picked up by the queue manager before
> > it is completely written. So it is safer to rsync outside "incoming"
> > (in the same file-system) and then rename into "incoming".
> 
> Good point. rsycn it some place else, the mv it atomically.

But not necessary if rsync temp file names are Postfix-safe (i.e.
not alnum + '_'), which is probably the case, so my point is likely
moot, but checking the validity of the assumption is sensible.

> > The above said, rsync also uses temporary file-names while creating files,
> 
> Yes.
> 
> > and uses rename to finalize the file copy only once the contents are
> > all there, so Wietse's suggestion will likely work, provided rsync's
> > temp file names don't look like Postfix queue-ids (the queue manager
> > incoming directory scans skip filenames that don't look like queue-ids).
> > 
> > The code in question is src/global/mail_queue.c:mail_queue_id_ok()
> > which skips any filenames that are not alphanumeric (with '_').
> > 
> > So provided rsync's temp names include some other chars (I think
> > it uses ".tempname" to keep temp files "out of view" while they
> > are being created) there is no need for the intermediate copy...

-- 
        Viktor.

Reply via email to