recreate
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
connect = host=PH_SQL_SERVER_ADDRESS port=PH_SQL_SERVER_PORT dbname=PH_REALTIME_QUOTA_DB_NAME user=PH_REALTIME_QUOTA_DB_USER password=PH_REALTIME_QUOTA_DB_PASSWORD
|
||||
|
||||
map {
|
||||
pattern = shared/last-login/imap/$user/$domain
|
||||
table = last_login
|
||||
value_field = imap
|
||||
value_type = uint
|
||||
|
||||
fields {
|
||||
username = $user
|
||||
domain = $domain
|
||||
}
|
||||
}
|
||||
|
||||
map {
|
||||
pattern = shared/last-login/pop3/$user/$domain
|
||||
table = last_login
|
||||
value_field = pop3
|
||||
value_type = uint
|
||||
|
||||
fields {
|
||||
username = $user
|
||||
domain = $domain
|
||||
}
|
||||
}
|
||||
|
||||
map {
|
||||
pattern = shared/last-login/lda/$user/$domain
|
||||
table = last_login
|
||||
value_field = lda
|
||||
value_type = uint
|
||||
|
||||
fields {
|
||||
username = $user
|
||||
domain = $domain
|
||||
}
|
||||
}
|
||||
|
||||
# Treat lmtp as lda.
|
||||
map {
|
||||
pattern = shared/last-login/lmtp/$user/$domain
|
||||
table = last_login
|
||||
value_field = lda
|
||||
value_type = uint
|
||||
|
||||
fields {
|
||||
username = $user
|
||||
domain = $domain
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
hosts = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
|
||||
ldap_version = PH_LDAP_BIND_VERSION
|
||||
auth_bind = yes
|
||||
dn = PH_LDAP_BINDDN
|
||||
dnpass = PH_LDAP_BINDPW
|
||||
base = PH_LDAP_BASEDN
|
||||
scope = subtree
|
||||
deref = never
|
||||
|
||||
# Below two are required by command 'doveadm mailbox ...'
|
||||
#iterate_attrs = mail=user
|
||||
#iterate_filter = (&(objectClass=mailUser)(accountStatus=active)(!(domainStatus=disabled))(enabledService=mail))
|
||||
|
||||
user_filter = (&(objectClass=mailUser)(accountStatus=active)(!(domainStatus=disabled))(enabledService=mail)(enabledService=%Ls%Lc)(|(mail=%u)(&(enabledService=shadowaddress)(shadowAddress=%u))))
|
||||
user_attrs = mail=master_user,mail=user,=home=%L{ldap:homeDirectory},=mail=%{ldap:mailboxFormat:maildir}:~/%{ldap:mailboxFolder:Maildir}/,mailQuota=quota_rule=*:bytes=%$
|
||||
|
||||
# Used for dn lookup
|
||||
pass_filter = (&(objectClass=mailUser)(accountStatus=active)(!(domainStatus=disabled))(enabledService=mail)(enabledService=%Ls%Lc)(|(mail=%u)(&(enabledService=shadowaddress)(shadowAddress=%u))))
|
||||
pass_attrs = mail=user,userPassword=password,allowNets=allow_nets
|
||||
default_pass_scheme = CRYPT
|
||||
@@ -0,0 +1,22 @@
|
||||
connect = host=PH_SQL_SERVER_ADDRESS port=PH_SQL_SERVER_PORT dbname=PH_DOVECOT_SHARE_FOLDER_DB_NAME user=PH_DOVECOT_SHARE_FOLDER_DB_USER password=PH_DOVECOT_SHARE_FOLDER_DB_PASSWORD
|
||||
map {
|
||||
pattern = shared/shared-boxes/user/$to/$from
|
||||
table = PH_DOVECOT_SHARE_FOLDER_DB_TABLE
|
||||
value_field = dummy
|
||||
|
||||
fields {
|
||||
from_user = $from
|
||||
to_user = $to
|
||||
}
|
||||
}
|
||||
|
||||
# To share mailbox to anyone, please uncomment 'acl_anyone = allow' in
|
||||
# dovecot.conf
|
||||
map {
|
||||
pattern = shared/shared-boxes/anyone/$from
|
||||
table = PH_DOVECOT_SHARE_FOLDER_ANYONE_DB_TABLE
|
||||
value_field = dummy
|
||||
fields {
|
||||
from_user = $from
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
driver = PH_SQL_DRIVER
|
||||
default_pass_scheme = CRYPT
|
||||
connect = host=PH_SQL_SERVER_ADDRESS port=PH_SQL_SERVER_PORT dbname=PH_VMAIL_DB_NAME user=PH_VMAIL_DB_BIND_USER password=PH_VMAIL_DB_BIND_PASSWD
|
||||
|
||||
# Required by doveadm tools which require to list all mail users.
|
||||
iterate_query = SELECT username AS user FROM mailbox
|
||||
|
||||
password_query = SELECT mailbox.password, mailbox.allow_nets \
|
||||
FROM mailbox,domain \
|
||||
WHERE mailbox.username='%u' \
|
||||
AND mailbox.enable%Ls%Lc=1 \
|
||||
AND mailbox.active=1 \
|
||||
AND mailbox.domain=domain.domain \
|
||||
AND domain.backupmx=0 \
|
||||
AND domain.active=1
|
||||
|
||||
user_query = SELECT \
|
||||
LOWER('%u') AS master_user, \
|
||||
LOWER(CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir)) AS home, \
|
||||
CONCAT(mailbox.mailboxformat, ':~/', mailbox.mailboxfolder) AS mail, \
|
||||
CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
|
||||
FROM mailbox,domain \
|
||||
WHERE mailbox.username='%u' \
|
||||
AND mailbox.enable%Ls%Lc=1 \
|
||||
AND mailbox.active=1 \
|
||||
AND mailbox.domain=domain.domain \
|
||||
AND domain.backupmx=0 \
|
||||
AND domain.active=1
|
||||
@@ -0,0 +1,13 @@
|
||||
connect = host=PH_SQL_SERVER_ADDRESS port=PH_SQL_SERVER_PORT dbname=PH_REALTIME_QUOTA_DB_NAME user=PH_REALTIME_QUOTA_DB_USER password=PH_REALTIME_QUOTA_DB_PASSWORD
|
||||
map {
|
||||
pattern = priv/quota/storage
|
||||
table = PH_DOVECOT_REALTIME_QUOTA_TABLE
|
||||
username_field = username
|
||||
value_field = bytes
|
||||
}
|
||||
map {
|
||||
pattern = priv/quota/messages
|
||||
table = PH_DOVECOT_REALTIME_QUOTA_TABLE
|
||||
username_field = username
|
||||
value_field = messages
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
require ["fileinto"];
|
||||
|
||||
# rule:[Move Spam to Junk Folder]
|
||||
if header :is "X-Spam-Flag" "YES"
|
||||
{
|
||||
fileinto "Junk";
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
# Purpose: Mail to user when his/her quota exceeds specified percentage.
|
||||
# Reference: http://wiki2.dovecot.org/Quota/Configuration#Quota_warnings
|
||||
|
||||
PERCENT=${1}
|
||||
USER=${2}
|
||||
|
||||
# Use "plugin/quota=maildir:User quota:noenforcing" for maildir quota.
|
||||
cat << EOF | PH_DOVECOT_DELIVER_BIN -d ${USER} -o "plugin/quota=dict:User quota::noenforcing:proxy::quotadict"
|
||||
From: no-reply@$(hostname -f)
|
||||
Subject: Warning: Your mailbox is now ${PERCENT}% full.
|
||||
|
||||
Your mailbox is now ${PERCENT}% full, please clean up some mails for further incoming mails.
|
||||
EOF
|
||||
|
||||
# Send a copy to postmaster@ if mailbox is greater than or equal to 95% full.
|
||||
if [ ${PERCENT} -ge 95 ]; then
|
||||
DOMAIN="$(echo ${USER} | awk -F'@' '{print $2}')"
|
||||
cat << EOF | PH_DOVECOT_DELIVER_BIN -d postmaster@${DOMAIN} -o "plugin/quota=dict:User quota::noenforcing:proxy::quotadict"
|
||||
From: no-reply@$(hostname -f)
|
||||
Subject: Mailbox Quota Warning: ${PERCENT}% full, ${USER}
|
||||
|
||||
Mailbox (${USER}) is now ${PERCENT}% full, please clean up some mails for
|
||||
further incoming mails.
|
||||
EOF
|
||||
fi
|
||||
@@ -0,0 +1,506 @@
|
||||
# More details about Dovecot settings:
|
||||
# - http://wiki2.dovecot.org/
|
||||
# - http://wiki2.dovecot.org/Variables
|
||||
|
||||
# Listen addresses.
|
||||
# - '*' means all available IPv4 addresses.
|
||||
# - '[::]' means all available IPv6 addresses.
|
||||
# Listen on all available addresses by default
|
||||
listen = * [::]
|
||||
|
||||
#base_dir = PH_BASE_DIR
|
||||
mail_plugins = quota mailbox_alias acl mail_log notify stats
|
||||
|
||||
# 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
|
||||
#
|
||||
# Use syslog
|
||||
syslog_facility = PH_IREDMAIL_SYSLOG_FACILITY
|
||||
# Log file path if we use internal log system
|
||||
#log_path = PH_LOG_PATH
|
||||
|
||||
# Debug
|
||||
#mail_debug = yes
|
||||
#auth_verbose = yes
|
||||
#auth_debug = yes
|
||||
#auth_debug_passwords = yes
|
||||
# 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://wiki.dovecot.org/SSL/DovecotConfiguration
|
||||
ssl_protocols = !SSLv2 !SSLv3 !TLSv1 !TLSv1.1
|
||||
ssl = required
|
||||
verbose_ssl = no
|
||||
#ssl_ca = </path/to/ca
|
||||
ssl_cert = <PH_SSL_CERT
|
||||
ssl_key = <PH_SSL_KEY
|
||||
|
||||
# Fix 'The Logjam Attack'
|
||||
ssl_cipher_list = PH_SSL_CIPHERS
|
||||
ssl_prefer_server_ciphers = yes
|
||||
|
||||
# With disable_plaintext_auth=yes AND ssl=required, STARTTLS is mandatory.
|
||||
# Set disable_plaintext_auth=no AND ssl=yes to allow plain password transmitted
|
||||
# insecurely.
|
||||
disable_plaintext_auth = yes
|
||||
|
||||
# Allow plain text password per IP address/net
|
||||
#remote 192.168.0.0/24 {
|
||||
# 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 = PLAIN LOGIN
|
||||
|
||||
# Limits the number of users that can be logging in at the same time.
|
||||
# Default is 100. This can be overridden by `process_limit =` in
|
||||
# `service [protocol]` block.
|
||||
# e.g.
|
||||
# protocol imap-login {
|
||||
# ...
|
||||
# process_limit = 500
|
||||
# }
|
||||
#default_process_limit = 100
|
||||
|
||||
# Login log elements.
|
||||
# Add '%k' for detailed SSL protocol and cipher information.
|
||||
# e.g. "TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)"
|
||||
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c %k session=<%{session}>
|
||||
|
||||
# Mail delivery log format
|
||||
deliver_log_format = from=%{from}, envelope_sender=%{from_envelope}, subject=%{subject}, msgid=%m, size=%{size}, delivery_time=%{delivery_time}ms, %$
|
||||
|
||||
service auth {
|
||||
unix_listener PH_POSTFIX_CHROOT_DIR/private/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
|
||||
}
|
||||
unix_listener auth-userdb {
|
||||
user = PH_AUTH_MASTER_USER
|
||||
group = PH_AUTH_MASTER_GROUP
|
||||
mode = 0660
|
||||
}
|
||||
}
|
||||
|
||||
# LMTP server (Local Mail Transfer Protocol).
|
||||
# Reference: http://wiki2.dovecot.org/LMTP
|
||||
service lmtp {
|
||||
user = PH_AUTH_MASTER_USER
|
||||
|
||||
# For higher volume sites, it may be desirable to increase the number of
|
||||
# active listener processes. A range of 5 to 20 is probably good for most
|
||||
# sites.
|
||||
process_min_avail = 5
|
||||
|
||||
# Logging.
|
||||
# Require 'log_path =' in 'protocol lmtp {}' block.
|
||||
executable = lmtp -L
|
||||
|
||||
# Listening on socket file and TCP
|
||||
unix_listener PH_POSTFIX_CHROOT_DIR/private/dovecot-lmtp {
|
||||
user = PH_DOVECOT_AUTH_USER
|
||||
group = PH_DOVECOT_AUTH_GROUP
|
||||
mode = 0600
|
||||
}
|
||||
|
||||
inet_listener lmtp {
|
||||
# Listen on localhost (ipv4)
|
||||
address = PH_LMTP_BIND_ADDRESS
|
||||
port = PH_LMTP_BIND_PORT
|
||||
}
|
||||
}
|
||||
|
||||
# Virtual mail accounts.
|
||||
userdb {
|
||||
args = PH_USERDB_ARGS
|
||||
driver = PH_USERDB_DRIVER
|
||||
}
|
||||
passdb {
|
||||
args = PH_PASSDB_ARGS
|
||||
driver = PH_PASSDB_DRIVER
|
||||
}
|
||||
|
||||
# Master user.
|
||||
# Master users are able to log in as other users. It's also possible to
|
||||
# directly log in as any user using a master password, although this isn't
|
||||
# recommended.
|
||||
# Reference: http://wiki2.dovecot.org/Authentication/MasterUsers
|
||||
auth_master_user_separator = *
|
||||
passdb {
|
||||
driver = passwd-file
|
||||
args = PH_DOVECOT_MASTER_USER_PASSWORD_FILE
|
||||
master = yes
|
||||
}
|
||||
|
||||
plugin {
|
||||
# Quota configuration.
|
||||
# Reference: http://wiki2.dovecot.org/Quota/Configuration
|
||||
quota = PH_QUOTA_TYPE
|
||||
|
||||
# Set default quota rule if no quota returned from SQL/LDAP query.
|
||||
#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.
|
||||
#
|
||||
# Only the command for the first exceeded limit is executed, so configure
|
||||
# the highest limit first.
|
||||
quota_warning = storage=100%% quota-warning 100 %u
|
||||
quota_warning2 = storage=95%% quota-warning 95 %u
|
||||
quota_warning3 = storage=90%% quota-warning 90 %u
|
||||
quota_warning4 = storage=85%% quota-warning 85 %u
|
||||
|
||||
# allow user to become max 10% (or 50 MB) over quota
|
||||
quota_grace = 10%%
|
||||
#quota_grace = 50 M
|
||||
|
||||
# Custom Quota Exceeded Message.
|
||||
# You can specify the message directly or read the message from a file.
|
||||
#quota_exceeded_message = Quota exceeded, please try again later.
|
||||
#quota_exceeded_message = </path/to/quota_exceeded_message.txt
|
||||
|
||||
# Used by quota-status service.
|
||||
quota_status_success = DUNNO
|
||||
quota_status_nouser = DUNNO
|
||||
quota_status_overquota = "552 5.2.2 Mailbox is full"
|
||||
|
||||
# Plugin: expire.
|
||||
#expire = Trash 7 Trash/* 7 Junk 30
|
||||
#expire_dict = proxy::expire
|
||||
|
||||
# ACL and share folder
|
||||
acl = vfile
|
||||
acl_shared_dict = proxy::acl
|
||||
|
||||
# By default Dovecot doesn't allow using the IMAP "anyone" or
|
||||
# "authenticated" identifier, because it would be an easy way to spam
|
||||
# other users in the system. If you wish to allow it,
|
||||
#acl_anyone = allow
|
||||
|
||||
# Pigeonhole managesieve service.
|
||||
# Reference: http://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration
|
||||
# Per-user sieve settings.
|
||||
sieve_dir = ~/sieve
|
||||
sieve = ~/sieve/PH_SIEVE_RULE_FILENAME
|
||||
|
||||
# Global sieve settings.
|
||||
sieve_global_dir = PH_SIEVE_DIR
|
||||
# Note: if user has personal sieve script, global sieve rules defined in
|
||||
# sieve_default will be ignored. Please use sieve_before or
|
||||
# sieve_after instead.
|
||||
#sieve_default =
|
||||
|
||||
sieve_before = PH_GLOBAL_SIEVE_FILE
|
||||
#sieve_after =
|
||||
|
||||
# The maximum number of redirect actions that can be performed during a
|
||||
# single script execution.
|
||||
# The meaning of 0 differs based on your version. For pigeonhole-0.3.0 and
|
||||
# beyond this means that redirect is prohibited. For older versions,
|
||||
# however, this means that the number of redirects is unlimited.
|
||||
sieve_max_redirects = 30
|
||||
|
||||
# Use recipient as vacation message sender instead of null sender (<>).
|
||||
sieve_vacation_send_from_recipient = yes
|
||||
|
||||
# Reference: http://wiki2.dovecot.org/Plugins/MailboxAlias
|
||||
mailbox_alias_old = Sent
|
||||
mailbox_alias_new = Sent Messages
|
||||
mailbox_alias_old2 = Sent
|
||||
mailbox_alias_new2 = Sent Items
|
||||
|
||||
# Events to log. `autoexpunge` is included in `expunge`
|
||||
# Defined in https://github.com/dovecot/core/blob/master/src/plugins/mail-log/mail-log-plugin.c
|
||||
mail_log_events = delete undelete expunge copy mailbox_create mailbox_delete mailbox_rename
|
||||
mail_log_fields = uid box msgid size from subject flags
|
||||
|
||||
# stats
|
||||
#
|
||||
# how often to session statistics (must be set)
|
||||
stats_refresh = 30 secs
|
||||
# track per-IMAP command statistics (optional)
|
||||
stats_track_cmds = yes
|
||||
|
||||
# Track user last login
|
||||
last_login_dict = proxy::lastlogin
|
||||
last_login_key = last-login/%s/%u/%d
|
||||
}
|
||||
|
||||
service stats {
|
||||
fifo_listener stats-mail {
|
||||
user = PH_DOVECOT_SERVICE_STATS_USER
|
||||
group = PH_DOVECOT_SERVICE_STATS_GROUP
|
||||
mode = 0644
|
||||
}
|
||||
|
||||
unix_listener stats-writer {
|
||||
user = PH_DOVECOT_SERVICE_STATS_USER
|
||||
group = PH_DOVECOT_SERVICE_STATS_GROUP
|
||||
mode = 0660
|
||||
}
|
||||
|
||||
inet_listener {
|
||||
address = 127.0.0.1
|
||||
port = PH_DOVECOT_SERVICE_STATS_PORT
|
||||
}
|
||||
}
|
||||
|
||||
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 quota-status {
|
||||
# '-p <protocol>'. Currently only 'postfix' protocol is supported.
|
||||
executable = quota-status -p postfix
|
||||
client_limit = 1
|
||||
inet_listener {
|
||||
address = PH_DOVECOT_SERVICE_QUOTA_STATUS_BIND_ADDRESS
|
||||
port = PH_DOVECOT_SERVICE_QUOTA_STATUS_PORT
|
||||
}
|
||||
}
|
||||
|
||||
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_SQL_DBN:PH_DOVECOT_REALTIME_QUOTA_CONF
|
||||
acl = PH_DOVECOT_SQL_DBN:PH_DOVECOT_SHARE_FOLDER_CONF
|
||||
lastlogin = PH_DOVECOT_SQL_DBN:PH_DOVECOT_LAST_LOGIN_CONF
|
||||
}
|
||||
|
||||
protocol lda {
|
||||
# Reference: http://wiki2.dovecot.org/LDA
|
||||
mail_plugins = $mail_plugins sieve
|
||||
lda_mailbox_autocreate = yes
|
||||
lda_mailbox_autosubscribe = yes
|
||||
|
||||
# Log file path if we use internal log system
|
||||
#log_path = PH_DOVECOT_SIEVE_LOG_FILE
|
||||
}
|
||||
|
||||
protocol lmtp {
|
||||
# Log file path if we use internal log system
|
||||
#log_path = PH_DOVECOT_LMTP_LOG_FILE
|
||||
|
||||
# Plugins
|
||||
mail_plugins = $mail_plugins sieve
|
||||
|
||||
# Address extension delivery
|
||||
lmtp_save_to_detail_mailbox = yes
|
||||
recipient_delimiter = +
|
||||
}
|
||||
|
||||
protocol imap {
|
||||
mail_plugins = $mail_plugins imap_quota imap_acl imap_stats last_login
|
||||
imap_client_workarounds = tb-extra-mailbox-sep
|
||||
|
||||
# Maximum number of IMAP connections allowed for a user from each IP address.
|
||||
# NOTE: The username is compared case-sensitively.
|
||||
# Default is 10.
|
||||
# Increase it to avoid issue like below:
|
||||
# "Maximum number of concurrent IMAP connections exceeded"
|
||||
mail_max_userip_connections = 30
|
||||
}
|
||||
|
||||
protocol pop3 {
|
||||
mail_plugins = $mail_plugins last_login
|
||||
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
|
||||
pop3_uidl_format = %08Xu%08Xv
|
||||
|
||||
# Maximum number of IMAP connections allowed for a user from each IP address.
|
||||
# NOTE: The username is compared case-sensitively.
|
||||
# Default is 10.
|
||||
mail_max_userip_connections = 30
|
||||
|
||||
# POP3 logout format string:
|
||||
# %i - total number of bytes read from client
|
||||
# %o - total number of bytes sent to client
|
||||
# %t - number of TOP commands
|
||||
# %p - number of bytes sent to client as a result of TOP command
|
||||
# %r - number of RETR commands
|
||||
# %b - number of bytes sent to client as a result of RETR command
|
||||
# %d - number of deleted messages
|
||||
# %m - number of messages (before deletion)
|
||||
# %s - mailbox size in bytes (before deletion)
|
||||
# Default format doesn't have 'in=%i, out=%o'.
|
||||
#pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s, in=%i, out=%o
|
||||
}
|
||||
|
||||
# Login processes. Refer to Dovecot wiki for more details:
|
||||
# http://wiki2.dovecot.org/LoginProcess
|
||||
service imap-login {
|
||||
#inet_listener imap {
|
||||
# port = 143
|
||||
#}
|
||||
#inet_listener imaps {
|
||||
# port = 993
|
||||
# ssl = yes
|
||||
#}
|
||||
|
||||
service_count = 1
|
||||
|
||||
# To avoid startup latency for new client connections, set process_min_avail
|
||||
# to higher than zero. That many idling processes are always kept around
|
||||
# waiting for new connections.
|
||||
#process_min_avail = 0
|
||||
|
||||
# number of simultaneous IMAP connections
|
||||
process_limit = 500
|
||||
|
||||
# vsz_limit should be fine at its default 64MB value
|
||||
#vsz_limit = 64M
|
||||
}
|
||||
|
||||
service pop3-login {
|
||||
#inet_listener pop3 {
|
||||
# port = 110
|
||||
#}
|
||||
#inet_listener pop3s {
|
||||
# port = 995
|
||||
# ssl = yes
|
||||
#}
|
||||
|
||||
service_count = 1
|
||||
|
||||
# number of simultaneous POP3 connections
|
||||
#process_limit = 500
|
||||
}
|
||||
|
||||
service managesieve-login {
|
||||
inet_listener sieve {
|
||||
# Listen on localhost (ipv4)
|
||||
address = PH_MANAGESIEVE_BIND_HOST
|
||||
port = PH_MANAGESIEVE_BIND_PORT
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
type = private
|
||||
separator = /
|
||||
prefix =
|
||||
inbox = yes
|
||||
|
||||
# Refer to document for more details about alias mailbox:
|
||||
# http://wiki2.dovecot.org/MailboxSettings
|
||||
#
|
||||
# Sent
|
||||
mailbox Sent {
|
||||
auto = subscribe
|
||||
special_use = \Sent
|
||||
}
|
||||
mailbox "Sent Messages" {
|
||||
auto = no
|
||||
special_use = \Sent
|
||||
}
|
||||
mailbox "Sent Items" {
|
||||
auto = no
|
||||
special_use = \Sent
|
||||
}
|
||||
|
||||
mailbox Drafts {
|
||||
auto = subscribe
|
||||
special_use = \Drafts
|
||||
}
|
||||
|
||||
# Trash
|
||||
mailbox Trash {
|
||||
auto = subscribe
|
||||
special_use = \Trash
|
||||
}
|
||||
|
||||
mailbox "Deleted Messages" {
|
||||
auto = no
|
||||
special_use = \Trash
|
||||
}
|
||||
|
||||
# Junk
|
||||
mailbox Junk {
|
||||
auto = subscribe
|
||||
special_use = \Junk
|
||||
}
|
||||
mailbox Spam {
|
||||
auto = no
|
||||
special_use = \Junk
|
||||
}
|
||||
mailbox "Junk E-mail" {
|
||||
auto = no
|
||||
special_use = \Junk
|
||||
}
|
||||
|
||||
# Archive
|
||||
mailbox Archive {
|
||||
auto = no
|
||||
special_use = \Archive
|
||||
}
|
||||
mailbox Archives {
|
||||
auto = no
|
||||
special_use = \Archive
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
type = shared
|
||||
separator = /
|
||||
prefix = Shared/%%u/
|
||||
location = maildir:%%Lh/Maildir/:INDEX=%%Lh/Maildir/Shared/%%Ld/%%Ln
|
||||
|
||||
# this namespace should handle its own subscriptions or not.
|
||||
subscriptions = yes
|
||||
list = children
|
||||
}
|
||||
|
||||
# Public mailboxes.
|
||||
# Refer to Dovecot wiki page for more details:
|
||||
# http://wiki2.dovecot.org/SharedMailboxes/Public
|
||||
#namespace {
|
||||
# type = public
|
||||
# separator = /
|
||||
# prefix = Public/
|
||||
# location = maildir:PH_PUBLIC_MAILBOX_DIR:CONTROL=%Lh/Maildir/public:INDEXPVT=%Lh/Maildir/public
|
||||
#
|
||||
# # Allow users to subscribe to the public folders.
|
||||
# subscriptions = yes
|
||||
#}
|
||||
|
||||
!include_try PH_DOVECOT_CONF_INCLUDE_DIR/*.conf
|
||||
@@ -0,0 +1,496 @@
|
||||
# More details about Dovecot settings:
|
||||
# - http://wiki2.dovecot.org/
|
||||
# - http://wiki2.dovecot.org/Variables
|
||||
|
||||
# Listen addresses.
|
||||
# - '*' means all available IPv4 addresses.
|
||||
# - '[::]' means all available IPv6 addresses.
|
||||
# Listen on all available addresses by default
|
||||
listen = * [::]
|
||||
|
||||
#base_dir = PH_BASE_DIR
|
||||
mail_plugins = quota mailbox_alias acl mail_log notify
|
||||
|
||||
# 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
|
||||
#
|
||||
# Use syslog
|
||||
syslog_facility = PH_IREDMAIL_SYSLOG_FACILITY
|
||||
# Log file path if we use internal log system
|
||||
#log_path = PH_LOG_PATH
|
||||
|
||||
# Debug
|
||||
#mail_debug = yes
|
||||
#auth_verbose = yes
|
||||
#auth_debug = yes
|
||||
#auth_debug_passwords = yes
|
||||
# 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_min_protocol = TLSv1.2
|
||||
ssl = required
|
||||
verbose_ssl = no
|
||||
#ssl_ca = </path/to/ca
|
||||
ssl_cert = <PH_SSL_CERT
|
||||
ssl_key = <PH_SSL_KEY
|
||||
ssl_dh = <PH_SSL_DH1024_PARAM_FILE
|
||||
|
||||
# Fix 'The Logjam Attack'
|
||||
ssl_cipher_list = PH_SSL_CIPHERS
|
||||
ssl_prefer_server_ciphers = yes
|
||||
|
||||
# With disable_plaintext_auth=yes AND ssl=required, STARTTLS is mandatory.
|
||||
# Set disable_plaintext_auth=no AND ssl=yes to allow plain password transmitted
|
||||
# insecurely.
|
||||
disable_plaintext_auth = yes
|
||||
|
||||
# Allow plain text password per IP address/net
|
||||
#remote 192.168.0.0/24 {
|
||||
# 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 = PLAIN LOGIN
|
||||
|
||||
# Limits the number of users that can be logging in at the same time.
|
||||
# Default is 100. This can be overridden by `process_limit =` in
|
||||
# `service [protocol]` block.
|
||||
# e.g.
|
||||
# protocol imap-login {
|
||||
# ...
|
||||
# process_limit = 500
|
||||
# }
|
||||
#default_process_limit = 100
|
||||
|
||||
# Login log elements.
|
||||
# Add '%k' for detailed SSL protocol and cipher information.
|
||||
# e.g. "TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)"
|
||||
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c %k session=<%{session}>
|
||||
|
||||
# Mail delivery log format
|
||||
deliver_log_format = from=%{from}, envelope_sender=%{from_envelope}, subject=%{subject}, msgid=%m, size=%{size}, delivery_time=%{delivery_time}ms, %$
|
||||
|
||||
service auth {
|
||||
unix_listener PH_POSTFIX_CHROOT_DIR/private/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
|
||||
}
|
||||
unix_listener auth-userdb {
|
||||
user = PH_AUTH_MASTER_USER
|
||||
group = PH_AUTH_MASTER_GROUP
|
||||
mode = 0660
|
||||
}
|
||||
}
|
||||
|
||||
# LMTP server (Local Mail Transfer Protocol).
|
||||
# Reference: http://wiki2.dovecot.org/LMTP
|
||||
service lmtp {
|
||||
user = PH_AUTH_MASTER_USER
|
||||
|
||||
# For higher volume sites, it may be desirable to increase the number of
|
||||
# active listener processes. A range of 5 to 20 is probably good for most
|
||||
# sites.
|
||||
process_min_avail = 5
|
||||
|
||||
# Logging.
|
||||
# Require 'log_path =' in 'protocol lmtp {}' block.
|
||||
executable = lmtp -L
|
||||
|
||||
# Listening on socket file and TCP
|
||||
unix_listener PH_POSTFIX_CHROOT_DIR/private/dovecot-lmtp {
|
||||
user = PH_DOVECOT_AUTH_USER
|
||||
group = PH_DOVECOT_AUTH_GROUP
|
||||
mode = 0600
|
||||
}
|
||||
|
||||
inet_listener lmtp {
|
||||
# Listen on localhost (ipv4)
|
||||
address = PH_LMTP_BIND_ADDRESS
|
||||
port = PH_LMTP_BIND_PORT
|
||||
}
|
||||
}
|
||||
|
||||
# Virtual mail accounts.
|
||||
userdb {
|
||||
args = PH_USERDB_ARGS
|
||||
driver = PH_USERDB_DRIVER
|
||||
}
|
||||
passdb {
|
||||
args = PH_PASSDB_ARGS
|
||||
driver = PH_PASSDB_DRIVER
|
||||
}
|
||||
|
||||
# Master user.
|
||||
# Master users are able to log in as other users. It's also possible to
|
||||
# directly log in as any user using a master password, although this isn't
|
||||
# recommended.
|
||||
# Reference: http://wiki2.dovecot.org/Authentication/MasterUsers
|
||||
auth_master_user_separator = *
|
||||
passdb {
|
||||
driver = passwd-file
|
||||
args = PH_DOVECOT_MASTER_USER_PASSWORD_FILE
|
||||
master = yes
|
||||
}
|
||||
|
||||
plugin {
|
||||
# Quota configuration.
|
||||
# Reference: http://wiki2.dovecot.org/Quota/Configuration
|
||||
quota = PH_QUOTA_TYPE
|
||||
|
||||
# Set default quota rule if no quota returned from SQL/LDAP query.
|
||||
#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.
|
||||
#
|
||||
# Only the command for the first exceeded limit is executed, so configure
|
||||
# the highest limit first.
|
||||
quota_warning = storage=100%% quota-warning 100 %u
|
||||
quota_warning2 = storage=95%% quota-warning 95 %u
|
||||
quota_warning3 = storage=90%% quota-warning 90 %u
|
||||
quota_warning4 = storage=85%% quota-warning 85 %u
|
||||
|
||||
# allow user to become max 10% (or 50 MB) over quota
|
||||
quota_grace = 10%%
|
||||
#quota_grace = 50 M
|
||||
|
||||
# Custom Quota Exceeded Message.
|
||||
# You can specify the message directly or read the message from a file.
|
||||
#quota_exceeded_message = Quota exceeded, please try again later.
|
||||
#quota_exceeded_message = </path/to/quota_exceeded_message.txt
|
||||
|
||||
# Used by quota-status service.
|
||||
quota_status_success = DUNNO
|
||||
quota_status_nouser = DUNNO
|
||||
quota_status_overquota = "552 5.2.2 Mailbox is full"
|
||||
|
||||
# Plugin: expire.
|
||||
#expire = Trash 7 Trash/* 7 Junk 30
|
||||
#expire_dict = proxy::expire
|
||||
|
||||
# ACL and share folder
|
||||
acl = vfile
|
||||
acl_shared_dict = proxy::acl
|
||||
|
||||
# By default Dovecot doesn't allow using the IMAP "anyone" or
|
||||
# "authenticated" identifier, because it would be an easy way to spam
|
||||
# other users in the system. If you wish to allow it,
|
||||
#acl_anyone = allow
|
||||
|
||||
# Pigeonhole managesieve service.
|
||||
# Reference: http://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration
|
||||
# Per-user sieve settings.
|
||||
sieve_dir = ~/sieve
|
||||
sieve = ~/sieve/PH_SIEVE_RULE_FILENAME
|
||||
|
||||
# Global sieve settings.
|
||||
sieve_global_dir = PH_SIEVE_DIR
|
||||
# Note: if user has personal sieve script, global sieve rules defined in
|
||||
# sieve_default will be ignored. Please use sieve_before or
|
||||
# sieve_after instead.
|
||||
#sieve_default =
|
||||
|
||||
sieve_before = PH_GLOBAL_SIEVE_FILE
|
||||
#sieve_after =
|
||||
|
||||
# The maximum number of redirect actions that can be performed during a
|
||||
# single script execution.
|
||||
# The meaning of 0 differs based on your version. For pigeonhole-0.3.0 and
|
||||
# beyond this means that redirect is prohibited. For older versions,
|
||||
# however, this means that the number of redirects is unlimited.
|
||||
sieve_max_redirects = 30
|
||||
|
||||
# Use recipient as vacation message sender instead of null sender (<>).
|
||||
sieve_vacation_send_from_recipient = yes
|
||||
|
||||
# Reference: http://wiki2.dovecot.org/Plugins/MailboxAlias
|
||||
mailbox_alias_old = Sent
|
||||
mailbox_alias_new = Sent Messages
|
||||
mailbox_alias_old2 = Sent
|
||||
mailbox_alias_new2 = Sent Items
|
||||
|
||||
# Events to log. `autoexpunge` is included in `expunge`
|
||||
# Defined in https://github.com/dovecot/core/blob/master/src/plugins/mail-log/mail-log-plugin.c
|
||||
mail_log_events = delete undelete expunge copy mailbox_create mailbox_delete mailbox_rename
|
||||
mail_log_fields = uid box msgid size from subject flags
|
||||
|
||||
# Track user last login
|
||||
last_login_dict = proxy::lastlogin
|
||||
last_login_key = last-login/%s/%u/%d
|
||||
}
|
||||
|
||||
service stats {
|
||||
fifo_listener stats-mail {
|
||||
user = PH_DOVECOT_SERVICE_STATS_USER
|
||||
mode = 0644
|
||||
}
|
||||
|
||||
unix_listener stats-writer {
|
||||
user = PH_DOVECOT_SERVICE_STATS_USER
|
||||
group = PH_DOVECOT_SERVICE_STATS_GROUP
|
||||
mode = 0660
|
||||
}
|
||||
|
||||
inet_listener {
|
||||
address = 127.0.0.1
|
||||
port = PH_DOVECOT_SERVICE_STATS_PORT
|
||||
}
|
||||
}
|
||||
|
||||
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 quota-status {
|
||||
# '-p <protocol>'. Currently only 'postfix' protocol is supported.
|
||||
executable = quota-status -p postfix
|
||||
client_limit = 1
|
||||
inet_listener {
|
||||
address = PH_DOVECOT_SERVICE_QUOTA_STATUS_BIND_ADDRESS
|
||||
port = PH_DOVECOT_SERVICE_QUOTA_STATUS_PORT
|
||||
}
|
||||
}
|
||||
|
||||
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_SQL_DBN:PH_DOVECOT_REALTIME_QUOTA_CONF
|
||||
acl = PH_DOVECOT_SQL_DBN:PH_DOVECOT_SHARE_FOLDER_CONF
|
||||
lastlogin = PH_DOVECOT_SQL_DBN:PH_DOVECOT_LAST_LOGIN_CONF
|
||||
}
|
||||
|
||||
protocol lda {
|
||||
mail_plugins = $mail_plugins sieve
|
||||
lda_mailbox_autocreate = yes
|
||||
lda_mailbox_autosubscribe = yes
|
||||
}
|
||||
|
||||
protocol lmtp {
|
||||
# Plugins
|
||||
mail_plugins = $mail_plugins sieve
|
||||
|
||||
# Address extension delivery
|
||||
lmtp_save_to_detail_mailbox = yes
|
||||
recipient_delimiter = +
|
||||
}
|
||||
|
||||
protocol imap {
|
||||
mail_plugins = $mail_plugins imap_quota imap_acl last_login
|
||||
imap_client_workarounds = tb-extra-mailbox-sep
|
||||
|
||||
# Maximum number of IMAP connections allowed for a user from each IP address.
|
||||
# NOTE: The username is compared case-sensitively.
|
||||
# Default is 10.
|
||||
# Increase it to avoid issue like below:
|
||||
# "Maximum number of concurrent IMAP connections exceeded"
|
||||
mail_max_userip_connections = 30
|
||||
}
|
||||
|
||||
protocol pop3 {
|
||||
mail_plugins = $mail_plugins last_login
|
||||
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
|
||||
pop3_uidl_format = %08Xu%08Xv
|
||||
|
||||
# Maximum number of IMAP connections allowed for a user from each IP address.
|
||||
# NOTE: The username is compared case-sensitively.
|
||||
# Default is 10.
|
||||
mail_max_userip_connections = 30
|
||||
|
||||
# POP3 logout format string:
|
||||
# %i - total number of bytes read from client
|
||||
# %o - total number of bytes sent to client
|
||||
# %t - number of TOP commands
|
||||
# %p - number of bytes sent to client as a result of TOP command
|
||||
# %r - number of RETR commands
|
||||
# %b - number of bytes sent to client as a result of RETR command
|
||||
# %d - number of deleted messages
|
||||
# %m - number of messages (before deletion)
|
||||
# %s - mailbox size in bytes (before deletion)
|
||||
# Default format doesn't have 'in=%i, out=%o'.
|
||||
#pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s, in=%i, out=%o
|
||||
}
|
||||
|
||||
# Login processes. Refer to Dovecot wiki for more details:
|
||||
# http://wiki2.dovecot.org/LoginProcess
|
||||
service imap-login {
|
||||
#inet_listener imap {
|
||||
# port = 143
|
||||
#}
|
||||
#inet_listener imaps {
|
||||
# port = 993
|
||||
# ssl = yes
|
||||
#}
|
||||
|
||||
service_count = 1
|
||||
|
||||
# To avoid startup latency for new client connections, set process_min_avail
|
||||
# to higher than zero. That many idling processes are always kept around
|
||||
# waiting for new connections.
|
||||
#process_min_avail = 0
|
||||
|
||||
# number of simultaneous IMAP connections
|
||||
process_limit = 500
|
||||
|
||||
# vsz_limit should be fine at its default 64MB value
|
||||
#vsz_limit = 64M
|
||||
}
|
||||
|
||||
service pop3-login {
|
||||
#inet_listener pop3 {
|
||||
# port = 110
|
||||
#}
|
||||
#inet_listener pop3s {
|
||||
# port = 995
|
||||
# ssl = yes
|
||||
#}
|
||||
|
||||
service_count = 1
|
||||
|
||||
# number of simultaneous POP3 connections
|
||||
#process_limit = 500
|
||||
}
|
||||
|
||||
service managesieve-login {
|
||||
inet_listener sieve {
|
||||
# Listen on localhost (ipv4)
|
||||
address = PH_MANAGESIEVE_BIND_HOST
|
||||
port = PH_MANAGESIEVE_BIND_PORT
|
||||
}
|
||||
}
|
||||
|
||||
metric imap_command_finished {
|
||||
event_name = imap_command_finished
|
||||
}
|
||||
|
||||
namespace {
|
||||
type = private
|
||||
separator = /
|
||||
prefix =
|
||||
inbox = yes
|
||||
|
||||
# Refer to document for more details about alias mailbox:
|
||||
# http://wiki2.dovecot.org/MailboxSettings
|
||||
#
|
||||
# Sent
|
||||
mailbox Sent {
|
||||
auto = subscribe
|
||||
special_use = \Sent
|
||||
}
|
||||
mailbox "Sent Messages" {
|
||||
auto = no
|
||||
special_use = \Sent
|
||||
}
|
||||
mailbox "Sent Items" {
|
||||
auto = no
|
||||
special_use = \Sent
|
||||
}
|
||||
|
||||
mailbox Drafts {
|
||||
auto = subscribe
|
||||
special_use = \Drafts
|
||||
}
|
||||
|
||||
# Trash
|
||||
mailbox Trash {
|
||||
auto = subscribe
|
||||
special_use = \Trash
|
||||
}
|
||||
|
||||
mailbox "Deleted Messages" {
|
||||
auto = no
|
||||
special_use = \Trash
|
||||
}
|
||||
|
||||
# Junk
|
||||
mailbox Junk {
|
||||
auto = subscribe
|
||||
special_use = \Junk
|
||||
}
|
||||
mailbox Spam {
|
||||
auto = no
|
||||
special_use = \Junk
|
||||
}
|
||||
mailbox "Junk E-mail" {
|
||||
auto = no
|
||||
special_use = \Junk
|
||||
}
|
||||
|
||||
# Archive
|
||||
mailbox Archive {
|
||||
auto = no
|
||||
special_use = \Archive
|
||||
}
|
||||
mailbox Archives {
|
||||
auto = no
|
||||
special_use = \Archive
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
type = shared
|
||||
separator = /
|
||||
prefix = Shared/%%u/
|
||||
location = maildir:%%Lh/Maildir/:INDEX=%%Lh/Maildir/Shared/%%Ld/%%Ln
|
||||
|
||||
# this namespace should handle its own subscriptions or not.
|
||||
subscriptions = yes
|
||||
list = children
|
||||
}
|
||||
|
||||
# Public mailboxes.
|
||||
# Refer to Dovecot wiki page for more details:
|
||||
# http://wiki2.dovecot.org/SharedMailboxes/Public
|
||||
#namespace {
|
||||
# type = public
|
||||
# separator = /
|
||||
# prefix = Public/
|
||||
# location = maildir:PH_PUBLIC_MAILBOX_DIR:CONTROL=%Lh/Maildir/public:INDEXPVT=%Lh/Maildir/public
|
||||
#
|
||||
# # Allow users to subscribe to the public folders.
|
||||
# subscriptions = yes
|
||||
#}
|
||||
|
||||
!include_try PH_DOVECOT_CONF_INCLUDE_DIR/*.conf
|
||||
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# IMAP shared folders. User 'from_user' shares folders to user 'to_user'.
|
||||
# WARNING: Works only with Dovecot 1.2+.
|
||||
#
|
||||
CREATE TABLE IF NOT EXISTS share_folder (
|
||||
from_user VARCHAR(150) NOT NULL,
|
||||
to_user VARCHAR(150) NOT NULL,
|
||||
dummy CHAR(1),
|
||||
PRIMARY KEY (from_user, to_user)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS anyone_shares (
|
||||
from_user VARCHAR(255) NOT NULL,
|
||||
dummy CHAR(1) DEFAULT '1',
|
||||
PRIMARY KEY (from_user)
|
||||
);
|
||||
@@ -0,0 +1,12 @@
|
||||
CREATE TABLE IF NOT EXISTS `last_login` (
|
||||
`username` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`domain` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`imap` INT(11) DEFAULT NULL,
|
||||
`pop3` INT(11) DEFAULT NULL,
|
||||
`lda` INT(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`username`),
|
||||
INDEX (`domain`),
|
||||
INDEX (`imap`),
|
||||
INDEX (`pop3`),
|
||||
INDEX (`lda`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
@@ -0,0 +1,26 @@
|
||||
-- used_quota
|
||||
-- Used to store realtime mailbox quota in Dovecot.
|
||||
-- WARNING: Works only with Dovecot 1.2+.
|
||||
--
|
||||
-- Note: Don't touch this table, it will be updated by Dovecot automatically.
|
||||
CREATE TABLE IF NOT EXISTS `used_quota` (
|
||||
`username` VARCHAR(255) NOT NULL,
|
||||
`bytes` BIGINT NOT NULL DEFAULT 0,
|
||||
`messages` BIGINT NOT NULL DEFAULT 0,
|
||||
`domain` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`username`),
|
||||
INDEX (domain)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- Trigger `used_quota_before_insert` is used to set `used_quota.domain`.
|
||||
-- NOTE: `used_quota.domain` is not used by Dovecot, but used in iRedAdmin to
|
||||
-- get better SQL query performance while calculating per-domain used
|
||||
-- quota.
|
||||
DELIMITER //
|
||||
CREATE TRIGGER `used_quota_before_insert`
|
||||
BEFORE INSERT ON `used_quota` FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.domain = SUBSTRING_INDEX(NEW.username, '@', -1);
|
||||
END;
|
||||
//
|
||||
DELIMITER ;
|
||||
@@ -0,0 +1,3 @@
|
||||
[Service]
|
||||
ProtectSystem=false
|
||||
#ProtectHome=false
|
||||
Reference in New Issue
Block a user