首先使用yum -y install dovecot* postfix* 來安裝郵件服務(wù)器,,然后... 按下面提供代碼配置服務(wù)器后,,剩下的就是創(chuàng)建用戶與解析域名啦... 【建立用戶的郵箱目錄】 首先建立用戶模板下的郵箱目錄,,以便于建立新用戶時(shí),,相應(yīng)用戶的郵箱目錄自動(dòng)被建立。 [[email protected] ~]# mkdir /etc/skel/Maildir ← 在用戶模板下建立用戶郵箱目錄 [[email protected] ~]# chmod 700 /etc/skel/Maildir ← 設(shè)置用戶郵箱目錄屬性為700 然后再為已經(jīng)存在的用戶建立相應(yīng)郵箱目錄,。 [[email protected] ~]# mkdir /home/webmaster/Maildir ← 為用戶(這里以webmaster用戶為例)建立郵箱目錄 [[email protected] ~]# chmod 700 /home/webmaster/Maildir ← 設(shè)置該用戶郵箱目錄屬性為700 [[email protected] ~]# chown webmaster. /home/webmaster/Maildir ← 設(shè)置該用戶郵箱目錄為該用戶所有 【添加用戶示例】 ①添加用戶:useradd -G 用戶組 -s /sbin/nologin 用戶名 ②設(shè)置用戶密碼:passwd 用戶名 ③添加用戶的sasl認(rèn)證:saslpasswd2 -u szzmzb.com -c 用戶名 【解析域名示例】 主機(jī)名 解析類型 對(duì)應(yīng)值 TTL 優(yōu)先級(jí) 操作 www A 113.105.117.2 900 - 修改 | 刪除 mail A 113.105.117.2 900 - 修改 | 刪除 @ MX mail.szzmzb.com. 900 10 修改 | 刪除 【最后使用foxmail進(jìn)行郵件收發(fā)】 1. [代碼]postfix配置## 不懂的直接 vim /etc/postfix/main.cf 然后復(fù)制下面代碼到你的服務(wù)器上,,修改下相應(yīng)的IP與域名即可 #============================基本配置============================================================= queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix mail_owner = postfix myhostname = mail.szzmzb.com mydomain = szzmzb.com myorigin = $mydomain inet_interfaces = all inet_protocols = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain unknown_local_recipient_reject_code = 550 #mynetworks = 0.0.0.0/0, 192.168.0.0/24, 127.0.0.0/8, 113.105.117.2 mynetworks = 192.168.0.0/24, 127.0.0.0/8 relay_domains = $mydestination alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases home_mailbox = Maildir/ smtpd_banner = $myhostname ESMTP unknow #smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) smtpd_sasl_auth_enable = yes smtpd_delay_reject = no smtpd_sasl_local_domain = $myhostname smtpd_sasl_security_options = noanonymous #smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination,reject_unknown_sender_domain, reject_unknown_hostname,reject_unauth_destination smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 2. [代碼]dovecot配置## 不懂的直接 vim /etc/dovecot/dovecot.conf 然后復(fù)制下面代碼到你的服務(wù)器上,修改下相應(yīng)的IP與域名即可 ## Dovecot configuration file # Protocols we want to be serving. protocols = imap pop3 log_path = /var/log/dovecot.log info_log_path = /var/log/dovecot.info log_timestamp = "%Y-%m-%d %H:%M:%S " # edit conf.d/master.conf. listen = * disable_plaintext_auth = no ssl=no mail_location = maildir:~/Maildir #default_mail_env = maildir:~/Maildir base_dir = /var/run/dovecot/ # Greeting message for clients. #login_greeting = Dovecot ready. #login_trusted_networks = 0.0.0.0/0 #login_access_sockets = #verbose_proctitle = no #shutdown_clients = yes #doveadm_socket_path = doveadm-server dict { #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext } !include conf.d/*.conf #!include_try /etc/dovecot/local.conf |
|