Google Groups Home
Help | Sign in
procmail - using output of external filter
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Otavio Exel  
View profile
 More options May 6, 3:53 pm
Newsgroups: comp.mail.misc
From: Otavio Exel <oe...@economatica.com.br>
Date: Tue, 06 May 2008 19:53:59 GMT
Local: Tues, May 6 2008 3:53 pm
Subject: procmail - using output of external filter
Hello List!

I would like to filter mail based on output of a script that I wrote;
this script reads the mail-message and...
- outputs something if it should be filtered
- outputs nothing if it should *NOT* be filtered

writing the script was easy! now how I use this in my procmailrc?
the best way I could find was:

        :0
        * ^FROM_MAILER
        X=|my_script param1 param2 param3
        :0A
        * ? test -n "$X"
        mail/filtered

it works. I can definitely live with that!

but I don't like the fact that I have to do it in 2 passes (one for
saving the script output in X and another for checking if anything was
actually saved in X);

also I'd like my script to reply via the return status of the script and
not via the output; it would be perfect if I could do:

        :0
        * ^FROM_MAILER
        * ? my_script param1 param2 param3
        mail/filtered

as I said: I can live with what I already have.

any clues?

[]s,

--
Otavio Exel /<\oo/>\ oe...@economatica.com.br


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Hunter  
View profile
 More options May 6, 10:16 pm
Newsgroups: comp.mail.misc
From: Mike Hunter <mhun...@lusArs.net>
Date: Tue, 06 May 2008 22:16:49 -0400
Local: Tues, May 6 2008 10:16 pm
Subject: Re: procmail - using output of external filter
On Tue, 06 May 2008 19:53:59 GMT, Otavio Exel wrote:

Hi,

This syntax works for me to preempt spam filtering based on the exit
status of a custom script:

:0:
* ?/home/mhunter/bin/my-incoming-script.pl
$DEFAULT


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Otavio Exel  
View profile
 More options May 7, 12:35 am
Newsgroups: comp.mail.misc
From: Otavio Exel <oe...@economatica.com.br>
Date: Wed, 07 May 2008 04:35:36 GMT
Local: Wed, May 7 2008 12:35 am
Subject: Re: procmail - using output of external filter

> On Tue, 06 May 2008 19:53:59 GMT, Otavio Exel wrote:

> > also I'd like my script to reply via the return status of the script
> > and not via the output; it would be perfect if I could do:

> >       :0
> >       * ^FROM_MAILER
> >       * ? my_script param1 param2 param3
> >       mail/filtered
Mike Hunter <mhun...@lusArs.net> wrote:

> This syntax works for me to preempt spam filtering based on the exit
> status of a custom script:

Mike,

it took some head-scratching: my script needs the body of the message,
not just the headers; appending a "B" to the ":0" did the trick!

many many thanks!

--
Otavio Exel /<\oo/>\ oe...@economatica.com.br


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google