Dear all, I need help with a standard recipe from rc.request. The recipe reads as follows: * -100^0 B ?? ^^([ ]|$)*\ ((((archives?:?($|[ ]+)|\ ((send|get)(me)?|gimme|retrieve|mail|ls|dir(ectory)?|\ list|show|search|[fe]?grep|find|maxfiles|version|help|info)\ ([ ].*)?$)([ ]|$)*)+\ ([^ a-z].*$(.*$(.*$(.*$(.*$)?)?)?)?)?^^|\ (help|info)[ ]*$|\ (add|join|leave|sign( [^ ]+ |-)?o(n|ff)|(un|de)?-?sub)\>)|\ ([^ a-z].*$(.*$(.*$(.*$(.*$)?)?)?)?)?^^|\ .*( (join|leave|add .* to|(delete|remove) .* from|\ (take|sign|get) .* off|(put|sign) .* on) .* [a-z-]*list|\ (un-?|sub?)scri(be|ption))\>|\ ^^) I have two questions: 1. What does the initial portion mean: "-100^0"? 2. What is the purpose of this portion: "$(.*$(.*$(.*$(.*$)?)?)?)?)?"? The reason I'm asking is that a custom mail processor I wrote causes random messages to be interpreted as admin requests by this recipe, and forwarded to the moderator needlessly. If I comment out the above recipe, the problem goes away. However I don't understand how the recipe is triggered on those messages. Thanks in advance - M
Dmitrii Manin asked, | I need help with a standard recipe from rc.request. The recipe | reads as follows: | | * -100^0 B ?? ^^([ ]|$)*\ | ((((archives?:?($|[ ]+)|\ | ((send|get)(me)?|gimme|retrieve|mail|ls|dir(ectory)?|\ | list|show|search|[fe]?grep|find|maxfiles|version|help|info)\ | ([ ].*)?$)([ ]|$)*)+\ | ([^ a-z].*$(.*$(.*$(.*$(.*$)?)?)?)?)?^^|\ | (help|info)[ ]*$|\ | (add|join|leave|sign( [^ ]+ |-)?o(n|ff)|(un|de)?-?sub)\>)|\ | ([^ a-z].*$(.*$(.*$(.*$(.*$)?)?)?)?)?^^|\ | .*( (join|leave|add .* to|(delete|remove) .* from|\ | (take|sign|get) .* off|(put|sign) .* on) .* [a-z-]*list|\ | (un-?|sub?)scri(be|ption))\>|\ | ^^) That's not a recipe; it's one condition of a recipe. | I have two questions: | | 1. What does the initial portion mean: "-100^0"? That is all explained in the procmailsc(5) man page. It's a point value: if the message's body [because of the "B ??" part -- but that's explained in the procmailrc(5) man page rather than in procmailsc(5)] has one or more matches to that regexp, take off 100 points. | 2. What is the purpose of this portion: "$(.*$(.*$(.*$(.*$)?)?)?)?)?"? It means the end of a line of text, plus zero to four more lines of text before the next element in the regexp (which is ^^, an anchor to the end of the search area). In other words, the earlier part of the regexp must be matched within five lines of the bottom; i.e., it should be the last thing in the body, but we'll allow a little bit more text after it in case the sender's mailer is configured to add a signature.
On Wed, 22 May 2002, David W. Tamkin wrote:
| 2. What is the purpose of this portion: "$(.*$(.*$(.*$(.*$)?)?)?)?)?"?
It means the end of a line of text, plus zero to four more lines of text before the next element in the regexp (which is ^^, an anchor to the end of the search area).
Here is some more of these from the start of rc.submit. # # Does it look like a regular submission? # Or perhaps more like an administrative request? # Look at the start of the body, and see if this could be # an administrative request, pass it on to rc.request in # that case. # :0 * $$=^0 * 9876543210^0 !divertcheck ?? y { } :0 * $$=^0 * !B ?? ^^(.*$(.*$(.*$(.*$(.*$(.*$(.*$(.*$)?)?)?)?)?)?)?)?[^]>} a-z0-9] * 9876543210^0 B ?? ^^.*$.*$.*$.*$.*$.*$.*$.*$.*$ { } In the second recipe, * $$=^0 means take over the score from the previous recipe. The second condition means I think, cancel this recipe if the first character in any of the first 8 lines isn't alphanumeric or a quoting character "]", ">", "}". The third condition means add a large value to the score if the mail is nine lines long, so it isn't diverted to rc.request. I am finding that many of my students mails are being diverted, so I want to amend this. A lack of subjects is also something that I would like not to trigger diversion to rc.request. But, I don't want to turn off divertcheck to achieve this. -- Greg Matheson Learn a second language and Chinmin College be born again, almost. Taiwan Penpals Archive <URL: http://netcity.hinet.net/kurage>
"GM" == Greg Matheson <lang-sl@ms.chinmin.edu.tw> writes: [...] GM> The second condition means I think, cancel this recipe if GM> the first character in any of the first 8 lines isn't GM> alphanumeric or a quoting character "]", ">", "}".
A colleague (lets call him John) ran into this recipe several times, always with mails like this: Subject: Next meeting ... Body: ... on Wednesday 2pm in our meeting room. John. Guess what: I had to resent it to the list. My .signature was added, and thus the mail had some lines starting with a letter, and the recipe did not fire anymore. Hans-Albert -- Hans-Albert Schneider Munich, Germany EMail: Hans-Albert@HA-Schneider.de
I looked at this in the FAQ but cannot seem to get it to work: ------------- Send an auto-reply back when someone posts Placing this in rc.local.s20 and uncommenting the appropriate line in the rc.custom file will provide this functionality. ** I did this ** # recipe to send an autoreply REPLY_TEXT=/path/to/autoreply.txt REPLY_SUBJECT="Message Recieved" ** I changed this to read: REPLY_TEXT=autoreply.txt REPLY_SUBJECT="Message Recieved" *** :0 whc | formail -rtzc -xTo: >tmp.from :0 ch :autoreply.lock | (formail -rtzc -I "Subject: $REPLY_SUBJECT" \ -A"Precedence: junk" ; cat $REPLY_TEXT) | \ $SENDMAIL -t `cat tmp.from` I made no other changes, but nothing happens. I created the rc.local.s20 and the autoreply.txt files and uncommented the rc.custom files. Any suggestions? Thanks Joe
participants (5)
-
David W. Tamkin
-
Dmitrii_Manin@NAI.com
-
Greg Matheson
-
Hans-Albert Schneider
-
Info @ Segura Solutions