Whatever it is that you are doing, chmod 777
is so misdirected as to lose your computer driver's license. It is a serious security problem to make files world-writable and executable.
You are probably looking for Procmail's UMASK
variable. If permissions are too tight, set a more relaxed UMASK
before delivering. Example:
:0
* some conditions
{
UMASK=003
:0
| uudeview --whatever
}
The umask
system call can only strip permissions, not add them. Typically, a C program tries to create a data file using mode 0666
and then the umask
is applied, often yielding something like 0644
(meaning the effective umask
was something like 0022
or 0033
). On Linux, the directory's permissions also somewhat influence the permissions of newly created files. But we are venturing outside of Procmail here. Perhaps you can achieve the end result you require by combining the UMASK
facility of Procmail with directory permissions.
If the "attachments" you are extracting are not MIME attachments but actual uuencode
, note also that the encoding specifies permissions for every encoded file. If the begin
line says 644
then you might have to change that. Procmail to the rescue again!
:0
* some conditions
{
UMASK=003
| sed 's/^begin [0-7][0-7][0-7][0-7]* /begin 664 /' | uudeview --whatever
}
In the end, if even this doesn't help, it may come down to modifying uudeview
, perhaps by tweaking its source, or by creating a wrapper which fixes up permissions after writing.