The script kopano2grommunio.sh was never designed to work with an S3 bucket. But it is easy to modify the script to work with an already mounted attachment store.
Remove this code starting near to line 318:
Write-MLog "Mount attachment directory: $GrommunioMount" "yellow"
# mount the attachment directory
if [[ -z "$KopanoUserPWD" ]]; then
# certificate login
Write-MLog "Please Enter Public Server Key Pass Phrase in next Line" "yellow"
# read -sp 'Pass Phrase:' PASS_PHRASE
ssh-agent -k > /dev/null
sleep 2
#unset SSH_AGENT_PID | tee -a $LOG
#unset SSH_AUTH_SOCK | tee -a $LOG
#
ssh-add
$SSHFS $KopanoUser@$KopanoServer:$KopanoAttachments $GrommunioMount -o idmap=user | tee -a $LOG
ExitCode=$?
Write-MLog "" white
else
# password login
$SSHFS $KopanoUser@$KopanoServer:$KopanoAttachments $GrommunioMount -o idmap=user,password_stdin <<< "$KopanoUserPWD" | tee -a $LOG
ExitCode=$?
Write-MLog "" white
fi
# test for Kopano attachment store, 10 directories 0..9 must exist, we look for 3 directories
if [[ ! -d $GrommunioMount/0 ]] || [[ ! -d $GrommunioMount/5 ]] || [[ ! -d $GrommunioMount/9 ]]; then
echo "$KopanoAttachments resp. $GrommunioMount does not exist. Please check readme on how to setup $0"
exit 1 # terminate and indicate error
fi
Now the script do not mount an store and do not test for the directories.