procmail
[Top] [All Lists]

Setting .procmailrc for the root account

1996-10-24 14:52:21
Hi there,

Here is what I want to do.  

We have a fleet of RS/6000 machines running AIX.  We would like to get the 
configuration snapshots of these servers and archive them to a central server.  
I have written a small procmailrc filter which I want to run as root.  The 
reason for running it as root is because the configuration snapshot contains 
some secured files, for instance, /etc/security/passwd file etc.  The filter 
creates a directory of the server from which it received the "configuration" 
information and copy the body of the mail message as the <server>.config file.  

The problem is that I am not able to run the .procmailrc as root, though the 
filter works fine if run as any other system users.  When run as root, it does 
not do anything.  The message stays in the root mailbox.  I also tried to use 
.forward file at the root $HOME, but then the mail got lost.  We are running 
sendmail version of 8.8.0 and I do have /usr/adm/sm.bin directory created with 
the symbolic link to procmail binary which is residing at 
/usr/local/bin/procmail.

Here is the .procmailrc recipe;

 PATH=/bin:/usr/bin:/usr/local/bin
 DIR=/temp
 
 :0 ic
 * ^Subject:.*configuration
 * ^Message-Id:(_dot_)*(_at_)\/[^.>]+
 * ? test ! -d $DIR/$MATCH
 |mkdir $DIR/$MATCH
 
 :0b
 |cat > $DIR/$MATCH/$MATCH.config


The .forward file looks like :

 "|/usr/local/bin/procmail #root"


Please let me know, what am I doing wrong here.  All suggestions are welcome.

Thanks in advance,
Naveed.

<Prev in Thread] Current Thread [Next in Thread>