Read Time:2 Minute, 17 Second
Mục lục
- Install và cấu hình cho Postfix.
- Install và cấu hình cho Dovecot.
- Tạo mail account.
- Setting SSL/TLS cho mail server.
- Install chương trình diệt virus Clamav và Amavisd.
- Video hướng dẫn từng bước cụ thể.
Ubuntu 22.04: Mail server.
Install và cấu hình cho Postfix.
Instal Postfix, cấu hình SMTP server sử dụng SMTP port 25/TCP.
root@mail:~# apt -y install postfix sasl2-bin # Thường thì sẽ cấu hình mặc định. Nhưng ở bài viết này sẽ hướng dẫn config # từng bước bằng tay. Nên ta chọn [No Configuration] +------+ Postfix Configuration +-------+ | General type of mail configuration: | | | | No configuration | | Internet Site | | Internet with smarthost | | Satellite system | | Local only | | | | <Ok> <Cancel> | | | +--------------------------------------+ root@mail:~# cp /usr/share/postfix/main.cf.dist /etc/postfix/main.cf root@mail:~# vi /etc/postfix/main.cf # Dòng 78: Xóa comment out mail_owner = postfix # Dòng 94: Xóa comment out và chỉ định host name. myhostname = mail.vidu.com # Dòng 102: Xóa comment out và chỉ đinh domain name mydomain = vidu.com # Dòng 123: Xóa comment out myorigin = $mydomain # Dòng 137: Xóa comment out inet_interfaces = all # Dòng 185: Xóa comment out mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain # Dòng 228: Xóa comment out local_recipient_maps = unix:passwd.byname $alias_maps # Dòng 270: Xóa comment out mynetworks_style = subnet # Dòng 287: Xóa comment out và add vào phía sau. mynetworks = 127.0.0.0/8 , 10.0.0.0/24 # Dòng 407: Xóa comment out alias_maps = hash:/etc/aliases # Dòng 418: Xóa comment out alias_database = hash:/etc/aliases # Dòng 440: Xóa comment out home_mailbox = Maildir/ # Dòng 576: Comment out và add thêm dòng phía dưới #smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_banner = $myhostname ESMTP # Dòng 650: Set giá trị cho biến. sendmail_path = /usr/sbin/postfix # Dòng 655: Set giá trị cho biến. newaliases_path = /usr/bin/newaliases # Dòng 660: Set giá trị cho biến. mailq_path = /usr/bin/mailq # Dòng 666: Set giá trị cho biến. setgid_group = postdrop # Dòng 670: Comment out #html_directory = # Dòng 674: Comment out #manpage_directory = # Dòng 679: Comment out #sample_directory = # Dòng 683: Comment out #readme_directory = # Dòng 684: Nếu sử dụng IPv6 nữa thì set là [all]. Không thì cứ set ipv4 inet_protocols = ipv4 # Add vào cuối file. # Giới hạn dung lương gửi nhận mail là 10M message_size_limit = 10485760 # Setting SMTP-Auth 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_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject root@mail:~# newaliases # Khởi động lại Postfix root@mail:~# systemctl restart postfix
Video hướng dẫn từng bước cụ thể.
Đang chuẩn bị