Voicemail .txt files created with strange permission 006

Running Asterisk SVN-branch-1.4-r84135 with FreePBX 2.3.0.3.

When i leave a voicemail msg to an extension the files is saved in
/var/spool/asterisk/voicemail/default/202/INBOX
with below permissions
-------rw- 1 asterisk asterisk 272 30 sep 19.14 msg0000.txt
-rwxr-xr-x 1 asterisk asterisk 92844 30 sep 19.14 msg0000.wav

Only the .txt. files get screwed up permissions.

Asterisk is running as asterisk user
[root@obelix asterisk]# ps -C asterisk -f
UID PID PPID C STIME TTY TIME CMD
asterisk 29216 29165 0 Oct01 ? 00:00:55 /usr/sbin/asterisk -U asterisk -G asterisk -vvvg -c

As far as i can tell umask is 0022.
[root@obelix asterisk]# umask -p
umask 0022

Pls help anyone. What is wrong?

:cry:

Had to comment out a line in sourcefile:
/usr/src/asterisk-1.4/apps/app_voicemail.c

Function:
static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *options)

Line commented/removed:
chmod(tmptxtfile, VOICEMAIL_FILE_MODE & ~my_umask);

After recompile, the voicemail .txt files was saved as
-rw------- 1 asterisk asterisk 5775 3 okt 10.58 msg0000.txt

And as im running Asterisk as “asterisk” user its afaik sufficient.
Somehow the chmod screwed the filepermissions as to read 0006.
Dunno why though… any ideas anyone?

References:
lists.digium.com/pipermail/aster … 14855.html
svn.digium.com/view/asterisk/tea … hrev=76731
linuxzoo.net/page/sec_umask.html