procmail
[Top] [All Lists]

Re: logs do not expand variables

2003-04-11 09:26:55
On 11 Apr 2003 at 10:02, David W. Tamkin wrote:

Dan Langille wrote:

My procmail logs contain items such as this:

  Folder:  cat > ${SPOOL} && mv ${SPOOL} ${DEST}      6359

Is is possible to get the actual variable values instead of the
above?  For example:

  Folder:  cat > /tmp/foo.bar && mv /tmp/foo.var /tmp/queue     6359

Not easily.  You would if there were no characters from $SHELLMETAS in 
there and procmail expanded the variables itself, but when the command 
line is run by a shell, you'd need some trickery with LOG= or TRAP= to 
do it.  It would have to expand the variables without acting on the ">" 
or "&&" -- not easy.

  :0 condition-related flags
  * conditions
  {
   TRAP='echo \$SPOOL is $SPOOL and \$DEST is $DEST.'

   :0 action-related flags
   | cat > $SPOOL && mv $SPOOL $DEST
  }

Thank you.  That does exactly what I need.  All I did was trap as 
shown.  Much appreciated.  This is great!

FWIW, this is what the log now contains

  Folder:  cat > ${SPOOL} && mv ${SPOOL} ${DEST}     4709
$SPOOL is /home/dan/spooling/2003.04.11.11.55.15.78419.txt and $DEST 
is /home/dan/incoming/2003.04.11.11.55.15.78419.txt.

:)
-- 
Dan Langille : http://www.langille.org/


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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