Re: Custom X-Header and AOL's New ARF Reports

Glen Stewart <[email protected]> Fri, 12 Sep 2008 17:23:22 -0400
Newsgroups gmane.mail.ezmlm
Organization http://freegroups.net
Message-ID <[email protected]>
--Boundary-00=_L3tyISnrpQgo23Y
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I use this to automatically handle AOL complaints.  It does call another 
script called ez-unsub-all which is very custom for my server, but gives a 
method you might leverage to solve your issue.

The mailbox that is scanned for messages from AOL obviously has to be the 
address you register with AOL, for them to send such complaints to.

On Friday 12 September 2008 12:48:20 pm Ken S. wrote:
> Good afternoon.
>
> The problem I'm trying to fix has to do with AOL switching to the new
> Abuse Reporting Format (ARF).  Previous to this switch, in order for
> me to unsubscribe an AOL user who marked a message from the listserv
> as spam I inserted a new X-Header with the user's email.  This was
> based on a phone conversation with AOL's postmaster department and was
> their recommendation.  The reason for the extra header was that they
> scrubbed the AOL user's email from the message for privacy.  They told
> me they would not scrub it from an X-Header.  This has worked great
> for me for years now.  Now with the new ARF reports, they scrub it
> from all parts of the message.
>
> So I've played around with it for a day or so and tried different
> combinations to the X-Header and it has scrubbed it each time.  My
> next idea would be to find a way to scrambled the email address and
> insert it in to the X-Header.  I could write an external program that
> could do the scrambling, but I don't know how I could link that in to
> ezmlm so it could insert it in to the message.
>
> Thanks for any advice or any other better ways to accomplish this goal.
>
> -ken

-- 
Associate.com - THE Place to Associate!                  http://freegroups.net
Is Your E-mail Group Here?  See http://freegroups.net/faq/your-group-here.html
A no-compromise Christian Presidential Candidate:  http://www.baldwin08.com

--Boundary-00=_L3tyISnrpQgo23Y
Content-Type: application/x-shellscript;
  name="abuse-response.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="abuse-response.sh"

#!/bin/bash

export HOME=/home/aol-reports
export PATH=$PATH:/usr/local/bin

mailbox="abuse-response"
mbroot="/home/aol-reports/.kde/share/apps/kmail/mail"

if [ -s "$mbroot/$mailbox" ]
then
  owner="[email protected]"
  spambox="/tmp/abuse-response"
  cp -p "$mbroot/$mailbox" "$spambox"
  echo -n "" >  "$mbroot/$mailbox"
  rm -f "$mbroot/.$mailbox.index" "$mbroot/.$mailbox.index.ids" "$mbroot/.$mailbox.index.sorted" 
  
  cutpoints=`grep -na "^From " "$spambox" | cut -d":" -f1 | sed 's/\n/ /g'`
  numlines=`wc -l "$spambox" | rev | cut -d" " -f2 | rev`
  for line in $cutpoints
  do
    if [ $line -ne 1 ]
    then
      ((bottom=line-1))
      sed -n "$oldline","$bottom"p "$spambox" | grep -E 'Original-Rcpt-To: |List-Post: <mailto:|User-Agent: AOL SComp' > /tmp/aol-abuse.txt
      aoluser=`grep "Original-Rcpt-To: " /tmp/aol-abuse.txt | cut -d" " -f2`
      aollist=`grep "List-Post: <mailto:" /tmp/aol-abuse.txt | cut -d":" -f3 | cut -d"@" -f1`
      aoltrue=`grep "User-Agent: AOL SComp" /tmp/aol-abuse.txt`
      if [ "$aollist" = "redacted" ]
      then
        sed -n "$oldline","$bottom"p "$spambox" > /tmp/aol-abuse.txt
	rpl -qe '=\n' '' /tmp/aol-abuse.txt > /dev/null 2>&1
        aoluser=`grep "Return-Path: <redacted-return-" /tmp/aol-abuse.txt | grep -iE 'associate.com|freegroups.net|welovegod.org' | head -1 | sed 's/^Return-Path: <redacted-return-[0-9]*-//' | rev | cut -d"@" -f2 | rev | tr "=" "@"`
        aollist=`grep -iE '[a-z0-9]*[email protected]|[a-z0-9]*[email protected]|[a-z0-9]*[email protected]|[a-z0-9]*[email protected]|[a-z0-9]*[email protected]|[a-z0-9]*[email protected]' /tmp/aol-abuse.txt | grep -v redacted | grep -v "=" | tr " " "\n" | grep @ | grep -E 'unsubscribe|leave' | head -1 | rev | cut -d"-" -f2-9 | rev`
      fi
      
      if [ -n "$aoluser" ] && [ -n "$aollist" ] && [ -n "$aoltrue" ]
      then
          echo "To: ${aollist}-owner
