procmail
[Top] [All Lists]

Re: procmail: Extraneous ignore-write-error flag ignored

2004-02-21 16:16:50
Greg Ennis wrote:
:0 Di
* VIRUS ?? FOUND
{

There's your culprit, as Gary and I theorized: you're using `i' when you open a brace structure. It makes no sense there, so procmail tells you it's ignoring it. Get rid of that i-flag.

  :0
      { SUBJ_=`formail -c -xSubject: \
              | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'` }
  :0
      { DATETIME_=`date "+%Y%m%d %k%M%S"` }
  :0
      { VIRUS_SHORT=`basename "${VIRUS}"` }

Take out the :0's and the braces from all of those and just put the backtick assignments out there. Actually, you can get $SUBJ_ more efficiently with procmail's extraction function than with two forks and a shell to connect them.

 :0
 * ^Subject:.*\/[^      ](.*[^  ])?
 { SUBJ_=$MATCH }

 DATETIME_=`date "+%Y%m%d %k%M%S"`
 VIRUS_SHORT=`basename "${VIRUS}"`

In fact, you can also avoid the call to basename by using extraction:

 :0
 * VIRUS ?? ()\/[^/]+^^
 { VIRUS_SHORT=$MATCH }


  :0 fhwi
      | formail -I"Subject: ${VIRUS_SHORT} ${DATETIME_} ${SUBJ_}"
  :0 fhwi
      | formail -A"X-SMILE_Virus: Virus ${VIRUS_SHORT}"

Those i-flags are not good ideas, but they're not the ones causing the warning in your logfile. However, it's a waste to call formail twice when once will do the job:

 :0fhw
 | formail -I"Subject: ${VIRUS_SHORT} ${DATETIME_} ${SUBJ_}" \
   -A"X-SMILE_Virus: Virus ${VIRUS_SHORT}"

  :0:
       /log/e.viral.txt
}

No further problems there.



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