Files
mailsystem/conf/install_update_dovecot.conf.sample
T
chrisandClaude Opus 5.5 38c7ce8f6a install_update_dovecot-2.4.sh: make provided mail services selectable
- New config parameter 'mail_protocols' (blank separated list of
  imap, pop3, sieve; defaults to "imap pop3 sieve"). lmtp is always
  enabled.
- New selection menu at install/update time:
    [1] all common mail services (imap pop3 sieve)
    [2] all common except pop3   (imap sieve)
    [3] other (follow-up input, preset with an individual list
        from the configuration file)
  The line matching the configuration file is highlighted.
- 'protocols' block is built from the selection; not selected
  protocols and dovecot's submission service are set to 'no'.
- Dovecot's submission service is no longer configured: submission
  (587/465) is provided by postfix. 'service submission-login' and
  'service submission' blocks are removed from 10-master.conf.
- 'service pop3-login' / 'service pop3' are only written if pop3 is
  selected, otherwise removed.
- Summary lists each protocol with its state; listener addresses are
  only shown for enabled protocols. 'mail_protocols' is written to the
  environment file.
- Helper functions call 'gawk' explicitly (they need GNU awk
  extensions like '\s'; mawk silently fails). gawk is installed for
  update and new installation, abort if that fails.
- Fix apt-get calls: '2&>1' -> '2>&1', add '-y', append to log.
- conf/install_update_dovecot.conf.sample: document 'mail_protocols'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:12:45 +01:00

248 lines
5.4 KiB
Bash

#!/usr/bin/env bash
## ===================================================================
## - Configuration File: Install/Update Dovecot Server
## ===================================================================
# ---
# --- Configure Settings for your Server here..
# ---
# ---
# - Base Configuration
# ---
# - Set update=false if that is a new installation
# -
# - This parameter must be set here! There is no default value.
# -
_update=false
# - Install dovecot with systemd support
# -
# - Defaults to 'true' if systemd is present, otherwise to 'false'
# -
#systemd_support=""
# - postmaster_address
# -
# - This parameter must be set here! There is no default value.
# -
# - Example:
# - postmaster_address="admin\@warenform.net"
# -
postmaster_address=""
# - hostname
# -
# - This parameter must be set here! There is no default value.
# -
hostname=""
# - IPv4 / IPv6 Addressen
# -
ipv4=""
ipv6=""
# - Webserver User
# -
# - defaults to:
# - http_user=www-data
# -
#http_user="www-data"
# ---
# - Postffix Settings
# ---
# - Postfix Main Configuration File
# -
# - defaults to:
# - /etc/postfix/main.cf
# -
#postfix_main_cf="/etc/postfix/main.cf"
# ---
# - Mail services (dovecot protocols)
# ---
# - mail_protocols
# -
# - Blank separated list of the mail services (dovecot protocols) to provide.
# -
# - Possible values:
# -
# - imap - IMAP (port 143) and IMAPS (port 993)
# - pop3 - POP3 (port 110) and POP3S (port 995)
# - sieve - ManageSieve (port 4190), e.g. used by the roundcube
# - 'managesieve' plugin (filter rules, vacation, ..)
# -
# - Note:
# - 'lmtp' is not part of this list. LMTP is required for delivering mail
# - from postfix into the mailboxes and is therefore always enabled.
# -
# - 'submission' is not part of this list either. In this mailsystem
# - submission (587) and submissions (465) are provided by postfix, so
# - dovecot's submission service is always disabled.
# -
# - The value given here determines which line is highlighted (and taken by
# - pressing <RETURN>) in the selection menu of the install script:
# -
# - "imap pop3 sieve" --> [1] all common mail services
# - "imap sieve" --> [2] all common mail services except pop3
# - anything else --> [3] other (the value is offered as default for
# - the following input)
# -
# - Defaults to "imap pop3 sieve"
# -
#mail_protocols="imap pop3 sieve"
# ---
# - Listener configuration
# ---
if [[ -n "$ipv6" ]]; then
imap_listener_adresses="127.0.0.1 $ipv4 $ipv6"
imaps_listener_adresses="$ipv4 $ipv6"
pop_listener_adresses="$ipv4 $ipv6"
pops_listener_adresses="$ipv4 $ipv6"
else
imap_listener_adresses="127.0.0.1 $ipv4"
imaps_listener_adresses="$ipv4"
pop_listener_adresses="$ipv4"
pops_listener_adresses="$ipv4"
fi
xmpp_listener=false
xmpp_listener_addresses="$ipv4 $ipv6"
xmpp_listener_port="44444"
# ---
# - Database settings
# ---
# - database
# -
# - This parameter must be set here! There is no default value.
# -
# - Possible values for parameter database are only 'mysql' and 'postgres'
# -
database=""
# - dbname
# -
# - Defaults to 'postfix'
#dbname=postfix
# - dbuser
# -
# - Defaults to 'postfix'
# -
#dbuser=postfix
# - dbpassword
# -
# - This parameter must be set here!
# -
dbpassword=""
# - dbhost
# -
# - Defaults to:
# - '/run/postgresql' if database is set to 'postgres'
# - '127.0.0.1' if database is set to 'mysql'
# -
dbhost=""
# - default_pass_scheme
# -
# - Password databases have a default password scheme.
# -
# - The password scheme can be overridden for each password by prefixing
# - it with {SCHEME}, for example: {SHA512-CRYPT}pass.
# -
# - See: https://wiki.dovecot.org/Authentication/PasswordSchemes
# -
# - Defaults to 'PLAIN'
# -
#default_pass_scheme=
# ---
# - Cert/Key configurations
# ---
cert_base_dir="/etc/dovecot/ssl"
server_cert=${cert_base_dir}/mailserver.crt
server_key=${cert_base_dir}/mailserver.key
dh_pem_file="${cert_base_dir}/dh_4096.pem"
imap_cert=${cert_base_dir}/mailserver.crt
imap_key=${cert_base_dir}/mailserver.key
pop_cert=${cert_base_dir}/mailserver.crt
pop_key=${cert_base_dir}/mailserver.key
# - Other settings
# -
spam_folder=Spam
max_userip_connections=24
#auth_mechanisms="plain login digest-md5 cram-md5"
auth_mechanisms="plain login"
# ---
# - Logging of mail actions (mail_log plugin, Dovecot 2.4+)
# ---
#
# - Logs copy/move, save, expunge, delete and folder create/delete/rename
# - into the dovecot log (file conf.d/95-mail-log.conf).
# -
# - Note: with fields 'from' and 'subject' personal data are written
# - to the log files.
# -
# - mail_log defaults to: true
# - mail_log_events defaults to:
# - "copy save expunge delete undelete mailbox_create mailbox_delete mailbox_rename"
# - mail_log_fields defaults to:
# - "uid box msgid from subject"
# -
#mail_log=true
#mail_log_events="copy save expunge delete undelete mailbox_create mailbox_delete mailbox_rename"
#mail_log_fields="uid box msgid from subject"
# ---
# - Settings for quota warning sript
# ---
# msg_language
#
# possible Vallues are 'en' or 'de'
#
msg_language=de
from_address="o.open <oo@oopen.de>"
reply_to="oo@oopen.de"
webmailer="https://webmail.oopen.de"
salutation="O.OPEN
--
O.OPEN | Phone: +49 30 / 290 484 91
Erkelenzdamm 21 | Fax: +49 30 / 290 484 99
D-10999 Berlin | http://oopen.de"
# ---
# --- End server-specific Settings
# ---