Wiki-Quellcode von Kopano mit lokalem Betrieb einrichten
Version 2.1 von Jonas Mayer am 2022/05/20 13:47
Zeige letzte Bearbeiter
author | version | line-number | content |
---|---|---|---|
1 | (% style="color:#000000" %)__**Voraussetzung**:__ Funktionale Kopano Einrichtung und Anbindung an die MariaDB103 | ||
2 | |||
3 | |||
4 | (% style="color:#000000" %)Um Kopano im lokalen Betrieb einzurichten, muss man Anpassungen an Konfigurationsdateien im Puppeteer vornehmen. Dadurch erhalten Benutzer dann [[username@schule.local>>mailto:username@schule.local]] als lokale Mailadresse und können untereinander Nachrichten verschicken. | ||
5 | **__Wichtig:__** Im lokalen Betrieb können keine Nachrichten an externe Mailadressen versendet werden. Die Kommunikation ist strikt auf interne Adressen beschränkt. | ||
6 | |||
7 | |||
8 | (% style="color:#000000" %)Um die Anpassungen vorzunehmen wechselt man in den (% style="color:#3498db" %)Puppeteer (% style="color:#000000" %)und dort in das Verzeichnis(% style="color:#3498db" %) /etc/logodidact/hiera/custom.d/ | ||
9 | |||
10 | (% class="box" %) | ||
11 | ((( | ||
12 | (% style="color:#000000" %)##cd /etc/logodidact/hiera/custom.d/## | ||
13 | ))) | ||
14 | |||
15 | (% style="color:#000000" %)Hier lassen sich diverse .yaml Konfigurationsdateien finden. Für die Einrichtung sind die Nachfolgenden von Relevanz: | ||
16 | |||
17 | (% class="box" %) | ||
18 | ((( | ||
19 | (% style="color:#000000" %)##kopano-g1.yaml / rev-proxy.yaml / mariadb103.yaml / ldhost.yaml / samba4-ad.yaml## | ||
20 | ))) | ||
21 | |||
22 | |||
23 | (% style="color:#000000" %)Anpassungen in der (% style="color:#3498db" %)kopano-g1.yaml(% style="color:#000000" %): | ||
24 | I.d.R. trägt man in der kopano-g1.yaml Die Maildomain und Zugangsdaten für das Catchall Postfach ein. Da wir jedoch keine externe Maildomain verwenden, bleiben diese Felder auf den Default-Wert bestehen. | ||
25 | |||
26 | (% class="box" %) | ||
27 | ((( | ||
28 | (% style="color:#000000" %)##~-~-- | ||
29 | ld_multidrop::ensure: absent | ||
30 | \\ld_kopano::amavisd_new::configs: | ||
31 | '@local_domains_maps': "( new_RE( qr'[@.](.*~\~\.?%{::domain})$'i ) )" | ||
32 | \\ld_kopano::postfix::configs: | ||
33 | smtp_generic_maps: | ||
34 | value: 'hash:%{dir_etc}/smtp_generic_maps.hash' | ||
35 | sender_dependent_relayhost_maps: | ||
36 | value: 'pcre:%{dir_etc}/sender_dependent_relayhost_maps_internal.pcre' | ||
37 | smtp_sender_dependent_authentication: | ||
38 | value: 'yes' | ||
39 | smtp_sasl_auth_enable: | ||
40 | value: 'yes' | ||
41 | smtp_sasl_password_maps: | ||
42 | value: 'hash:%{dir_etc}/smtp_sasl_password_maps.hash' | ||
43 | smtp_sasl_security_options: | ||
44 | value: 'noanonymous, noplaintext' | ||
45 | smtp_sasl_tls_security_options: | ||
46 | value: 'noanonymous' | ||
47 | smtp_tls_session_cache_database: | ||
48 | value: 'btree:${data_directory}/smtp_scache' | ||
49 | smtp_use_tls: | ||
50 | value: 'yes' | ||
51 | virtual_mailbox_domains: | ||
52 | value: 'pcre:%{dir_etc}/virtual_mailbox_domains_internal.pcre' | ||
53 | # Vordefinierte Absender beim Versand an Empfänger der lokalen Maildomänen einschränken | ||
54 | smtpd_restriction_classes: | ||
55 | value: 'local_only' | ||
56 | local_only: | ||
57 | value: 'check_recipient_access pcre:%{dir_etc}/local_domains.pcre, reject' | ||
58 | smtpd_recipient_restrictions: | ||
59 | value: 'check_sender_access pcre:%{dir_etc}/restricted_senders.pcre, permit_mynetworks,permit_sasl_authenticated, reject_invalid_hostname, reject_non_fqdn_hostname, reject_non_fqdn_recipient, reject_non_fqdn_sender, reject_unknown_recipient_domain, reject_unknown_sender_domain, reject_unauth_destination, reject_unauth_pipelining, reject' | ||
60 | \\\\ld_kopano::postfix::hashes: | ||
61 | '%{dir_etc}/smtp_generic_maps.hash': | ||
62 | content: | | ||
63 | %{header} | ||
64 | # Umschreibung der Absender-Domain bei externem Mailversand | ||
65 | # (Dummy-Eintrag, durch Empfängerfilterung nicht genutzt) | ||
66 | @%{::fqdn} @example.com | ||
67 | '%{dir_etc}/sender_dependent_relayhost_maps_external.hash': | ||
68 | content: | | ||
69 | %{header} | ||
70 | # Bounce-Nachrichten mit Null-Sender via Relayhost versenden | ||
71 | <> smtp.example.com | ||
72 | # Mails an externe Empfänger via Relayhost versenden | ||
73 | @example.com smtp.example.com | ||
74 | '%{dir_etc}/smtp_sasl_password_maps.hash': | ||
75 | content: | | ||
76 | %{header} | ||
77 | #user1@example.com user1@example.com:geheim | ||
78 | '%{dir_etc}/virtual_mailbox_domains_external.hash': | ||
79 | content: | | ||
80 | %{header} | ||
81 | example.com ACCEPT | ||
82 | '%{dir_etc}/restricted_senders.pcre': | ||
83 | content: | | ||
84 | %{header} | ||
85 | # Regular Expression Format: Liste an Absendern, die beim Versand eingeschränkt werden | ||
86 | /@(.+?\.)?%{::domain}$/ local_only | ||
87 | #/@sbe-technik-ring0\.ldmail\.schule$/ local_only | ||
88 | /@students\.sbe-technik-ring0\.ldmail\.schule$/ local_only | ||
89 | '%{dir_etc}/local_domains.pcre': | ||
90 | content: | | ||
91 | %{header} | ||
92 | # Regular Expression Format: Liste erlaubter Empfängerdomänen (für eingeschränkte Absender) | ||
93 | /@(.+?\.)?%{::domain}$/ OK | ||
94 | /@sbe-technik-ring0\.ldmail\.schule$/ OK | ||
95 | /@students\.sbe-technik-ring0\.ldmail\.schule$/ OK | ||
96 | \\ld_kopano::postfix::verbose: false | ||
97 | \\ld_kopano::ldap_type: openldap | ||
98 | \\ld_kopano::db_server: mariadb103 | ||
99 | \\# Optimierte Z-Push Webserver-Einstellungen für ActiveSync Devices | ||
100 | apache::keepalive: 'On' | ||
101 | apache::keepalive_timeout: '45' | ||
102 | apache::max_keepalive_requests: '500' | ||
103 | apache::mod::prefork::maxclients: '384' | ||
104 | apache::mod::prefork::serverlimit: '384' | ||
105 | nginx::keepalive_timeout: 3600 | ||
106 | nginx::keepalive_requests: 500## | ||
107 | ))) | ||
108 | |||
109 | |||
110 | (% style="color:#000000" %)Anpassungen in der (% style="color:#3498db" %)rev-proxy.yaml(% style="color:#000000" %): | ||
111 | |||
112 | (% class="box" %) | ||
113 | ((( | ||
114 | (% style="color:#000000" %)##~-~-- | ||
115 | # Kopano: KeepAlive Timeout erhöhen für Z-Push / ActiveSync Devices | ||
116 | nginx::keepalive_timeout: 3600 | ||
117 | nginx::keepalive_requests: 500## | ||
118 | ))) | ||
119 | |||
120 | |||
121 | (% style="color:#000000" %)Anpassungen in der(%%) (% style="color:#3498db" %)mariadb103.yaml(%%): | ||
122 | |||
123 | (% class="box" %) | ||
124 | ((( | ||
125 | (% style="color:#000000" %)##~-~-- | ||
126 | mysql::server::override_options: | ||
127 | mysqldump: | ||
128 | max_allowed_packet: '1G' | ||
129 | mysqld: | ||
130 | innodb_file_per_table: '1' | ||
131 | bind-address: '0.0.0.0' | ||
132 | skip-name-resolve: true | ||
133 | innodb_large_prefix: '1' | ||
134 | max_allowed_packet: '256M' | ||
135 | max_connections: '151' | ||
136 | query_cache_limit: '2M' | ||
137 | query_cache_size: '64M' | ||
138 | thread_stack: '512K' | ||
139 | tmp_table_size: '64M' | ||
140 | max_heap_table_size: '64M' | ||
141 | sort_buffer_size: '2M' | ||
142 | join_buffer_size: '2M' | ||
143 | table_open_cache: '500' | ||
144 | innodb_autoextend_increment: '1000' | ||
145 | innodb_buffer_pool_size: '1G' | ||
146 | # The following setting is based on the existing ibdata1 file, check current size and insert it here (rounded to MB) | ||
147 | # - Hint: Initial value after first installation = 12M | ||
148 | innodb_data_file_path: 'ibdata1:76M:autoextend' | ||
149 | innodb_flush_log_at_trx_commit: '2' | ||
150 | innodb_flush_method: 'O_DSYNC' | ||
151 | innodb_lock_wait_timeout: '120' | ||
152 | innodb_log_buffer_size: '8M' | ||
153 | innodb_log_file_size: '1G' | ||
154 | innodb_log_files_in_group: '3' | ||
155 | innodb_read_io_threads: '4' | ||
156 | innodb_write_io_threads: '4' | ||
157 | wait_timeout: '28800'## | ||
158 | ))) | ||
159 | |||
160 | |||
161 | (% style="color:#000000" %)Anpassungen in der (% style="color:#3498db" %)ldhost.yaml(% style="color:#000000" %): | ||
162 | Hier wird die Maildomain festgelegt, die Benutzer im Attribut mail unter (% style="color:#3498db" %)/var/lds/user/username/mail(% style="color:#000000" %) im (% style="color:#3498db" %)logosrv (% style="color:#000000" %)erhalten. | ||
163 | |||
164 | (% class="box" %) | ||
165 | ((( | ||
166 | (% style="color:#000000" %)##~-~--##(%%) | ||
167 | (% style="color:#000000; font-family:~"Open Sans~",~"Helvetica Neue~",Helvetica,Arial,sans-serif" %)### Kopano: Definition einer Maildomain (abweichend zu schule.local), die Benutzer & Gruppen im LDAP-Feld 'mail' erhalten sollen##(%%)## | ||
168 | (% style="color:#000000" %)#ld_legacy::mail::filters: | ||
169 | # '(zarafaaccount=1)': 'example.com' | ||
170 | # Kopano: Definition von Gruppen, die eine Mailadresse erhalten sollen und dadurch anschreibbar werden | ||
171 | ld_legacy::mail::zarafa_groups: | ||
172 | - elehrer(%%)## | ||
173 | ))) | ||
174 | |||
175 | |||
176 | (% style="color:#000000" %)Nun fehlen noch die Anpassungen in der (% style="color:#3498db" %)samba4-ad.yaml(% style="color:#000000" %): | ||
177 | Hier wird dem admin die administrativen Rechte zugeteilt. Falls noch andere Benutzer mit administrativen Rechten innerhalb von Kopano vergeben werden sollen, können diese ergänzt werden. | ||
178 | |||
179 | (% class="box" %) | ||
180 | ((( | ||
181 | (% style="color:#000000" %)##~-~-- | ||
182 | # Kopano: Definition von Benutzern, die administrative Rechte erhalten sollen | ||
183 | # (Einstellung wird nicht benutzt, sofern Kopano an das OpenLDAP angebunden ist, was dem Standard entspricht) | ||
184 | ld_samba4::ad::kopano::admins: | ||
185 | - 'admin'## | ||
186 | ))) | ||
187 | |||
188 | |||
189 | (% style="color:#000000" %)Damit die Änderungen sauber übernommen werden, fehlt noch ein Git commit im (% style="color:#3498db" %)Puppeteer(% style="color:#000000" %). | ||
190 | |||
191 | (% class="box" %) | ||
192 | ((( | ||
193 | (% style="color:#000000" %)##git add .## | ||
194 | ))) | ||
195 | |||
196 | (% class="box" %) | ||
197 | ((( | ||
198 | (% style="color:#000000" %)##git commit -am "Kopano für den lokalen Betrieb eingerichtet"## | ||
199 | ))) | ||
200 | |||
201 | |||
202 | (% style="color:#000000" %)und ein (% style="color:#3498db" %)prun in den jeweiligen Containern(% style="color:#000000" %) (Alle Container, die durch die .yaml Konfigurationsdateien angesprochen werden) |