6.配置dovecot
编辑/etc/dovecot/conf.d/auth-sql.conf.ext,如果没有此文件可以从/usr/share/doc/dovecot-core/dovecot/example-config/conf.d/auth-sql.conf.ext复制一个过来 ,编辑后的内容如下:

文件:/etc/dovecot$ sudo vi dovecot-sql.conf.ext 上面的路径不对。。

[plain] view plaincopy
29行

# Database driver: mysql, pgsql, sqlite
driver = mysql

[plain] view plaincopy

66行
# Examples:
#   connect = host=192.168.1.1 dbname=users
#   connect = host=sql.example.com dbname=virtual user=virtual password=blarg
#   connect = /etc/dovecot/authdb.sqlite
#
connect = host=localhost dbname=mail user=mail password=mailpassword

[plain] view plaincopy

73行
# Default password scheme.
#
# List of supported schemes is in
# http://wiki2.dovecot.org/Authentication/PasswordSchemes
#
default_pass_scheme = MD5-CRYPT

pop3,imap登录时验证

[plain] view plaincopy
103行
# Define the query to obtain a user password.
password_query = \  SELECT username as user, password, ‘/var/vmail/%d/%n’ as userdb_home, \  ‘maildir:/var/vmail/%d/%n’ as userdb_mail, 150 as userdb_uid, 8 as userdb_gid \  FROM mailbox WHERE username = ‘%u’ AND active = ‘1’
[plain] view plaincopy
134行
# Define the query to obtain user information.
user_query = \  SELECT ‘/var/vmail/%d/%n’ as home, ‘maildir:/var/vmail/%d/%n’ as mail, \  150 AS uid, 8 AS gid, concat(‘dirsize:storage=’, quota) AS quota \  FROM mailbox WHERE username = ‘%u’ AND active = ‘1’
下一步编辑/etc/dovecot/conf.d/10-auth.conf 文件如下[plain] view plaincopy
9行
# Disable LOGIN command and all other plaintext authentications unless
# SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
# matches the local IP (ie. you’re connecting from the same computer), the
# connection is considered secure and plaintext authentication is allowed.
disable_plaintext_auth = yes
[plain] view plaincopy
99行
# Space separated list of wanted authentication mechanisms:
#   plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey
#   gss-spnego
# NOTE: See also disable_plaintext_auth setting.
auth_mechanisms = plain login
[plain] view plaincopy
122行
此处修改不知道是否正确。。。。是否应该加载dovecot-sql.conf.ext这个文件还是加载默认的auth-sql.conf.ext这个文件?##
## Password and user databases
##  #
# Password database is used to verify user’s password (and nothing more).
# You can have multiple passdbs and userdbs. This is useful if you want to
# allow both system users (/etc/passwd) and virtual users to login without
# duplicating the system users into virtual database.
#
#
#
# User database specifies where mails are located and what user/group IDs
# own them. For single-UID configuration use “static” userdb.
#
#   #!include auth-deny.conf.ext
#!include auth-master.conf.ext  #!include auth-system.conf.ext
# Use the SQL database configuration rather than any of these others.
!include auth-sql.conf.ext
#!include auth-ldap.conf.ext
#!include auth-passwdfile.conf.ext
#!include auth-checkpassword.conf.ext
#!include auth-vpopmail.conf.ext
#!include auth-static.conf.ext

接下来,配置dovecot的虚拟邮箱用户目录,编辑/etc/dovecot/conf.d/10-mail.conf改变如下:

[plain] view plaincopy
30行  原来配置已经人工注释。# Location for users’ mailboxes. The default is empty, which means that Dovecot
# tries to find the mailboxes automatically. This won’t work if the user
# doesn’t yet have any mail, so you should explicitly tell Dovecot the full
# location.
#
# If you’re using mbox, giving a path to the INBOX file (eg. /var/mail/%u)
# isn’t enough. You’ll also need to tell Dovecot where the other mailboxes are
# kept. This is called the “root mail directory”, and it must be the first
# path given in the mail_location setting.
#
# There are a few special variables you can use, eg.:
#
#   %u – username
#   %n – user part in user@domain, same as %u if there’s no domain
#   %d – domain part in user@domain, empty if there’s no domain
#   %h – home directory
#
# See doc/wiki/Variables.txt for full list. Some examples:
#
#   mail_location = maildir:~/Maildir
#   mail_location = mbox:~/mail:INBOX=/var/mail/%u
#   mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n
#
# <doc/wiki/MailLocation.txt>
#
mail_location = maildir:/var/vmail/%d/%n
[plain] view plaincopy
107行
# System user and group used to access mails. If you use multiple, userdb
# can override these by returning uid or gid fields. You can use either numbers
# or names. <doc/wiki/UserIds.txt>
mail_uid = vmail
mail_gid = mail
[plain] view plaincopy
172行
# Valid UID range for users, defaults to 500 and above. This is mostly
# to make sure that users can’t log in as daemons or other system users.
# Note that denying root logins is hardcoded to dovecot binary and can’t
# be done even if first_valid_uid is set to 0.
#
# Use the vmail user uid here.
first_valid_uid = 150
last_valid_uid = 150

编辑/etc/dovecot/conf.d/10-master.conf

[plain] view plaincopy

service auth {  # auth_socket_path points to this userdb socket by default. It’s typically  # used by dovecot-lda, doveadm, possibly imap process, etc. Its default  # permissions make it readable only by root, but you may need to relax these  # permissions. Users that have access to this socket are able to get a list  # of all usernames and get results of everyone’s userdb lookups.  unix_listener auth-userdb {  mode = 0600                                //90行user = vmail  group = mail  }  unix_listener /var/spool/postfix/private/auth {                   //96行 去掉注释mode = 0660  # Assuming the default Postfix user and group  user = postfix                               // 与group  手动新增group = postfix          }

改变dovecot的权限,确保vmail用户能正常访问:

[plain] view plaincopy
chown -R vmail:dovecot /etc/dovecot
chmod -R o-rwx /etc/dovecot

6.配置dovecot相关推荐

  1. 配置dovecot 以及邮件相关命令

    文章目录 Dovecot 配置 相关命令 Dovecot 配置 ​ Dovecot 是一款能够为 Linux 系统提供 IMAP 和 POP3 电子邮件服务的开源服务程序,安全性极高,配置简单,执行速 ...

  2. 配置dovecot服务

    3.配置dovecot服务 问题 沿用练习一.二,在已实现Postfix发信功能的基础之上,为了方便邮箱用户收取各自的电子邮件,需要进一步提供专门的收信服务.本案例要求采用Dovecot软件来实现. ...

  3. 配置dovecot服务(3)

     步骤 实现此案例需要按照如下步骤进行. 步骤一:安装 dovecot 软件包 [root@mail ~]# yum -y install dovecot [root@mail ~]# chkcon ...

  4. rhel5之sendmail、dovecot配置

    一.dns的配置: 我的配置如下所示: [root@server2 named]# cat rhel5.com.cn.zone $TTL    86400 @               IN SOA ...

  5. centos dovecot mysql_Centos6.4 配置postfix+dovecot+mysql

    使用Linux用户验证和收发邮件 需要组件 postfix dovecot roundcube postfix 用来收发邮件, 作为SMTP服务器, 监听25端口 dovecot 用作为POP3, I ...

  6. postfix+dovecot+foxmail虚拟用户配置

    本文由ilanniweb提供友情赞助,首发于烂泥行天下 想要获得更多的文章,可以关注我的微信ilanniweb 在前一篇文章<烂泥:Postfix邮件服务器搭建之软件安装与配置>中,我们介 ...

  7. centos7+sendmail+dovecot配置邮件服务

    centos7+sendmail+dovecot配置邮件服务 安装一个新的虚拟机 安装完成.重启系统 配置虚拟机网络 配置虚拟机软件的网关 配置centos静态IP地址 设置centos dns地址 ...

  8. linux+postfix+extmail+dovecot搭建邮件服务器

    一.我们可以重新搭建服务器,也可以利用我前面的搭建方法编译安装,地址: http://wangzan18.blog.51cto.com/8021085/1605480,本次我们使用yum的方法来安装h ...

  9. Sendmail+dovecot+saslauth+rainloop

    环境:CentOS 6.4(最小化安装) 关闭防火墙和selinux Sendmail的配置文件 /etc/mail/sendmail.cf :Sendmail的主配置文件: /etc/mail/ac ...

最新文章

  1. 重磅丨国家发改委公布56个AI支持项目名单
  2. 做一个计算器_2019年初级会计考试考生能不能带计算器?现在统一回复!
  3. 开发日记-20190726 关键词 读书笔记《Linux 系统管理技术手册(第二版)》DAY 16
  4. Python PIPEs
  5. mysql常见数据库设计_常见数据库设计
  6. 微信客服系统开发SDK使用教程-给好友发消息任务
  7. 代号红狗:那些站在微软云起点的中国创业者
  8. JMH在性能测试中的使用
  9. ActiveSync 无法同步解决记录
  10. python--(点餐--元组)enumerate将索引与值一一对应、 模拟手机通信录、 模拟手机通信录--使用集合
  11. 软件开发每个阶段的任务以及产生的文档
  12. 电脑如何防蹭网?使用防蹭网功能杜绝未知设备连接WiFi
  13. 【条形码识别】条形码中数字的识别的matlab仿真
  14. 营业执照编码验证规则(15位和18位
  15. 10大H5前端框架(转)
  16. 电子邮件附件下载器简介
  17. 离线模式:Unresolved dependency: ‘com.xx.xx:xx-xx:jar:x.x.x‘
  18. teamviewer 使用数量到达上限_Teamviewer免费版到达设备上限号就废了?
  19. 英读廊——拔了电源插头为什么要等三十秒再重插?
  20. 转帖:谁动了它们的基因?

热门文章

  1. 3D游戏建模到底需要学习哪些美术基础?新手如何开始学习3D建模?
  2. docker 批量垃圾清理
  3. MSXML操作XML的完整例子
  4. 预训练模型最新综述:过去、现在和未来
  5. 关于室内分布系统中合路器、功分器、耦合器的对比
  6. 在北京租房应该注意什么?
  7. 网站外链和反向链接的区别(怎么区分外链与反向链接)
  8. (MB) MRM域中的物理格式
  9. Java复习第九章 多线程
  10. Quill-强大的富文本编辑器