I'm in the process of configuring an email platform and I would like to clear some doubts that I have.
When building this system I have 2 options:
- Have PHP doing the connections to my SMTP external server (it's a delivery only server). This is how my network is configured at the moment and I feel it's very heavy on the server.
- Have PHP connecting to my local MTA and having the local MTA (postfix) connecting through SMTP to my external delivery server
I think the option 2 is the preferable one for a couple of reasons:
- Dispatch from the email platform is faster
- PHP processes will finish faster
- Delivery itself will be on postfix (local MTA) responsibility thus creating a new layer on the delivery dataflow providing a lot more abstraction on the PHP platform
- Delivery rules can be defined specifically on Postfix
So, question 1 is if this is the preferable solution or if I should keep option 1?
Bellow is a small representation of what I'm referring in point 2:
+------------+
| |
+---> smtp external backend a ----->| |
| | |
platform -------> local MTA lb ---> smtp external backend b ----->| Delivery |
| | |
+---> smtp external backend c ----->| |
| |
+------------+
Question 2:
If this is the preferable situation how can I create a load balance postfix solution?
I need to be able to easily add and remove smtp servers.
Thank you!