procmail
[Top] [All Lists]

RE: exit current script before end of aka goto|return|exit|jump (DIGEST REPLY)

2005-02-04 16:11:44
Message: 2
Date: Fri, 04 Feb 2005 12:47:02 +0100
From: Dallman Ross <dman(_at_)nomotek(_dot_)com>
Subject: Re: exit current script before end of  aka

On Fri, Feb 04, 2005 at 01:08:26AM -0500, J Britain wrote:

Is there some way to exit the main /etc/procmailrc script early
(bypass further processing in that script) and continue in the
individual account RC scripts?

You can do this by unsetting $SWITCHRC.

  :0  f l a g s
  * conditions
  { SWITCHRC }

This looks like the most reasonable approach.  I do want to simply "fall
thru" to the next appropriate level of processing in the _NORMAL_ flow.

The majority of the /etc/procmailrc file is concerned with spam filtering,
and necessary bypasses before spam filtering, spam collection -- both before
and after spamc(spamassassin) most often ending feeding vsnag.rc, or
individual accounts.

The bottom falls through to:
INCLUDERC=/etc/procmail/vsnag.rc

which was being skipped (as well as skipping individual account rc files).

------------------------------

Message: 3
Date: Fri, 04 Feb 2005 12:55:17 +0100
From: Robert Allerstorfer <roal(_at_)anet(_dot_)at>
Subject: Re: exit current script before end of  aka> >
what about setting something like

DROPPRIVS = 'yes'
INCLUDERC = "$HOME/.procmailrc"

in '/etc/procmailrc', just before delivering to $DEFAULT?

rob.
--
Jim:
It makes no sense to add complicated redirection --
That just adds complexity, when a "fall through" solution is more
appropriate.
There are currently 35 conditions for ending the procmailrc and continuing
on in the normal processing path.

------------------------

Message: 4
Date: Fri, 04 Feb 2005 13:53:00 +0100
From: "Ruud H.G. van Tol" <rvtol(_at_)isolution(_dot_)nl>hat about setting 
something
like

DROPPRIVS = 'yes'
INCLUDERC = "$HOME/.procmailrc"

in '/etc/procmailrc', just before delivering to $DEFAULT?

Transferring control to the user's .procmailrc is already the
'natural' way, so using INCLUDERC to mimic that seems strange.

If the user's .procmailrc does not exist or is not properly
accessible, delivery to $DEFAULT is already taken care of
(AFAIK).

With the INCLUDERC, if delivery to $DEFAULT fails, there could
be 2 passes of ~/.procmailrc (although there are ways to prevent
that, but that means more hoops).

So why not lay out /etc/procmailrc in a way that makes it
ignore further recipes? Or use SWITCHRC?

Jim, what are the specific reasons to 'exit early'? Do they
occur almost never, or are they part of the daily routine?
Are you familiar with the A and E flags? (as in :0A and :0E)
Are you familiar with the usage of curly brackets?

Right now, there are 35 exit conditions -- the bulk of which have to do with
not being sure how to linewrap in a condition list -- dropping the spaces,
or stuff a variable.

I will address that question separately from this long string of responses,
under a different Subject.


------------------------------>
Message: 6
Date: Fri, 04 Feb 2005 15:05:04 +0100
From: "Ruud H.G. van Tol" <rvtol(_at_)isolution(_dot_)nl>
Toen wij Robert Allerstorfer kietelden, kwam er dit uit:

Unsetting SWITCHRC within '/etc/procmailrc' seems to be the same
as my suggestion.

No, SWITCHRC is like a GOTO, INCLUDERC like a GOSUB.

------------------------------

Message: 7
Date: Fri, 04 Feb 2005 15:52:28 +0100
From: Robert Allerstorfer <roal(_at_)anet(_dot_)at>>
On Fri, 04 Feb 2005, 15:05 GMT+01 Ruud H.G. van Tol wrote:

Toen wij Robert Allerstorfer kietelden, kwam er dit uit:

Unsetting SWITCHRC within '/etc/procmailrc' seems to be the same
as my suggestion.

No, SWITCHRC is like a GOTO, INCLUDERC like a GOSUB.

sure, but if the INCLUDERC occurs directly before delivering to
$DEFAULT the bahaviour is the same. I would define SWITCHRC as a
INCLUDERC with exiting afterwards.

rob.




------------------------------

Message: 8
Date: Fri, 04 Feb 2005 17:37:05 +0100
From: "Ruud H.G. van Tol" <rvtol(_at_)isolution(_dot_)nl>


If you choose to ignore procmail's normal line of processing,
you need to code stuff in your /etc/procmailrc a bit like the
following, to mimic procmail's normal line of processing.

  :0
  $DEFAULT
  :0
  $ORGMAIL
  EXITCODE=78
  HOST
  :0
  /dev/null

All that to keep procmail from ever falling into the ~/.procmailrc.

Just forget about that INCLUDERC. It is not elegant. SWITCHRC is
a clean way out, because it ensures that /etc/procmailrc's
business is finished.

Q: Why is there no need to write   SWITCHRC = "$HOME/.procmailrc"
A: Because "$HOME/.procmailrc" is already standing in line, waiting
for /etc/procmailrc to finish.

--
Grtz, Ruud



------------------------------

Message: 9
Date: Fri, 04 Feb 2005 14:20:13 -0600
From: "David W. Tamkin" <dattier(_at_)panix(_dot_)com>

Ruud wrote,

Q: Why is there no need to write   SWITCHRC = "$HOME/.procmailrc"
A: Because "$HOME/.procmailrc" is already standing in line, waiting
 for /etc/procmailrc to finish.

Not only that!  If you write   SWITCHRC = "$HOME/.procmailrc"   and
somewhere in $HOME/.procmailrc or in a SWITCHRC called from it, the user
unsets SWITCHRC or sets it to /dev/null as an intentional quick exit
with a save to $DEFAULT, instead, procmail will go back to the start of
$HOME/.procmailrc.  You'd be setting up an unexpected situation for the
user.


SWITCHRC seems to be the answer I was looking for.  Now I have some reading
to do.  Although I have seen it before in the list -- it does not show up in
the Index of the book I have.


____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>
  • RE: exit current script before end of aka goto|return|exit|jump (DIGEST REPLY), J Britain <=