Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

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

share|improve this answer
You could also set this folder sgid, but setting umask looks a cleaner way. – Benoit Nov 15 '10 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 '10 at 13:20

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.

share|improve this answer

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

chown -R <owner>:<group> <myfolder>
share|improve this answer
folder owner ship is already set properly.. but it seems when postfix user store the attachment in that folder... it's changing the permissions. – Amit Aggarwal Nov 15 '10 at 12:49

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.