marcel
By:
marcel

How to setup e-mail for use with Outlouk / Mailclient with Virtualmin

December 27, 2013 6.4k views
Hello, I have setup mail.mydomain A and MX records, and added user myname@mydomain.com to virtualmin. How can I setup mail so that I can use it in Outlouk or any other mail client via IMAP and POP? I have searched for tutorials, found other questions, but all with differten options. Is there a tutorial or guide on how to set this up? Also, in my previous hosting experiences it was often possible to use some general mailserver, like mail.thehost.com. Whatever domain I used, I could authenticate on their mail server as long as I created my mail account in their directadmin panel. In my case I do have a simple setup of main and subservers, with 3 simple lightweight sites. Is it possible to have the subservers (as virtualmin calls them) let use the mailserver of the main site? This would spare me lots of time for future domains/mailaccounts.
11 Answers
"I have setup mail.mydomain A and MX records..."

Where, i.e. which DNS control panel? To which nameservers did you point your domain?

"How can I setup mail so that I can use it in Outlouk or any other mail client via IMAP and POP?"

Install the Postfix + Dovecot Webmin modules.

"In my case I do have a simple setup of main and subservers, with 3 simple lightweight sites."

Unless you already know how to use it, efficiently, Virtualmin -- or any control panel, for that matter -- might be a bit of overkill for 3 sites/domains.
Hi Pablo, thanks for your answer! I pointed my domain to digitaloceans nameservers (because my registart did not support glue records and stuff, so I was not able to setup own DNS). In Digitalocean I added mail.mydomain.com for the main domain.

I will install postfix + dovecot modules.

I need virtualmin because I need a scalable solution, which for now are only 3 sites, but are going to be much more in the future. And to access mail, create mailadresses/user, etc I found it easy to use a controlpanel since I am not going to do this by myself in the future, but someone with no technical skills. Virtualmin seems the best solution with many features. Or are you recommending another (free) controlpanel for basic website hosting and e-mail management?

Thanks!
Oh, and what I did not get out your comment? Is it possible to have subservers use the maildomain of the mainserver?
Hi, I now have setup Dovecot and Postfix. I can connect via SMTP to my mail.rootdomain.com with a user added there, although I can only receive mails, not send.

But email for my domain which is a subserver of rootdomain.com does not work. I cannot connect via either mail.rootdomain.com or mail.subserverdomain.com. Both failes when trying to connect. Email for domain is enabled and my rootdomain as well my subserverdomain do have mx records from mail.domain to the IP of the VPS.

What to do? I need to setup e-mail, but even sending an email to myuser@subserverdomain.com does not work, the mail never gets to the user if I check its inbox with webmin postfix.

Anyone? I can receive but not sent mails:
The following error appears in the mail. log:42C06629C7: to=, relay=none, delay=312, delays=311/0.01/0.94/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for
name=domain.com type=MX: Host not found, try again)
That is the error
Looks like a DNS error, can you post a screenshot of your DNS records?
Thank you for your reply. I have uploaded the screen to http://www.filedropper.com/dns For privacy I made my domainname and the last part of the IP`s blank. All the blank parts are the same for domain name.

Thanks in advance!
Hi! It seems that I have been able to fix it. The files var/spool/postfix/etc/resolv.conf and etc/resolv.conf differs. I have now added these records to both:
- 127.0.0.1
- 4.4.4.4
- 8.8.8.8
It is now working from virtualmin, but not yet from my mailclient
Yeah! Was just configuration. It is now working in Outlouk too.

Then one more final question: I now have mail up&running for 2 domains on my VPS, however, I would like to have one central mailserver (my main virtaulmin server). I will create up to 10 light sites (sub-servers), but I don`t want to go through the email configuration part for every sub-server. Is that possible? To automatically let users for sub-servers be using the mailserver of the main server? It is kind of a shared hosting idea, where it is often possible to do so.

Thanks!
Glad to hear that! :]

You can create a wildcard MX record but that would apply to www.yourdomain.com too, simply name the MX record "*" and it should apply for every subdomain under yourdomain.com.
Have another answer? Share your knowledge.