| 1 |
NEWSGROUPS="`formail -xNewsgroups: -xNewsgroup:` $TO"
|
| 2 |
|
| 3 |
# Mangle the From: address.
|
| 4 |
|
| 5 |
FROMADDR=`formail -z -xFrom:`
|
| 6 |
SENDMAILBV=`$SENDMAIL -bv -- "$FROMADDR"`
|
| 7 |
USERADDR=`echo $SENDMAILBV | sed -e 's/^.*, user //'`
|
| 8 |
|
| 9 |
:0
|
| 10 |
*! SENDMAILBV ?? mailer e?smtp
|
| 11 |
{ USERADDR="${USERADDR}@${LOCALHOST}" }
|
| 12 |
|
| 13 |
AUTHORADDR=`echo $USERADDR | sed -e 's/@/ <AT> /' -e 's/\./ <DOT> /g'`
|
| 14 |
USERFROM=`echo $FROMADDR | sed -e "s/$USERADDR/Use-Author-Address-Header@[127.1]/"`
|
| 15 |
|
| 16 |
:0 fh
|
| 17 |
| formail -fb "-IFrom: $USERFROM" \
|
| 18 |
"-IAuthor-Address: $AUTHORADDR"
|
| 19 |
|
| 20 |
# If binary posts are disabled, pass them to replay.
|
| 21 |
# Designed for Mixmaster 2.0.4. Change "replay" to the appropriate
|
| 22 |
# number if still using 2.0.3.
|
| 23 |
|
| 24 |
:0 B
|
| 25 |
* DISABLEBINARYPOSTS ?? (yes|on)
|
| 26 |
* -999^0
|
| 27 |
* 500^.5 NEWSGROUPS ?? binaries
|
| 28 |
* HB ?? 500^0 ^Content-Transfer-Encoding: base64
|
| 29 |
* 500^0 ^begin [0-9]+ .*
|
| 30 |
* 1^1.1 ^M............................................................$
|
| 31 |
| formail -bf -IFrom: -ITo: -IComments: -IMessage-ID: \
|
| 32 |
| $MIXMASTER -f -to $TO -l replay
|
| 33 |
|
| 34 |
# Anti-Spam-Bait Recipe summary:
|
| 35 |
# Obviously somebody has been paying attention. The spam baiting check
|
| 36 |
# is now sufficiently complicated to warrent an external program for
|
| 37 |
# testing. It is defined in SPAMBAITTEST. If it returns a non-zero exit
|
| 38 |
# code, addresses are mangled a la _nospam.
|
| 39 |
|
| 40 |
:0 B
|
| 41 |
* MANGLESPAMBAITS ?? (yes|on)
|
| 42 |
* ! ? $SPAMBAITTEST
|
| 43 |
{
|
| 44 |
REPLYTO=`formail -z -xReply-To: \
|
| 45 |
| sed -e 's/\(\w\+\)@\(\w\)/\1 <AT> \2/g' \
|
| 46 |
-e 's/\(\w\+\)\.\(\w\)/\1 <DOT> \2/g'`
|
| 47 |
|
| 48 |
:0 fh
|
| 49 |
*! REPLYTO ?? ^$
|
| 50 |
| formail -fb "-IReply-To: \"$REPLYTO\" <nobody@$HOSTNAME>"
|
| 51 |
|
| 52 |
:0 fh
|
| 53 |
| formail -fb "-aX-Comments: apparent spam-bait, addresses mangled"
|
| 54 |
|
| 55 |
:0 bf
|
| 56 |
| sed -e 's/\(\w\+\)@\(\w\)/\1 <AT> \2/g' \
|
| 57 |
-e 's/\(\w\+\)\.\(\w\)/\1 <DOT> \2/g'
|
| 58 |
}
|
| 59 |
|
| 60 |
# Add _nospam to the mail2news address for gateways which support it
|
| 61 |
# (alpha.jpunix.com, anon.lcs.mit.edu, nym.alias.net). It turns out
|
| 62 |
# nym.alias.net didn't really support this, even though it is the
|
| 63 |
# same as anon.lcs.mit.edu. This has been fixed. Some people now have
|
| 64 |
# the habit of sending to multiple gateways, which confused the old
|
| 65 |
# recipe. This one is more precise.
|
| 66 |
|
| 67 |
:0
|
| 68 |
* ADDNOSPAM ?? (yes|on)
|
| 69 |
* TO ?? (alpha\.jpunix\.com|anon\.lcs\.mit\.edu|nym\.alias\.net)
|
| 70 |
{
|
| 71 |
GATEWAY=`formail -z -xTo: | \
|
| 72 |
sed -e 's/\(mail2news\|m2n\)\([^@]*\)@\(anon.lcs.mit.edu\|nym.alias.net\|alpha.jpunix.com\)/\1_nospam\2@\3/g' \
|
| 73 |
-e 's/_nospam_nospam/_nospam/g'`
|
| 74 |
|
| 75 |
:0 fh
|
| 76 |
| formail -fb "-ITo: $GATEWAY"
|
| 77 |
}
|
| 78 |
|
| 79 |
# Add [IGNORE] to Subject: for posts to test groups if not already
|
| 80 |
# present.
|
| 81 |
|
| 82 |
SUBJECT=`formail -z -xSubject:`
|
| 83 |
IGNORESUBJECT="$SUBJECT [IGNORE]"
|
| 84 |
|
| 85 |
:0 fh
|
| 86 |
* ADDIGNORE ?? (yes|on)
|
| 87 |
* NEWSGROUPS ?? test
|
| 88 |
* ! SUBJECT ?? ignore
|
| 89 |
| formail -fb "-ISubject: $IGNORESUBJECT"
|
| 90 |
|
| 91 |
# Create USENET Message-ID: based on body.
|
| 92 |
UMID="<`sed -e '1,/^$/d' | md5sum | sed 's/\([0-9a-f]*\).*/\1@anonymous.poster/'`>"
|