diff --git a/imapsync/usr/local/bin/syncctl b/imapsync/usr/local/bin/syncctl index e40ed93..666b76f 100755 --- a/imapsync/usr/local/bin/syncctl +++ b/imapsync/usr/local/bin/syncctl @@ -22,7 +22,14 @@ fi action=${1} task_id=${2} -source /etc/imapsync/${task_id}.env +while IFS= read -r line; do + # Trim leading/trailing whitespace + line=$(echo "$line" | xargs) + # Ignore empty lines + [ -z "$line" ] && continue + # Export the variable + export "$line" +done < /etc/imapsync/${task_id}.env if [[ "$action" == "start" ]]; then