Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I'm trying to install a mail server on my root server. I'm relative new to Linux but not a absolute beginner. 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 '').

I want to have some email adresses (,, 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

In of Postfix I used this:

myhostname              = 
mydomain                =

Is this right?

At least I got it to send mails via Thunderbird and send/receive via telnet. But I'm not so sure about that what I'm doing.

Now I'm looking for some guides which will get me working this. Also some guides which get me into this topic.

share|improve this question
I put this tutorial together a while ago for setting up a mail server on CentOS 5 which might be helpful for you: I use sendmail in the tutorial, not postfix but it still might be helpful for you. –  slm Jun 28 '13 at 2:32

2 Answers 2

myhostname: is the host name of the system (i.e, the system is called mail or 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 If you set it like than it will be **... If you usemyorigin = $mydomain`

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

See here

share|improve this answer
first line is for IPv4, so consider changing your hostname like, for example, mailmorekings localhost.localdomain localhost, change 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 has that IP. –  mirkobrankovic Jun 28 '13 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? 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? –  HeyILikeYouAlot Jun 28 '13 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 than keep If this isn't mail server only –  mirkobrankovic Jun 28 '13 at 13:23
hostname is which is not my but the adress which is given from my root server provider. –  HeyILikeYouAlot Jun 28 '13 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.

share|improve this answer

Your Answer


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.