Exemple #1
0
    'run_as_user':
    Config.string(default="kopano"),
    'run_as_group':
    Config.string(default="kopano"),
    'search_engine':
    Config.string(default='xapian'),
    'suggestions':
    Config.boolean(default=True),
    'index_junk':
    Config.boolean(default=True),
    'index_drafts':
    Config.boolean(default=True),
    'server_bind_name':
    Config.string(default='file:///var/run/kopano/search.sock'),
    'ssl_private_key_file':
    Config.path(default=None,
                check=False),  # XXX don't check when default=None?
    'ssl_certificate_file':
    Config.path(default=None, check=False),
    'term_cache_size':
    Config.size(default=64000000),
}


def db_get(db_path, key):
    """ get value from db file """
    if not isinstance(key, bytes):  # python3
        key = key.encode('ascii')
    with closing(bsddb.hashopen(db_path, 'c')) as db:
        value = db.get(key)
        if value is not None:
            return db.get(key).decode('ascii')
import kopano
from kopano import Config
from kopano.utils import bytes_to_human

from MAPI.Tags import PR_EC_QUOTA_MAIL_TIME

CONFIG = {
    'quota_check_interval':
    Config.integer(default=15),
    'mailquota_resend_interval':
    Config.integer(default=1),
    'servers':
    Config.string(default=''),  # XXX
    'userquota_warning_template':
    Config.path(default='/etc/kopano/quotamail/userwarning.mail'),
    'userquota_soft_template':
    Config.path(default='/etc/kopano/quotamail/usersoft.mail'),
    'userquota_hard_template':
    Config.path(default='/etc/kopano/quotamail/userhard.mail'),
    'companyquota_warning_template':
    Config.path(default='/etc/kopano/quotamail/companywarning.mail'),
}
""""
TODO:
- set sender
- Company quota
- Send email to system administrator? => who is this?

"""
Exemple #3
0
migration management is done from command-line (using socket for communication).

basic commands (see --help for all options):

kopano-msr --list-users -> list users currently being migrated

kopano-msr -u user1 --add --server node14 -> start migrating user

kopano-msr -u user1 ->  check migration status, compare store contents

kopano-msr -u user1 --remove -> finalize migration (metadata, special folders..)

"""

CONFIG = {
    'state_path': Config.path(default='/var/lib/kopano/msr/', check=True),
    'server_bind_name': Config.string(default='file:///var/run/kopano/msr.sock'),
    'ssl_private_key_file': Config.path(default=None, check=False), # XXX don't check when default=None?
    'ssl_certificate_file': Config.path(default=None, check=False),
}

setproctitle.setproctitle('kopano-msr main')

def init_globals(): # late init to survive daemonization
    global LOCK, STORE_STORE, USER_INFO, STORE_FOLDER_QUEUED, STORE_FOLDERS_TODO, USER_SINK

    LOCK = multiprocessing.Lock()

    _mgr = multiprocessing.Manager()

    # TODO persistency
Exemple #4
0
    # 0x001A: PR_MESSAGE_CLASS # XXX add to cfg
    'index_exclude_properties': Config.integer(multiple=True, base=16, default=[0x007D, 0x0064, 0x0C1E, 0x0075, 0x678E, 0x678F, 0x001A]),
    'index_path': Config.string(default='/var/lib/kopano/search/'),
    'index_processes': Config.integer(default=1),
    'limit_results': Config.integer(default=0),
    'optimize_age': Config.ignore(),
    'optimize_start': Config.ignore(),
    'optimize_stop': Config.ignore(),
    'run_as_user': Config.string(default="kopano"),
    'run_as_group': Config.string(default="kopano"),
    'search_engine': Config.string(default='xapian'),
    'suggestions': Config.boolean(default=True),
    'index_junk': Config.boolean(default=True),
    'index_drafts': Config.boolean(default=True),
    'server_bind_name': Config.string(default='file:///var/run/kopano/search.sock'),
    'ssl_private_key_file': Config.path(default=None, check=False), # XXX don't check when default=None?
    'ssl_certificate_file': Config.path(default=None, check=False),
    'term_cache_size': Config.size(default=64000000),
}

if sys.hexversion >= 0x03000000:
    unicode = str

    def _is_unicode(s):
        return isinstance(s, str)

    def _decode(s):
        return s

    def _decode_ascii(s):
        return s.decode('ascii')