postfix "mail-pipe" alias shellscript creates permissionless files/dirs
        Posted  
        
            by 
                Gung Foo
            
        on Super User
        
        See other posts from Super User
        
            or by Gung Foo
        
        
        
        Published on 2012-09-17T15:32:44Z
        Indexed on 
            2012/09/18
            9:40 UTC
        
        
        Read the original article
        Hit count: 391
        
I am using an alias to a shellscript in postfix... After the script that is called by the shellscript creates a directory it has no permissions at all..
#!/bin/sh
umask 002
cat | php /var/www/html/catchmymail rcvemail
result is like this:
d--------- 2 apache   apache 4096 Sep 17 17:25 50
it works for files tho:
-rw-rw---- 1 apache   apache 5836288 Sep 18 11:21 test
Not even setting umask 002 in the shellscript before it hands the mail on changes a thing
Setting umask(0002) inside catchmymail has no effect either.
Has anyone seen this behaviour before or an idea to save my day?!?
This is extremely confusing and actually insane behaviour from what i understand about umask and file permissions.
© Super User or respective owner