Set up the Postfix + Dovecot email server under RHEL6.4. For details, refer to the installation and basic configuration of the Postfix email service in CentOS6.4.
Set up the Postfix + Dovecot email server under RHEL6.4.
Related reading:
Postfix mail service installation and basic configuration http://www.linuxidc.com/Linux/2013-08/88977.htm under CentOS 6.4
Install the mail server Postfix in CentOS 5.5Http://www.linuxidc.com/Linux/2012-05/60010.htm
Build a Postfix Mail Server http://www.linuxidc.com/Linux/2012-12/77167.htm for Red Hat Enterprise Linux 5.4
Postfix (certified) http://www.linuxidc.com/Linux/2012-09/70527.htm for Secure Mail Server in Linux
Lab requirement: Build a mail server (192.168.100.1) that can receive and send emails for the company to provide services to its employees. The Company domain name is linuxidc.com.
1. Modify the mx mail exchange record on the DNS server (192.168.100.2) to ensure that the client can resolve the mail server address
1. Modify the DNS region File
# Vim/var/named/linuxidc.com. zone
$ TTL 3 H
@ In soa linuxidc.com. root.linuxidc.com .(
2014042601; serial
1D; refresh
1 H; retry
1 W; expire
3 H); minimum
NS dns1.linuxidc.com.
In mx 10 mail.linuxidc.com.
Dns1 in a 192.168.100.2
Mail in a 192.168.100.1
......
2. Restart the service
# Service named restart
3. Check whether the client can resolve the issue.
# Host-t mx linuxidc.com 192.168.100.2 // query the MX record of the Target Domain
Using domain server:
Name: 192.168.100.2
Address: 192.168.100.2 #53
Aliases:
Linuxidc.com mail is handled by 10 mail.linuxidc.com.
# Host mail.linuxidc.com 192.168.100.2 // view the resolution result of the email server
Using domain server:
Name: 192.168.100.2
Address: 192.168.100.2 #53
Aliases:
Mail.linuxidc.com has address 192.168.100.1
2. Set up a postfix Mail Server
1. install the software package
# Yum-y install postfix
2. Modify the master configuration file
[Root @ mail ~] # Cd/etc/postfix/
# Postconf-n> tmp.txt // export non-default configuration
# Mv main. cf main. cf. bak
# Mv tmp.txt main. cf
# Vim main. cf
...
9 # inet_interfaces = localhost // listener Port
22 myhostname = mail.linuxidc.com // Mail Server Host Name
23 mydomain = linuxidc.com // region of the email server
24 myorigin = $ mydomain // sender's DNS suffix
25 mydestination = $ mydomain // specify the mail that the Postfix allows to process
26 home_mailbox = Maildir // mail type
3. Check the syntax to start the service.
# Postfix check
# Service postfix start
# Chkconfig postfix on
# Netstat-tulnp | grep: 25 // send mail using SMTP protocol
Tcp 0 0 0.0.0.0: 25 0.0.0.0: * LISTEN 3564/master
Tcp 0 0: 25: * LISTEN 3564/master
4. Create a mailbox user // The Mail User is a system user by default.
# Useradd damao
# Echo 123456 | passwd -- stdin damao
# Useradd tom
# Echo 123456 | passwd -- stdin tom
5. Test the mail sending Function
# Telnet mail.linuxidc.com 25
Trying 192.168.100.1...
Connected to mail.linuxidc.com.
Escape character is '^]'.
220 mail.linuxidc.com ESMTP Postfix
Helo localhost // advertise the client
250 mail.linuxidc.com
Mail from: damao@linuxidc.com // mail sender
250 2.1.0 OK
Rcpt to: tom@linuxidc.com // email recipient
250 2.1.5 OK
Data // email body
354 End data .
Subject: Test mail // subject
Hello, tom // email content
. // Independent. indicates that the email has ended.
250 2.0.0 OK: queued as 9B6463FD97
Quit // exit
221 2.0.0 Bye
Connection closed by foreign host.
6. verify whether the email is successfully sent.
# Ls/home/tom/Maildir/new/
1398426202.v803ibf420m185454.mail.linuxidc.com
# Cat/home/tom/Maildir/new/1398426202.v803ibf420m185454.mail.linuxidc.com
Return-Path:
X-Original-To: tom@linuxidc.com
Delivered-To: tom@linuxidc.com
Received: from localhost (unknown [192.168.100.1])
By mail.linuxidc.com (Postfix) with SMTP id 9B6463FD97
For ; Fri, 25 Apr 2014 23:00:32-0700 (PDT)
Subject: Test mail
Message-Id: <20140426060137.9B6463FD97@mail.linuxidc.com>
Date: Fri, 25 Apr 2014 23:00:32-0700 (PDT)
From: damao@linuxidc.com
To: undisclosed-recipients :;
Hello, tom
For more details, refer to the highlights on the next page.: Http://www.linuxidc.com/Linux/2014-05/101164p2.htm