I'm trying to install a mail server on my root server.

There are many many how to's on the internet I tried to get my own mail server with IMAP/SMTP. Also maybe some virus/spam detection.

I've got a Root Server (CentOS 6.4) and a own domain (let us say 'morekings.com').

I want to have some email adresses ([email protected], [email protected], etc). Nice would be some kind of encryption (ssl/tsl). But I have no official cert.

Roughly speaking I removed sendmail, installed postfix and cyrus and configured it. Among others for example I tried this tutorial https://www.digitalocean.com/community/articles/how-to-install-postfix-on-centos-6

In main.cf of Postfix I used this:

myhostname              = mail.morekings.com 
mydomain                = morekings.com

Is this right?

At least I got it to send mails via Thunderbird and send/receive via telnet.


2 Answers 2


myhostname: is the host name of the system (i.e, the system is called mail or mail.example.com). You can find it in /etc/hosts or /etc/hostname

mydomain: is the domain name for the email server (it can be a real or fake domain name). So when you add a mail user foo for your configuration his mail will be [email protected]. If you set it like mydomain=mail.morekings.com than it will be *[email protected]*... If you usemyorigin = $mydomain`

This is the default settings on postfix, if you don't specify mydomain.

See here

  • first line is for IPv4, so consider changing your hostname like, for example, mail.morekings.com mailmorekings localhost.localdomain localhost, change HOSTNAME=mail.morekings.com in /etc/sysconfig/network and do /etc/init.d/network restart or like in example here . Ofcourse if you have public IP or you will be relaying you mail to some other server, you need to tell your DNS that mail.morekings.com has that IP. Jun 28, 2013 at 13:11
  • Sorry that I deleted my comment. I just wanted edit it again but it wasnt possible anymore. I'm really new to this stackexchange network. I know this is a little bit off topic and doesnt treat my question but: Why do I have to change my hosts file? www.morekings.com forwards to my public IP adress already. Is it just for internal behaviors? In my etc/sys/config/network also only is this line: NETWORKING=yes. I guess I have to read some more about this. Do you maybe have some helpfull article for me? Jun 28, 2013 at 13:15
  • what is the output of hostname, if you already registered that hostname with your DNS, than in postfix: myhostname=<output you get from hostname>, and if it's morekings.com than keep mydomain=morekings.com. If this isn't mail server only Jun 28, 2013 at 13:23
  • hostname is xxxxx.servers.jiffybox.de which is not my morekings.com but the adress which is given from my root server provider. Jun 28, 2013 at 13:26

Take a look at the ISPmail tutorials, their are made for Debian releases but it's easy to modify them for CentOS. They are not only explaining how to install and configure basic services but how to put them all together in to a professional mail server with antivirus and spam filters.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .