I have an AWS EC2 instance running Amazon Linux with Postfix for serving mail. I have only local users -- no virtual users -- and my users and aliases are served via PostgreSQL. My aliases
table in psql looks like this:
alias | email
-------+---------------------------------------------------------------------
doc | | /usr/bin/php /var/www/vhosts/mydomain.com/httpsdocs/app/pipe.php
When I send an email to doc@mydomain.com and tail the maillog, I see this:
May 18 21:22:35 ip-172-30-0-33 dovecot: auth: userdb(?): Username character disallowed by auth_username_chars: 0x7c (username: |/usr/bin/php /var/www/vhosts/mydomain.com/httpsdocs/app/pipe.php@mydomain.com)
May 18 21:22:35 ip-172-30-0-33 dovecot: auth: Debug: userdb out: NOTFOUND#0111
May 18 21:22:35 ip-172-30-0-33 dovecot: lmtp(11981): Debug: auth input:
May 18 21:22:35 ip-172-30-0-33 postfix/lmtp[11980]: 9992660E42: to=<|/usr/bin/php /var/www/vhosts/mydomain.com/httpsdocs/app/pipe.php@mydomain.com>, relay=mail.mydomain.com[private/dovecot-lmtp], delay=0.03, delays=0/0.01/0/0.01, dsn=5.1.1, status=bounced (host mail.mydomain.com[private/dovecot-lmtp] said: 550 5.1.1 <|/usr/bin/php /var/www/vhosts/mydomain.com/httpsdocs/app/pipe.php@mydomain.com> User doesn't exist: |/usr/bin/php /var/www/vhosts/mydomain.com/httpsdocs/app/pipe.php@mydomain.com (in reply to RCPT TO command))
Additionally, it doesn't like the pipe character, nor can I wrap the pipe path in quotes, as those are rejected as well.
What's the solution to getting Postfix to forward emails to doc@ to the script when the aliases are in PostgreSQL?
Thanks for any assistance!
(PS - I'm a total noob at all of this, muddling my way through getting this server set up. Please be gentle...)