Skip to content

Commit

Permalink
howto/rootless: Add setcap alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse committed Oct 26, 2023
1 parent ede6a45 commit 0556538
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ effinger
egid
EID
Eing
eip
ekh
emacs
emaillookup
Expand Down Expand Up @@ -868,6 +869,7 @@ seqno
SERVERBUG
servermetadata
SETACTIVE
setcap
setcred
setra
setspn
Expand Down
25 changes: 23 additions & 2 deletions source/configuration_manual/howto/rootless.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ example configuration file exists in
``~/dovecot/share/doc/dovecot/example-config/`` and needs to be copied
to ``~/dovecot/etc/dovecot/``.

Add capabilities
----------------

Modern linux systems support capabilities which allows you to permit
selective rights to processes. This allows you to run dovecot rootless
without losing chroot and privileged ports.

Use following commands to enable this

.. code:: bash
setcap cap_sys_chroot,cap_net_bind_service+eip ~/dovecot/libexec/dovecot/submission-login
setcap cap_sys_chroot,cap_net_bind_service+eip ~/dovecot/libexec/dovecot/pop3-login
setcap cap_sys_chroot,cap_net_bind_service+eip ~/dovecot/libexec/dovecot/imap-login
setcap cap_sys_chroot,cap_net_bind_service+eip ~/dovecot/libexec/dovecot/lmtp
setcap cap_sys_chroot+eip ~/dovecot/libexec/dovecot/anvil
# if you have installed managesieve
setcap cap_sys_chroot+eip ~/dovecot/libexec/dovecot/managesieve-login
Configuration
-------------

Expand All @@ -61,7 +80,8 @@ The important settings to change for rootless installation are:
default_login_user = user
default_internal_group = group

- Remove default chrooting from all services:
- Remove default chrooting from all services, this is optional if you want
to use Linux capabilities instead.

::

Expand All @@ -75,7 +95,8 @@ The important settings to change for rootless installation are:
chroot =
}

- Change listener ports:
- Change listener ports, this is optional if you want to use Linux
capabilities instead

::

Expand Down

0 comments on commit 0556538

Please sign in to comment.