procmail
[Top] [All Lists]

Inserting info to mail body

2001-02-15 18:07:19
Hello all,

I've received suggestions to make the recipe to work but it's not working
yet.
I need to add the fields Variables From/Subject/to on the body of the
filtered mail.
The recipe can catch the mail and SUBJ_, FROM_ and TO_ are populating.
The second part is where the problem exists.
The variables aren't expanding and |$SENDMAIL $SENDMAILFLAGS -t command line
is skipped.
.procmailrc
( ... )
SHELL=/bin/sh           #/bin/sh -> /bin/bash
SENDMAIL=/usr/sbin/sendmail


Could someone fix it for me please? I've tried everything I could.

Thank you,
Carlos


:0 B
* $ ^Content-(Type|Disposition)*:${dotstar}name${ws}=${ws}${dq}.*${ext}${dq}
{
  SUBJ_=`formail -c -xSubject:`
  FROM_=`formail -c -xFrom:`
  TO_=`formail -c -xTo:`

  :0 fhw
  |  ( formail -I"To: rivellis(_at_)terra(_dot_)com(_dot_)br"; \
    echo "===== Filtered email - (stop.rc) ====="; \
    echo "Subject: $SUBJ_"; \
    echo "From   : $FROM_"; \
    echo "To       : $TO_"; \
    echo "======================================" ; \
    cat -  )
  |  $SENDMAIL $SENDMAILFLAGS -t
}

LOG:
( ... )
procmail: Match on
^Content-(Type|Disposition)*:.*($[      ].*)*name[      ]*($[   ]+)*=[  ]*($[   
]+)*".
*\.(xls|scr|vbs|shs|bat|com|exe|pif)""
procmail: Executing "formail,-c,-xSubject:"
procmail: Assigning "SUBJ_= subject  test"
procmail: Executing "formail,-c,-xFrom:"
procmail: Assigning "FROM_= "Carlos Eduardo R. L. de Miranda"
<consultor(_at_)linuxbr(_dot_)com(_dot_)br>"
procmail: Executing "formail,-c,-xTo:"
procmail: Assigning "TO_= "test" <consultor(_at_)galena(_dot_)com(_dot_)br>"
procmail: Executing "  ( formail -I"To: 
rivellis(_at_)terra(_dot_)com(_dot_)br"; \
    echo "===== Filtered email - (stop.rc) ====="; \
    echo "Subject: $SUBJ_"; \
    echo "From   : $FROM_"; \
    echo "To       : $TO_"; \
    echo "======================================" ; \
    cat -  )"
procmail: Skipped "| $SENDMAIL $SENDMAILFLAGS -t "

_______________________________________________
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>