I was wondering now, I have developed a Helpdesk System, than uses the PHP imap library to connect to configured mailbox's and "pull" the mails through and create tickets based on the content.
But alas I've run into an issue, some of the servers that our application is deployed on the PHP was not compiled with the --with-imap-ssl
flags.
My first thought for the solution was too:
- login to each of the servers via SSH
- execute
php-config
copy the build flags - recompile php with the
--with-imap-ssl
flag and all other flags from the previous step
But then some clients might not let us recompile PHP as they are utilizing this for other applications. and also this is a bit of a DevOps Nightmare as we will have to do this at Night to make sure that no one is using their servers and make them all aware that we will be recompiling php so we will disable apache for $N period of time whilst this process is happening.
Then i thought another solution would be:
- Get all the different versions of PHP running on the servers
- Ensure that all the openSSL paths are the same
/usr
- Spin up a vm foreach flavor of Linux (CentOS / Ubuntu)
cd /tmp && wget ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz
OR get whatever other versions of IMAP people are running.tar xzf imap-2007f.tar.gz
sudo mv imap-2007f /usr/local
- Compile imap
- Download all required versions of php
- compile with the
--with-imap-ssl
flag - We will then have the required "imap.so" file that we will need for that Specific PHP Version
- scp that imap.so file onto the clients server and restart apache then php will hopefully have imap-ssl support without breaking anything else on the server.
Now the questions are:
- Is there a better way to do this ?
- Will these methods work at all ?
- What steps to follow to automate this process ?