On Tue, 25 Nov 1997 02:25:32 -0600, "A. Lester Buck III"
<buck(_at_)Compact(_dot_)COM> wrote:
I administer a LISTSERV mailing list and our host has asked us to
reduce excess quoting of previously posted material. To that end,
I composed the following recipe to bounce a copy to both the poster
and me, with the Subject: asking if this was excessive quoting.
With the weights below, this extra copy will activate at 66%
quoted lines of all body lines.
I would actually try to make this a function of the overall size of
the message. In a four-line message, I would definitely tolerate 75%
quotes. And in the end, you will of course always have to face the
kinds of people who would rather change their quoting style to evade
such constraints than quote less ...
An idealized quote parser should perhaps realize that a non-blank
prefix that recurs on a lot of lines is probably a customized quote
string.
* 10^1 ^> # quoted lines
* -15^1 ^[^>] # non-blank, non-quoted lines
* -15^1 ^$ # completely blank lines
Here, I would perhaps change the first two regexes to ^[ ]*>
and ^[ ]*[^ >] -- compare to my own quoting style.
I'm not sure what would be appropriate to generate behavior more like
I suggested above, any takers? Perhaps no score at all for empty
lines, neutralize .signatures (hope sender obeys "-- " convention) and
add 10^0.5 for each quoted line and dish out -15^0.3 for nonquoted? (I
haven't really explored this -- could be completely up the creek.)
[Also, perhaps long runs of quoted material should be penalized harder
than quoted snippet -- reply text -- quoted snippet -- reply text
alternations?]
| formail -i "Subject: Is this excessive quoting?" \
-i "From: buck(_at_)compact(_dot_)com" \
-i "Sender: buck(_at_)compact(_dot_)com" \
| $SENDMAIL -oi $SENDER buck(_at_)compact(_dot_)com
:0
/dev/null
You generally don't need to send stuff to /dev/null once you have
already dealt with it. In other words ":0c action :0 /dev/null" can
always be shortened to ":0 action" (as long as action is a delivering
recipe).
Second, some people are confused by the message coming back with
only the Subject: line, and do not understand that this is only an
automated process and cannot correctly interpret all situations.
I would like to add some boilerplate text from a file after
the headers but before the rest of the original body to set the
context for this bounce back to the poster. Could someone suggest
a good way to insert some boiler text before the original text
of the message?
You will need a slightly more elaborate action than you have above. In
general, if you need to make modifications to the body before sending
out a message, you'll have to change an action like
:0
| formail -whatever | $SENDMAIL something
into
:0
{
:0fhw
| formail -whatever
:0fbw
| (do something to the body)
:0
! something
}
In this case, the following might help (it doesn't match the above
generalization exactly -- we filter the whole message first, then the
body):
:0
* ^Sender: <mailing list tag>
{
:0B
* 10^1 ^[ ]*>
* -15^1 ^[ ]*[^ >]
* -15^1 ^[ ]*$
{
# You don't need to repeat the original condition here
# You also don't really need to extract SENDER
# Generate a reply with appropriate headers and the body quoted
:0fw
| formail -rtk -A"Bcc: buck(_at_)compact(_dot_)com"
# Now "replace" the body with template text + body
# (In other words, add the template before the quoted body)
:0fbw
| cat $HOME/template.txt -
# Now send it off to recipients mentioned in generated header
! -t
}
# Wasn't excessively quoted; save to Mail/directory/
:0
Mail/<directory name>/.
}
This will preserve the correspondent's original subject (with a Re:
added if it didn't already have one) and thus the template text should
indicate the nature of the problem.
/* era */
--
Paparazzi of the Net: No matter what you do to protect your privacy,
they'll hunt you down and spam you. <http://www.iki.fi/~era/spam/>