The grommunio hook script for Let's Encrypt certificates contains an error: only the firsp part of the certificate chain is included in the grommunio certificate, and Android mobile devices do not consider such certificates to be trustworthy.
The faulty hook script looks like this:
cat /usr/share/grommunio-setup/grommunio-certbot-renew-hook
#!/bin/bash
# SPDX-License-Identifier: AGPL-3.0-or-later
# SPDX-FileCopyrightText: 2021 grommunio GmbH
openssl x509 -in "$RENEWED_LINEAGE/chain.pem" -out "$RENEWED_LINEAGE/chain-first.pem"
cat "$RENEWED_LINEAGE/cert.pem" "$RENEWED_LINEAGE/chain-first.pem" > "/etc/grommunio-common/ssl/server-bundle.pem"
cp "$RENEWED_LINEAGE/privkey.pem" "/etc/grommunio-common/ssl/server.key"
find /etc/grommunio-common/ssl/ -type f -exec chown -h gromox:gromox {} +
systemctl restart postfix gromox-http gromox-imap gromox-pop3 gromox-delivery-queue
These two lines are incorrect:
openssl x509 -in "$RENEWED_LINEAGE/chain.pem" -out "$RENEWED_LINEAGE/chain-first.pem"
cat "$RENEWED_LINEAGE/cert.pem" "$RENEWED_LINEAGE/chain-first.pem" > "/etc/grommunio-common/ssl/server-bundle.pem"
The first line only extracts one part of the chain, and the second line only copies this part of the chain in the grommunio certificate. Therefore, we need to remove the first line and replace the second line so that the fullchain.pem is copied into the certificate.
Test the certificate with the Qualys SSL Test. However, you can also use any other SSL test.
Note: You will see a "Not trusted" if only the first part of the certificate chain is includes in the grommunio certificate.
Read Part 2 to learn how to fix this error.
Thanks to @gbailey https://community.grommunio.com/d/2715-certbot-zertifikat-fur-smtpimappop3mapi-unvollstandig