procmail
[Top] [All Lists]

Re: logs do not expand variables

2003-04-11 11:49:11
On 11 Apr 2003 at 12:50, David W. Tamkin wrote:

You know, here's another idea, provided that your version of formail is 
new enough to support -l:

    :0 condition-related flags
    * conditions
    {
     LOGABASTRACT=off
     TRAP='formail -l "cat > $SPOOL && mv $SPOOL $DEST"'

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

But I still don't see a general solution to expanding variables from the 
command line in the log entry when the command line is run by a shell.

The above truncates the log entries.  Confession: the examples 
provided 
in my previous emails were shortened to ease reading.  The actual 
pathnames are much longer.  Here is the unmodified output using the 
above:

From dan(_at_)langille(_dot_)org  Fri Apr 11 14:39:45 2003
 Subject: cvs commit: doc/en_US.ISO8859-1/articles/checkpoint 
networks.pic
  Folder:  cat > ${SPOOL} && mv ${SPOOL} ${DEST}                      
     5565
From dan(_at_)langille(_dot_)org  Fri Apr 11 14:39:45 2003
 Subject: cvs commit: doc/en_US.ISO8859-1/articles/checkpoint 
networks.pic  doc
  Folder: cat > 
/home/dan/FreshPorts/beta.freshports.org/msgs/FreeBSD/s    5565

Using your initial suggestion, slightly altered:

  TRAP='echo \$SPOOL is $SPOOL && echo \$DEST. is $DEST'

I get this:

From dan(_at_)langille(_dot_)org  Fri Apr 11 14:41:58 2003
 Subject: cvs commit: doc/en_US.ISO8859-1/articles/checkpoint 
networks.pic
  Folder:  cat > ${SPOOL} && mv ${SPOOL} ${DEST}                      
     5565
$SPOOL is 
/home/dan/FreshPorts/beta.freshports.org/msgs/FreeBSD/spooling/2003.04
.11.14.41.58.82245.txt
$DEST. is 
/home/dan/FreshPorts/beta.freshports.org/msgs/FreeBSD/incoming/2003.04
.11.14.41.58.82245.txt

Thanks.
-- 
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>