cc: $owner
From: $owner
Subject: AOL Spam Report for $aollist

Your group subscriber, $aoluser, has reported that mail from
the group is what they consider spam.  As a result, AOL expects them to
immediately be unsubscribed from the group, and this is now done.

Too many spam reports about your group will result in your group being deleted
so please take care that messages do not appear as spam, and that your
subscribers know how to unsubscribe properly.

To maintain your list via web, please visit http://freegroups.net and log in.

--
Associate.com - THE Place to Associate!" | /etc/qmail/bin/qmail-inject -f $owner
	  /home/ez-unsub-all "$aoluser" > /dev/null 2>&1
#echo "reported1 $aoluser"
      fi
    fi
    oldline=$line
  done
  
  # snatch the last message
  sed -n "$oldline","$numlines"p "$spambox" | grep -E 'Original-Rcpt-To: |List-Post: <mailto:|User-Agent: AOL SComp' > /tmp/aol-abuse.txt
  aoluser=`grep "Original-Rcpt-To: " /tmp/aol-abuse.txt | cut -d" " -f2`
  aollist=`grep "List-Post: <mailto:" /tmp/aol-abuse.txt | cut -d":" -f3 | cut -d"@" -f1`
  aoltrue=`grep "User-Agent: AOL SComp" /tmp/aol-abuse.txt`
  if [ "$aollist" = "redacted" ]
  then
    sed -n "$oldline","$numlines"p "$spambox" > /tmp/aol-abuse.txt
    rpl -qe '=\n' '' /tmp/aol-abuse.txt > /dev/null 2>&1
    aoluser=`grep "Return-Path: <redacted-return-" /tmp/aol-abuse.txt | grep -iE 'associate.com|freegroups.net|welovegod.org' | head -1 | sed 's/^Return-Path: <redacted-return-[0-9]*-//' | rev | cut -d"@" -f2 | rev | tr "=" "@"`
    aollist=`grep -iE '[a-z0-9]*[email protected]|[a-z0-9]*[email protected]|[a-z0-9]*[email protected]|[a-z0-9]*[email protected]|[a-z0-9]*[email protected]|[a-z0-9]*[email protected]' /tmp/aol-abuse.txt | grep -v redacted | grep -v "=" | tr " " "\n" | grep @ | grep -E 'unsubscribe|leave' | head -1 | rev | cut -d"-" -f2-9 | rev`
  fi

  if [ -n "$aoluser" ] && [ -n "$aollist" ] && [ -n "$aoltrue" ]
  then
      echo "To: ${aollist}-owner
cc: $owner
From: $owner
Subject: AOL Spam Report for $aollist

Your group subscriber, $aoluser, has reported that mail from
the group is what they consider spam.  As a result, AOL expects them to
immediately be unsubscribed from the group, and this is now done.

Too many spam reports about your group will result in your group being deleted
so please take care that messages do not appear as spam, and that your
subscribers know how to unsubscribe properly.

To maintain your list via web, please visit http://freegroups.net and log in.

--
Associate.com - THE Place to Associate!" | /etc/qmail/bin/qmail-inject -f $owner
      /home/ez-unsub-all "$aoluser" > /dev/null 2>&1
#echo "reported2 $aoluser"
  fi
fi

--Boundary-00=_L3tyISnrpQgo23Y--