Beispiel #1
0
def backend_user_update(user, force=False):
    "Perform required backend updates"
    update = False
    if force or user.spam_checks is False:
        create_spam_checks.apply_async(exchange=FANOUT_XCHG)
        update = True
    if force or user.low_score > 0:
        create_spam_scores.apply_async(exchange=FANOUT_XCHG)
        update = True
    if force or user.high_score > 0:
        create_highspam_scores.apply_async(exchange=FANOUT_XCHG)
        update = True
    if update:
        update_serial.apply_async(exchange=FANOUT_XCHG)
Beispiel #2
0
def update_relay_backend(relay, force=False):
    "Update the required backend files"
    update = False
    create_relay_hosts.apply_async(exchange=FANOUT_XCHG)
    create_auth_data.apply_async(exchange=FANOUT_XCHG)
    create_ratelimit.apply_async(exchange=FANOUT_XCHG)
    if force or relay.high_score > 0:
        create_highspam_scores.apply_async(exchange=FANOUT_XCHG)
        update = True
    if force or relay.low_score > 0:
        create_spam_scores.apply_async(exchange=FANOUT_XCHG)
        update = True
    if force or relay.highspam_actions != 2:
        create_highspam_actions.apply_async(exchange=FANOUT_XCHG)
        update = True
    if force or relay.spam_actions != 2:
        create_spam_actions.apply_async(exchange=FANOUT_XCHG)
        update = True
    if update:
        update_serial.apply_async(exchange=FANOUT_XCHG)
Beispiel #3
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)