<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[iRedMail — How to allow only access through webmail (roundcube) for a user?]]></title>
		<link>http://www.iredmail.org/forum/topic355-how-to-allow-only-access-through-webmail-roundcube-for-a-user.html</link>
		<atom:link href="http://www.iredmail.org/forum/feed-rss-topic355.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in How to allow only access through webmail (roundcube) for a user?.]]></description>
		<lastBuildDate>Tue, 20 Oct 2009 14:08:53 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How to allow only access through webmail (roundcube) for a user?]]></title>
			<link>http://www.iredmail.org/forum/post1575.html#p1575</link>
			<description><![CDATA[<p>OK, first problem.. They can send mail from roundcube even if `enablesmtp` = 0 in `mailbox`, because<br /></p><div class="codebox"><pre><code>mynetworks = 127.0.0.0/8</code></pre></div><p> in &quot;main.cf&quot; for postfix.</p><p>Can I remove &quot;permit_mynetworks&quot; from &quot;smtpd_sender_restrictions&quot; so the flag in the database gets actually used when sending from roundcube (127.0.0.1)?</p>]]></description>
			<author><![CDATA[null@example.com (maxie_ro)]]></author>
			<pubDate>Tue, 20 Oct 2009 14:08:53 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post1575.html#p1575</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to allow only access through webmail (roundcube) for a user?]]></title>
			<link>http://www.iredmail.org/forum/post1574.html#p1574</link>
			<description><![CDATA[<p>Well, I was talking about my own server. Roundcube is running here... But that can be modified...<br /></p><div class="codebox"><pre><code>...... AND (pwd_change_enforced = 0 OR (pwd_change_enforced=1 AND (&#039;xx.xx.xx.xx&#039; = &#039;%r&#039;)))</code></pre></div><p>`pwd_change_enforced` is required actually because I want certain users to change their password because they have very very weak passwords.&nbsp; So, if I put `pwd_change_enforced` to 1 and enablesmtp to 0, they won&#039;t be able to use Outlook/Thunderbird to read mail, and nothing to send mail (roundcube included). They will have to login to roundcube, and when they do, they&#039;ll get redirected to the password change page, with a big warning that they must change password. After they do, `pwd_change_enforced` gets set back to 0 and enablesmtp to 1 and everything is ok again.</p><p>Obviously, this will only work with an MySQL-enabled server, not LDAP. But I guess something similar can be done with LDAP too.</p>]]></description>
			<author><![CDATA[null@example.com (maxie_ro)]]></author>
			<pubDate>Tue, 20 Oct 2009 12:41:52 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post1574.html#p1574</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to allow only access through webmail (roundcube) for a user?]]></title>
			<link>http://www.iredmail.org/forum/post1572.html#p1572</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>If remote IP = local IP, then user is accessing mail using roundcube</p></blockquote></div><p>Nice solution.<br />But it will fail if SA deployes Roundcube on another server. <img src="http://www.iredmail.org/forum/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p><p>And i think &#039;pwd_change_enforced&#039; column is not required in this case. <img src="http://www.iredmail.org/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (ZhangHuangbin)]]></author>
			<pubDate>Tue, 20 Oct 2009 12:29:30 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post1572.html#p1572</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to allow only access through webmail (roundcube) for a user?]]></title>
			<link>http://www.iredmail.org/forum/post1571.html#p1571</link>
			<description><![CDATA[<p>I found a way to disable remote POP3/IMAP, and allow only locally.</p><p>Add another field to `mailbox` table, called `pwd_change_enforced` (or whatever). If set to 0 (default), everything ok. If set to 1, user cannot login remotely, can only use roundcube (which will immediately redirect him to password change page).</p><p>and then modify &quot;user_query&quot; in dovecot-mysql.conf to:<br /></p><div class="codebox"><pre><code>user_query = SELECT CONCAT(storagebasedirectory, &#039;/&#039;, maildir) AS home, CONCAT(&#039;*:bytes=&#039;, quota*1048576) AS quota_rule FROM mailbox WHERE username=&#039;%u&#039; AND active=&#039;1&#039; AND enable%Ls=&#039;1&#039; AND expired &gt;= NOW() AND (pwd_change_enforced = 0 OR (pwd_change_enforced=1 AND (&#039;%l&#039; = &#039;%r&#039;)))</code></pre></div><p>%l expands into local address (127.0.0.1), %r expands to remote IP. If remote IP = local IP, then user is accessing mail using roundcube <img src="http://www.iredmail.org/forum/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" />.<br />Tested and working exactly as expected.<br />Lemme see what I can do about postfix (smtp) now...</p>]]></description>
			<author><![CDATA[null@example.com (maxie_ro)]]></author>
			<pubDate>Tue, 20 Oct 2009 12:21:12 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post1571.html#p1571</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to allow only access through webmail (roundcube) for a user?]]></title>
			<link>http://www.iredmail.org/forum/post1568.html#p1568</link>
			<description><![CDATA[<p>I don&#039;t think that would be enough, because Roundcube also uses IMAP to read user&#039;s mails, and will totally block if he/she doesn&#039;t have IMAP enabled.</p><p>I will research into it, to see if I can make a mysql map for postfix, IP dependent. The problem, how I see it right now, is that Postfix doesn&#039;t send IP when checking check_recipient_access &amp; co, only username.</p>]]></description>
			<author><![CDATA[null@example.com (maxie_ro)]]></author>
			<pubDate>Tue, 20 Oct 2009 11:32:24 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post1568.html#p1568</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to allow only access through webmail (roundcube) for a user?]]></title>
			<link>http://www.iredmail.org/forum/post1566.html#p1566</link>
			<description><![CDATA[<p>No idea yet. Because roundcube uses IMAP, so it&#039;s not possible to control webmail.</p><p>I think you can hack roundcube, check user access privilege with MYSQL query before/after user authentication. such as:<br /></p><div class="codebox"><pre><code>SELECT username WHERE username=&#039;www@example.com&#039; AND enablewebmail=&#039;1&#039;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ZhangHuangbin)]]></author>
			<pubDate>Tue, 20 Oct 2009 10:55:07 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post1566.html#p1566</guid>
		</item>
		<item>
			<title><![CDATA[How to allow only access through webmail (roundcube) for a user?]]></title>
			<link>http://www.iredmail.org/forum/post1565.html#p1565</link>
			<description><![CDATA[<p>Hi.<br />I got a question. How can I disable remote SMTP/POP/IMAP access for a particular user, and allow only through webmail (roundcube).<br />I can&#039;t simply set &quot;enableimap&quot; to 0 in `mailbox` table because then roundcube won&#039;t work (it uses IMAP).</p><p>Also, simply disabling SMTP and POP3 (enablesmtp, enablepop3) would not be enough, he/she could still use IMAP.</p><p>Is there a quick way to this? Preferably using the MySQL tables, so I can write a PHP script to easy enable/disable?</p>]]></description>
			<author><![CDATA[null@example.com (maxie_ro)]]></author>
			<pubDate>Tue, 20 Oct 2009 09:26:33 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post1565.html#p1565</guid>
		</item>
	</channel>
</rss>
