The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Spam Check Script

Discussion in 'General Discussion' started by lostinspace, Feb 10, 2005.

  1. lostinspace

    lostinspace Well-Known Member

    Jul 19, 2003
    Likes Received:
    Trophy Points:
    Colorado Springs, CO
    Hey folks.

    I followed the RBL tutorial posted (I have no idea who the original poster of the tutorial is since it's duplicated on several sites). Regaurdless, the tutorial is excellent and goes great with Cheerpys dictionary attack tutorial.

    I run the script in the RBL tutorial nightly. I was wondering if anyone would be willing to give me some pointers on how to enhance the script to include RCPT e-mails for tracking?

    Here's a copy of what I have so far:
    grep "blacklisted" /var/log/exim_mainlog -i > kilme
    tail -100 kilme
    tail /var/log/exim_paniclog
    printf "\n"
    printf "Total Spam Count = "
    grep "blacklisted" kilme -c -i
    printf "\n"
    printf "Totals Per Blacklist Domain:"
    printf "\n"
    printf "============================"
    printf "\n"
    printf " = "
    grep "" kilme -c
    printf "spamcop   = "
    grep "bl.spamcop" kilme -c
    printf "easynet   = "
    grep "easynet" kilme -c
    printf "spamhaus  = "
    grep "sbl.spamhaus" kilme -c
    printf "  = "
    grep "dsbl" kilme -c
    printf "abuseat   = "
    grep "" kilme -c
    printf "  = "
    grep "ordb" kilme -c
    printf "\n"
    printf "Manual Blocks     = "
    grep "manual" kilme -c
    printf "Verify Fail       = "
    grep "verify fail" /var/log/exim_mainlog -c
    printf "No Relay          = "
    grep "not permitted" /var/log/exim_mainlog -c
    printf "Dictionary Attack = "
    grep "dictionary attack" /var/log/exim_mainlog -c
    printf "\n"
    printf "All Spam: \n"
    zgrep -ci "blacklisted" /var/log/exim_mainlog*
    printf "\n"
    Example Output:
    Total Spam Count = 3430
    Totals Per Blacklist Domain:
    ============================ = 811
    spamcop   = 1411
    easynet   = 0
    spamhaus  = 484  = 245
    abuseat   = 478  = 0
    Manual Blocks     = 1
    Verify Fail       = 337
    No Relay          = 126
    Dictionary Attack = 33
    All Spam:
    Basically, I'd like to add each RCPT address into the totals but not sure how to grep it.
    #1 lostinspace, Feb 10, 2005
    Last edited: Feb 10, 2005

Share This Page