Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have been slowly learning how to run a linux VPS for a while now. Since I build websites I'm confident with running and securing a web server like nginx... or at least there haven't been any casualties yet.

However, email scares me.

Almost all websites require email to communicate with users. Most of the time email is only needed on my sites during registration as a means of verification. I hardly ever need to accept incoming mail back and I have never sent bulk email. Nevertheless, my lack off understanding of how email servers can be abused is worrying me.

Not only do you need to secure email servers - you also have to prove to the world that your emails are legit and constantly fight against being blacklisted. Insuring my emails 'good name' is not something I want to devote my life too.

What should someone like me do to send emails from my VPS? Should I look for a company to send email through that can worry about this for me? Should I just use google apps until my sites are large enough to worry about? Or is all this just ignorant fear and running your own email server (that actually works) really is easy?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Don't touch incoming email. Let somebody else do it. Set up an account with Google for domains (or one of the billions of other providers) and let them worry about security, spam, webmail, uptime, etc. GMail for domains is pretty awesome but it does mean you have to trust Google with quite a lot of your data.

As for sending email, install postfix and sendmail. Set it up as a local only system, so it's only listening on localhost. This will stop people using you as an open relay and getting your IP marked as spam.

If you host has other clients that are spammers and they don't do anything about it, your whole IP block might get marked as spam. In this case, you can also use external SMTP servers (including GMail) but you usually set this up on a per-application basis.

For example, a Django webapp of mine connects to gmail for SMTP and this is set up in the Django configuration. This is just so I can guarantee emails send and I get a copy in the gmail accounts Sent Mail box. Another site uses another client's email provider (Message Labs) and that's fine too. Everything else on that server uses sendmail+postfix.

Just to be clear, there's nothing inherently wrong with sending email through postfix. It usually gets there and unless you're doing big business through automated emails, you'll probably be fine sending email directly from your server.

This certainly isn't an ignorant fear. Open postfix and spamd processes taking up too many system resources are the bain of my existence. When I adopt clients and I'm troubleshooting their servers' lack of resources, I try and move as many of them to third party services as possible.

share|improve this answer
    
I'm a newbie to email, and I've never set up postfix or anything similar. In terms of ease of setting up, should I just use SendGrid? Cause from what I understand, that just means setting up an account and defining a few constants in my application, right? (I'm using Django, by the way). –  Edan Maor Jul 24 '11 at 14:07
    
Yeah it's pretty simple with Django but let's be clear: that's only for sending email. –  Oli Jul 24 '11 at 14:28
    
But assuming all I want is to send email, there is no downside to just using this external SMTP server? (For future reference, I'm using google apps to receive emails to my domain). –  Edan Maor Jul 24 '11 at 14:43
    
@Edan - No, it's a good option. –  Oli Jul 24 '11 at 15:46

Use google until there is a reason not to. If you are sending mail only, perhaps it is easier to use your own box, perhaps not. One advantage of using Google's outgoing SMTP server is that you are less likely to be spam-filtered by the remote end. The disadvantage is that it is harder to use than a local one, perhaps. You also rely on connecting to Google's servers, which is quite likely not an issue.

If you have to send mail in bulk (not spam, but things like customer opt-in mailing lists) you may want to use a service to do this, as getting on an anti-spam list is easy, and getting off them is hard. I've used www.icontact.com before with good results.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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