mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-07-23 13:13:29 +00:00
Add support for extending mail_plugins via extra files
- Modified docker-entrypoint.sh to create empty mail_plugins_extra files - Updated dovecot.conf to read from additional plugin files - Added documentation on how to extend mail_plugins Co-authored-by: DerLinkman <62480600+DerLinkman@users.noreply.github.com>
This commit is contained in:
@@ -121,7 +121,13 @@ echo -n 'quota acl zlib mail_crypt mail_crypt_acl mail_log notify fts fts_flatcu
|
|||||||
echo -n 'quota imap_quota imap_acl acl zlib imap_zlib imap_sieve mail_crypt mail_crypt_acl notify mail_log fts fts_flatcurve listescape replication' > /etc/dovecot/mail_plugins_imap
|
echo -n 'quota imap_quota imap_acl acl zlib imap_zlib imap_sieve mail_crypt mail_crypt_acl notify mail_log fts fts_flatcurve listescape replication' > /etc/dovecot/mail_plugins_imap
|
||||||
echo -n 'quota sieve acl zlib mail_crypt mail_crypt_acl fts fts_flatcurve notify listescape replication' > /etc/dovecot/mail_plugins_lmtp
|
echo -n 'quota sieve acl zlib mail_crypt mail_crypt_acl fts fts_flatcurve notify listescape replication' > /etc/dovecot/mail_plugins_lmtp
|
||||||
fi
|
fi
|
||||||
chmod 644 /etc/dovecot/mail_plugins /etc/dovecot/mail_plugins_imap /etc/dovecot/mail_plugins_lmtp /templates/quarantine.tpl
|
|
||||||
|
# Create empty extra plugin files if they don't exist (can be populated via extra.conf or direct file)
|
||||||
|
[[ ! -f /etc/dovecot/mail_plugins_extra ]] && touch /etc/dovecot/mail_plugins_extra
|
||||||
|
[[ ! -f /etc/dovecot/mail_plugins_imap_extra ]] && touch /etc/dovecot/mail_plugins_imap_extra
|
||||||
|
[[ ! -f /etc/dovecot/mail_plugins_lmtp_extra ]] && touch /etc/dovecot/mail_plugins_lmtp_extra
|
||||||
|
|
||||||
|
chmod 644 /etc/dovecot/mail_plugins /etc/dovecot/mail_plugins_imap /etc/dovecot/mail_plugins_lmtp /etc/dovecot/mail_plugins_extra /etc/dovecot/mail_plugins_imap_extra /etc/dovecot/mail_plugins_lmtp_extra /templates/quarantine.tpl
|
||||||
|
|
||||||
cat <<EOF > /etc/dovecot/sql/dovecot-dict-sql-userdb.conf
|
cat <<EOF > /etc/dovecot/sql/dovecot-dict-sql-userdb.conf
|
||||||
# Autogenerated by mailcow
|
# Autogenerated by mailcow
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# Please create a file "extra.conf" for persistent overrides to dovecot.conf
|
# Please create a file "extra.conf" for persistent overrides to dovecot.conf
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
# To extend mail_plugins, you can either:
|
||||||
|
# 1. Create/edit /etc/dovecot/mail_plugins_extra (for global plugins)
|
||||||
|
# 2. Create/edit /etc/dovecot/mail_plugins_imap_extra (for IMAP-specific plugins)
|
||||||
|
# 3. Create/edit /etc/dovecot/mail_plugins_lmtp_extra (for LMTP-specific plugins)
|
||||||
|
# For example, to add the virtual plugin globally:
|
||||||
|
# echo -n ' virtual' > data/conf/dovecot/mail_plugins_extra
|
||||||
|
# --------------------------------------------------------------------------
|
||||||
# LDAP example:
|
# LDAP example:
|
||||||
#passdb {
|
#passdb {
|
||||||
# args = /etc/dovecot/ldap/passdb.conf
|
# args = /etc/dovecot/ldap/passdb.conf
|
||||||
@@ -21,7 +28,7 @@ disable_plaintext_auth = yes
|
|||||||
login_log_format_elements = "user=<%u> method=%m rip=%r lip=%l mpid=%e %c %k"
|
login_log_format_elements = "user=<%u> method=%m rip=%r lip=%l mpid=%e %c %k"
|
||||||
mail_home = /var/vmail/%d/%n
|
mail_home = /var/vmail/%d/%n
|
||||||
mail_location = maildir:~/
|
mail_location = maildir:~/
|
||||||
mail_plugins = </etc/dovecot/mail_plugins
|
mail_plugins = </etc/dovecot/mail_plugins </etc/dovecot/mail_plugins_extra
|
||||||
mail_attachment_fs = crypt:set_prefix=mail_crypt_global:posix:
|
mail_attachment_fs = crypt:set_prefix=mail_crypt_global:posix:
|
||||||
mail_attachment_dir = /var/attachments
|
mail_attachment_dir = /var/attachments
|
||||||
mail_attachment_min_size = 128k
|
mail_attachment_min_size = 128k
|
||||||
@@ -180,12 +187,12 @@ userdb {
|
|||||||
skip = found
|
skip = found
|
||||||
}
|
}
|
||||||
protocol imap {
|
protocol imap {
|
||||||
mail_plugins = </etc/dovecot/mail_plugins_imap
|
mail_plugins = </etc/dovecot/mail_plugins_imap </etc/dovecot/mail_plugins_imap_extra
|
||||||
imap_metadata = yes
|
imap_metadata = yes
|
||||||
}
|
}
|
||||||
mail_attribute_dict = file:%h/dovecot-attributes
|
mail_attribute_dict = file:%h/dovecot-attributes
|
||||||
protocol lmtp {
|
protocol lmtp {
|
||||||
mail_plugins = </etc/dovecot/mail_plugins_lmtp
|
mail_plugins = </etc/dovecot/mail_plugins_lmtp </etc/dovecot/mail_plugins_lmtp_extra
|
||||||
auth_socket_path = /var/run/dovecot/auth-master
|
auth_socket_path = /var/run/dovecot/auth-master
|
||||||
}
|
}
|
||||||
protocol sieve {
|
protocol sieve {
|
||||||
|
|||||||
Reference in New Issue
Block a user