Hi, everyone!
I'm trying to set up remote e-mail piping on AWS using CodeIgniter and the osTicket documentation doesn't have a section on AWS integration.
https://docs.osticket.com/en/latest/Getting%20Started/Email%20Piping.html
But I did find a good strategy on StackOverflow
https://stackoverflow.com/questions/43851016/piping-email-sent-to-aws-ses-address-to-php-script-on-ec2
To summarize the StackOverflow post, the user said to create a Receipt Rule that would invoke a SNS action on incoming e-mails.
I incorporated the suggestion and now the following happens after a client opens a ticket:
- Admin is sent a new ticket alert e-mail
- Admin responds in e-mail thread
- Admin's response e-mail goes to supportdesk account, AWS Receipt Rule invokes SNS action on received e-mail, SNS action fans out data to https endpoint (should be content of e-mail)
- The https endpoint is https://api/automail.php
- api/automail.php displays the "Error reading stdin. No message" error when visiting the page in the browser
However, writing the CodeIgniter function mail() inside of automail.php, I can send myself an e-mail of the contents of file_get_contents('php://input') which turns out to be a massive string filled with raw data (see screenshot). It looks similar to what AWS documentation says to expect from SNS notifications, but far too long of a string is present in the message value.
If I try to mail myself file_get_contents('php://input') - what osTicket sets $data as - I receive a blank e-mail.
Has anyone encountered this? Or has anyone successfully set up e-mail piping with AWS differently? If so what steps did you use?
Thanks!