I always post on here and solve my own answer, but at least it'll do someone else some good.
Yeah so for whatever reason, my server also had 7.0+ versions of PHP installed and it was causing weird issues.
So I made sure I had mysqli installed for php5.6
apt-get install php5.6-mysqli
I then checked my php version
php -v
Noticed it was using v7.3, so I then I ran a extremely useful PHP update config command I was not familiar with:
update-alternatives --config php
This should let you choose what version you want to use.
I then made sure the mysqli mod was enabled:
phpenmod mysqli
Then restarted the apache2 server
service apache2 restart
And now its working fine.
Sorry for the BS forum post. Hopefully this will resolve someone elses issues.
Make sure pipe.php has the correct permissions as well should be in the postfix group and owned by www-data and have the correct read-write perms.
Make sure to insert your user accounts into the alias file in /etc/aliases, as follows:
# See man 5 aliases for format
postmaster: root
osa: "|/var/www/html/osticket/upload/api/pipe.php"
osaccounting: "|/var/www/html/osticket/upload/api/pipe.php"
osap: "|/var/www/html/osticket/upload/api/pipe.php"
oscgajdzik: "|/var/www/html/osticket/upload/api/pipe.php"
osinsurancerequest: "|/var/www/html/osticket/upload/api/pipe.php"
osramorales: "|/var/www/html/osticket/upload/api/pipe.php"
Obviously change the username (on the left) and the path (on the right) accordingly based on your server setup.
And I cant stress this enough if you're using Postfix, you NEED TO RUN:
newaliases
Otherwise Postfix will not take into consideration any changes you have made in the 'aliases' configuration file.
Other troubleshooting steps:
-CHECK YOUR LOG FILES -> /var/log/mail.log
-Create a php file you can navigate to on your folder with the following code inside:
<?php
phpinfo();
?>
When you go to that page, it should display all the PHP information on and about your server.
Make sure to remove this file once you're done troubleshooting as it is a huge security risk.
You can close this mods! Thanks for giving me a place to vomit my problems and thoughts.