Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Mar 2000 10:40:16 -0800 (PST)
From:      Dave Wells <wellsian@caffeine.com>
To:        C J Michaels <cjm2@earthling.net>
Cc:        freebsd-questions@freebsd.org
Subject:   RE: Procmail: Is there an OR command for procmailrc?
Message-ID:  <Pine.BSF.4.21.0003181013200.63016-100000@boris.netgate.net>
In-Reply-To: <NDBBILKDCLLECBCLPMBIGEBACAAA.cjm2@earthling.net>

next in thread | previous in thread | raw e-mail | index | archive | help
You bet. TRY it. :) And check out the procmailrc and procmailex manpages.

Before experimenting, maybe set paranoid logging in your rc file:

  LOGFILE=$HOME/procmail.log
  VERBOSE='yes'
  LOGABSTRACT='all'

Oh, this is where another terminal window becomes imperative for watching
your log:

 tail -f mylogfilename

Don't leave both VERBOSE and LOGABSTRACT on for too long or your log will
bloat. Check the procmailrc manpage for info. Or just try each with simple
sample messages and see what's logged.

There's plenty of good info on procmail out there. I used to point people
to stuff at universities & such. Just search for procmail and tutorial or
faq and you should turn up lots of goodies. Haven't done that myself in
ages or I'd point you to real places.

And just in case you're trying to do some kind of virtual hosting thing,
Procmail isn't very good for that. You have to get really tricky to handle
messages addressed to more than one of your people. I'll shut up now since
I don't know what's up. But if you _are_ trying to handle virtual hosting,
check out fetchmail (/usr/ports/mail...) or your MTA's methods. Those are
much better places to split multiple addresses arriving at a single
mailbox.

Good luck!
Dave

On Sat, 18 Mar 2000, C J Michaels wrote:

> Thanks for the info.. I was wondering then, could I do something like...
> 
> * user@abc.com|user@xyz.com
> 
> Thanks again,
> -Chris
> 
> -----Original Message-----
> 
> Nope, no OR. Not explicitly anyway. You can do an OR in your match:
> 
>  * (abc|def|ghi)@somedomain.com
> 
> Or an exclusive OR (else if) with a sequence of recipes:
> 
>  :0
>  * abc@somedomain.com
>  | dothisstuff
> 
>  :0 E
>  * def@somedomain.com
>  | dootherstuff
> 
>  :0 E
>  * ghi@somedomain.com
>  | lastchance
> 
> Only one of the above 3 recipes can fire. That's bad if you want more than
> one arriving in a single message to be handled in more than one recipe.
> Only the first match gets to do anything.
> 
> You can get interesting, doing complex ORs with negation:
> 
>  :0 c
>  * ! abc@somedomain.com
>  * ! def@otherdomain.com
>  * ! ghi@howdyho.com
>  /dev/null  <- yes, this is right. We'll pass on the copy.
> 
>  :0 E
>  | at least one of those _did_ match. Do our stuff.
> 
> Hope that gives you some clues.
> 
> Dave
> 
> p.s. Codebert just mumbled "Don't forget your local locks!" :)
> 
> On Sat, 18 Mar 2000, C J Michaels wrote:
> 
> > Hi,
> > I'm trying to find out if there is an "or" for the procmailrc.  I didn't
> > seem to find an example in procmailrc or procmailex, or in the archives.
> >
> > What I would like to do is have anything from a list of addresses go into
> on
> > specified folder.  How I am currently doing that is to have a separate
> rule
> > for each address.  I was hoping I could condense this into one rule.
> >
> > Any pointers would be helpful.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0003181013200.63016-100000>