Hendry Ten
Hendry Ten

Reputation: 1092

PHP as a bridge to an smtp/pop3 server

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 server. Is it possible to be done?

Upvotes: 0

Views: 506

Answers (2)

Robin
Robin

Reputation: 4260

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?

Upvotes: 1

Pekka
Pekka

Reputation: 449395

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.

Upvotes: 1

Related Questions