zcore

Name

zcore — Bridge for PHP-MAPI requests

Synopsis

zcore [-c config]

Description

zcore is a bridge process (proxy) between mapi(4gx) and exmdb_provider(4gx). It listens on /run/gromox/zcore.sock (hardcoded) for zcore RPCs, a Gromox-specific protocol and issues exmdb RPCs to exmdb_provider(4gx). As exmdb_provider connections have no state to speak of, zcore is the process that defines the logins sessions. zcore needs to run on the same server as the program that uses the Z-MAPI PHP functions.

Options

-c config

Read configuration directives from the given file. If this option is not specified, /etc/gromox/zcore.cfg will be read if it exists.

--version

Output version information and exit.

-?

Display option summary.

All time-based command-line options and configuration file directives are subject to the syntax described in gromox(7), section "Duration specifications".

Configuration directives (gromox.cfg)

The following directives are recognized when reading from /etc/gromox/gromox.cfg, or when the -c option is used to specify a custom file:

daemons_fd_limit

In gromox-zcore, this is treated as an alias for zcore_fd_limit.

outgoing_smtp_url
The SMTP server to use for outgoing mails. To use the local maildrop queue, set the value to sendmail://localhost. smtp:// is unqueued(!), and if the SMTP server is offline, submissions will be rejected (and mails stick around in Outbox or whatever folder they were submitted from).
Default: smtp://%3a%3a1:25/
zcore_fd_limit
Request that the file descriptor table be at least this large. The magic value 0 indicates that the system default hard limit (rlim_max, cf. setrlimit(2)) should be used.
Default: 0

Configuration directives (zcore.cfg)

The following directives are recognized when reading from /etc/gromox/zcore.cfg, or when the -c option is used to specify a custom file:

address_cache_interval

Default: 5 minutes

address_table_size

Default: 3000

config_file_path
Colon-separated list of directories which will be scanned when locating further configuration files, especially those used by plugin instances.
Default: /etc/gromox/zcore:/etc/gromox
data_file_path
Colon-separated list of directories which will be scanned when locating data files.
Default: /usr/share/gromox/zcore
default_charset

Default: utf-8

host_id
A unique identifier for this system. It is used for the HELO line of outgoing SMTP connections, and as an unused identifier within muidStoreWrap entryids. The identifier should only use characters allowed for hostnames.
Default: (system hostname)
mailbox_ping_interval

Default: 5 minutes

mail_max_length

Default: 64M

max_ext_rule_length

Default: 510K

max_mail_num

Default: 1000000

max_rcpt_num
The maximum number of recipients that an e-mail is allowed to have.
Default: 256
notify_stub_threads_num
For every exmdb server in exmdb_list.txt, establish and keep this many number of outbound connections for receiving notification RPCs.
Default: 10
rpc_proxy_connection_num
For every exmdb server in exmdb_list.txt, establish and keep this many number of outbound connections for sending commands.
Default: 10
state_path
Directory for runtime variadic data.
Default: /var/lib/gromox
submit_command

Default: /usr/bin/php /usr/share/gromox/sa/submit.php

user_cache_interval
Sets the time how long the MAPI profile is cached before it is written to disk.
Default: 1 hour
user_table_size

Default: 5000

x500_org_name

Default: (unspecified)

zcore_listen
The named path for the AF_LOCAL socket that zcore will listen on.
Default: /run/gromox/zcore.sock
zcore_log_file
Target for log messages here. Special values: "-" (stderr/syslog depending on parent PID) or "syslog" are recognized.
Default: - (auto)
zcore_log_level
Maximum verbosity of logging. 1=crit, 2=error, 3=warn, 4=notice, 5=info, 6=debug.
Default: 4 (notice)
zcore_max_obh_per_session
The maximum number of object handles each session can have at any one time (e.g. folders/messages/etc. open simultaneously). Use 0 to indicate unlimited. There is one session for each time a mailbox is opened.
Default: 500
zcore_threads_num
The minimum number of client processing threads to keep around.
Default: 10
zrpc_debug
Log every incoming zcore RPC and the return code of the operation in a minimal fashion to stdout. Level 1 emits RPCs with a failure return code, level 2 emits all RPCs. Note the daemon log level needs to be "debug" (6), too.
Default: 0

Network protocol

The transmissions on the zcore socket are simple concatenations of protocol data units built using the NDR format. The PDU length is present within the PDU itself near the start.

{
     leuint32_t length;
     char pdu[];
}
pdu := {
     uint8_t call_id;
     string directory;
     switch (call_id) {
             ...
     }
}

Store lookup

zcore determines the store path for a user from the user database, which may be provided by a service plugin like mysql_adaptor(4gx).

The filemap that specifies how paths are handled is located at data_file_path/exmdb_list.txt, whereby data_file_path is the eponymous directive from the config file.

Each line in this file consists of 4 columns separated by whitespace:

  • A portion of the store path to match on

  • The type of store ("private" or "public")

  • An IPv6 address (or v4-mapped address) of the server running exmdb_provider(4gx)

  • The TCP port number of the server

Files

  • config_file_path/exmdb_list.txt: exmdb multiserver selection map, see exmdb_provider(4gx) for details.

  • data_file_path/folder_names.txt: Translations for essential folders in a message store.

  • data_file_path/msgchg_grouping/: Data files for exchange_emsmdb(4gx)

  • data_file_path/notify_bounce/: templates for read/nonread notification mails sent to originators

  • /usr/lib/gromox/libgxs_*.so: service plugins

Notes

Behavior for the address book generally mirrors exchange_nsp(4gx), so see that manpage for additional notes.

See also

gromox(7)