This document extends the files already existing as README.md
and
README.develop.md
with some information learnt and needed for SouvAP
development and deployment.
While the code under app/listener_trigger
was developed with the AppCenter
provisioning in mind, SouvAP has no Univention AppCenter.
AppCenter provisioning places files under
/var/lib/univention-appcenter/apps/dovecot-connector/data
such as creation, deletion and changes on LDAP objects. The AppCenter provisioning service then calls thedovecot-connector
which runs on a container until it finishes processing the changes found on this directory. More info on this topic can be found here
SouvAP, on the other hand has access to Univention Directory Listener , which can be adapted to work with the base code of the
dovecot-connector
and runs on a container continuously.
In the file docker-compose.yaml
you will find some variables you can change via docker-compose.override.yaml
.
DCC_ADM_URI
:http://{dcc_adm_host}:{dcc_adm_port:d}/doveadm/v1
as template for the python connector.DCC_ADM_HOST
: host where the doveadm HTTP API is hosted.DCC_ADM_PORT
: port where the doveadm HTTP API is exposed.DCC_ADM_USERNAME
: doveadm user, normallydoveadm
or specified underdoveam_username
atdovecot.conf
.DCC_ADM_PASSWORD
: doveadm password, usually underdoveadm_password
on thedovecot.conf
file.DCC_DC_VMAIL_TEMPLATE
: the path to the mail folders as a python template, like/var/spool/dovecot/private/{domain}/{username}
with the following options available:domain
: the domain where the folders are located (email domain, likeexample.org
)username
: the username at the domain (before the@
)email
: the whole email, conformed by the user and the domain joined by the@
uuid
: a unique id
This depends on how the dovecot server is configured, specially the auth part (using LDAP, PAM or passwd-file as drivers on the passdb setting in
dovecot.conf
) The home path for email is set undermail_home
andmail_location
also on that file. Details hereDCC_ADM_ACCEPTED_EXIT_CODES
: dovecot specsDCC_LOGLEVEL
: DEBUG
- Run the steps on
README.develop.md
to get thepython-doveadm.zip
package. - Run the steps on
README.md
on the listener-container-base and ensuressl
,secret
anddocker-compose.override.yaml
have been created. - Configure additional domains if needed under the
docker-compose.override.yaml
to ensure doveadm HTTP API is reachable from within the container. - Happy development!
If dovecot is using the user
part on [email protected]
there seems to be
currently no way of removing its mailbox, unless the user
is also the LDAP uid.
Example: my user on ldap is
jnice
but my email id[email protected]
, my mailbox could be located underjohn
folder, thus not being deleted by any possible template onDCC_DC_VMAIL_TEMPLATE
variables.
Frequent in the sense of I found out the hard way 😃
Found when setting up a dovecot server.
- Ensure it is not running on the port you expect it by
netstat -l --tcp -np | grep dovecot
- Visit the logs at
/var/log/dovecot.log
an check for messages by the doveadm service. - You probably have specified
doveadm_port
on yourdovecot.conf
, but that is not enough. Make sure something like this is on thedovecot.conf
:service doveadm {{ chroot = client_limit = 1 drop_priv_before_exec = no executable = doveadm-server extra_groups = $default_internal_group group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 1 type = unix_listener doveadm-server {{ group = mode = 0600 user = }} inet_listener {{ port = 2425 }} inet_listener http {{ port = {doveadm_port:d} #ssl = yes # uncomment to enable https }} user = vsz_limit = 18446744073709551615 B }}
Double brackets are there for python templating. If you are not using the configuration file as such template, please remove the duplicates.
Due to the expiration time of artifacts on the python-doveadm repository, the artifacts may have expired and the zip file containing the package may not be downloaded.
- Rerun the pipeline on python-doveadm repository.
- Fix any failing tests if there are errors.
- Make sure you have a
docker-compose.override.yaml
file on the root folder. Else, you can find more details on how to get it on the listener-container-base repo and its playbooks.
For this case, you may try the following command:
curl -u doveadm:<some_pass> http://domain.example.org:8080/doveadm/v1
or try out a full command for more specific cases
curl -u doveadm:<some_pass> http://domain.example.org:8080/doveadm/v1 -X POST -H "Content-Type: application/json" -d '[["fsDelete",{"recursive":true,"maxParallel":1,"fsDriver":"posix","fsArgs":"dirs","path":"/var/spool/dovecot/private/<some_domain>/<some_user>"},"tag1"]]'