Results 1 to 2 of 2

Thread: Attachment Blocking Stats

  1. #1
    NOC IT Dept is offline Member
    Join Date
    Feb 2009
    Rep Power

    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.

    #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
    cd /home/zimbra
    zmprov gcf zimbraMtaBlockedExtension | cut -d: -f2>temp.txt #echo blocked attachment extensions to temp file
    echo "Number of Messages blocked by the MTA due to Attachments with banned Extensions"
    echo -e "Number \t | \t Extension"
    for i in $(cat temp.txt); #reads the list into $i
            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"
            if [ "$count" = "1" ] #checks to see if count is 1 (for grammatically correct output)
                    then echo -e "$count \t | \t $i"
            let total+="$count" #adds the value of count to the total
    tput smso;
    echo -e "$total \t | \t total"
    tput rmso;
    rm -f temp.txt #removes temp file

  2. #2
    kalculator is offline Member
    Join Date
    Apr 2012
    Rep Power


    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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, 05: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, 10: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