Do I need to copy all files from /etc? Why so, which configuration files are read from there?
cp -Rf /etc /var/spool/postfix ?
/edit/ Answer: Since postfix is chrooted to /var/spool/postfix it needs these files to be able to determine hostname etc.
Not all files are requiered only hosts, localtime, nsswitch.conf, resolv.conf, services /edit/
And how do I create the TLS certificates? Does iRedMail use different certificates for dovecot and apache?
Or do I just need to recreate the iRedMail_CA.pem with the command I found in functions/packages.sh?
/edit/ Answer: Well apparently apache and dovecot use the same hostname, script for new certificate attached. /edit/
#!/usr/bin/env bash
# Generate new certificate for iRedMail 0.5.0
if [ X"${DISTRO}" == X"RHEL" ]; then
export SSL_FILE_DIR="/etc/pki/tls"
elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
export SSL_FILE_DIR="/etc/ssl"
else
echo "Your distribution is not supported yet."
exit 255
fi
export HOSTNAME="$(hostname --fqdn)"
export SSL_CERT_FILE="${SSL_FILE_DIR}/certs/iRedMail_CA.pem"
export SSL_KEY_FILE="${SSL_FILE_DIR}/private/iRedMail.key"
export TLS_COUNTRY='DE'
export TLS_STATE=''
export TLS_CITY=''
export TLS_COMPANY="${HOSTNAME}"
export TLS_DEPARTMENT='IT'
export TLS_HOSTNAME="${HOSTNAME}"
export TLS_ADMIN="root@${HOSTNAME}"
openssl req \
-x509 -nodes -days 3650 -newkey rsa:1024 \
-subj "/C=${TLS_COUNTRY}/ST=${TLS_STATE}/L=${TLS_CITY}/O=${TLS_COMPANY}/OU=${TLS_DEPARTMENT}/CN=${TLS_HOSTNAME}/emailAddress=${TLS_ADMIN}/" \
-out ${SSL_CERT_FILE} -keyout ${SSL_KEY_FILE}