2

How can I assure that all existing files (or future files) inside a folder in unix are always world readable ?

I am using email piping to read attachment from the email via php script and store it in some folder which will be viewable by the apache user.

Now, the email pipe is storing the attachment with rights to only user nobody and group nobody ..

How can I change it so that anyone can read the files inside that folder ?

Thanks, Amit

4 Answers 4

5

You would need to change the umask in the environment of the user running postfix. How this is done depends on how it is started. You can most likely set it in the init script that is starting postfix.

Controlling file permissions with umask

2
  • You could also set this folder sgid, but setting umask looks a cleaner way.
    – Benoit
    Nov 15, 2010 at 13:16
  • I was going to mention that but he said ownership was fine and seemed to be specifically concerned with permissions.
    – sinping
    Nov 15, 2010 at 13:20
1

According to Wietse in the post linked below, Postfix runs with umask 077, and it seems intentional. You might patch the code, to run with a different umask.

http://tech.groups.yahoo.com/group/postfix-users/message/254262

0

You can change the file ownership of a folder and files and directories in it with

chown -R <owner>:<group> <myfolder>
1
  • folder owner ship is already set properly.. but it seems when postfix user store the attachment in that folder... it's changing the permissions. Nov 15, 2010 at 12:49
0

Using incron a similar cron scheduler, based on file system changes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .