Results 1 to 5 of 5

Thread: Importing from Mailbox to Zimbra UPLOAD_SIZE_LIMIT_EXCEEDED

  1. #1
    MoreDakka is offline Active Member
    Join Date
    Apr 2009
    Posts
    25
    Rep Power
    6

    Default Importing from Mailbox to Zimbra UPLOAD_SIZE_LIMIT_EXCEEDED

    Hey, have a problem here. Here is my script (very edited from an original):

    Code:
    #!/bin/bash
    
    #
    # Maildir to Zimbra import
    #
    # Created by Jaros.aw Czarniak on 26-10-2008
    # Edited by Josh Henry 12-11-2009
    #
    
    function checktime {
            date +%m-%d-%Y-%T
    }
    
    LOG=/var/log/mailimport/IMPORT-`checktime`.log
    domain="3cis.biz" # change to your domain!
    IMPORT="/Inbox"
    
    clear
    chown -R zimbra:zimbra *
    
    for user in `ls -d1 */|sed s/\\\///`
    do
        echo "####USER####"|tee -a $LOG
        echo "`checktime` - User $user"|tee -a $LOG
        echo "####USER####"|tee -a $LOG
    
        echo "#######"|tee -a $LOG
        echo "# CUR #"|tee -a $LOG
        echo "#######"|tee -a $LOG
        
        for varDIR in `find $user -maxdepth 10 -type d -name cur| sed 's/ /_/g'`
        do
    
        ###Removing .INBOX and turning '.'s into '/'s to import right into the inbox.
        varCUT=`echo $varDIR|cut -f3 -d"/"|sed 's/.INBOX//; s/[.]//; s/[.]/\//g'`
        varWC=`echo $varCUT |sed 's/\// /g'|wc -w` ###Counting the words in the line for diretory creation
        varFIN=${varCUT/_/ }
    
        echo |tee -a $LOG
        echo "`checktime` - Directory with /cur - /Inbox/$varFIN"|tee -a $LOG
    
        if [ "$varFIN" = "cur" ]  ###If the folder is /Inbox then write directly to /Inbox.
            then
               echo "`checktime` - ##Starting mail Import for directory /Inbox##"|tee -a $LOG
               /opt/zimbra/bin/zmmailbox -z -m $user@$domain addMessage "${IMPORT}" "$PWD/$user/Maildir/cur"|tee -a $LOG
               echo "`checktime` - ##Mail Import complete for directory /Inbox##"|tee -a $LOG
    
            elif [ $varCUT == "Sent" ]  ###If the folder is the sent folder then write to /Sent
                then
                    echo "`checktime` - ##Starting mail Import for directory /Sent##"|tee -a $LOG
                   /opt/zimbra/bin/zmmailbox -z -m $user@$domain addMessage "/Sent" "${PWD}/`echo $varDIR|sed 's/ /\\ /g; s/_/\\ /g'`"|tee -a $LOG
                    echo "`checktime` - ##Mail Import complete for directory /Sent##"|tee -a $LOG
    
            elif [ $varCUT == "Drafts" ]  ###If the folder is the drafts folder then write to /Drafts
                then
                    echo "`checktime` - ##Starting mail Import for directory /Drafts##"|tee -a $LOG
                    /opt/zimbra/bin/zmmailbox -z -m $user@$domain addMessage "/Drafts" "${PWD}/`echo $varDIR|sed 's/ /\\ /g; s/_/\\ /g'`"|tee -a $LOG
                    echo "`checktime` - ##Mail Import complete for directory /Drafts##"|tee -a $LOG
    
            elif [ $varCUT == "Trash" ] || [ $varCUT == "Junk" ] || [ $varCUT == "Deleted_Items" ]  ###We don't want to waste time on these, bypassing
                then
                    echo "`checktime` - ####BYPASSING because this folder is $varCUT and doesn't need to be transfered####"|tee -a $LOG
    
            else
    
            ii=2
            for (( i = $varWC; i >= 0; i-- )) ##Loop through the dir's and create them in order
            do
                varSEQ=`seq -s, 1 $ii` ##Create a sequence for the cut command
                varFOLDER=`echo ${IMPORT}/$varCUT|cut -f$varSEQ -d "/"|sed 's/_/ /g'` ##The actual folder to create
    
                echo "`checktime` - Creating Folder - "$varFOLDER|tee -a $LOG
                /opt/zimbra/bin/zmmailbox -z -m $user@$domain createFolder "$varFOLDER"|tee -a $LOG  ##Creating the Folders.
                echo >>$LOG
                ((ii++))
    
            done
                echo "`checktime` - ##Starting mail Import for directory "$varFOLDER"##"|tee -a $LOG
                /opt/zimbra/bin/zmmailbox -z -m $user@$domain addMessage "$varFOLDER" "${PWD}/`echo $varDIR|sed 's/ /\\ /g; s/_/\\ /g'`"|tee -a $LOG
                echo "`checktime` - ##Mail Import Complete for directory "$varFOLDER"##"|tee -a $LOG
        fi
        done
    
        echo "#######"|tee -a $LOG
        echo "# NEW #"|tee -a $LOG
        echo "#######"|tee -a $LOG
        for varDIR in `find $user -maxdepth 10 -type d -name new| sed 's/ /_/g'`
    do
    
        ###Removing .INBOX and turning '.'s into '/'s to import right into the inbox.
        varCUT=`echo $varDIR|cut -f3 -d"/"|sed 's/.INBOX//; s/[.]//; s/[.]/\//g'`
        varWC=`echo $varCUT |sed 's/\// /g'|wc -w` ###Counting the words in the line for diretory creation
        varFIN=${varCUT/_/ }
    
        echo |tee -a $LOG
        echo "`checktime` - Directory with /new /Inbox/$varFIN"|tee -a $LOG
    
        if [ "$varFIN" = "new" ]  ###If the folder is /Inbox then write directly to /Inbox.
            then
               echo "`checktime` - ##Starting mail Import for directory /Inbox##"|tee -a $LOG
               /opt/zimbra/bin/zmmailbox -z -m $user@$domain addMessage "${IMPORT}" "$PWD/$user/Maildir/new"|tee -a $LOG
               echo "`checktime` - ##Mail Import complete for directory /Inbox##"|tee -a $LOG
    
            elif [ $varCUT == "Sent" ]  ###If the folder is the sent folder then write to /Sent
                then
                    echo "`checktime` - ##Starting mail Import for directory /Sent##"|tee -a $LOG
                   /opt/zimbra/bin/zmmailbox -z -m $user@$domain addMessage "/Sent" "${PWD}/`echo $varDIR|sed 's/ /\\ /g; s/_/\\ /g'`"|tee -a $LOG
                    echo "`checktime` - ##Mail Import complete for directory /Sent##"|tee -a $LOG
    
            elif [ $varCUT == "Drafts" ]  ###If the folder is the drafts folder then write to /Drafts
                then
                    echo "`checktime` - ##Starting mail Import for directory /Drafts##"|tee -a $LOG
                    /opt/zimbra/bin/zmmailbox -z -m $user@$domain addMessage "/Drafts" "${PWD}/`echo $varDIR|sed 's/ /\\ /g; s/_/\\ /g'`"|tee -a $LOG
                    echo "`checktime` - ##Mail Import complete for directory /Drafts##"|tee -a $LOG
    
            elif [ $varCUT == "Trash" ] || [ $varCUT == "Junk" ] || [ $varCUT == "Deleted_Items" ]  ###We don't want to waste time on these, bypassing
                then
                    echo "`checktime` - ####BYPASSING because this folder is $varCUT and doesn't need to be transfered####"|tee -a $LOG
    
            else
    
            ii=2
            for (( i = $varWC; i >= 0; i-- )) ##Loop through the dir's and create them in order
            do
                varSEQ=`seq -s, 1 $ii` ##Create a sequence for the cut command
                varFOLDER=`echo ${IMPORT}/$varCUT|cut -f$varSEQ -d "/"|sed 's/_/ /g'` ##The actual folder to create
    
                echo "`checktime` - Creating Folder - "$varFOLDER|tee -a $LOG
                /opt/zimbra/bin/zmmailbox -z -m $user@$domain createFolder "$varFOLDER"|tee -a $LOG  ##Creating the Folders.
                echo >>$LOG
                ((ii++))
    
            done
                echo "`checktime` - ##Starting mail Import for directory "$varFOLDER"##"|tee -a $LOG
                /opt/zimbra/bin/zmmailbox -z -m $user@$domain addMessage "$varFOLDER" "${PWD}/`echo $varDIR|sed 's/ /\\ /g; s/_/\\ /g'`"|tee -a $LOG
                echo "`checktime` - ##Mail Import Complete for directory "$varFOLDER"##"|tee -a $LOG
        fi
        done
    done
    It gets about 8800 messages into a mailbox then it kills the script with an error: "ERROR: zclient.UPLOAD_SIZE_LIMIT_EXCEEDED (upload size limit exceeded)"
    The mailbox size is 25Meg so it's strange that would even be a problem. I've already imported over half the user's email twice (they've purged it for me) and I'm sure they are getting annoyed with having to do this. Has anyone else run into the size limit issue? Possibly importing too many messages?

    thanks.

  2. #2
    phoenix is online now Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,437
    Rep Power
    56

    Default

    You haven't actually given much information about the problem. What errors did you see in the log files. What is the upload size set in the Admin UI? What is the size of the message you're trying to upload? Did you search the forums as details of how to change the upload size are there and this error has been covered before.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    veronica is offline Outstanding Member
    Join Date
    Jun 2008
    Posts
    594
    Rep Power
    8

    Default

    What is the o/p of: -
    zmprov gacf | grep upload

  4. #4
    MoreDakka is offline Active Member
    Join Date
    Apr 2009
    Posts
    25
    Rep Power
    6

    Default

    Sorry about the lack of information. I'll try to give as much information as required but wasn't sure what was needed.

    veronica
    What is the o/p of: -
    zmprov gacf | grep upload
    [root@mail ~]# su zimbra
    [zimbra@mail root]$ zmprov gacf | grep upload
    [zimbra@mail root]$


    As for the log file, I cannot find a log file for the /opt/zimbra/bin/zmmailbox command. Can someone point this out to me. The log file created by the script actually shows less information then what was on the screen (just some basic time stamps and all the messages but the error that zmmailbox created wasn't logged for some reason).

  5. #5
    MoreDakka is offline Active Member
    Join Date
    Apr 2009
    Posts
    25
    Rep Power
    6

    Default

    Found that it can't be a message size issue. The old server was set to 30 meg. I upped that, and re-imported a message that was 40 meg. Zimbra imported it no problem. It almost seems to be a message count thing since it gets to 8700ish messages then craps out.

    Any ideas?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Moving Zimbra to a new server
    By krolen in forum Administrators
    Replies: 109
    Last Post: 02-05-2009, 11:38 AM
  2. Replies: 12
    Last Post: 02-25-2008, 07:28 PM
  3. [SOLVED] Clamav problem ? What's happening ?
    By aNt1X in forum Installation
    Replies: 23
    Last Post: 02-14-2008, 05:43 AM
  4. Zimbra shutdowns every n hours.
    By Andrewb in forum Administrators
    Replies: 13
    Last Post: 08-14-2007, 08:55 AM
  5. Fedora Core 3, Clean Install - Not working!
    By pcjackson in forum Installation
    Replies: 17
    Last Post: 03-05-2006, 07:38 PM

Posting Permissions

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