ZhangHuangbin wrote:Can you check file /etc/passwd, which user has /var as HOME directory? or any setting in dovecot use /var directory?
[root@mail log]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
distcache:x:94:94:Distcache:/:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
exim:x:93:93::/var/spool/exim:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
webalizer:x:67:67:Webalizer:/var/www/usage:/sbin/nologin
squid:x:23:23::/var/spool/squid:/sbin/nologin
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
pcap:x:77:77::/var/arpwatch:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
avahi:x:70:70:Avahi daemon:/:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
avahi-autoipd:x:100:102:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin
xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
sabayon:x:86:86:Sabayon user:/home/sabayon:/sbin/nologin
jack:x:500:500::/home/jack:/bin/bash
dovecot:x:101:103:Dovecot IMAP server:/usr/libexec/dovecot:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
clamav:x:102:104:Clam Anti Virus Checker:/var/clamav:/sbin/nologin
ldap:x:55:55:LDAP User:/var/lib/ldap:/bin/false
amavis:x:103:105:Amavis email scan user:/var/amavis:/bin/sh
vmail:x:501:501::/var/vmail:/sbin/nologin
policyd:x:502:502::/home/policyd:/sbin/nologin
iredadmin:x:503:503::/home/iredadmin:/sbin/nologin
iredapd:x:504:504:iRedAPD daemon user:/home/iredapd:/sbin/nologin
zhb:x:505:50::/home/zhb:/bin/bash
lanever:x:506:506::/home/lanever:/bin/bash
no user using /var as home directory
[root@mail etc]# vi dovecot.conf
#
# File generated by iRedMail (2010.09.17.20.19.14):
#
# Version: 0.6.1
# Project: http://www.iredmail.org/
#
# Community: http://www.iredmail.org/forum/
#
# umask = 0077
# Provided services.
protocols = pop3 pop3s imap imaps managesieve
# Listen addresses. for Dovecot-1.1.x.
# ipv4: *
# ipv6: [::]
#listen = *, [::]
listen = *
# mail uid/gid.
mail_uid = 501
mail_gid = 501
#
# Debug options.
#
mail_debug = yes
#auth_verbose = yes
#auth_debug = yes
#auth_debug_passwords = yes
#
# Log file.
#
#log_timestamp = "%Y-%m-%d %H:%M:%S "
log_path = /var/log/dovecot.log
#login_processes_count = 3
#login_max_processes_count = 128
#login_max_connections = 256
#max_mail_processes = 512
disable_plaintext_auth = no
# Performance Tuning. Reference:
# http://wiki.dovecot.org/LoginProcess
#
# High-Security mode. Dovecot default setting.
#
# It works by using a new imap-login or pop3-login process for each
# incoming connection. Since the processes run in a highly restricted
# chroot, running each connection in a separate process means that in
# case there is a security hole in Dovecot's pre-authentication code
# or in the SSL library, the attacker can't see other users'
# connections and can't really do anything destructive.
login_process_per_connection=yes
#
# High-Performance mode.
#
# It works by using a number of long running login processes,
# each handling a number of connections. This loses much of
# the security benefits of the login process design, because
# in case of a security hole the attacker is now able to see
# other users logging in and steal their passwords.
#login_process_per_connection = no
# Default realm/domain to use if none was specified.
# This is used for both SASL realms and appending '@domain.ltd' to username in plaintext logins.
auth_default_realm = lanever.com
# ---- NFS storage ----
# Set to 'no' For NFSv2. Default is 'yes'.
#dotlock_use_excl = yes
#mail_nfs_storage = yes # v1.1+ only
# If indexes are on NFS.
#mail_nfs_index = yes # v1.1+ only
# ----
plugin {
# Quota warning.
#
# You can find sample script from Dovecot wiki:
# http://wiki.dovecot.org/Quota/1.1#head- … b45bec1734
#
# If user suddenly receives a huge mail and the quota jumps from
# 85% to 95%, only the 95% script is executed.
#
quota_warning = storage=85%% /usr/local/bin/dovecot-quota-warning.sh 85
quota_warning2 = storage=90%% /usr/local/bin/dovecot-quota-warning.sh 90
quota_warning3 = storage=95%% /usr/local/bin/dovecot-quota-warning.sh 95
}
# SSL support.
#ssl_disable = no
ssl = yes
verbose_ssl = no
ssl_key_file = /etc/pki/tls/private/iRedMail.key
ssl_cert_file = /etc/pki/tls/certs/iRedMail_CA.pem
# Maildir format and location.
# Such as: /var/mail/vmail01/iredmail.org/www/
# ----------- ================
# homeDirectory mailMessageStore
mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
plugin {
#quota = maildir
quota = dict:user::proxy::quotadict
# Quota rules. Reference: http://wiki.dovecot.org/Quota/1.1
# The following limit names are supported:
# - storage: Quota limit in kilobytes, 0 means unlimited.
# - bytes: Quota limit in bytes, 0 means unlimited.
# - messages: Quota limit in number of messages, 0 means unlimited. This probably isn't very useful.
# - backend: Quota backend-specific limit configuration.
# - ignore: Don't include the specified mailbox in quota at all (v1.1.rc5+).
#quota_rule = *:storage=100M
#quota_rule2 = *:messages=0
#quota_rule3 = Trash:storage=1G
#quota_rule4 = Junk:ignore
}
dict {
# NOTE: dict process currently runs as root, so this file will be owned as root.
quotadict = mysql:/etc/dovecot-used-quota.conf
#expire = db:/var/lib/dovecot/expire/expire.db
}
plugin {
# ---- Expire plugin ----
# Expire plugin. Mails are expunged from mailboxes after being there the
# configurable time. The first expiration date for each mailbox is stored in
# a dictionary so it can be quickly determined which mailboxes contain
# expired mails. The actual expunging is done in a nightly cronjob, which
# you must set up:
#
# 1 3 * * * /usr/sbin/dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool
#
# Trash: 7 days
# Trash's children directories: 7 days
# Junk: 30 days
expire = Trash 7 Trash/* 7 Junk 30
expire_dict = proxy::expire
# If you have a non-default path to auth-master, set also:
auth_socket_path = /var/run/dovecot/auth-master
}
# Per-user sieve mail filter.
plugin {
# For maildir format.
sieve = /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
}
# LDA: Local Deliver Agent
protocol lda {
postmaster_address = root
auth_socket_path = /var/run/dovecot/auth-master
#mail_plugins = cmusieve quota expire
mail_plugins = sieve quota
sieve_global_path = /var/vmail/sieve/dovecot.sieve
log_path = /var/log/sieve.log
}
# IMAP configuration
protocol imap {
#mail_plugins = quota imap_quota zlib expire
mail_plugins = quota imap_quota
# number of connections per-user per-IP
#mail_max_userip_connections = 10
}
# POP3 configuration
protocol pop3 {
#mail_plugins = quota zlib expire
mail_plugins = quota
pop3_uidl_format = %08Xu%08Xv
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}
# ManageSieve service. http://wiki.dovecot.org/ManageSieve
protocol managesieve {
listen = 127.0.0.1:2000
}
# Plugin: sieve. http://wiki.dovecot.org/LDA/Sieve
plugin {
#sieve_global_path =
#sieve_global_dir =
#sieve_before = /var/vmail/sieve/dovecot.sieve
#sieve_after =
sieve = /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
sieve_dir = /var/vmail/sieve/%Ld/%Ln/
}
auth default {
mechanisms = plain login
user = vmail
passdb ldap {
args = /etc/dovecot-ldap.conf
}
userdb ldap {
args = /etc/dovecot-ldap.conf
}
socket listen {
master {
path = /var/run/dovecot/auth-master
mode = 0666
user = vmail
group = vmail
}
client {
path = /var/spool/postfix/dovecot-auth
mode = 0666
user = postfix
group = postfix
}
}
}