Procmail permission
Hi,
I cannot make procmail to write to local mailbox. get following error message: procmail: Error while writing to "/var/mail/... What is missing, permission ? Thanks for assistance. Cheers mike |
Are you using this from Sendmail?
Code:
FEATURE(`local_procmail',`',`procmail -t -f- -a $h -d $u')dnl Code:
file /var/mail |
Hi jayjwa,
thanks for your reply. I just use this: :0 * ^Subject:.*Undelivered Mail.*Returned.*to.*Sender /var/mail/admin and I get following error message: procmail: Error while writing to "/var/mail/admin" ls -la /var/mail/ total 76 drwxrwsr-x 2 root mail 4096 Mar 29 16:15 . drwxr-xr-x 13 root root 4096 Feb 26 2020 .. Cheers mike |
If you are not running that as root nor mail, you can't write to /var/mail as you have
Code:
drwxrwsr-x Code:
drwxrwxrwt |
Ah, thanks,
so you mean that procmailrc needs root permissions? cheers mike |
AFAIK, procmail can’t create directories…the targets of procmail recipes must already exist.
|
thanks scasey,
/var/mail/admin is an existing file. i stuck with the permissions, not very familiar for me. anyway procmailrc file has root:root permission. so i think it's problem with the permission of /var/mail/admin file, which i have posted above in my earlier reply. cheers mike |
Jayjwa,
could you give me perhaps the command for setting drwxrwxrwt to /var/mail/admin (file)? Thanks for your info. Cheers mike |
I think it needs to create a temp file in /var/mail so /var/mail must be writable.
Code:
chmod 1777 /var/mail |
thanks MadeInGermany,
get now: ls -la /var/mail/ total 120 drwxrwsrwt 2 root mail 4096 Mar 30 12:31 . drwxrwxr-x 13 root root 4096 Feb 26 2020 .. btw get also: stat -c '%A %a %n %U %G' /var/mail/ drwxrwsrwt 3777 /var/mail/ root mail why do I get 3777 instead of 1777 ? cheers mike |
still get this result for procmailrc entry:
:0 * ^Subject:.*Undelivered Mail.*Returned.*to.*Sender /var/mail/admin procmail: Match on "^Subject:.*Undelivered Mail.*Returned.*to.*Sender" procmail: Assigning "LASTFOLDER=/var/mail/admin" procmail: Opening "/var/mail/admin" procmail: Error while writing to "/var/mail/admin" cheers mike |
It seems to me that a possible solution to the OP's question would be if the OP were able to create a standard user and configure said user with a mailbox as a debugging step.
|
The g+s adds one bit, obviously the significant 2.
(Like the significant 1 that is the t bit. Both bits make 2+1 == 3). Ensure the file is present with correct owner and permission: as the user (mailbox owner) do Code:
touch /var/mail/admin |
thanks MadeInGermany,
permission 660 does not work. but if i use 662 it works. Am I missing something? cheers mike |
OK,
found the solution: Just add user 'root' to /var/mail/admin (root is the user of procmailrc) permission 660 is now OK for /var/mail/admin. adding the t bit to /var/mail/ is not needed. everything works now as wanted. just one more question: ls -la /var/mail/ total 76 drwxrwsr-x 2 root mail 4096 Mar 29 16:15 . drwxr-xr-x 13 root root 4096 Feb 26 2020 .. First entry is the permission of the folder itself. But what is the second permission? Thanks for a tip. Cheers mike |
All times are GMT -5. The time now is 06:17 PM. |