Toen ik deb kietelde, kwam er dit uit:
Ruud, what is the translation for the above line? Is the language
Dutch?
Yes, Dutch. 'When I tickled so-and-so, this came out:'.
But I think that 'tickle' only covers the gentle version
of 'kietelen', that ranges from titilate to the most
manual ways to make one laugh-and-pee.
The more known headers, the better. If you can, add checks of the From_
header, any List-headers, etc.
Okay, one (probably naive) question: Why would I want to match on the
date?
Well, that was extra-specially over-done, to make the point that you
cannot be too cautious. Please add a check on a Received-header
as well, to make sureR that the message is not a faked one.
* B ?? ^^$$\
.*<\/[^>]+> \
requests that you approve the following:$$\
[ ]+unsubscribe .*
Yes, that was munged. Always read [ ] as contaning a space and a tab,
obviously not as a character-class containing 2 spaces. The ^^$$ means
2 empty lines (the $$) right at the start (the ^^). If the actual message
starts with 1 empty line, remove a $. If there is no empty line, remove
the other $ as well. If the number of empty lines at the start varies,
I think you can use $+ or $*. (Maybe that should be ($)+ and ($)*, need
to lookup-or-test).
The problem is, I don't understand exactly what this line is doing. The
B says look in the body for the following line, and I think that it's
supposed to match what is inside the angle brackets, right?
Almost. The expression covers five lines, since $ matches a newline.
The ^^ can be read as 'start of buffer', in this case the start of
the body.
Matching starts at the \/-operator, until the end of what the
expression can match.
You need to adjust the expression from analysing an actual message.
Then after that, on the same line, I'm not sure what is happening at
the end.
{
M = "$MATCH"
:0
* M ?? ^^\/[^>]+
{ Req_addr = "$MATCH" }
Once this above matches (I haven't been able to get a match yet in my
testing), how to I use Req_addr? $Req_addr or "$Req_addr" ? Should
I have seen this in the man page?
The variable Req_addr receives what was matched: the Requestor-address.
You can use that variable as $Req_addr or as "$Req_addr", the latter
is sometimes needed if the variable can contain whitespace.
See also man procmailex.
(now unmunged)
:0
* M ?? ^^[^>]+> \
requests that you approve the following:$$\
[ ]+unsubscribe \/.*
{ M = "$MATCH" }
Here M becomes everything (on the same line) that is after
'unsubscribe '. That is the listname and the subscribed address.
:0
* M ?? ^^\/[^ ]+
{ Listname = "$MATCH" }
:0
* M ?? ^^[^ ]+ \/[^ ]+
{ Sub_addr = "$MATCH" }
}
Now the two variables Listname and Sub_addr should have values too.
Test it in your sandbox, with VERBOSE=on, and you'll see where you
need to make adjustments.
--
Affijn, Ruud
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail