Tips for personal domain and mailserver

Soldato
Joined
14 Mar 2011
Posts
5,438
Hey all,

I've heard plenty of references to a method of managing your emails where (please excuse/correct me if I have the details slightly wrong) you do something like:

  • Register a cheap domain name
  • Rent out a small private server (I was already planning to do this for other purposes)
  • Configure a mail server to receive emails for your domain
  • Create one "master" email account which you use for communication but don't give out when signing up for things
  • When signing up to anything else you can then just create extra accounts which forward messages to your main account

The idea being that if any of the extra accounts aren't needed anymore or get compromised you can easily get rid of them or replace them. Are the steps above about right? I thought I had it clear in my head but I went on "godaddy" who I had vaguely heard of and in their pricing list it mentions that the different tiers come with e.g. "100 email accounts" or "500 email accounts" and talks about the amount of storage etc. Does that mean the service there includes some sort of hosting (and hence I don't need the separate server to run the mail server on?)

I'm doing this partly out of curiosity and to learn - so doubt I'd start seriously making use of it until I've had a change to play about and do some testing and such... I have plenty of experience with Linux so no troubles there (though I've never setup a mail server!) Appreciate any advice and experiences on this :) Is there a way I can try some of this out via a trial or without committing any money? Or can I mess about with a local version on a spare machine/VM at home to see how the setup works?
 
I did this about 6months ago :)

I have a VPS running debian and have various domains setup for both hosting and mail.
It works out a lot cheaper than shared hosting and you have more control.

I had experience with doing linux administration (mainly in the form of firewalls and exim MTAs connected to Microsoft Exchange / Active Directory).

I tried a lot of different setups for email but it seemed spam filtering was a huge resource and memory hog :( spamassassin + clamav + mysql was using so much memory.
I spent a week or two just testing things on virtualbox.

In the end I setup email using postfix, dovecot & postscreen with TLS + OpenDKIM + SPF Checking (also with IMAPS / SMTPS for clients)
(also roundcube+nginx+php for webmail if needed - also gives users the ability to do password changes)
I have all of the mail accounts / virtual domains etc in mysql and write the passwords to the database using mysql's encrypt SHA/RAND for SHA salting.

I also wrote my own CLI tools in python for user / domain management.
Setup offsite backups to run nightly.

I would say if you want to learn it's definitely worth it, altho it does take a bit of time and research unless you just use something automated :(

Also for site hosting I use nginx :)
Most of the sites I host are based on nodejs (some php)
mariadb + xtradb is also a good move

My current server has 50 mailboxes and I get an average of 1500 spam blocked every day. (with postscreen greylisting most spammers don't seem to bother my server much now)
The memory usage for running just the mailserver is around 140mb but with all of my nodejs sites the server is sitting around 200-250mb memory usage (100mb is swap mem)

Using spamassassin + postfix + mysql + clamav (iredmail automated) I was nearly maxing out the memory (1024mb) on a test server where I only had 1domain and 3 test email addresses :( so I'm not really sure what would have happened if I put that setup into production on a 1024mb VPS :eek:

Also you can migrate emails quite easily using tools like IMAPCopy
 
Last edited:
Thanks for the helpful response, I'll have a look... Not sure if I quite need all that but it would be interesting to play around with none-the-less

When you say a test server do you mean on the VPS you had already rented?
 
When you say a test server do you mean on the VPS you had already rented?
I did all my testing on virtualbox (I just used debian.test with a few emails and aliases and setup some mail clients to send/receive emails with attachments etc) and then paid for a 1024mb 3-core VPS for a year when I put it up live :)

I guess you can't really load test properly on virtualbox but you can get an idea on how to configure everything and memory usage etc. You can also limit the VM's memory / cores etc :)
Also with virtualbox, if it falls over it's easy enough to start over or even test it until it does fall over :D

I think the only automated mailserver software that worked when I was testing was iRedmail but the memory and cpu usage was too high for me, I think if you have a dedicated server with lots of resource it might be ok but once you look at how it is designed and configured you soon see huge security holes + bad choices they seem to have made regarding core configuration. :( (including the way they configure the SSL certificates)

Some technical information like postscreen configuration seems to be almost hidden/guarded but I think that's really done on purpose to get people to learn how it works rather than just follow a howto or guide (which I kind of agree with because there are too many people who follow howto's and end up crying when stuff fails *looks toward ubuntu users*)
 
Haha yeah I know exactly what you mean

Do you think one of Amazon's free-tier EC2 servers would be okay for it? I know of TeamSpeak server's being run from those and since it's up to 1 year for free I wonder if it might be a good way to try it all out
 
Back
Top Bottom