Tech Support > Operating Systems > Linux / Variants > Processing .procmailrc files in home directories?
Processing .procmailrc files in home directories?
Posted by Kevin G. on November 30th, 2003


Hello all,

I currently have 3 RedHat 8 servers. These are plain RedHat installs,
with no Cpanel or Ensim tied in.

I have Sendmail and Procmail installed, and working on these machines.
However, for the life of me I can't figure out how to make *ALL*
..procmailrc files process in user's home directories. I thought this
worked by default if you have procmail installed, but I guess this
isn't the case.

What I mean is, if I create a .procmailrc file and drop it into a
user's home directory, it does NOT process the file. I have to
manually edit /etc/procmailrc to show something like this:

INCLUDERC=/home/user/.procmailrc

Then it DOES process this file, but processes this recipe file
globally for the entire server rather than just for that user. Which
isn't really good at all.... because I might want to filter different
user's mail in different ways.

So basically, I'm trying to find the correct way to setup procmail so
it's "hooked" into each user's home directory, by using a .procmailrc
file. And then for any new or existing users, I would only have to
drop a .procmailrc file in the home directory and it would be
processed automatically rather than having to define each one in
/etc/procmailrc

Any help on this would be greatly appreciated.

Kevin G.
kevin[at]kgibbons[dot]com

Posted by Davide Bianchi on November 30th, 2003


Kevin G. <kevin@kgibbons[nospam].com> wrote:
Does the user have a valid shell? If the user doesn't have a shell
the .procmailrc file isn't executed.

Davide

Posted by Kevin G. on November 30th, 2003


On 30 Nov 2003 08:49:38 GMT, Davide Bianchi
<davideyeahsure@onlyforfun.net> wrote:

Yes, the users are all set to /bin/bash for their shell.

Are there any special settings in sendmail.cf or something I might
want to look for?

Posted by Alan Connor on November 30th, 2003


On Sun, 30 Nov 2003 08:38:52 GMT, Kevin G. <kevin@kgibbons> wrote:
I don't have any such problem, but then, I don't have an /etc/procmailrc
either....

AC


Posted by Davide Bianchi on November 30th, 2003


Kevin G. <kevin@kgibbons[nospam].com> wrote:
The only thing I can think of, is to check how procmail is
invoked from the mailer, if it's wit the -m switch, you must
specify the recipe file on the command line or it will not
process anything.

Davide

Posted by P.T. Breuer on November 30th, 2003


Kevin G. <kevin@kgibbons[nospam].com> wrote:
No. Just the standard ones. Is procmail set as your local delivery
agent in sendmail.cf?

If it isn't, you will want to add it as a filter in your users
.forward.

Peter

Posted by Floyd Davidson on November 30th, 2003


kevin@kgibbons[nospam].com (Kevin G.) wrote:
Sure sounds like a permissions problem. Are you changing the
ownership of the files in each user's home directory?

--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@barrow.com

Posted by Michael Heiming on November 30th, 2003


Kevin G. <kevin@kgibbons[nospam].com> wrote:

[..]
You might need to take a look at sendmail.mc and perhaps recreate
sendmail.cf using m4.

$ grep -i procmail /etc/mail/sendmail.mc
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
MAILER(procmail)dnl

This is from mine, no guarantee that this will work out for you.
My box might run a newer sendmail then yours.

BTW
The proper ng for sendmail related questions:
comp.mail.sendmail

--
Michael Heiming

Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of SPAM

Posted by Bob Tennent on November 30th, 2003


On Sun, 30 Nov 2003 08:38:52 GMT, Kevin G. wrote:

Check the permissions on the .procmailrc files and the $HOME directories:

Suspicious rcfile "x"

The owner of the rcfile was not the recipient or root, the file was
world writable, or the directory that contained it was world writable,
or this was the default rcfile ($HOME/.procmailrc) and either it was
group writable or the directory that contained it was group writable
(the rc-file was not used).

Bob T.


Posted by Raj Rijhwani on November 30th, 2003


On Sun, 30 Nov 2003 09:50:24 GMT, in article
<a8ecqb.4hg.ln@news.it.uc3m.es> ptb@oboe.it.uc3m.es
"P.T. Breuer" wrote:

That's how I had to sort it out, without hacking the sendmail.cf file
for myself. Although I've sucessfully hacked a few around in my time
I'm no expert by any means, and I gave up trying - especially when I
tried to dive into m4...
--
Raj Rijhwani | This is the voice of the Mysterons...
raj@rijhwani.org | ... We know that you can hear us Earthmen
http://www.rijhwani.org/raj/ | "Lieutenant Green: Launch all Angels!"


Similar Posts