Results 1 to 2 of 2

Thread: Attachment Blocking Stats

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Posts
    11
    Rep Power
    6

    Lightbulb Attachment Blocking Stats

    I noticed that the daily mail report doesn't report on attachment blocking statistics. Here's a script to get statistics for attachment block by the MTA. It could easily be extended to email in CSV format.

    Code:
    #!/bin/bash
    #This script counts how many of each attachment extension were blocked by the MTA,
    #If no messages for that extension were blocked they are omitted from the count
    #created by james[dot]barnett[at]noc[dot]com
    
    clear
    cd /home/zimbra
    zmprov gcf zimbraMtaBlockedExtension | cut -d: -f2>temp.txt #echo blocked attachment extensions to temp file
    total=0;
    
    echo "Number of Messages blocked by the MTA due to Attachments with banned Extensions"
    echo
    echo -e "Number \t | \t Extension"
    for i in $(cat temp.txt); #reads the list into $i
    do
            count=$(grep -c "unacceptable extension \"$i\"" /var/log/zimbra.log) #counts the number of occurences in the log of $i
            if [ "$count" -gt "1" ] #checks to see if count is greater than 1 if not then don't print report that extension
                    then echo -e "$count \t | \t $i"
            fi
            if [ "$count" = "1" ] #checks to see if count is 1 (for grammatically correct output)
                    then echo -e "$count \t | \t $i"
            fi
            let total+="$count" #adds the value of count to the total
    done
    tput smso;
    echo -e "$total \t | \t total"
    tput rmso;
    echo
    rm -f temp.txt #removes temp file

  2. #2
    Join Date
    Apr 2012
    Posts
    13
    Rep Power
    3

    Default

    hello! can be used eg newer version. 7
    As can be run as root or user zimbra?
    cd /home/Zimbra is the path where is installed, will be changed to /opt/Zimbra
    thanks

Similar Threads

  1. [SOLVED] Attachment blocking within .zip files?
    By bsneddon in forum Administrators
    Replies: 6
    Last Post: 02-15-2010, 10:58 PM
  2. Attachment Blocking
    By hodd in forum General Questions
    Replies: 1
    Last Post: 07-11-2008, 06:26 AM
  3. Web client logon fails (INVALID_PDU)
    By jermxx in forum Installation
    Replies: 8
    Last Post: 02-20-2007, 02:20 PM
  4. Tomcat broken after upgrade to 4
    By dotslashroot in forum Migration
    Replies: 13
    Last Post: 01-31-2007, 06:05 PM
  5. Replies: 2
    Last Post: 10-26-2006, 11:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •