Kopano to grommunio HowTo

Aus Neobikers Wiki
Zur Navigation springen Zur Suche springen

Installation auf Debian 12

Eine fertige grommunio Appliance ist auf Basis von S.u.S.E. erstellt und steht u.a. als ISO download zur Verfügung. Da ich derzeit ausschliesslich Debian basierte Systeme verwende, bevorzuge ich eine grommunio Installation auf Debian 12 (bookworm).

Im grommunio Forum findet sich ein Diskussionsthread für die grommunio Installation auf Debian 12 durch ein Script. Diese läuft auf einer neu erstellten VM auf Proxmox Server fehlerfrei durch. In einem LXC Container gab es Probleme, u.a. klemmte der POP3 Service.

Im Anschluss an das Installationsskript habe ich noch folgendes Script unter Additions - Fix Grommunio Admin Live Status page ausgeführt, welches ebenfalls funktionierte und die entsprechende Seite im Web Interface reparierte.

Konfiguration

Kopano Core ist bei mir als Applikation auf meinem UCS File- und Mailserver installiert. Die Benutzerkonten und deren Konfiguration werden von UCS verwaltet und stehen per LDAP zur Verfügung.

LDAP

Groupware Konfiguration

ssh ucsmail grep -e ^ldap_b -e ^ldap_sea -e ^ldap_u /etc/kopano/ldap.cfg

ldap_uri = ldap://ucsmail.zuhause.de:7389/
ldap_bind_user = cn=ucsmail,cn=dc,cn=computers,dc=zuhause,dc=de
ldap_bind_passwd = xxxxxxxxxxxxxx
ldap_search_base = dc=zuhause,dc=de
ldap_user_unique_attribute = entryUUID
ldap_user_type_attribute_value = kopano-user
ldap_user_search_filter = (kopanoAccount=1)

# configure LDAP
grommunio-admin ldap configure

# list users
grommunio-admin ldap search

Email Domains und User

Das Anlegen einer Domain im Web-Interface schlägt direkt fehl - "Bad Request". Nicht schlimm, aber vielleicht nehme ich doch lieber die fertige Appliance auf Basis von S.u.S.E. ?

kopano_server=ucsmail
domains=$(ssh $kopano_server ucr get mail/hosteddomains)
users=$(grommunio-admin ldap search)
for domain in $domains; do
    u_cnt=$(echo "$users" | grep -c $domain)
    [ $u_cnt -gt 0 ] && echo grommunio-admin domain create -u $u_cnt $domain
done

# import and sync LDAP users
grommunio-admin ldap downsync -c


Export - Import via Outlook .pst

Da ich nur 5 Konten habe, erwäge ich dieses Verfahren, da neben Email auch gleich alles andere aus Outlook importiert wird:

  • Emails
  • Kalender
  • Kontakte
  • Notizen
  • usw.
gromox-pff2mt /tmp/neobiker_outlook.pst | gromox-mt2exm -u neobiker@neobiker.de

Import von Emails aus Kopano

# gromox-kdb2mt — Utility for analysis/import of Kopano mailboxes
# gromox-mt2exm — Utility for importing various mail items

kopano_server=ucsmail

# ssh conections without prompts
ssh-copy-id $kopano_server

# mount /var/lib/kopano/attachments per sshfs
apt install sshfs screen
mkdir -p /mnt/kopano_attachments
sshfs $kopano_server:/var/lib/kopano/attachments /mnt/kopano_attachments

# detach (CTRL-A d) the SSH tunnel to SQL server (who only accepts localhost conections)
screen ssh -L 12345:localhost:3306 "root@${kopano_server}"

# EXAMPLE for user neobiker = neobiker@neobiker.de
# ------------------------------------------------
# ENVIRONMENT variable is used for SQL password
# either EXPORT it or write in one line with cmd
SQLPASS=$(ssh $kopano_server cat /etc/mysql.secret) gromox-kdb2mt --sql-host 127.0.0.1 --sql-port 12345 --src-attach /mnt/kopano_attachments --mbox-mro neobiker | gromox-mt2exm -u neobiker@neobiker.de

# LOOP over all email accounts (except SYSTEM)
# --------------------------------------------
for user in $(ssh $kopano_server kopano-admin -l | tail +4 | awk '{print $1}' | grep -v SYSTEM); do

  details=$(ssh $kopano_server kopano-admin --details $user)
  email=$(echo "${details}" $user | awk '/Emailaddress:/ {print $2}')
  guid=$(echo "${details}" $user | awk '/Store GUID:/ {print $3}')

  SQLPASS=$(ssh $kopano_server cat /etc/mysql.secret) gromox-kdb2mt --sql-host 127.0.0.1 --sql-port 12345 --src-attach /mnt/kopano_attachments --mbox-guid $guid | gromox-mt2exm -u $email

done

# stop ssh tunnel -> exit ssh on kopano server
screen -r

# unmount kopano attachments
umount /mnt/kopano_attachments

Postfix

Mail Delivery Agent (MDA) Konfiguration

  • zum versenden von Emails
  • Mailaddress rewritings
domains=$(ssh ucsmail ucr get mail/hosteddomains)

Mail Relay Server

Postfix can use a mail relay server.

ucr get mail/relayhost
# authentification on relay host
/etc/postfix/smtp_auth
# format
# FQDN-Relayhost username:password

postmap /etc/postfix/smtp_auth
postmap /etc/postfix/tls_policy
service postfix reload

Fetchmail

Fetchmail Konfiguration zum abholen der Emails von meinem Email Provider. Emails werden entweder von UCS oder grommunio abgeholt und and Postfix übergeben!

Auf UCS für jeden Benutzer deaktivieren
-> Advanced settings ‣ Remote mail retrieval (single)
oder Postfix auf UCS zur weiterleitung an grommunio konfigurieren.

systemctl stop fetchmail
systemctl disable fetchmail
ucr set fetchmail/autostart=false

# fetchmail config and passwords
cat /etc/fetchmailrc