Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    move many mails from one folder to another

    Kopano WebApp
    3
    7
    1085
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • item
      item last edited by

      During a migration from Outlook I have to move thousands of mails from one folder to another… (different Sent folders)
      This is difficult and tedious… (mark mails and move them… slowly reaction of the webapp…)
      Is there a simple way to do this?

      1 Reply Last reply Reply Quote 0
      • mcostan
        mcostan last edited by

        I only found two ways to move emails all emails from one folder to another.

        • via IMAP sync (or kopano-sync can’t remember the name) essentially using IMAP.
        • by hand in webapp (actually the old webaccess I find it faster for this).

        In both cases it is very tedious.

        Something more simple would be very much welcome from me too…

        1 Reply Last reply Reply Quote 0
        • item
          item last edited by

          Thank you - now I do it via IMAP connection with thunderbird…

          Something more simple would be very much welcome from me too…
          

          sometimes simple things matter

          1 Reply Last reply Reply Quote 0
          • mcostan
            mcostan last edited by

            I understand the right solution here is kopano-python.

            I was however wondering if someone has written a script for this already.

            1 Reply Last reply Reply Quote 0
            • mcostan
              mcostan last edited by

              in the end the easiest way I could do it was via Thunderbird (IMAP).

              I still believe there should be an option somewhere in webapp to say “move all emails from this folder to another folder”.

              1 Reply Last reply Reply Quote 0
              • robgnu
                robgnu last edited by robgnu

                Hello,

                I had the same need for a bulk move of many (>10.000) Mails from one folder to another. The advanced wish was moving many mails to another (archive) user.

                At first I searched this forum and the internet and found this documentation:
                https://documentation.kopano.io/kopano_python_kopano/PythonKopano.pdf

                For now I have made a quick’n’dirty Python script to move Mails from one Folder to another - even to another mailbox. Here it is. Hope it helps anyone:

                move.py:

                import kopano
                from datetime import datetime, timedelta
                
                dont_move_days = datetime.now() - timedelta(days=90)
                
                server = kopano.Server()
                store1 = server.user('office').store
                store2 = server.user('archiv_office').store
                
                srcfolder = store1.folder('Weiterleitungen')
                dstfolder = store2.folder('Weiterleitungen')
                
                #other_folder = store1.folder('Archiv/Weiterleitungen')
                
                print("SRC: Folder {} has {} Mails.".format(srcfolder.name, srcfolder.count) )
                print("DST: Folder {} has {} Mails.".format(dstfolder.name, dstfolder.count) )
                print("Mails older than {} will not moved.".format(dont_move_days))
                
                count = 0
                count_src = srcfolder.count
                for item in srcfolder:
                        count += 1
                        item_created = item.created
                        if item_created < dont_move_days:
                                print("Move Mail {}/{} to {}...".format(count, count_src, dstfolder.name))
                                item.move(dstfolder)
                #       else:
                #               print("Mail not moved {}.".format(count))
                
                
                1 Reply Last reply Reply Quote 1
                • mcostan
                  mcostan last edited by

                  that’s great this will be very helpful!

                  I do believe that this funcitonality should be visible somewhere other than the back end…

                  I.e. some button in Webapp.

                  I am sure we won’t be the last two that need something like this.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post