Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

4 Answers 4

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.

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

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

 
discard

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.