Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

EMS mail to root account filtering

José L. Marcos
Occasional Advisor

EMS mail to root account filtering

Hi *,

i'm trying to filter some EMS events notified to root by E-mail (severity >= MAJOR WARNING)...

I've installed procmail 3.21 software depot on my HPUX 11.00 server, and just try to configure procmail.

The first steps are :
- /home/root/.procmailrc file creation. Nothing special here I just use - for the moment - a silly rule telling procmail to deliver any message to the default mailbox...
- /home/root/.forward. I've configured this file according to the many docs/faq found on the Net :
"|IFS=' ' && exec /opt/procmail/bin/procmail || exit 75 "

And here is my problem... Without those files in place on my /home/root directory, everything goes nice : a 'mailx root < /etc/issue' command sends /etc/issue in /var/mail/root.

If I configure both files (~/.procmailrc and ~/.forward), the same commands goes to /var/mail/daemon !!!!

This is just driving me nuts !

Any ideas ?

Regards,
Jose L. Marcos
2 REPLIES
Jordan Bean
Honored Contributor

Re: EMS mail to root account filtering

Are you saying that the procmail and forward rules for user root also affect user daemon?

From your post, root's home dir is /home/root. What's the home directory for daemon?

What does this show you?

$ echo ~root ~daemon



José L. Marcos
Occasional Advisor

Re: EMS mail to root account filtering

> Are you saying that the procmail and forward rules for user root also affect user
> daemon?

No. What I'm saying is that : mail adressed to user root aren't correctly handled via forward and procmail rules.

> From your post, root's home dir is /home/root. What's the home directory for daemon?

Home directory for root is '/home/root' and home directory for daemon is '/'.

I've tested the same procmail and forward rules with a "normal' account. After setting the correct permissions to /opt/procmail/bin/procmail (root:mail and chmod 2755) it works correctly for this normal account, I mean the mail is correctly forwarded to the /var/mail/account mailbox.

The point is that mail sent to 'root account' is misdistributed into /var/mail/daemon !

It's still driving me nuts...

Jose L.