<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[iRedMail — [FAQ] How to track user last login data (ip, date, mail protocol).]]></title>
	<link rel="self" href="http://www.iredmail.org/forum/feed-atom-topic379.xml" />
	<updated>2009-10-31T13:55:32Z</updated>
	<generator>PunBB</generator>
	<id>http://www.iredmail.org/forum/topic379-faq-how-to-track-user-last-login-data-ip-date-mail-protocol.html</id>
		<entry>
			<title type="html"><![CDATA[[FAQ] How to track user last login data (ip, date, mail protocol).]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post1669.html#p1669" />
			<content type="html"><![CDATA[<p>This tutorial is used to explain how to translate iRedAdmin to your language. If they don&#039;t work for you, please post a new topic in our <a href="http://www.iredmail.org/forum/forum5-iredadmin-webbased-iredmail-admin-panel.html">iRedAdmin support forum</a>.</p><h5>How to Track User Last Login Date and IP Address</h5><p>=================================================</p><h5>WARNING</h5><p>Tracking operation MAY cause PERFORMANCE ISSUE on a BUSY server<br />due to frequently update the SQL database/LDAP directory server, AND<br />roundcube webmail will automatic check users&#039; mailbox via IMAP protocol<br />frequently.</p><h5>Requirements</h5><p>This tutorial is written for Dovecot-1.x. If you have Dovecot-2.x running, please refer to <a href="http://wiki2.dovecot.org/PostLoginScripting">official tutorial</a>.</p><h5>Modify dovecot.conf, add &#039;mail_executable&#039; in protocol imap and/or pop3</h5><div class="codebox"><pre><code>    protocol imap {
        mail_drop_priv_before_exec=yes
        mail_executable = /usr/bin/trackLastLogin.sh imap
        ...
    }

    protocol pop3 {
        mail_drop_priv_before_exec=yes
        mail_executable = /usr/bin/trackLastLogin.sh pop3
        ...
    }</code></pre></div><h5>Download samples/trackLastLogin.sh, copy to /usr/bin/trackLastLogin.sh, set correct owner and permission.</h5><div class="codebox"><pre><code># wget http://iredmail.googlecode.com/hg/extra/trackLastLogin.sh
# mv -i trackLastLogin.sh /usr/bin/
# chown root:root /usr/bin/trackLastLogin.sh
# chmod 0755 /usr/bin/trackLastLogin.sh</code></pre></div><h5>Open /usr/bin/trackLastLogin.sh, choose your preferred update method.</h5><p>Currently, it supports updating user last login data to plain text, MySQL database and OpenLDAP directory server.</p><ul><li><p>For plain text, user &#039;dovecot&#039; must have write privilege on the log file.</p></li><li><p>For MySQL database, you must specify correct mysql user and password, this mysql user should have SELECT and UPDATE privilege.</p></li><li><p>For LDAP server, you must specify correct URI, bind dn and password, this bind dn should have write privilege.</p></li></ul><h5>Reference</h5><ul><li><p>Post-login scripting for Dovecot-1.x: <a href="http://wiki.dovecot.org/PostLoginScripting">http://wiki.dovecot.org/PostLoginScripting</a></p></li><li><p>Post-login scripting for Dovecot-2.x: <a href="http://wiki2.dovecot.org/PostLoginScripting">http://wiki2.dovecot.org/PostLoginScripting</a></p></li></ul>]]></content>
			<author>
				<name><![CDATA[ZhangHuangbin]]></name>
				<uri>http://www.iredmail.org/forum/user2.html</uri>
			</author>
			<updated>2009-10-31T13:55:32Z</updated>
			<id>http://www.iredmail.org/forum/post1669.html#p1669</id>
		</entry>
</feed>
