# 设置域名 78 # The mydomain parameter specifies the local internet domain name. 79 # The default is to use $myhostname minus the first component. 80 # $mydomain is used as a default value for many other configuration 81 # parameters. 82 # 83 mydomain = test.com
# 设置发件后缀 93 # 94 # For the sake of consistency between sender and recipient addresses, 95 # myorigin also specifies the default domain name that is appended 96 # to recipient addresses that have no @domain part. 97 # 98 #myorigin = $myhostname 99 myorigin = $mydomain
# 监听所有端口 110 # 111 # Note: you need to stop/start Postfix when this parameter changes. 112 # 113 inet_interfaces = all 114 #inet_interfaces = $myhostname 115 #inet_interfaces = $myhostname, localhost 116 #inet_interfaces = localhost (注意屏蔽该行,作用:只监听回环端口)
# 设置允许发件的域名 161 # 162 # See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS". 163 # 164 mydestination = $mydomain
# 设置监听的端口 260 # You can also specify the absolute pathname of a pattern file instead 261 # of listing the patterns here. Specify type:table for table-based lookups 262 # (the value on the table right-hand side is not used). 263 # 264 mynetworks = 0.0.0.0/0
# 设置发件存储位置 412 # 413 # The home_mailbox parameter specifies the optional pathname of a 414 # mailbox file relative to a user's home directory. The default 415 # mailbox file is /var/spool/mail/user or /var/mail/user. Specify 416 # "Maildir/" for qmail-style delivery (the / is required). 417 # 418 #home_mailbox = Mailbox 419 home_mailbox = Maildir/
[root@centos-linux ~]# vi /etc/sysconfig/saslauthd
5 # Mechanism to use when checking passwords. Run "saslauthd -v" to get a list 6 # of which mechanism your installation was compiled with the ablity to use. 7 MECH=shadow
# 配置完之后开启服务,并设置开机启动 [root@centos-linux ~]# chkconfig saslauthd on [root@centos-linux ~]# service saslauthd start 正在启动 saslauthd: [确定] [root@centos-linux ~]# service saslauthd status saslauthd (pid 1636) 正在运行...
[root@centos-linux ~]# vi /etc/dovecot/conf.d/10-auth.conf
1 ## 2 ## Authentication processes 3 ## 4 5 # Disable LOGIN command and all other plaintext authentications unless 6 # SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP 7 # matches the local IP (ie. you're connecting from the same computer), the 8 # connection is considered secure and plaintext authentication is allowed. 9 disable_plaintext_auth = no
设置邮箱存放位置
由于24行的样本位置即是postfix的默认发件位置,所以解除该行屏蔽即可。
1 2 3 4 5 6 7 8 9 10 11 12 13
[root@centos-linux ~]# vi /etc/dovecot/conf.d/10-mail.conf
21 # 22 # See doc/wiki/Variables.txt for full list. Some examples: 23 # 24 mail_location = maildir:~/Maildir 25 # mail_location = mbox:~/mail:INBOX=/var/mail/%u 26 # mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n 27 # 28 # <doc/wiki/MailLocation.txt> 29 # 30 #mail_location = 31
好了,做完以上操作后,基本上收件服务器的配置就完成了。
然后配置下开机启动,以及开启服务。
1 2 3 4 5 6
[root@centos-linux ~]# chkconfig dovecot on [root@centos-linux ~]# service dovecot start 正在启动 Dovecot Imap: [确定] [root@centos-linux ~]# service dovecot status dovecot (pid 1556) 正在运行... [root@centos-linux ~]#