@!@
# get all recipient restrictions from UCR ==> [ (key, val), ... ]
ucrlist = [ x for x in configRegistry.items() if x[0].startswith('mail/postfix/smtpd/restrictions/recipient/') ]
# add listfilter if enabled by UCR with level "05" (Bug #17954)
if configRegistry.is_true("mail/postfix/policy/listfilter", False):
	ucrlist.append( ('mail/postfix/smtpd/restrictions/recipient/05-listfilter', 'check_policy_service unix:private/listfilter') )
if configRegistry.is_true("mail/postfix/greylisting", False):
	ucrlist.append( ('mail/postfix/smtpd/restrictions/recipient/40-greylisting', 'check_policy_service inet:127.0.0.1:10023') )
ucrlist.sort()
recipient_restrictions = [ x[1] for x in ucrlist ]

print "smtpd_recipient_restrictions = %s" % ",\n        ".join(recipient_restrictions)
@!@
# smtpd_sender_restrictions is not defined since all relevant checks have been moved to
# smtpd_recipient_restrictions and every mail has to pass smtpd_recipient_restrictions too.
#smtpd_sender_restrictions =

