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:
- You can check blacklists here
- Your server must have MX and reverse DNS records
- You must always have SPF DNS records (many servers reject mail without a valid SPF, GMail for example, here's an explanation and a wizard)
- For general config, your mailserver's HELO response must match your hostname
- Your mailserver is not an open relay - it must be a "closed" relay dedicated to your server - see how here
- Finally, ensure your DNS records' TTL is not too low - 86400 (24 hours) is recommended (some spammers set their TTL very low to regularly update forged DNS records)
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!)
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.
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
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.