I have made an email forward for a hosted domain example.com to point to a local alias example-alias@localhost to automatically process incoming emails, like this in the /etc/aliases: example-alias: "| /opt/php-7.1/bin/php /var/www/example.com/web/script.php shop_emailOrderImport:mail " It has been in use for years and it is working. But now that I wanted to do adjustments in the ISPConfig GUI -> Email -> Email Forward -> Save I get the following: "The destination contains at least one invalid email address." It appears the forwarding email validation is not able to accept @localhost as a valid email adress anymore, or have I been doing something wrong all the time?
Try using @localhost.localdomain instead plus take care that you have localhost.localdomain in /etc/hosts too.
you could check your postfix' master.conf and your /etc/hosts most systems have a localhost.local or localhost.internal configured, this validates the email syntax and should be delivered local aswell. Maybe you need to adjust your script and configuration to fetch those.