procmail
[Top] [All Lists]

Re: Computed list of destinations?

2015-09-08 13:50:13
On 2015-09-08 13:49 -0400, R P Herrold wrote:

Is there any way for procmail to deliver to a computed or
dynamically determined list of mailboxes or addresses?

The lack of loops in the procmailrc "language" makes "no" the
obvious answer, but I thought there might be a trick the assembled
experts know.

The absence of explicit loops does not mean you cannot 
'munged' a X header inside an emai, and then send the result 
back into the top of the procmail process by simply re-sending 
to your self, of course

Hi!  I guess this may be the trick I was looking for, although there is
both a technical/minor problem and a philosophical/major one.

The technical problem is that this will run into de-duplication schemes
based on message-ID, such as the formail based snippet given in
procmailex(5).  It is minor because the de-duplication code can be
conditionally bypassed depending on the munged headers.

The philosophical problem (and this is also my reaction to the other
posts, which suggest farming out the job to some non-procmail script
entirely) is: if I go to so much trouble to communicate between procmail
and some sh/awk/perl/python code, and that other code does almost all of
the work (that is, both the "directing" to a destination and the actual
delivery), then why not use the other code as the filter in the first
place, why use procmail at all?  

<sarcasm> 
Surely not for its superior flow of
control mechanisms or its superior regexp capabilities?
</sarcasm>

In any case, thanks for the answer, at least it got me thinking.

This is a so-called 'forward reference resolution problem.  We 
need not face it, usually, with some planning

I don't see how the rest of your post is relevant, though.  The
difficulty is delivering to _multiple_ dynamically determined folders at
the same time; your code always delivers to one and exactly one.

-- 
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.
____________________________________________________________
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