Source

iredmail / iRedMail / samples / conf / dovecot2.conf

Full commit

# Listen addresses.
#   - '*' means all available IPv4 addresses.
#   - '[::]' means all available IPv6 addresses.
# Use below setting to listen on all available addresses:
#listen = *, [::]
listen = *

#base_dir = PH_BASE_DIR

# Enabled mail protocols.
protocols = PH_PROTOCOLS

# User/group who owns the message files:
mail_uid = PH_MAIL_UID
mail_gid = PH_MAIL_GID

# Assign uid to virtual users.
first_valid_uid = PH_FIRST_VALID_UID
last_valid_uid = PH_LAST_VALID_UID

# Logging. Reference: http://wiki2.dovecot.org/Logging
log_path = PH_LOG_PATH
mail_debug = no
auth_verbose = no
auth_debug = no
auth_debug_passwords = no
# Possible values: no, plain, sha1.
auth_verbose_passwords = no

# SSL: Global settings.
# Refer to wiki site for per protocol, ip, server name SSL settings:
# http://wiki2.dovecot.org/SSL/DovecotConfiguration
ssl = PH_ENABLE_SSL
verbose_ssl = no
ssl_cert = PH_SSL_CERT
ssl_key = PH_SSL_KEY


disable_plaintext_auth = no

# Mail location and mailbox format.
mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/

# Authentication related settings.
# Append this domain name if client gives empty realm.
auth_default_realm = PH_AUTH_DEFAULT_REALM

# Authentication mechanisms.
auth_mechanisms = PH_AUTH_MECHANISMS

service auth {
    unix_listener /var/spool/postfix/dovecot-auth {
        user = PH_DOVECOT_AUTH_USER
        group = PH_DOVECOT_AUTH_GROUP
        mode = 0666
    }
    unix_listener auth-master {
        user = PH_AUTH_MASTER_USER
        group = PH_AUTH_MASTER_GROUP
        mode = 0666
    }
}

# Virtual mail accounts.
userdb {
    args = PH_USERDB_ARGS
    driver = PH_USERDB_DRIVER
}
passdb {
    args = PH_PASSDB_ARGS
    driver = PH_PASSDB_DRIVER
}

plugin {
    auth_socket_path = PH_AUTH_SOCKET_PATH

    quota = PH_QUOTA_TYPE
    quota_rule = *:storage=1G
    #quota_rule2 = *:messages=0
    #quota_rule3 = Trash:storage=1G
    #quota_rule4 = Junk:ignore

    # Quota warning.
    # If user suddenly receives a huge mail and the quota jumps from
    # 85% to 95%, only the 95% script is executed.
    quota_warning = storage=85%% quota-warning 85 %u
    quota_warning2 = storage=90%% quota-warning 90 %u
    quota_warning3 = storage=95%% quota-warning 95 %u

    # Plugin: autocreate. Create and subscribe to default IMAP folders.
    autocreate = INBOX
    autocreate2 = Sent
    autocreate3 = Trash
    autocreate4 = Drafts
    autocreate5 = Junk
    autosubscribe = INBOX
    autosubscribe2 = Sent
    autosubscribe3 = Trash
    autosubscribe4 = Drafts
    autosubscribe5 = Junk

    # Plugin: expire.
    expire = Trash 7 Trash/* 7 Junk 30
    expire_dict = proxy::expire

    # Pigeonhole managesieve service.
    # Reference: http://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration
    # Per-user sieve settings.
    sieve_dir = /%Lh/sieve
    sieve = /%Lh/sieve/PH_SIEVE_RULE_FILENAME

    # Global sieve settings.
    sieve_global_dir = PH_SIEVE_DIR
    sieve_global_path = PH_GLOBAL_SIEVE_FILE
    #sieve_before =
    #sieve_after =
}

service quota-warning {
    executable = script PH_QUOTA_WARNING_SCRIPT
    unix_listener quota-warning {
        user = PH_QUOTA_WARNING_USER
        group = PH_QUOTA_WARNING_GROUP
        mode = 0660
    }
}

service dict {
    unix_listener dict {
        mode = 0660
        user = PH_SERVICE_DICT_USER
        group = PH_SERVICE_DICT_GROUP
    }
}

dict {
    expire = db:/var/lib/dovecot/expire/expire.db
    quotadict = PH_DOVECOT_REALTIME_QUOTA_SQLTYPE:PH_DOVECOT_REALTIME_QUOTA_CONF
}

protocol lda {
    # Reference: http://wiki2.dovecot.org/LDA
    mail_plugins = quota sieve autocreate
    auth_socket_path = /var/run/dovecot/auth-master
    log_path = /var/log/sieve.log
    lda_mailbox_autocreate = yes
    postmaster_address = root
}
protocol imap {
    imap_client_workarounds = tb-extra-mailbox-sep
    mail_plugins = quota imap_quota autocreate
}
protocol pop3 {
    mail_plugins = quota
    pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
    pop3_uidl_format = %08Xu%08Xv
}