If you execute the script from within a chrooted shell, it might not be able to find postqueue as that is located outside the chrooted shell. Instead, try to
a) run the script as a system user account such as "root" or a system user with less privileges but enough privileges to run postqueue...