I’m working on a small project for my company here. We have a situation where we have email hosting through Everyone.net and are trying to migrate our hosting away from them while retaining users folders/data as we IMAP copy to our inhouse server.
However we’ve ran into a problem where Everyone.net will not give us access to usernames/passwords so we can plug those into our IMAP copy applications to do the actual transfers. Instead we are left with the only solution is to create a php script that sits between the user login screen and the Everyone.net server so that when a user logs in, their information is sent to a secure location on our inhouse server in the awaiting IMAP program that will then later transfer data from Everyone.net to our inhouse server. Btw, users have been notified (we only have about 70) that we support which are clients and which have signed off agreeing to this.
So currently I have started to write a small PHP program to do this but am having problems getting it to fully work. On the main page we have an HTML FORM that that normally sends the username/pass info straight to a PERL.PL script on Everyone.net servers. I have written the PHP code thus far to instead use the form action of sending it to a local login.php page.
On the Login.php page it gets the variables from the first page via $_POST[‘variable’] ability. I then gather the username and password testing my own account that it indeed has the right information. I pass those variables into opening a cURL_init connection to the everyone.net/email/scripts/logon.pl website.
I then use CURLOPT_POSTFIELDS to pass the two fields onto the everyone.net server and execute the program and then close the curl connection. However when I run a sample login, instead of the php program taking me to the everyone.net site and logging me in, it sits on the login.php (local) page pulling the everyone.net page to me looking like it errored out logging in.
Am I doing this right? Is there ANYWAY to be able to use PHP to take HTML form information and actually log in and manipulate inside of the everyone.net email service? I know I must be missing something here… help!