On Tue, Mar 28, 2006 at 09:41:51PM -0500, fleet(_at_)teachout(_dot_)org wrote:
On Tue, 28 Mar 2006, Dallman Ross wrote:
:0 c:
* ^Return-Path:(_dot_)*(_at_)hotmail
* ^Subject:.*\/[^ ].*
spamtest/gotcha
:0 A
| echo -e $TIME "bounce address" $MATCH "\n" spamtest/spam.log
:0
spamtest/spamlast
Ok. This works; but I have some questions.
Before I get to your questions, let me give a warning that I have
been reminded (elsewhere, coincidentally) that there is a bug in
my algorithm above. That is, if the Subject is empty, the
recipe set won't run right. One solution is to collect the Subject
earlier on, unconditionally.
1. I'm still seeing the pipe command being assigned to LASTFOLDER.
procmail: Assigning "LASTFOLDER= echo -e $TIME "bounce address" $MATCH >>
spamtest/spam.log"
From fleet(_at_)teachout(_dot_)org Sat Mar 25 23:27:06 2006 -0500
Subject: 60% off Generíc Víagra
That's normal, because for the original message that is being eaten by
the pipe, it *is* the last "folder." You could turn off logging
before that delivery if you don't like that.
Also, even if you use a different algorithm such that the pipe to
echo is run without its being a delivering recipe, you still will
see that log entry if you have LOGABSTRACT=all set.
2. My "live" .procmailrc sends anything that passes through ALL recipes to
a special folder (which very seldom ever has anything in it); but it looks
like this will pass the cloned message all the way through unless it gets
caught by another recipe. (and it will get cloned again then)?? I notice
it winds up in spamlast as well as in gotcha. Is there a way to make it
go away?
I don't see why you say that. I see another fatal bug in my suggestion,
fwiw.(!) But it's not that all mail will pass to your "clean" folder.
Indeed, it's the reverse: the way I coded that above, all mail will go
to the spamtest folder. That was dumb of me. This goes to show that
untested or quickly tested suggestions are still not unlikely to have
problems. The reader is advised to do his own testing and own thinking,
always.
Recapping my algorithm, I had:
Recipe 1:
a) look for "hotmail" string in Return-Mail header
b) if it was there, capture non-empty Subject line
(i) If there's no Subject or and empty one, this recipe fails.
That was neither planned nor desired. :-(
c) (assuming no failure above), replicate the message and spawn
a new instance of procmail that starts with that message
stream just below this recipe (the c-flag is invoked on
condition-success)
d) save the original instance of the message to spamtest/gotcha
Recipe 2:
a) if the above conditions succeeded (implies we are running the
carbon-copy of the spammed message now), deliver to the echo
pipe
Recipe 3:
if we're here, message failed the spam-test above.
Our erroneous algorithm says to save anything here to "spamlast".
3. Can I put a sequence of these recipes in one file as:
:0 c
:0 A
:0 c
:0 A
:0 c
:0 A
You could, but if you get lost in the algorithm, you should recode
cleaner. See 'man procmailex' and 'man procmailrc' wrt the c-flag,
the A-flag, etc.
etc.? Or should I do something like below?
:0
* ^Return-Path:(_dot_)*(_at_)hotmail
{
:0 c;
* ^Subject:.*\/[^ ].*
spamtest/gotcha
Same error I had: if there's no Subject, you won't stop the emssage here.
:0 A
| echo -e $TIME "bounce address" $MATCH >> spamtest/spam.log
You don't need the A-flag here, because we wouldn't be here if @hotmail
handn't appeared as per the outer condition up-top.
}
Another thing: this whole section is going to "spamtest", so why
not set MAILDIR to spamtest for this part and leave all those
directory- name prefixes off the recipes in this region? Then you
can reset MAILDIR later in your rcfile.
For some reason, when I first set up the sandbox, I couldn't get that to
work properly. I *do* have
LOGFILE=$HOME/spamtest/spamtest.log
DEFAULT=$HOME/spamtest/
VERBOSE=on
LOGABSTRACT= "all"
The LOGABSTRACT entry is part of the reason why you're seeing the
echo pipe. Or if it's not the reason yet per the above algorithm,
it will be even if you change that pipe to a nondelivering recipe.
Dallman
____________________________________________________________
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