Re: Computed list of destinations?

udi M <[email protected]> Wed, 09 Sep 2015 10:42:31 +0300
Newsgroups gmane.mail.procmail
Organization tau
Message-ID <[email protected]>
On 08/09/15 20:49, R P Herrold wrote:

On Mon, 7 Sep 2015, Ian Zimmerman 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

Sending the message to yourself is B A DÂ idea!

Also, you can pipe the message to procmail like this:

 | /usr/bin/procmail -p

but it is again B A D idea.

The keyword search for loops in procmail is "recursive" read the

man procmailrc(1)

--udi

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

I compute the destination folder 'on the fly' for various spam
sorting

# ------------ general definitions ---------------------
#
SHELL=/bin/bash
#
export MAILDIR=$HOME/mail
export LOGDATE=` date +%d`
export LOGMONTH=` date +%m`
export MONTHROTOR=` echo "0${LOGMONTH} % 3" | bc`
# the next line actually all one line
# without '\' continuation
[ ! -d $MAILDIR/_spam/$MONTHROTOR-$LOGDATE/ ] && mkdir -p \
$MAILDIR/_spam/$MONTHROTOR-$LOGDATE/
# ...
:0 Whc: .msgid.lock
| formail -D 8192 .msgid.cache
:0 a:
$MAILDIR/_spam/$MONTHROTOR-$LOGDATE/z_duplicates
#
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
$MAILDIR/_spam/$MONTHROTOR-$LOGDATE/z_almost-certainly-spam
#

# All mail tagged as spam (eg. with a score hig her than the
# set threshold) is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
$MAILDIR/_spam/$MONTHROTOR-$LOGDATE/probably-spam
# LOG="after procmailrc spam testing
# "

and so on

----------

This builds a three month lookback pile of spam compiled by
day, that I can paw through using 'egrep' (I had an electronic
payment notification email from a person lost in such
recently)

-- Russ herrold
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
[email protected]
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
[email protected]
http://mailman.rwth-aachen.de/mailman/listinfo/procmail