I've read a few articles, including posts on here, but there doesn't seem to be a clear concise answer.
I have CentOS7 running Postfix on an EC2 instance on AWS. I want to direct all emails for a domain (@support.mydomain.com) to a PHP script. The server hostname is not set to the domain (hostname is default ip-1-2-3-4.awsregion.internal.compute).
I have set an MX record for support.mydomain.com to point to www.mydomain.com.
From what I have read, I need a virtual alias
to handle the domain.
I have tried:
- adding
@support.mydomain.com apache@localhost
to/etc/postfix/virtual
- running
postmap /etc/postfix/virtual
- adding
virtual_alias_maps = :hash:/etc/postfix/virtual
andinet_interfaces=all
to/etc/postfix/main.cf
- adding
apache: "|php -q /var/www/mydomain/my-script.php"
- newaliases
- postfix reload
- service postfix restart
/var/log/maillog
shows email a ```454 4.7.1 Relay access denied" error - at least this shows DNS/firewalls are OK ...
Would appreciate where to go from here or a new guide from the start.