示例#1
0
def update_destination_backend(protocol):
    """Update the required backend files"""
    create_smtp.apply_async(args=[1], exchange=FANOUT_XCHG)
    create_lmtp.apply_async(args=[1], exchange=FANOUT_XCHG)
    create_smtp.apply_async(args=[2], exchange=FANOUT_XCHG)
    create_lmtp.apply_async(args=[2], exchange=FANOUT_XCHG)
    create_relay_proto_domains.apply_async(args=[protocol],
                                        exchange=FANOUT_XCHG)
    create_route_data.apply_async(exchange=FANOUT_XCHG)
示例#2
0
def update_domain_backend(domain, force=False):
    "Update the required backend files"
    create_relay_domains.apply_async(exchange=FANOUT_XCHG)
    create_callback_domains.apply_async(exchange=FANOUT_XCHG)
    create_post_smtp_av.apply_async(exchange=FANOUT_XCHG)
    create_av_disabled.apply_async(exchange=FANOUT_XCHG)
    create_ldap_domains.apply_async(exchange=FANOUT_XCHG)
    create_smtp.apply_async(args=[1], exchange=FANOUT_XCHG)
    create_lmtp.apply_async(args=[1], exchange=FANOUT_XCHG)
    create_smtp.apply_async(args=[2], exchange=FANOUT_XCHG)
    create_lmtp.apply_async(args=[2], exchange=FANOUT_XCHG)
    create_route_data.apply_async(exchange=FANOUT_XCHG)
    update = False
    if force or domain.language != 'en':
        create_language_based.apply_async(exchange=FANOUT_XCHG)
        update = True
    if force or domain.message_size != '0':
        create_message_size.apply_async(exchange=FANOUT_XCHG)
        update = True
    if force or domain.high_score > 0:
        create_highspam_scores.apply_async(exchange=FANOUT_XCHG)
        update = True
    if force or domain.low_score > 0:
        create_spam_scores.apply_async(exchange=FANOUT_XCHG)
        update = True
    if force or domain.highspam_actions != 2:
        create_highspam_actions.apply_async(exchange=FANOUT_XCHG)
        update = True
    if force or domain.spam_actions != 2:
        create_spam_actions.apply_async(exchange=FANOUT_XCHG)
        update = True
    if force or domain.virus_checks is False or \
            domain.virus_checks_at_smtp is False:
        create_virus_checks.apply_async(exchange=FANOUT_XCHG)
        update = True
    if force or domain.spam_checks is False:
        create_spam_checks.apply_async(exchange=FANOUT_XCHG)
        update = True
    if update:
        update_serial.apply_async(exchange=FANOUT_XCHG)