Is it possible if I want to use PHP script to be used as the bridge or the middle man from the clients to the real smtp/pop3 server? The real server is behind a firewall and will not be configured to be accessible for the public. So I need a fake server which just relay the email to the real smtp s开发者_如何学JAVAerver. Is it possible to be done?
I'm fairly sure it is fundamentally impossible to have a PHP script on shared hosting perform the functions of a true POP3 / SMTP proxy.
The requests coming from the clients would be using those protocols, and try to connect to your Godaddy server. That server will either have its own POP3 / SMTP server listening on those ports, or none.
You would have to use a server on which you have full root privileges to do this - but then, you will no longer need PHP, there will be better tools to do that available to you there.
Theoretically you could write a proxy, you'd have to implement the wire-level SMTP / POP3 / IMAP protocols in PHP. This would have to be run a a service (i.e. CLI, not inside Apache). If you need a mail proxy, have you considered nginx?
精彩评论