views:

35

answers:

2

Here's the thing. I need a daemon running on the server which basically will open an smtp connection, then it will expect calls to the process to send e-mails through the opened connection.

This is to avoid connecting to the smtp every time, instead I can receive multiple calls to the process but connection only one time.

By the way, the SMTP always authenticates with the same user and password, no need of a different authentication by each user.

Does this make any sense?

A: 

You could use a php mailing class that connects only once to the smtp server and uses this connection for all the emails that are sent during the scripts execution. If I'm not mistaken pear php will do that.

DCC
Nop, we need the connection alive after the script execution, that's why we need a daemon service.
paterlinimatias
A: 

I think you should seriously consider using an existing MTA which can do authentication and queuing, then just send the messages directly to there and let it relay.

Use (for example), sendmail. This is not a recommendation just an example. Make your own choice.

Making a custom server to do all of this is fraught with problems and will definitely have interoperability problems (because SMTP is such a bag of crap)

MarkR
There is an MTA, but we need to hit the MTA through an SMTP, so we need a daemon to keep de connection opened to the smtp so it doesn't need to connect again every time.
paterlinimatias
That doesn't sound like a good reason. I'm talking about you running your own MTA locally on the box. This is a good idea and you should do it in dev as well as production.
MarkR