Changing default categories for WebApp

  • Hi,

    I want to change the default categories for WebApp serverwide and didn’t find the defaults.php, where this should / could be done.
    I’m using Kopano on UCS and wanted to know, if I could just copy the defaults.php from github to /etc/kopano/webapp/ and edit it afterwards for changing the categories or if there is another way to do this.

    Thanks in advanced,

  • Kopano

    Hi @onex-de

    You should add it to your config,

    for example:

            define('DEFAULT_CATEGORIES', json_encode(array(
                    'name' => _('NumberOne'),
                    'color' => '#e40023',
                    'standardIndex' => 6,
                    'quickAccess' => true,
                    'sortIndex' => 0,
                    'used' => false
                    'name' => _('Number2'),
                    'color' => '#f99406',
                    'standardIndex' => 2,
                    'quickAccess' => true,
                    'sortIndex' => 1,
                    'used' => false

    But it probably won’t work if you already wrote categories in the persistent settings, so if you have used them before

  • @marty said in Changing default categories for WebApp:

    But it probably won’t work if you already wrote categories in the persistent settings, so if you have used them before

    Thanks … how can I check if there are some already?
    Is it possible, to delete/reset them?


  • Kopano

    @onex-de Not that trivial, but you could remove it from the persistent settings via python-kopano.

  • @marty cool, do you have an example, because I don’t know, what you mean with the JSON thing, mentioned above.

  • Kopano

    something like this (untested)

    import kopano
    from MAPI.Util import *
    import sys
    # Define the persistent setting property
    parser = kopano.parser('skp')
    parser.add_option("-u", dest="user", action="store", help="Username")
    parser.add_option("-d", dest="delete", action='store_true', help="delete persistent setting")
    parser, args = parser.parse_args()
    server = kopano.Server(parser)
    if parser.user:
        user = server.user(parser.user)
        # Define the prop in users store
            prop =
        except Exception:
            print "Property does not exist in store"
    if parser.delete:
            # Delete the persistent setting property
            print "Property deleted"
        except Exception:
            print "Property does not exist in your store"

  • Hi,

    sorry for bringing this thread up again.

    Is there still no way to change the categories for a user once a name was added to a colour? I get more and more requests to change categories because they aren’t used anymore. Is this feature on the roadmap?

    Thanks in advance for a quick answer and best regards,

  • Kopano


    End users can change the category color in WebApp (right click on an item -> Categories -> Manage Categories) 9b87024a-5c02-4254-b027-541e0546df91-image.png
    For the default colors this can only be changed once but with webapp_admin you can export the categories for a user and alter them

    Export the categories

    python3 --export-categories -u username

    and to import them for the same user

    python3 --import-categories -u username

    Or if restoring it from a different user export

    python3 --import-categories -u username --file /path/to/json/file

  • Hi Robin,

    thanks for the hint with the python-script. This was new to me.

    kind regards,

Log in to reply