# vim: ft=apparmor
# ------------------------------------------------------------------
#
#    Copyright (C) 2020 Michael Hirmke
#    Copyright (C) 2020 Christian Boltz
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of version 2 of the GNU General Public
#    License published by the Free Software Foundation.
#
# ------------------------------------------------------------------

abi <abi/4.0>,

include <tunables/global>

profile dovecot-script-login /usr/lib*/dovecot/script-login {
  include <abstractions/base>
  include <abstractions/dovecot-common>
  include <abstractions/nameservice>

  capability setuid,

  @{exec_path} mrPx,

  # NOTE: You'll need to allow execution of your actual login script.
  # The recommended way is to add a rule for it in local/usr.lib.dovecot.script-login
  # for example
  #   /home/vmail/bin/postlogin.sh Px,
  # and then to create the profile for the script.

  # Site-specific additions and overrides. See local/README for details.
  include if exists <local/usr.lib.dovecot.script-login>
}
