postfix "mail-pipe" alias shellscript creates permissionless files/dirs
- by Gung Foo
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.