VnLamp

Go Back   VnLamp > Khu vực Training > LPI > Mail

Trả lời
 
LinkBack Ðiều Chỉnh Xếp Bài
Configure Mail Server Sử Dụng Postfix và Dovecot
Old
  (#1 (permalink))
 
Status: Offline
Posts: 459
Tham gia: Dec 2007
Administrator
 
patrick's Avatar
Default Configure Mail Server Sử Dụng Postfix và Dovecot - 07-01-2008, 21:7 07-01-2008

1. Cấu hình Mail Server sử dụng Postfix làm SMTP:

Mở file /etc/main.cf lên:

command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
myhostname = mail.test.vn
mydomain = test.vn
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, $mydomain, localhost.$mydomain
mynetworks_style = class
mynetworks_style = subnet
mynetworks = 127.0.0.0/8, 192.168.0.0/24
relay_domains = hash:/etc/postfix/relaydomains
local_recipient_maps =
transport_maps = hash:/etc/postfix/transport
alias_maps = hash:/etc/postfix/aliases
mail_spool_directory = /var/spool/mail
header_checks = pcre:/etc/postfix/header_checks
debugger_command =
PATH=/usr/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
manpage_directory = /usr/share/man
readme_directory = /usr/share/doc/postfix-2.2.10/README_FILES
alias_database = hash:/etc/postfix/aliases
unknown_local_recipient_reject_code = 450
maximal_queue_lifetime = 2d
smtp_destination_recipient_limit = 100
smtpd_recipient_limit = 200

smtpd_sender_restrictions =
permit_mynetworks,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
reject_rhsbl_sender dsn.rfc-ignorant.org

mailbox_size_limit = 1004857600
message_size_limit = 20971520

body_checks = regexp:/etc/postfix/body_check

smtp_sender_dependent_authentication = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

permit_mynetworks, reject_unauth_destination
html_directory = no
queue_directory = /var/spool/postfix
mail_owner = postfix

2. Configure Dovecot (POP3 & SMTP) /etc/dovecot.conf

protocols = imap pop3
imap_listen = *
pop3_listen = *
ssl_disable = yes
login_dir = /var/run/dovecot-login
login = imap
login = pop3
mbox_locks = fcntl
auth = default
auth_mechanisms = plain
auth_userdb = passwd
auth_passdb = pam
auth_user = root

Sau khi chúng ta cấu hình xong postfix và dovecot xong chúng ta có một mail Server hoàn chỉnh.
  Send a message via Yahoo to patrick  
Trả Lời Với Trích Dẫn
Old
  (#2 (permalink))
 
Status: Offline
Posts: 35
Tham gia: Dec 2007
Member
 
loveit's Avatar
Default 12-01-2008, 13:12 12-01-2008

nhớ thực hiện thêm bước sau nửa các bạn ah.
rpm -e --nodeps sendmail


~~~~~~~~~~~~~~~~~~~~~~ |
!。*˚ ˚ ˛ ˚ ˛ ° ˛ ˚ ˛ * _Π_____|>
!。*˚ ˚ ˛ ˚ ˛ •˛ •˚ * / ______/~\
!。*˚ ˚ ˛ ˚ ˛ •˛ •˚ *| 田田 | 門| ˚

################ ####
   
Trả Lời Với Trích Dẫn
Old
  (#3 (permalink))
 
Status: Offline
Posts: 29
Tham gia: Dec 2007
Member
Default 13-01-2008, 02:13 13-01-2008

Các file cấu hình trên chạy tốt với CentOs 4.x, tuy nhiên CentOS 5.x có 1 số thay đổi. Tập trung nhiều nhất là trên file cấu hình của dovecot.
Nếu anh có thời gian thì post thêm cách cấu hinh trên CentOS 5.x luôn nha. ^_^
   
Trả Lời Với Trích Dẫn
Old
  (#4 (permalink))
 
Status: Offline
Posts: 29
Tham gia: Dec 2007
Member
Default 13-01-2008, 02:13 13-01-2008

Cho em đề nghị thêm 1 cái nữa là anh post luôn cách cấu hình trên QMail. QMail hiện nay rất mạnh, Yahoo va Gmail sử dụng hệ thống QMail này. ^_^
   
Trả Lời Với Trích Dẫn
Old
  (#5 (permalink))
 
Status: Offline
Posts: 368
Tham gia: Dec 2007
Member
 
atula's Avatar
Default 13-01-2008, 13:13 13-01-2008

@nhutminh008: bạn phải tự tìm hiểu đi chứ.Cấu hình bị lỗi thì mọi người sẽ giúp.Như vậy mới mau tiến bộ.
  Send a message via Yahoo to atula  
Trả Lời Với Trích Dẫn
Old
  (#7 (permalink))
 
Status: Offline
Posts: 601
Tham gia: Dec 2007
^..^
 
hautp's Avatar
Default 14-01-2008, 08:14 14-01-2008

Tặng bạn vài tài liệu về mail

http://download.vnlamp.com/Books/Mail/

thay đổi nội dung bởi: hautp, 27-06-2008 lúc 08:27 27-06-2008.
   
Trả Lời Với Trích Dẫn
Old
  (#8 (permalink))
 
Status: Offline
Posts: 17
Tham gia: Jan 2008
Junior Member
Default 19-01-2008, 16:19 19-01-2008

Có ai post cấu hình Dovecot trong CentOS 5.0 duoc ko ? em đang cần cái đó, nó không giống như 4.4. Thanks !
   
Trả Lời Với Trích Dẫn
Old
  (#9 (permalink))
 
Status: Offline
Posts: 601
Tham gia: Dec 2007
^..^
 
hautp's Avatar
Default 19-01-2008, 16:19 19-01-2008

Mình thấy ở đây có hướng dẫn nè
http://www.howtoforge.com/centos-5.1...p-ispconfig-p5 ( centos 5.1 )
http://www.howtoforge.com/perfect_setup_centos5.0_p5 ( centos 5.0 )

Bạn nên xem từ đầu thì hay hơn !
   
Trả Lời Với Trích Dẫn
Old
  (#10 (permalink))
 
Status: Offline
Posts: 7
Tham gia: Jan 2008
Junior Member
Default 30-01-2008, 11:30 30-01-2008

Hi All

Mình vừa mới cấu hình cái dovecot trên cenos5. file config của mình như sau:
Trích:
protocol imap {
listen = *:10143
ssl_listen = *:10943
}
protocol pop3 {
listen = *:10100
}
ssl_disable = yes
login_dir = /var/run/dovecot-login
login_chroot = yes
login_user = dovecot
#login = imap
#login = pop3
mbox_read_locks = fcntl
mbox_write_locks = dotlock fcntl
auth default {
passdb passwd-file {
args = /etc/dovecot.deny
deny = yes
}
passdb pam {
driver = passwd-file
args = /etc/passwd.dovecot
driver = passwd
}
userdb passwd {
args = /etc/passwd.dovecot
driver = passwd
}
user = root
}
Nếu mình mở cái login = imap va login = pop3
Trích:
Warning: Ignoring deprecated 'login' section handling. Use protocol imap/pop3 { .. } instead. Some settings may have been read incorrectly.
Warning: Ignoring deprecated 'login' section handling. Use protocol imap/pop3 { .. } instead. Some settings may have been read incorrectly.
Lỗi phát sinh khi mình chạy lệnh dovecot -n

nếu mình bỏ login = pop3 va login = imap
Trích:
listen: *:10143
ssl_listen: *:10943
ssl_disable: yes
login_dir: /var/run/dovecot-login
login_executable: /usr/local/libexec/dovecot/imap-login
auth default:
passdb:
driver: passwd-file
args: /etc/dovecot.deny
deny: yes
passdb:
driver: passwd
args: /etc/passwd.dovecot
userdb:
driver: passwd
args: /etc/passwd.dovecot
Ai có thể giải thích cho mình nguyên nhân tại sao ko?
   
Trả Lời Với Trích Dẫn
Trả lời


Ðiều Chỉnh
Xếp Bài

Quyền Sử Dụng Ở Diễn Ðàn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Smilies đang Mở
[IMG] đang Mở
HTML đang Tắt
Trackbacks are Mở
Pingbacks are Mở
Refbacks are Mở


Múi giờ GMT. Hiện tại là 00:23 23-05-2012.