LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 05-26-2008, 11:09 PM   #1
nexus55
LQ Newbie
 
Registered: May 2004
Posts: 5

Rep: Reputation: 0
issue with procmail recipe and external script


Hiya,

I've got a problem with a procmail recipe which launches an external script:

MBASE=/var/qmail/mailnames/domain.com/orders
MBOX=${MBASE}/renewals
LOGFILE=${MBASE}/procmail.log
MFILE=${MBOX}/msg_${MDATE}

:0
* ^Subject: New Order Notice$
* !^X-Loop: PR$
{
:0 fhw
| formail -A "X-Loop: PR"

:0 c:
$MFILE

:0
| /var/qmail/mailnames/domain.com/orders/process_email.sh $MFILE
}

:0
${MBASE}/Maildir/

What I can't get working is the second rule, where all email gets delivered in ${MBASE}/Maildir/, it simply does not run. The issue is the external script that gets run (the script is run correctly, but after that the rest of the recipe is not run. It seems like procmail is hanging after that external script because the output isn't being redirected anywhere. And when I do redirect it, the script never gets run correctly.. This syntax also does not work:

"| /var/qmail/mailnames/domain.com/orders/process_email.sh $MFILE" >> /dev/null

so how do I do that redirect, without messing up the $MFILE parameter which that script needs to run properly.

Thanks in advance for any tips.
 
Old 05-27-2008, 10:24 AM   #2
nexus55
LQ Newbie
 
Registered: May 2004
Posts: 5

Original Poster
Rep: Reputation: 0
I think I found the working solution, but I'll need to do some more testing on it.

instead of an action line beginning with | on the line that executes the shell script, I just assign the output of it to an arbitrary variable, making that recipe non-delivering.. Then the .procmailrc file seems to continue on as it should:

:0
RUNSHSCR=| /var/qmail/mailnames/domain.com/orders/process_email.sh $MFILE
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Three actions in a recipe of Procmail Borelian Linux - Software 1 11-11-2012 07:48 AM
Procmail recipe question gauge73 Linux - Software 3 05-03-2006 05:09 AM
Procmail/Formail recipe question Toadman Linux - Software 0 12-31-2005 11:41 PM
Procmail recipe jebix666 Linux - General 1 06-09-2005 02:43 PM
procmail recipe not working? theLIGHT Linux - Software 3 11-18-2002 11:04 PM


All times are GMT -5. The time now is 12:32 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration