11 lines
539 B
Bash
Executable File
11 lines
539 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -o pipefail -o nounset -o errexit
|
|
|
|
# Récupère le fingerprint SHA1 du certificat fourni par le serveur
|
|
IMAP_CERT="$(echo | (openssl s_client -connect "${IMAP_SRV}:993" 2>/dev/null || true) | openssl x509 -fingerprint -sha1 -noout | cut -d'=' -f2 | sed 's/://g')"
|
|
|
|
sed -i'' "s/XXX_REPLACE_USER_XXX/${IMAP_USER}/g;s/XXX_REPLACE_PASS_XXX/${IMAP_PASS}/g;s/XXX_REPLACE_SRV_XXX/${IMAP_SRV}/g;s/XXX_REPLACE_FINGERPRINT_XXX/${IMAP_CERT}/g" "/home/offlineimap/.offlineimaprc"
|
|
|
|
exec offlineimap -c "/home/offlineimap/.offlineimaprc"
|