主题: 记录用户最新的登录日期、地址和ip信息失败
您好!
按以下地址的说明,在vmail.mailbox中记录用户最新的登录日期、地址和ip信息失败。
http://www.iredmail.org/forum/topic379- … tocol.html
文件设置如下:
vi trackLastLogin.sh
MYSQL_USER='root'
PASSWD='rootpasswd'
VMAIL_DB_NAME='vmail'
if [ X"${USER}" != X"dump-capability" ]; then
mysql -u${MYSQL_USER} -p${PASSWD} ${VMAIL_DB_NAME} >/dev/null 2>&1 <<EOF
UPDATE mailbox SET \
lastloginipv4="INET_ATON('$IP')", \
lastlogindate="NOW()", \
lastloginprotocol="${1}" \
WHERE username='$USER';
EOF
fi
-------------------------------------------------------------------------------------------------
vi /etc/dovecot.conf
# IMAP configuration
protocol imap {
mail_drop_priv_before_exec=yes
mail_executable = /usr/bin/trackLastLogin.sh imap
mail_plugins = quota imap_quota zlib
# number of connections per-user per-IP
#mail_max_userip_connections = 10
}
# POP3 configuration
protocol pop3 {
mail_drop_priv_before_exec=yes
mail_executable = /usr/bin/trackLastLogin.sh pop3
mail_plugins = quota zlib
pop3_uidl_format = %08Xu%08Xv
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}
-------------------------------------------------------------------------------
service dovecot restart
之后,数据库中只能记录lastloginprotocol,如下面的内容:
mysql> select lastloginipv4,lastlogindate,lastloginprotocol from mailbox where lastloginprotocol<>'' limit 10;
+---------------+---------------------+-------------------+
| lastloginipv4 | lastlogindate | lastloginprotocol |
+---------------+---------------------+-------------------+
| 0 | 0000-00-00 00:00:00 | pop3 |
| 0 | 0000-00-00 00:00:00 | pop3 |
| 0 | 0000-00-00 00:00:00 | pop3 |
| 0 | 0000-00-00 00:00:00 | pop3 |
| 0 | 0000-00-00 00:00:00 | pop3 |
| 0 | 0000-00-00 00:00:00 | pop3 |
| 0 | 0000-00-00 00:00:00 | pop3 |
| 0 | 0000-00-00 00:00:00 | pop3 |
| 0 | 0000-00-00 00:00:00 | pop3 |
| 0 | 0000-00-00 00:00:00 | pop3 |
+---------------+---------------------+-------------------+
-----------------------------------------------------------------------------------------
将/etc/dovecot.conf中的调试选项全部开启,也没有sql update的信息出现。
#
# Debug options.
#
mail_debug = yes
auth_verbose = yes
auth_debug = yes
auth_debug_passwords = yes
不知道是什么原因?
谢谢!