Re: mbox ownership
Mark Overmeer <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Organization | MARKOV Solutions |
| Message-ID | <[email protected]> |
* andre deblire ([email protected]) [040406 13:25]: > As root, I process several unix mbox files which belong to non-root > users. Isn't it saver to process the mailbox of a user with the permissions of that user? That way, to also avoid the ownership problem. foreach my $user (@users) { unless(my $kid = fork) { $> = getpwnam $user; # process user's mailbox exit 0; } waitpid $kid; } [untested] > How can I force MailBox to preserve the correct ownership of the boxes ? Not on the moment. > I read an answer from Mark stating that a call to chown could restore > the correct ownership. There is a good case for restoring the owner and permissions on the moment that the mailbox replacement is accepted. However: how do we get this to work for all unix/linux versions AND windows? > Yes. But AFAIK, this call is only possible AFTER the $folder->close(), > which unlocks the box, giving to a waiting sendmail process the > opportunity to throw away the "BOGUS mbox". True -- MarkOv ------------------------------------------------------------------------ drs Mark A.C.J. Overmeer MARKOV Solutions [email protected] [email protected] http://Mark.Overmeer.net http://solutions.overmeer.net