[Gllug] Procmail if/then/else structures?

Stig Brautaset stigbrau at start.no
Mon Oct 28 19:26:05 UTC 2002


On Oct 28 2002, Rev wrote:
> Procmail, for all its power, is somewhat cryptic.  Can anyone help me
> on this one?
> 
> I have an old email address which is only still used by Citibank and
> Amazon.  All else that it receives is spam.  It identifies itself with
> a specific header, which I can trap.  I want to stick the rest
> straight into bogofilter as spam, but not the amazon and citibank
> stuff.
> 
> Here's my first hack at it, but I want the amazon and citibank stuff
> to go to my inbox.  How do I do that?  And what rule would I use to
> catch everything else?  Is this the best approach? (is there an
> "unless" construction?)
> 
> :0:
    ^

Will complain about spurious lockfile, I believe; don't use lockfiles
outside nesting blocks.

> * ^X-Authentication-Warning\:\ kosh\.infotainment\.com\.au
> (

Nesting blocks in procmail are introduced by { and ended by }.

>   :0
>   * ^From: .*amazon.*
> 
>   :0
>   * ^From: .*citibank.*
> 
>   |/home/bin/spamsubmit
> )

I think this will do what you want a bit cleaner:

:0 
* ^To: old_address at anywhere.com
* ! ^From: .*(amazon|citibank)
|/home/bin/spamsubmit

Anything that is too your address and not from amazon or citibank will
be filed as spam.




Stig
-- 
brautaset.org

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list