# ------------------------------------------------------------------
#
#    Copyright (C) 2002-2006 Novell/SUSE
#    Copyright (C) 2018 Canonical, Ltd.
#    Copyright (C) 2019 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/3.0>,

include <tunables/global>

profile postfix-cleanup /usr/lib/postfix/{bin/,sbin/,}cleanup {
  include <abstractions/base>
  include <abstractions/nameservice>
  include <abstractions/postfix-common>

  capability net_bind_service,
  capability dac_read_search,

  /usr/lib/postfix/{bin/,sbin/,}cleanup                   mrix,

  /{var/spool/postfix/,}incoming/[0-9]*.[0-9]*            rwl,
  /{var/spool/postfix/,}incoming/[0-9A-F]/[0-9A-F]/*      rwl,
  /{var/spool/postfix/,}incoming/[0-9A-F]/[0-9A-F]/       rwl,
  /{var/spool/postfix/,}incoming/[0-9A-F]/                rwl,
  /{var/spool/postfix/,}incoming/[0-9A-F]*                rw,
  /{var/spool/postfix/,}private/bounce                    w,
  /{var/spool/postfix/,}private/rewrite                   rw,
  /{var/spool/postfix/,}public/qmgr                       rw,
  /{var/spool/postfix/,}hold/[0-9A-F]*                    w,
  /{var/spool/postfix/,}public/cleanup          rw,
  /{var/spool/postfix/,}pid/unix.cleanup         rwk,

  /etc/{m,fs}tab                              r,
  /etc/postfix/*                              r,
}
