I have currently set up my web application on Amazon EC2 server. As a well known fact sending email from EC2 has a problem. As a cheap and long lasting solution instead of using "authsmtp" is it possible to rent a server and use it as a Mail Server? I am currently looking for cheap hosting which will give me root access so that it can be configured and used as a relayhost. I am curently using Postfix as MTA. Has any one implemented this before? I am curious about its feasibility of this solution. I guess common requirements are: 1: Dedicated IP which is not black listed. 2: Open relay( open to my Server only) Any Tips for Header configurations to keep the mails out of spam folder. This is like exactly cloning authsmtp for personal use. Any suggestions for other Mail Server software instead of Postfix? Another problem is Reverse DNS for this server. Should PTR entry be present if a server is used as a relayhost?


is it possible to rent a server and use it as a Mail Server

Definitely, this is the solution my company implements. If you're not too worried about the time it takes to open an SMTP connection, you could use any free (gmail) account to send your mail too - you'll still need DNS config, and it's slow, but you'll get the mail sent as if it were despatched from the account itself.

I have recently answered some of these points. In summary, for config and prevention of "spam" tagging:

Any suggestions for other Mail Server software instead of Postfix?

Not unless you use a remote SMTP server from your code, and this is slow. Qmail is the only real linux alternative: it's slow, cumbersome and irregularly updated. I wouldn't recommend it.

Another problem is Reverse DNS for this server. Should PTR entry be present if a server is used as a relayhost?

I believe DNS records (including reverse records) are always required: there are many different providers who check slightly varying parameters, so be sure to verify your configuration on every major provider (if possible!)

  • Thanks Andy. Can you suggest some Hosting services? Possibly cheap and can be configured as relayhosts for Mail. – Sujay Oct 8 '09 at 17:42
  • The only hosting company I have ever been happy with is Rackspace, however they are not cheap :) Otherwise anybody who will host a linux box would do, although it's worth notifying them of your intentions beforehand. – Andy Oct 9 '09 at 14:31

You're probably better off paying someone to do that hosting for you. You don't want to do all the work to keep a mail server running, and it sounds like you'd take quite a while to get started on it. Outsource the stuff that you don't care about :)

That being said, yes you could do that. Mattering on load, you could probably go with a VPS running whatever distro you're comfortable with. Postfix isn't too bad to set up, and configuring it to accept mail from a set IP (your EC2 instance) wouldn't be hard at all.

You could also configure authentication there, and set up a mail server on your EC2 instance which relays through your mail server and knows how to authenticate. That way if you need to change IPs on your EC2 (I don't know if you get allocated one or if it can change) you won't have to mess with the mail server.

  • For a quick overview of possible vendors, there's a chart here: ( tomuse.com/… ) Before you pick one, it would be a good idea to do a quick check through the Spam-L mailing list archives to make sure they don't have a reputation as a spam-friendly hosting service, otherwise you'll likely run into blacklisting issues – gharper Jul 10 '10 at 18:37

Any virtual dedicated server would do this fine. You just go to a company like slicehost, order a basic one, choose your preferred OS for it, and it'll be ready in no time. Log in, setup your mailserver, configure firewall etc., and you're done.

  • 1
    @Lee B: If you have past experience in this domain, then it's probably easy for you. And you're right about the capacity issue, any VPS should be fine for a few thousand emails per day. I don't like to see the task almost trivialized though... Mail deliverabilty is an ongoing arms race between spammers and the countermeasures that ISPs take, and companies who need to send legitimate email can become unintended victims. Additionally there is an upkeep to keeping a Internet server secure, both in terms of installing security updates, and periodic maintenance. There is work in the DYI approach... – Jesper M Oct 8 '09 at 18:01
  • Yes, but I'd expected that you know all that, and you've confirmed it here, so I didn't mention it. If there's anything else you're unsure of, ask the question, but it would be silly of me (and patronising) to spell it all out if you likely don't need to know :) – Lee B Oct 8 '09 at 18:22
  • p.s.: I'd definitely recommend postfix. It's the nicest mail server I've used from an administator's perspective, and is often held up as an example of great coding/software design, too. – Lee B Oct 8 '09 at 18:26
  • Thanks for the suggestion Lee. This is a serious problem with EC2. I hope they do something to improve upon it. Moreover we end up spending about 100$ a month for an instance and need to spend some more just for the mail server.Apart from that the resources spent in configuring it and testing it.Most solutions I got were suggesting using relayhost like authsmtp so I was wondering if this would work. – Sujay Oct 8 '09 at 20:02

You could also Google down a few smarthost providers and subscribe to their service to send out email.

The EC2 issue isn't the headers, it's the source IP.


It could be caused by the previous owner of that IP address .. Get to know the allocated IP address and check it againts RBL and check the IP address reputiation againts senderbase

http://www.senderbase.org/ http://www.dnswatch.info/dns/rbl-lookup

Another tips is to set your Reverse DNS entry for the IP address and match with the forward entry. Setting up SPF / DKIM entry for your domain also help as more and more people adopting SPF.

If you are sending a lot of email the deadbeats ticks : Postfix Stagger/Rate Limit Outbound Mail


You may want to look into a VPS solution for your mail server needs. There are many available, most are likely inexpensive. I've used VPSLink (http://vpslink.com) for a few years for both private and commercial products, and have had mostly good experiences. At this time, their lowest offering will get you a barebones VPS for about eight US dollars per month.

Some caveats I've run into on a VPS solution:

  • It won't run java (at least, not on OpenVZ). There may be solutions for this.
  • It will likely not have a usable MAC address. This could affect any software that generates UUIDs, though there are proscribed ways around this (see RFC 4122 for more details).

You can have Amazon setup a PTR for your EIP. This is the form to use for that.



You could go to all this trouble setting up and maintaining your own Postfix server, and that might be the way to go if you want mail services other than just sending out on behalf of your web servers. However, it'll be cheaper and easier to just have somebody else do it.

SendGrid Basic compares pricewise to a fairly cheap VPS host, but will be a lot more stable and has more features you don't need to maintain yourself. If you're sending out a lot more emails than that, the features of Silver and above will be worth your while.

If you're particularly cheap then I've seen people create a Gmail account and use the Google smtp servers from their web apps. I wouldn't like to comment on how sensible that is, but it seems to work for them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.