<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[iRedMail — [FAQ] How to track user last login data (ip, date, mail protocol).]]></title>
		<link>http://www.iredmail.org/forum/topic379-faq-how-to-track-user-last-login-data-ip-date-mail-protocol.html</link>
		<atom:link href="http://www.iredmail.org/forum/feed-rss-topic379.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [FAQ] How to track user last login data (ip, date, mail protocol)..]]></description>
		<lastBuildDate>Sat, 31 Oct 2009 13:55:32 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[[FAQ] How to track user last login data (ip, date, mail protocol).]]></title>
			<link>http://www.iredmail.org/forum/post1669.html#p1669</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (ZhangHuangbin)]]></author>
			<pubDate>Sat, 31 Oct 2009 13:55:32 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post1669.html#p1669</guid>
		</item>
	</channel>
</rss>
