procmail
[Top] [All Lists]

Re: procmail filtering for specific attachments

2004-11-04 12:41:46
Google Kreme wrote:

<> :0
<> * Content-type:(.*\<)?multipart
<> {
<> 
<>    # If it does carry an attachment,
<>    # check the body for the filename
<> 
<>    :0 h
<>    CLEANFROM=|formail -IReply-To: -rtzxTo:
<> 
<>    :0fw
<>    * 987654321^0 B ?? (file)?name[  ]*=.*\.doc
<>    * 987654321^0 B ?? (file)?name[  ]*=.*\.rtf(d)
<>    | (formail -rt  -A "X-Loop: bsmith.autoreply.domain.tld" \
<>      -I "From: myaddress"; cat "/path/to/reply/text" ; echo; ) \
<>      | sendmail -oi -t -f $CLEANFROM
<> }
<> 
<> the empty echo, btw, is critical.

Hmmm ...

Using scoring seems like extra work?

  :0 fw
  * B ?? name[   ]*=.*\.(doc|rtf)
  | (formail -r -I "X-Loop: bsmith.autoreply.domain.tld" \
                -I "From: $MYADDRESS" \
                -I "Subject: Paper submission autoresponse"; \
     cat "/path/to/reply/text" ; echo; ) \
     | sendmail -oi -t -f $CLEANFROM

Also not tested ...

I also changed the test for the string "file" optionally preceding
"name=" -- as we'll accept either, why check to see if it exists? Is
there a case where "name=" is preceded by something besides "file?"

For some reason, in my autoresponder recipes, I've done this:

  :0
  *   ! ^FROM_DAEMON
  * $ ! ^X-Loop: $LOOPTOKEN
  {
    :0 fhw
    <Generate a new header using formail as above>

    : fbw
    | (cat - > /dev/null; cat ${RESPONSE})

    :0 w
    | $SENDMAIL -f nobody(_at_)tifosi(_dot_)com -oi -t
  }

I should probably go back and think about those ...

R
-- 
R A Lichtensteiger              rali(_at_)tifosi(_dot_)com

  "It was a +good+ plan; smart, carefully laid out. But I got bored."

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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