diff --git a/conf/dovecot/conf.d/20-imap.conf b/conf/dovecot/conf.d/20-imap.conf deleted file mode 100644 index b9855b89..00000000 --- a/conf/dovecot/conf.d/20-imap.conf +++ /dev/null @@ -1,94 +0,0 @@ -## -## IMAP specific settings -## - -# If nothing happens for this long while client is IDLEing, move the connection -# to imap-hibernate process and close the old imap process. This saves memory, -# because connections use very little memory in imap-hibernate process. The -# downside is that recreating the imap process back uses some resources. -#imap_hibernate_timeout = 0 - -# Maximum IMAP command line length. Some clients generate very long command -# lines with huge mailboxes, so you may need to raise this if you get -# "Too long argument" or "IMAP command line too large" errors often. -#imap_max_line_length = 64k - -# IMAP logout format string: -# %i - total number of bytes read from client -# %o - total number of bytes sent to client -# %{fetch_hdr_count} - Number of mails with mail header data sent to client -# %{fetch_hdr_bytes} - Number of bytes with mail header data sent to client -# %{fetch_body_count} - Number of mails with mail body data sent to client -# %{fetch_body_bytes} - Number of bytes with mail body data sent to client -# %{deleted} - Number of mails where client added \Deleted flag -# %{expunged} - Number of mails that client expunged, which does not -# include automatically expunged mails -# %{autoexpunged} - Number of mails that were automatically expunged after -# client disconnected -# %{trashed} - Number of mails that client copied/moved to the -# special_use=\Trash mailbox. -# %{appended} - Number of mails saved during the session -#imap_logout_format = in=%i out=%o - -# Override the IMAP CAPABILITY response. If the value begins with '+', -# add the given capabilities on top of the defaults (e.g. +XFOO XBAR). -#imap_capability = - -# How long to wait between "OK Still here" notifications when client is -# IDLEing. -#imap_idle_notify_interval = 2 mins -imap_idle_notify_interval=4 mins - -# ID field names and values to send to clients. Using * as the value makes -# Dovecot use the default value. The following fields have default values -# currently: name, version, os, os-version, support-url, support-email. -#imap_id_send = - -# ID fields sent by client to log. * means everything. -#imap_id_log = - -# Workarounds for various client bugs: -# delay-newmail: -# Send EXISTS/RECENT new mail notifications only when replying to NOOP -# and CHECK commands. Some clients ignore them otherwise, for example OSX -# Mail ( - -## -## Quota limits -## - -# Quota limits are set using "quota_rule" parameters. To get per-user quota -# limits, you can set/override them by returning "quota_rule" extra field -# from userdb. It's also possible to give mailbox-specific limits, for example -# to give additional 100 MB when saving to Trash: - -plugin { - #quota_rule = *:storage=1G - #quota_rule2 = Trash:storage=+100M - - # LDA/LMTP allows saving the last mail to bring user from under quota to - # over quota, if the quota doesn't grow too high. Default is to allow as - # long as quota will stay under 10% above the limit. Also allowed e.g. 10M. - #quota_grace = 10%% - - # Quota plugin can also limit the maximum accepted mail size. - #quota_max_mail_size = 100M -} - -## -## Quota warnings -## - -# You can execute a given command when user exceeds a specified quota limit. -# Each quota root has separate limits. Only the command for the first -# exceeded limit is excecuted, so put the highest limit first. -# The commands are executed via script service by connecting to the named -# UNIX socket (quota-warning below). -# Note that % needs to be escaped as %%, otherwise "% " expands to empty. - -plugin { - #quota_warning = storage=95%% quota-warning 95 %u - #quota_warning2 = storage=80%% quota-warning 80 %u -} - -# Example quota-warning service. The unix listener's permissions should be -# set in a way that mail processes can connect to it. Below example assumes -# that mail processes run as vmail user. If you use mode=0666, all system users -# can generate quota warnings to anyone. -#service quota-warning { -# executable = script /usr/local/bin/quota-warning.sh -# user = dovecot -# unix_listener quota-warning { -# user = vmail -# } -#} - -## -## Quota backends -## - -# Multiple backends are supported: -# dirsize: Find and sum all the files found from mail directory. -# Extremely SLOW with Maildir. It'll eat your CPU and disk I/O. -# dict: Keep quota stored in dictionary (eg. SQL) -# maildir: Maildir++ quota -# fs: Read-only support for filesystem quota - -plugin { - quota = maildir - - quota_grace = 10% - - quota_status_success = DUNNO - quota_status_nouser = DUNNO - quota_status_overquota = "522 5.2.2 Mailbox is full" - - #quota = dirsize:User quota - #quota = maildir:User quota - #quota = dict:User quota::proxy::quota - #quota = fs:User quota -} - -service quota-status { - executable = quota-status -p postfix - inet_listener { - port = 12340 - } -} - -# Multiple quota roots are also possible, for example this gives each user -# their own 100MB quota and one shared 1GB quota within the domain: -plugin { - #quota = dict:user::proxy::quota - #quota2 = dict:domain:%d:proxy::quota_domain - #quota_rule = *:storage=102400 - #quota2_rule = *:storage=1048576 -} diff --git a/setup/mail-dovecot.sh b/setup/mail-dovecot.sh index 9ddd14ce..2efa29b9 100755 --- a/setup/mail-dovecot.sh +++ b/setup/mail-dovecot.sh @@ -67,8 +67,28 @@ tools/editconf.py /etc/dovecot/conf.d/10-mail.conf \ # Create, subscribe, and mark as special folders: INBOX, Drafts, Sent, Trash, Spam and Archive. cp conf/dovecot/conf.d/15-mailboxes.conf /etc/dovecot/conf.d/ -cp conf/dovecot/conf.d/20-imap.conf /etc/dovecot/conf.d/ -cp conf/dovecot/conf.d/90-quota.conf /etc/dovecot/conf.d/ +sed -i "s/mail_plugins = .*/mail_plugins = \$mail_plugins imap-quota/" /etc/dovecot/conf.d/20-imap.conf +sed -i "s/protocol imap/mail_plugins = \$mail_plugins quota\nprotocol imap/" /etc/dovecot/conf.d/20-imap.conf + +# configure stuff for quota support +cat > /etc/dovecot/conf.d/90-quota.conf << EOF; +plugin { + quota = maildir + + quota_grace = 10% + + quota_status_success = DUNNO + quota_status_nouser = DUNNO + quota_status_overquota = "522 5.2.2 Mailbox is full" +} + +service quota-status { + executable = quota-status -p postfix + inet_listener { + port = 12340 + } +} +EOF # ### IMAP/POP