Hi, all. I want to track user last login data (ip address, login date, etc) with dovecot, followed dovecot tutorial[1], and it now works with IMAP, but failed with POP3. i don't know why. My script: ---- LDAP_URI='ldap://127.0.0.1:389' LDAP_BASEDN='o=domains,dc=iredmail,dc=org' BIND_DN='cn=vmailadmin,dc=iredmail,dc=org' BIND_PW='plain_passwd' if [ X"${USER}" != X"dump-capability" ]; then ldapmodify -c -x \ -H "${LDAP_URI}" \ -D "${BIND_DN}" \ -w "${BIND_PW}" <<EOF dn: mail=${USER},ou=Users,domainName=$(echo ${USER} | awk -F'@' '{print $2}'),${LDAP_BASEDN} changetype: modify replace: lastLoginDate lastLoginDate: $(date +%Y%m%d%H%M%SZ) - replace: lastLoginIP lastLoginIP: ${IP} - replace: lastLoginProtocol lastLoginProtocol: pop3 EOF fi ---- It works with IMAP protocol, but failed with POP3 protocol. Error msg in Thunderbird: ---- The STAT command did not succeed. Error getting message number and sizes. Mail server r6.iredmail.org responsed: ying entry "mail=www at a.cn,ou=Users,domainName=a.cn,o=domains,dc=iredmail,dc=org" ---- [1] Post-login scripting: http://wiki.dovecot.org/PostLoginScripting -- Best Regards. Zhang Huangbin - Open Source Mail Server Solution for Red Hat(R) Enterprise Linux, CentOS, Debian, Ubuntu: http://www.iredmail.org/
On Sat, 2009-10-31 at 23:09 +0800, Zhang Huangbin wrote:> It works with IMAP protocol, but failed with POP3 protocol. > Error msg in Thunderbird: > ---- > The STAT command did not succeed. Error getting message number and > sizes. > Mail server r6.iredmail.org responsed: ying entry > "mail=www at a.cn,ou=Users,domainName=a.cn,o=domains,dc=iredmail,dc=org"Looks like it writes some error message to POP3 session. 1) Did you look at Dovecot's error log yet to see if this script logged something? 2) Log in with telnet to see what exactly it's writing. http://wiki.dovecot.org/TestPop3Installation -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20091103/76ce29c6/attachment-0002.bin>
On Nov 4, 2009, at 2:42 AM, Timo Sirainen wrote:> > Looks like it writes some error message to POP3 session. > > 1) Did you look at Dovecot's error log yet to see if this script > logged > something?No error logs in dovecot log file. All logs during the telnet testing session: ---- dovecot: Nov 03 20:45:45 Info: pop3-login: Disconnected (no auth attempts): rip=192.168.187.1, lip=192.168.187.128 dovecot: Nov 03 20:45:51 Info: pop3-login: Login: user=<www at a.cn>, method=PLAIN, rip=192.168.187.1, lip=192.168.187.128 dovecot: Nov 03 20:46:08 Info: POP3(www at a.cn): Disconnected: Logged out top=0/0, retr=1/1453, del=0/1, size=1436 ----> 2) Log in with telnet to see what exactly it's writing. > http://wiki.dovecot.org/TestPop3InstallationIt seems works fine: ---- $ telnet r6 110 Trying 192.168.187.128... Connected to r6. Escape character is '^]'. +OK Dovecot ready. user www at a.cn +OK pass www +OK Logged in. modifying entry "mail=www at a.cn,ou=Users,domainName=a.cn,o=domains,dc=iredmail,dc=org" stat +OK 1 1436 retr 1 +OK 1436 octets <Mail content here> ---- After telnet testing, i use Thunderbird to test it again, but it failed with same error message i posted in previous mail: ---- The STAT command did not succeed. Error getting message number and sizes. Mail server r6.iredmail.org responsed: ying entry "mail=www at a.cn,ou=Users,domainName=a.cn,o=domains,dc=iredmail,dc=org" ---- Is it OK? -- Best Regards. Zhang Huangbin - Open Source Mail Server Solution for Red Hat(R) Enterprise Linux, CentOS, Debian, Ubuntu: http://www.iredmail.org/