We have web application hosted on EC2. We use two Ubuntu servers: one is web server, second is database server. Web server has public Elastic IP assigned. Now we want to send notification mails from the application (notifications about changes in the system made by other users). The simplest solution would be to install postfix SMTP server on the web server, and register its Elastic IP in Amazon e-mail server registration form (so they register reverse-DNS, remove mail transfer restrictions etc). I hope this should work without much problem (correct me if I'm wrong).
If the load on the web server increases, we plan to start additional EC2 instances with replicas of web server, setup Amazon's load balancer in front of them, and remap the Elastic IP to this load balancer - so that from outside it still looks like single server. But what with SMTP server then?
I think the best solution would be to run local postfix server on each of those web servers - so that application running on every web server always contacts with local postfix server via localhost. Still, from outside it will look like one mail server running, because of one public IP. But i'm not expert in SMTP stuff, how the process of sending mails work etc.
Perhaps I'm not aware of something, which would cause such setup to break. What do you think, is this approach ok?