# Advice for building an SMTP  server

## dejima

I am looking for building an SMTP server that could handle sending some millions emails per month.

I am building an application(PHP based) more like a social media that users would be sending messages and invites using the application's internal mail system.

This SMTP server will only be responsible sending these emails.

Currently I am thinking that the web servers will be running on Amazon Cloud while our smtp server will be based on our dedicated servers.

I would like your advice on 

1) What kind of software should I use (postfix, sendmail, etc...)

2) What would be the hardware requirements for such server (CPU, RAM, Storage etc...)

3) How can I restrict that this smtp server is used only for requests send from my application? My Amazon cloud probably won't have static IP addresses expect my load balancers.

4) If the volume of emails is increased to a certain level should I use some kind of load balancing between smtp servers?

Thank you in advance.

----------

## cach0rr0

 *dejima wrote:*   

> I am looking for building an SMTP server that could handle sending some millions emails per month.
> 
> I am building an application(PHP based) more like a social media that users would be sending messages and invites using the application's internal mail system.
> 
> This SMTP server will only be responsible sending these emails.
> ...

 

how will the messages be stored? What you describe, if messages are ultimately stored in e.g. a database, and read by a web frontend, then involving SMTP at all is an unnecessary step

 *dejima wrote:*   

> 
> 
> I would like your advice on 
> 
> 1) What kind of software should I use (postfix, sendmail, etc...) - Postfix wins on scale, security, and simplicity. Exim wins on configurability. Sendmail *can* be win in that commercial support is readily available. I personally am a "postfix guy"
> ...

 

comments in blue above. I may be thinking way overkill for what you intend to do, but when you say millions of messages per day, i start thinking "enterprise class deployment". When you start talking "enterprise class", i.e. "this is going to be a large-scale deployment", your common "all-in-one" LAMP stack is not the best path. But, it can certainly be used temporarily as a test platform for both development and the initial user base. 

HTH

----------

## dejima

Thank you for all your answers.

You are right about "enterprise class deployment". I already have an production environment which will have a load balancer, web servers that will be launching depending on load/traffic, and MySQL servers which will all be hosted on Amazon.

The reason that I am thinking of having a separate SMTP server on my dedicated and not in Amazon is that this way I can have a static IP and mail servers don't tag the emails as spam or even blacklist them. 

Even if messages are stored in the database then in order a user to be notified an smtp should be involved. If the local smtp(of the web servers) is used then it would be probably be tagged as spam or be blacklisted.

----------

