procmail
[Top] [All Lists]

Re: New Cook... Recipe Help

2001-01-12 17:42:57
"Brian C. Doyle" wrote:
Here is what i have for a recipe currently.
:0:
* HB ?? ^Content-type:.*image/*
* ^(From)(_dot_)*brian(_at_)jbbent(_dot_)com
me

:0:
* HB ?? ^Content-type:.*video/*
* ^(From)(_dot_)*brian(_at_)jbbent(_dot_)com
me

:0
* ^(From)(_dot_)*brian(_at_)jbbent(_dot_)com
/dev/null


I have 2 questions.

How can I condense the above so i do not have 3 separate entrees for 1 
message.  IE If the email is from brian(_at_)jbbent(_dot_)com and has an 
image or 
video attachment move to me Else if it is from brian(_at_)jbbent(_dot_)com 
and does 
not have an image or video attachment delete!


    :0
    * ^From(_dot_)*brian(_at_)jbbent(_dot_)com
    { 
        :0:
        * HB ?? ^Content-type:.*(image|video)/
        me

        :0
        /dev/null
    }

The second deals with taken the attachments and automatically saving them 
to a directory on my computer and then delete the email.  I have seen 
several script but I do not understand what they were doing !!

What exactly is your question?  How to do it?  You could start with
what you see in:

    http://MailMan.RWTH-Aachen.DE/pipermail/procmail/2000-June/000220.html

Maybe if the munpack is successful, you can delete the body before
saving, like this:

  :0
  * ^Content-type:.*(multipart/mixed|application/(.*ms|x-v))
  * HB ?? Content-transfer-encoding:.*(x-uuencode|base64)
  * ! ^X-Loop: *yourName(_at_)(_dot_)*YourDomain
  {
      LOCKFILE=munpack.lock

      TMPDIR=/tmp/mail

      :0
      UnpackOutput|=sed -e \
        '/^Content-[Tt]ype:.*[Nn]ame=/s,[Tt]ext/,application/,' | \
        munpack -C $TMPDIR 2>&1

      :0 afbwi
      | echo unpacked by munpack into $TMPDIR; echo "$UnpackOutput"

      LOCKFILE
  }

The above is NOT TESTED, your mileage may vary, etc.

-- 
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information.  Sorry.
Collin Park                         Not a statement of my employer.
_______________________________________________
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>