To be honest, I don’t have the slightest idea about the intentions of this check. You should run the backup as root anyways, so I agree that root is the only user who MUST have access. so even 700 would be sufficient.
And vice versa, the check currently would succeed even for 005 😃😃
Finally, the script would, by itself, create a directory with 755 if it’s not present 😃
mailcow/mailcow-dockerizedblob/master/helper-scripts/backup_and_restore.sh#L42
This would be a sufficient solution:
if [[ ${1} == "backup" ]] && [[ -w ${BACKUP_LOCATION}) ]]
This just checks if the backup dir is writable for the user running the script. Job done.