Skip to content
Snippets Groups Projects
Commit 41c7ad95 authored by dominik.epple's avatar dominik.epple
Browse files

Mail system setup documentation

parent 4cc631cf
No related branches found
No related tags found
No related merge requests found
# Mail system setup
See setup.sh for copy-paste installation commands. A short description of the setup follows below.
On "one-in-all" installations this can go to localhost. On more reasonable setups this will go to your dedicated mail node. On even more reasonable setups (multi-node mail cluster) you need something else -- this is out of scope of this document.
TODO: object store based setup (e.g. against a local ceph/radosgw -- input welcome)
TODO: multi-node setup (proxy, director, backend nodes -- input welcome)
## Dovecot
Kind of performance optimized standard sdbox based setup with some additional features (namespaces, acl, quota, sieve).
Auth / userdb goes against passwd files in /etc/dovecot. See supplied passwd and masters file. We refrained to do any fancy "auth against OX DB" things for performance reasons.
Warning: this configures default accounts with "secret" passwords; change for anything else than internal performance testing use!
Dovecot offers listeners for lmtp and auth for postfix, so postfix can be configured with as few information on its own as possible.
## Postfix
Configured to use dovecot listeners for auth and lmtp to dovecot.
Postfix needs to be told which domains are considered internal delivery in relay_domains. In the transport file we configure that external mails are dropped -- this way the performance test scripts can invite fake google, microsoft, whatever users to invite appointments without spamming the respective services. If that is not desired, empty that file.
Dont forget to run postmap on these files after changes.
#auth_debug = yes
auth_master_user_separator = *
#auth_verbose = yes
auth_cache_size = 512M
auth_cache_negative_ttl = 0
auth_worker_max_count = 100
default_client_limit = 10000
default_process_limit = 1000
disable_plaintext_auth = no
#mail_debug = yes
mail_gid = vmail
mail_home = /mnt/vmail/vmail/%256LNu/%u
mail_location = sdbox:~/sdbox
mail_plugins = " quota acl zlib"
mail_uid = vmail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext
namespace {
list = children
location = sdbox:%%Lh/sdbox
prefix = shared/%%u/
separator = /
subscriptions = yes
type = shared
}
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix = INBOX/
separator = /
}
passdb {
args = /etc/dovecot/masters
driver = passwd-file
master = yes
pass = yes
}
passdb {
#args = /etc/dovecot/dovecot-sql.conf.ext
#driver = sql
args = /etc/dovecot/passwd
driver = passwd-file
}
plugin {
acl = vfile
acl_shared_dict = file:/var/lib/dovecot/shared-mailboxes
quota = dict:User quota::file:%h/sdbox/dovecot-quota
quota_rule = *:storage=100M
sieve = file:~/sieve;active=~/.dovecot.sieve
zlib_save = gz
zlib_save_level = 6
}
protocols = " imap lmtp sieve"
service auth {
unix_listener /var/spool/postfix/private/auth {
mode = 0666
}
}
service imap-login {
process_min_avail = 16
service_count = 0
}
service lmtp {
inet_listener lmtp {
address = 127.0.0.1
port = 24
}
}
service managesieve-login {
inet_listener sieve {
port = 4190
}
inet_listener sieve_deprecated {
port = 2000
}
}
ssl = no
#ssl = yes
#ssl_cert = </etc/dovecot/dovecot-crt-plus-vodafone-chain.pem
#ssl_key = </etc/dovecot/dovecot-key.pem
#userdb {
# driver = prefetch
#}
userdb {
driver = passwd-file
args = /etc/dovecot/passwd
#default_fields = uid=vmail gid=vmail home=/mnt/vmail/vmail/%u
}
#userdb {
# args = /etc/dovecot/dovecot-sql.conf.ext
# driver = sql
#}
verbose_proctitle = yes
protocol lmtp {
mail_plugins = " quota acl zlib sieve"
}
protocol lda {
mail_plugins = " quota acl zlib sieve"
}
protocol imap {
imap_client_workarounds = delay-newmail tb-extra-mailbox-sep tb-lsub-flags
mail_max_userip_connections = 100
mail_plugins = " quota acl zlib imap_quota imap_acl imap_zlib"
}
#
# dovecot
#
# jessie
cat >/etc/apt/sources.list.d/backports.list <<EOF
deb http://ftp.debian.org/debian jessie-backports main
EOF
apt-get update
apt-get -t jessie-backports install dovecot-core dovecot-imapd dovecot-managesieved dovecot-lmtpd
# stretch
#apt-get update
#apt-get install dovecot-core dovecot-imapd dovecot-managesieved dovecot-lmtpd
rm -rf /etc/dovecot/*
cp dovecot.conf /etc/dovecot
echo "testuser@localdomain:{PLAIN}secret:::::" >/etc/dovecot/passwd
echo "master:{PLAIN}supersecret:::::" >/etc/dovecot/masters
useradd -U -r vmail
mkdir -p /mnt/vmail/vmail
chown vmail:vmail /var/lib/dovecot /mnt/vmail /mnt/vmail/vmail
#
# postfix
#
apt-get install postfix postfix-doc
postconf -e \
"smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination reject_unverified_recipient" \
"smtpd_sasl_type = dovecot" \
"smtpd_sasl_path = private/auth" \
"smtpd_sasl_auth_enable = yes" \
"relay_domains = hash:/etc/postfix/relay_domains" \
"transport_maps = hash:/etc/postfix/transport, \$relay_domains"
cat >/etc/postfix/relay_domains <<\EOF
localdomain lmtp:[127.0.0.1]
gatling lmtp:[127.0.0.1]
EOF
cat >/etc/postfix/transport <<\EOF
* discard:
EOF
( cd /etc/postfix && postmap relay_domains && postmap transport )
service dovecot restart
service postfix restart
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment