# ------------------------------------------------------------------
#
#    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/4.0>,

include <tunables/global>

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

  capability dac_override,
  capability dac_read_search,
  capability net_bind_service,

  @{exec_path} mrix,

  /{var/spool/postfix/,}active/[0-9A-F]/[0-9A-F]/*      rwl,
  /{var/spool/postfix/,}active/[0-9A-F]/[0-9A-F]/       rwl,
  /{var/spool/postfix/,}active/[0-9A-F]/*               rwk,
  /{var/spool/postfix/,}active/[0-9A-F]/                rwl,
  /{var/spool/postfix/,}active/[0-9A-F]*                rwlk,
  /{var/spool/postfix/,}private/anvil                   w,
  /{var/spool/postfix/,}private/bounce                  w,
  /{var/spool/postfix/,}private/defer                   w,
  /{var/spool/postfix/,}private/rewrite                 w,
  /{var/spool/postfix/,}private/scache                  w,
  /{var/spool/postfix/,}private/tlsmgr                  w,
  /{var/spool/postfix/,}private/trace                   w,
  /{var/spool/postfix/,}public/flush                    w,
  /{var/spool/postfix/,}pid/unix.smtp            rwk,
  /{var/spool/postfix/,}pid/unix.relay           rwk,
  /etc/postfix/{ssl/,}*.pem                   r,
  /etc/postfix/prng_exch                      rw,
  /usr/share/ssl/certs/ca-bundle.crt          r,
  /etc/mtab                                   r,

  # Site-specific additions and overrides. See local/README for details.
  include if exists <local/postfix-smtp>
}
