Changeset View
Changeset View
Standalone View
Standalone View
bin/kolab_smtp_access_policy.py
Show First 20 Lines • Show All 1,350 Lines • ▼ Show 20 Lines | if not recipient == '' and recipients == []: | ||||
recipients = [recipient] | recipients = [recipient] | ||||
for recipient in recipients: | for recipient in recipients: | ||||
recipient_found = False | recipient_found = False | ||||
for record in records: | for record in records: | ||||
if record.recipient == recipient: | if record.recipient == recipient: | ||||
recipient_found = True | recipient_found = True | ||||
if not recipient_found: | if not recipient_found: | ||||
try: | |||||
cache_insert( | cache_insert( | ||||
function=function, | function=function, | ||||
sender=sender, | sender=sender, | ||||
recipient=recipient, | recipient=recipient, | ||||
result=result, | result=result, | ||||
sasl_username=sasl_username, | sasl_username=sasl_username, | ||||
sasl_sender=sasl_sender, | sasl_sender=sasl_sender, | ||||
data=data | data=data | ||||
) | ) | ||||
except Exception as errmsg: | |||||
log.error(_("Exception caught: %r") % (errmsg)) | |||||
def defer_if_permit(message, policy_request=None): | def defer_if_permit(message, policy_request=None): | ||||
log.info(_("Returning action DEFER_IF_PERMIT: %s") % (message)) | log.info(_("Returning action DEFER_IF_PERMIT: %s") % (message)) | ||||
print("action=DEFER_IF_PERMIT %s\n\n" % (message)) | print("action=DEFER_IF_PERMIT %s\n\n" % (message)) | ||||
sys.exit(0) | sys.exit(0) | ||||
▲ Show 20 Lines • Show All 352 Lines • Show Last 20 Lines |