Ok, here goes my paradoxical question.

For about 1 year into my hobby-ish career, I used to buy my domains and a hosting package from Reseller Club. I purchased their " shared hosting " plan and with the help of the cPanel I was able to host and manage around 7 websites, emails, domain addons for me and my clients.

Now, this month I bought un-manged VPS hosting plan with root access, from another provider. Running on CentOs 6.5, with Nginx, PHP-FPM installed after some hustles, and Goggling I was able to have my sites working without any problem. The only confusing part so far is the e-mail problem. I have no idea how to solve the logical aspect of the problem.

Though, I was able to set up an email for one account using postfix, dovecot, and installed roundcube/squirrelmail and everything worked just fine.

The problem of creating multiple emails for multiple domain, for example, before I switched to VPS, I had 5 clients that had multiple emails like john@foo.com, nina@bar.net .... There does not seem easy way create such type of email, and integrate the backup. the first problem is how do I create multiple email account, without having one to conflict with the other? I have understood that, each email account has it's own directory in the /home folder, but this means if someone from site1 creates an email called contact@site1.com and another client from different domain creates an email called contact@differentsite.net then there would be two folders called contact in home directory. This surely is impossible. Also, as of now, to avoid my website's environment getting messed up with my email environment, I have brought a second VPS. with just 512ram for email service only. I am thinking of installing arch linux since it is a lightweight OS. I would love a feedback on this one too.


  • 1
    Look up "virtual hosting" in the context of email. – a CVn Apr 17 '14 at 11:10
  • @MichaelKjörling Sorry. I don't understand. What do you mean? – Bimlik Apr 17 '14 at 11:16
  • 1
    Honestly (and really, no offense intended), if you don't know what you are doing then you shouldn't be running your own VPS but rather just stick with paying someone else to do the hard stuff; it'll be easier for you and likely less frustration for others. Even more so if you are providing something for others. Use your favorite search engine to look up virtual hosting, but don't forget that "making it work" is only a small part of running an Internet-exposed server. Keeping it secure and properly locked down is not a task to be taken lightly either. – a CVn Apr 17 '14 at 11:24
  • No offense taken. But, I am not as noob as you might think I am. This is not even an error question, more like an idea. I've read some books on linux, plus countless video tutorials. I feel very much comfortable with my VPS host, and I was able to install and do basic security tasks without any problem. I will get there eventually. – Bimlik Apr 17 '14 at 11:37

Basically, you need to configure postfix correctly and set it up for dealing with multiple domain names and virtual aliases.

Have a look at /etc/postfix/main.cf, and search for the line virtual_alias_domains. If it isn't there, add it. The line should contain the domain names that will receive mails:

virtual_alias_domains = site1.com, differentsite.net

Then, add a line to point to the file which will contain your alias mappings:

virtual_alias_maps = hash:/etc/postfix/virtualmaps

Next, make the file (touch /etc/postfix/virtualmaps) and edit it with your text editor. Syntax is pretty straight forward:

contact@site1.com            john
contact@differentsite.net    nina

Save the file, do postmap /etc/postfix/virtualmaps and you should be ready to go.

| improve this answer | |
  • Thanks. I will try this tomorrow. I spent 5 hours struggling with this blog.iandreev.com/?p=849 . which drained the blood out of me – Bimlik Apr 17 '14 at 18:16

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.