LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-31-2014, 02:38 PM   #1
cotton213
LQ Newbie
 
Registered: Dec 2004
Location: Michigan
Distribution: Slackware, Red Hat, Ubuntu
Posts: 23

Rep: Reputation: 1
$HOME/.procmailrc won't run unless $HOME has 755 permissions


Our company has always set our home directories with 750 permissions. We've just updated our internal email server to ubuntu 12.04/sendmail/dovecot/ESET antivirus (from slackware/sendmail/POP3a/ASSP) and now our .procmailrc files won't execute unless the home directory they live in is 755.

Any ideas? I don't see why I should have to use 755. I thought that procmail ran as the user for whom it was delivering mail(?)

barb

ETA: turns out 751 works as well. Still want to know why.

Last edited by cotton213; 07-31-2014 at 02:52 PM.
 
Old 07-31-2014, 03:16 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Your home directory should have octal 0750 to shield its contents. And .procmailrc is a resource file. It gets read and interpreted by procmail, not executed like a file with the executable bit set. Set the VERBOSE variable in your ~/.procmailrc, make it use a log file and test.
 
Old 07-31-2014, 03:32 PM   #3
cotton213
LQ Newbie
 
Registered: Dec 2004
Location: Michigan
Distribution: Slackware, Red Hat, Ubuntu
Posts: 23

Original Poster
Rep: Reputation: 1
Thanks for the reply, Unspawn.

I do understand that we don't manually execute the .procmailrc file, that it is used by procmail. The problem I'm having is that unless I set those directory permissions at 755 or 751, the .procmailrc file is completely ignored. I have LOGFILE, VERBOSE, and LOGABSTRACT all set in the $HOME/.procmailrc file and absolutely nothing is written unless I open up the permissions on the $HOME directory. I can also set up an /etc/procmailrc file that works, but just can't get the $HOME/.procmailrc working for any of my users.
 
Old 07-31-2014, 03:47 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by cotton213 View Post
I do understand that we don't manually execute the .procmailrc file,
Sorry, misread that.


Quote:
Originally Posted by cotton213 View Post
just can't get the $HOME/.procmailrc working for any of my users.
Can you run a strace on the process? See what it errors out on?
 
Old 07-31-2014, 04:37 PM   #5
cotton213
LQ Newbie
 
Registered: Dec 2004
Location: Michigan
Distribution: Slackware, Red Hat, Ubuntu
Posts: 23

Original Poster
Rep: Reputation: 1
Thanks for the follow-up. I probably can't do the strace -- tomorrow is actually my last day at this job and I'm swamped with other issues. I just *really* wanted to understand this. Maybe I can get my heir to do it

Thanks again.
 
Old 07-31-2014, 05:50 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
My guess would be that the test for the existence of .procmailrc might be done before switching to the user's UID for processing it. Frankly, that sounds like it would be a bug. Trying to get an strace of a process spawned by the mail delivery agent might be a challenge.
 
Old 08-01-2014, 12:54 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by cotton213 View Post
I probably can't do the strace -- tomorrow is actually my last day at this job and I'm swamped with other issues.
Then at least document the issue together with a link to this thread?
 
Old 08-01-2014, 08:26 AM   #8
cotton213
LQ Newbie
 
Registered: Dec 2004
Location: Michigan
Distribution: Slackware, Red Hat, Ubuntu
Posts: 23

Original Poster
Rep: Reputation: 1
Yup, unSpawn, I definitely will. Actually, I looked at it with someone else last night and we determined this:

-- some process needs to check if the $HOME/.procmailrc file exists before trying to run it (hence needing the execute permission)
-- let's assume (for lack of anything better) that this process is run by root
-- the HOME directories are NFS mounted, so let's mount them no_root_squash to the mail server (running procmail)
-- voila!! It works now
-- set home dir permissions back to 750

Thanks for everyone's help!
 
1 members found this post helpful.
Old 08-01-2014, 10:18 AM   #9
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
I would definitely report that as a bug against procmail. It should not be necessary to use no_root_squash or to open up the permissions on the home directory in order to use a user's .procmailrc in an NFS-mounted directory.
 
Old 08-01-2014, 12:18 PM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by cotton213 View Post
Thanks for everyone's help!
Likewise thanks for researching it and posting your findings and that on the last day of your current job.
Good luck with your new job, I hope it will prove to be profitable in many ways.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
.procmailrc MAILDIR=$HOME/Maildir not working? paulclark Linux - Newbie 4 01-28-2009 07:56 AM
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 04:02 PM
Championship Manager 3 won't run on Win XP Home crmpicco General 5 12-03-2007 07:34 AM
LXer: Vista Home Editions Won't Run On Mac, Linux Virtual Machines LXer Syndicated Linux News 0 02-03-2007 05:54 PM
home directories created w/ 755 permissions psychobyte Linux - Security 8 01-16-2006 09:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration