procmail
[Top] [All Lists]

Re: Need to clear out inbox with procmail

2008-07-21 11:29:27
The script i have needs to be run by passing in the path of an mbox file.
(therefore, the message must be delivered). Currently, as the recipe stands,
will deliver the message, then execute the upload.sh script. The attachments
are extracted properly, but if the mbox file isn't cleared, then it'll
always copy those old attachments out each time a new message comes in. Does
this help any?

On Mon, Jul 21, 2008 at 2:22 PM, Holger Wahlen 
<H(_dot_)Wahlen(_at_)gmx(_dot_)de> wrote:

* Nathan Brown wrote:
:0
* ^TO(_dot_)*upload(_at_)example(_dot_)com
/var/mail/upload
{
  :0
  | /usr/local/bin/upload.sh
}

The problem you mentioned aside, does this actually do what you want
at all? What you have there is:

- if the message is addressed to upload(_at_)example(_dot_)com, save it in
 /var/mail/upload (without locking) and don't do anything else,

- otherwise send it to the upload.sh script,

with the second part in a pair of unneeded braces. If you want both
actions to happen for messages to upload(_at_)(_dot_)(_dot_)(_dot_), you need 
a "c" flag on
the first action, so that processing doesn't stop there. Something
like:

:0  # see man procmailrc about ^TO and ^TO_
* ^TO_upload(_at_)example(_dot_)com
{
   :0c:  # second colon to lock the mbox file during delivery
    /var/mail/upload

   :0
   | /usr/local/bin/upload.sh
}

/HW

____________________________________________________________
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