DIỄN ĐÀN NÂNG TẦM TRI THỨC
Would you like to react to this message? Create an account in a few clicks or log in to continue.

CẤU HÌNH MAIL SERVER TRÊN CENTOS 6.0

Go down

CẤU HÌNH MAIL SERVER TRÊN CENTOS 6.0 Empty CẤU HÌNH MAIL SERVER TRÊN CENTOS 6.0

Post  chantroitinhoc Mon Sep 26, 2011 5:25 pm

1. Cài đặt và cấu hình Postfix (SMTP Server):

Cài đặt postfix:

[root@mail ~]# yum -y install postfix

Cấu hình postfix:

[root@mail ~]# vi /etc/postfix/main.cf

Code:

# line 75: uncomment and specify hostname
myhostname = mail.ispace.com
 
# line 83: uncomment and specify domain name
mydomain = ispace.com
 
# line 99: uncomment
myorigin = $mydomain

# line 116: change
inet_interfaces = all
 
# line 119: change if you use only IPv4
inet_protocols = ipv4
 
# line 164: add
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
 
# line 264: uncomment and specify your LAN

mynetworks = 127.0.0.0/8, 192.168.100.0/24
 
# line 419: uncomment (use Maildir)
home_mailbox = Maildir/

# line 545: uncomment, line 546: add

header_checks = regexp:/etc/postfix/header_checks
body_checks = regexp:/etc/postfix/body_checks
 
# line 571: add
smtpd_banner = $myhostname ESMTP
 
# add at the last line
# limit an email size 10M
message_size_limit = 10485760

# limit mailbox 1G
mailbox_size_limit = 1073741824
 
# for SMTP-Auth settings
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_client_restrictions = permit_mynetworks,reject_unknown_client,permit
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject


Tạo tập tin kiểm tra header mail:

[root@mail ~]# vi /etc/postfix/header_checks

Code:

# add at the head
# reject if email address is empty
 
/^From:.*<#.*@.*>/ REJECT
/^Return-Path:.*<#.*@.*>/ REJECT


Tạo tập tin kiểm tra body mail:

[root@mail ~]# vi /etc/postfix/body_checks

Code:

# reject if includes 'example.com' in mail body
 
/^(|[^>].*)example.com/ REJECT



Khởi động dịch vụ postfix:

[root@mail ~]# /etc/rc.d/init.d/postfix start
[root@mail ~]# chkconfig postfix on


2. Cài dịch vu Dovecot (POP & IMAP):

[root@mail ~]# yum -y install dovecot

Chỉnh sửa tập tin dovecot.conf:

[root@mail ~]# vi /etc/dovecot/dovecot.conf

Code:

# line 31: change ( if not use IPv6 )

 listen = *


Chỉnh sửa tập tin 10-auth.conf:

[root@mail ~]# vi /etc/dovecot/conf.d/10-auth.conf

Code:

# line 9: uncomment and change ( allow plain text auth )
disable_plaintext_auth = no
 
# line 97: add
auth_mechanisms = plain login
 

Chỉnh sửa tập tin 10-mail.conf:

[root@mail ~]# vi /etc/dovecot/conf.d/10-mail.conf

Code:

# line 30: uncomment and add
mail_location = maildir:~/Maildir


Chỉnh sửa tập tin 10-master.conf:

[root@mail ~]# vi /etc/dovecot/conf.d/10-master.conf

Code:

# line 84-86: uncomment and add
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix            # add
group = postfix          # add
}

Khởi động dịch vụ dovecot:

[root@mail ~ ]# service dovecot start
[root@mail ~ ]# chkconfig dovecot on

chantroitinhoc
chantroitinhoc
Admin

Posts : 149
Join date : 2008-01-16

http://chantroitinhoc.niceboard.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum