dovecot主要配置文件

主配置文件 /usr/local/etc/dovecot/dovecot.conf

# Protocols we want to be serving.
protocols = imap pop3 lmtp
 
# A comma separated list of IPs or hosts where to listen in for connections. 
# "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
# If you want to specify non-default ports or anything more complex,
# edit conf.d/master.conf.
listen = *

认证文件 /usr/local/etc/dovecot/conf.d/10-auth.conf

disable_plaintext_auth = no
auth_mechanisms = plain login
#!include auth-system.conf.ext
!include auth-sql.conf.ext

ssl配置文件 /usr/local/etc/dovecot/conf.d/10-ssl.conf 设置为no,注释掉ssl_cert,如要启用,则要创建ssl_key

ssl = no
#ssl_cert = </etc/ssl/certs/dovecot.pem
#ssl_key = </etc/ssl/private/dovecot.pem

日志文件 /usr/local/etc/dovecot/conf.d/10-logging.conf 指定的日志文件记得给权限,我指定的777

log_path = /var/log/dovecot.log
auth_debug = yes
mail_debug = yes

邮箱配置 /usr/local/etc/dovecot/conf.d/10-mail.conf uid和gid是开始建立的postfix的id

mail_home = /home/xmail/%d/%n
mail_location = maildir:~/Maildir
first_valid_uid = 1010
first_valid_gid = 1010

配合postfix /usr/local/etc/dovecot/conf.d/10-master.conf

unix_listener auth-userdb {
    mode = 0600
    user = tmail
    group = tmail
  }
# Postfix smtp-auth
    unix_listener /var/spool/postfix/private/auth {
      mode = 0666
    user = postfix
    group = postfix
   }

指定sql配置文件 /usr/local/etc/dovecot/conf.d/auth-sql.conf.ext

passdb {
  driver = sql
  # Path for SQL configuration file, see example-config/dovecot-sql.conf.ext
  args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
}
userdb {
  driver = sql
  args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
}

mysql配置文件 /usr/local/etc/dovecot/dovecot-sql.conf.ext

driver = mysql
connect = host=localhost dbname=postfix user=root password=123456
default_pass_scheme = MD5
password_query = \
  SELECT username,password \
  FROM mailbox WHERE username = '%u' AND active = '1'
##下面的1020 是指邮件存储目录的uid gid
user_query = \
  SELECT maildir,1020 AS uid,1020 AS gid \
  FROM mailbox WHERE username = '%u' AND active = '1'

邮箱目录 /usr/local/etc/dovecot/conf.d/15-mailboxes.conf

##
## Mailbox definitions
##
 
# NOTE: Assumes "namespace inbox" has been defined in 10-mail.conf.
namespace inbox {
 
  #mailbox name {
    # auto=create will automatically create this mailbox.
    # auto=subscribe will both create and subscribe to the mailbox.
    #auto = no
 
    # Space separated list of IMAP SPECIAL-USE attributes as specified by
    # RFC 6154: \All \Archive \Drafts \Flagged \Junk \Sent \Trash
    #special_use =
  #}
 
  # These mailboxes are widely used and could perhaps be created automatically:
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Junk {
    auto = subscribe
    special_use = \Junk
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
 
  # For \Sent mailboxes there are two widely used names. We'll mark both of
  # them as \Sent. User typically deletes one of them if duplicates are created.
  mailbox Sent {
    auto = subscribe # autocreate and autosubscribe the Sent mailbox
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
 
  # If you have a virtual "All messages" mailbox:
  mailbox virtual/All {
    special_use = \All
  }
 
  # If you have a virtual "Flagged" mailbox:
  mailbox virtual/Flagged {
    auto = subscribe
    special_use = \Flagged
  }
}

转载于:https://my.oschina.net/hxily/blog/465090

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值