Hi, thanks for your response. i've been searching docs for 2 days and i wasnt assuming on the code i wrote, but it somehow doesnt seem to work. Can you have a look at it and tell me whats wrong, if you have a good knowledge of procmail recepies. All i want to do is, change the permission of a file created by /etc/procmailrc (spam mails forwarded to that file). I've tried following codes: :0 | chown username "filename" :0 | my-script (which is a shell scipt and does the same thing) :0 * | chown username "filename" :0 * | my-script (which is a shell scipt and does the same thing) None of above works. while the following works: :0: * ^X-Spam-Status: Yes chown username "filename" but it was actually: :0: * ^X-Spam-Status: Yes filename Now, I cudnt either find, how to do both tasks, cuz if it doesnt forward message, there is no meaning of changing the owner. Please help me or direct me to somewhere I can find the answer, maybe a list or website, I'll really appreciate that Thanks Nitin ----- Original Message ----- From: <replies-lists-redhat@xxxxxxxxxxxxxxxxxxxxx> To: "Nitin" <nitinmehta@xxxxxxxxxxxx> Sent: Thursday, April 07, 2005 10:12 PM Subject: Re: Procmail help > procmail scripting syntax is very different from most > scripting/programming languages. you need to look at documentation > for procmail in order to understand how to accomplish what you're > after. > > i'd suggest that you start with the procmail site. there are links at > the bottom of the main page that point to a variety of other sites, > some of which provide very useful examples. > > you seem to just be guessing at things, which is a very dangerous > thing to do when running as root and mucking with mail related things. > > > ---------- Original Message ---------- > > From: Nitin <nitinmehta@xxxxxxxxxxxx> > > To: replies-lists-redhat@xxxxxxxxxxxxxxxxxxxxx > > Date: Thursday, April 07, 2005 09:58:54 PM +0530 > > Subject: Re: Procmail help > > > > I used this before, thinking the same, but didnt work either: > > > > :0 > > * ! ? chown apache "$SPAMFILE" > > { > > LOG = "$_: ERROR: Could not change ownership of '$SPAMFILE' to > > 'apache'" > > } > > > > What's wrong with this? Can you help me correct it if thr's > > anything wrong, it doesnt give any other but simply doesnt work > > either. > > > > Thanks anyway for your time > > Nitin > > > > > > ----- Original Message ----- > > From: replies-lists-redhat@xxxxxxxxxxxxxxxxxxxxx > > To: "Nitin" <nitinmehta@xxxxxxxxxxxx> > > Sent: Thursday, April 07, 2005 09:50 PM > > Subject: Re: Procmail help > > > > > >> what you wrote was a shell script. you should look at procmail > >> scripting syntax and do your script in that syntax (so that it will > >> work from within your procmailrc file). > >> > >> > >> ---------- Original Message ---------- > >> > From: Nitin <nitinmehta@xxxxxxxxxxxx> > >> > To: replies-lists-redhat@xxxxxxxxxxxxxxxxxxxxx > >> > Date: Thursday, April 07, 2005 09:43:06 PM +0530 > >> > Subject: Re: Procmail help > >> > > >> > no i was using that in procmail itself > >> > > >> > and it works from other script. Do i need to do i from other > >> > script, if yes, how can i call it from procmail? > >> > > >> > thanks for your time > >> > Nitin > >> > ----- Original Message ----- > >> > From: <replies-lists-redhat@xxxxxxxxxxxxxxxxxxxxx> > >> > To: "Nitin" <nitinmehta@xxxxxxxxxxxx> > >> > Sent: Thursday, April 07, 2005 08:15 PM > >> > Subject: Re: Procmail help > >> > > >> > > >> >> you're trying do this as a separate shell script, correct? > >> >> (that's not procmail scripting syntax). > >> >> > >> >> also, what user are you trying to run this script as? it will > >> >> only work if run as root. [i haven't actually looked at it > >> >> closely enough to see if it *should* work.] > >> >> > >> >> > >> >> ---------- Original Message ---------- > >> >> > From: Nitin <nitinmehta@xxxxxxxxxxxx> > >> >> > To: General Red Hat Linux discussion list > >> >> > <redhat-list@xxxxxxxxxx> Date: Thursday, April 07, 2005 > >> >> > 07:44:55 PM +0530 > >> >> > Subject: Procmail help > >> >> > > >> >> > Hi all, > >> >> > > >> >> > I'm facing a problem and its urgent. > >> >> > > >> >> > Can anybody help me in this: > >> >> > > >> >> > I'm using procmail to filter mails and put the spam mails in > >> >> > separate file. Now the problem is, its creates the file with > >> >> > root as owner and webmail cant read it unless the owner is > >> >> > apache. > >> >> > > >> >> > I'm trying following code to change owner and permission but > >> >> > somehow it's not working (no erroras either), while if i > >> >> > change the code slightly it gives valid errors, which means it > >> >> > executes. Code is: > >> >> > > >> >> > if [ -f "$SPAMFILE" ]; then > >> >> > chown apache.mail "$SPAMFILE" > >> >> > chmod 660 "$SPAMFILE" > >> >> > else > >> >> > LOG = "$_: ERROR: Could not change ownership of > >> >> > '$SPAMFILE'" fi > >> >> > > >> >> > What's wrong with it? or if it wont work, how shud i do tht? > >> >> > > >> >> > Please help me ASAP.. > >> >> > > >> >> > Thanks in advance > >> >> > Nitin > >> >> > > >> >> > > >> >> > -- > >> >> > redhat-list mailing list > >> >> > unsubscribe > >> >> > mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe > >> >> > https://www.redhat.com/mailman/listinfo/redhat-list > >> >> > >> >> ---------- End Original Message ---------- > >> >> > >> > > >> > >> ---------- End Original Message ---------- > >> > > > > ---------- End Original Message ---------- > -- redhat-list mailing list unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list