Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-08-2010, 03:31 PM
Active Member
 
Posts: 25
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.
Reply With Quote
  #2 (permalink)  
Old 01-08-2010, 11:54 PM
Zimbra Consultant & Moderator
 
Posts: 20,312
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
Reply With Quote
  #3 (permalink)  
Old 01-10-2010, 12:11 AM
Outstanding Member
 
Posts: 594
Default

What is the o/p of: -
zmprov gacf | grep upload
Reply With Quote
  #4 (permalink)  
Old 01-11-2010, 07:50 AM
Active Member
 
Posts: 25
Default

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

Quote:
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).
Reply With Quote
  #5 (permalink)  
Old 01-11-2010, 02:40 PM
Active Member
 
Posts: 25
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?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.