<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[iRedMail — Sieve bugs in iRedAdmin-Mysql-Pro-1.5.1]]></title>
	<link rel="self" href="http://www.iredmail.org/forum/feed-atom-topic4069.xml" />
	<updated>2012-10-24T03:39:50Z</updated>
	<generator>PunBB</generator>
	<id>http://www.iredmail.org/forum/topic4069-sieve-bugs-in-iredadminmysqlpro151.html</id>
		<entry>
			<title type="html"><![CDATA[Re: Sieve bugs in iRedAdmin-Mysql-Pro-1.5.1]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post18806.html#p18806" />
			<content type="html"><![CDATA[<p>完美解决，jood job！</p>]]></content>
			<author>
				<name><![CDATA[thatday]]></name>
				<uri>http://www.iredmail.org/forum/user15597.html</uri>
			</author>
			<updated>2012-10-24T03:39:50Z</updated>
			<id>http://www.iredmail.org/forum/post18806.html#p18806</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Sieve bugs in iRedAdmin-Mysql-Pro-1.5.1]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post18801.html#p18801" />
			<content type="html"><![CDATA[<p>抱歉。请在已经打过补丁的版本上再打这个补丁：<br /></p><div class="codebox"><pre><code>diff -r 744053b4657c libs/mysql/user.py
--- a/libs/mysql/user.py    Tue Oct 23 21:08:30 2012 +0800
+++ b/libs/mysql/user.py    Wed Oct 24 08:18:00 2012 +0800
@@ -599,11 +599,12 @@
                 pass
 
         elif self.profile_type == &#039;advanced&#039;:
-            # Get enabled services.
+            # Get enabled/disabled services.
             self.enabledService = [str(v).lower()
                                    for v in data.get(&#039;enabledService&#039;, [])
                                    if v in ENABLED_SERVICES
                                   ]
+            self.disabledService = []
 
             # Append &#039;sieve&#039;, &#039;sievesecured&#039; for dovecot-1.2.
             if &#039;enablemanagesieve&#039; in self.enabledService:
@@ -616,7 +617,7 @@
             else:
                 self.disabledService += [&#039;enablesievesecured&#039;]
 
-            self.disabledService = [v for v in ENABLED_SERVICES if v not in self.enabledService]
+            self.disabledService += [v for v in ENABLED_SERVICES if v not in self.enabledService]
 
             # Enable/disable services.
             for srv in self.enabledService:</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ZhangHuangbin]]></name>
				<uri>http://www.iredmail.org/forum/user2.html</uri>
			</author>
			<updated>2012-10-24T00:18:43Z</updated>
			<id>http://www.iredmail.org/forum/post18801.html#p18801</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Sieve bugs in iRedAdmin-Mysql-Pro-1.5.1]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post18797.html#p18797" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>ZhangHuangbin wrote:</cite><blockquote><p>这个补丁同时修正了你反馈的这个问题：<br /><a href="http://www.iredmail.org/forum/post18793.html#p18793">http://www.iredmail.org/forum/post18793.html#p18793</a></p></blockquote></div><p>我打了这个补丁之后，勾选“自定义邮件过滤规则”和“自定义邮件过滤规则（使用 TLS/SSL 加密传输）”能够正确保存，数据库里四个字段enablemanagesieve，enablemanagesievesecured，enablesieve，enablesievesecured的值均为1.</p><p>但“自定义邮件过滤规则”和“自定义邮件过滤规则（使用 TLS/SSL 加密传输）”其中之一不勾选的话，仍然不能保存，网页出现“internal server error”。</p><p>后台httpd日志如下：</p><div class="codebox"><pre><code>   File &quot;/var/www/iredadmin/controllers/decorators.py&quot;, line 33, in decorated
     return f(*args, **kw)
   File &quot;/var/www/iredadmin/controllers/decorators.py&quot;, line 11, in proxyfunc
     return func(self, *args, **kw)
   File &quot;/var/www/iredadmin/controllers/mysql/user.py&quot;, line 191, in POST
     data=i,
   File &quot;/var/www/iredadmin/libs/mysql/decorators.py&quot;, line 22, in proxyfunc
     return func(*args, **kw)
   File &quot;/var/www/iredadmin/libs/mysql/user.py&quot;, line 612, in update
     self.disabledService += [&#039;enablesieve&#039;]
 AttributeError: User instance has no attribute &#039;disabledService&#039;</code></pre></div><p>应该还是有点问题，请站长费心。</p>]]></content>
			<author>
				<name><![CDATA[thatday]]></name>
				<uri>http://www.iredmail.org/forum/user15597.html</uri>
			</author>
			<updated>2012-10-23T14:41:47Z</updated>
			<id>http://www.iredmail.org/forum/post18797.html#p18797</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Sieve bugs in iRedAdmin-Mysql-Pro-1.5.1]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post18794.html#p18794" />
			<content type="html"><![CDATA[<p>这个补丁同时修正了你反馈的这个问题：<br /><a href="http://www.iredmail.org/forum/post18793.html#p18793">http://www.iredmail.org/forum/post18793.html#p18793</a></p>]]></content>
			<author>
				<name><![CDATA[ZhangHuangbin]]></name>
				<uri>http://www.iredmail.org/forum/user2.html</uri>
			</author>
			<updated>2012-10-23T13:19:16Z</updated>
			<id>http://www.iredmail.org/forum/post18794.html#p18794</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Sieve bugs in iRedAdmin-Mysql-Pro-1.5.1]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post18785.html#p18785" />
			<content type="html"><![CDATA[<p>==== Required information ====<br />- iRedMail version: 0.8.3<br />- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql<br />- Linux/BSD distribution name and version: centos 6.3<br />- Related log if you&#039;re reporting an issue: <br />==== </p><p>我今天又测试了一下sieve功能，<br />数据库里面，有四个字段enablemanagesieve，enablemanagesievesecured，enablesieve，enablesievesecured，<br />在iredadmin后台的“用户属性-高级设置”里，只要点保存更改，数据库里的enablesieve，enablesievesecured都会变成0，<br />即使勾上“自定义邮件过滤规则+自定义邮件过滤规则（使用TLS/SSL加密传输）”，只要保存设置，后面两个字段都会变成0，而enablemanagesieve，enablemanagesievesecured两个字段则分别能保存设置。</p><p>看到libs/mysql/user.py里有如下代码：<br /></p><div class="codebox"><pre><code>if &#039;enablemanagesieve&#039; in self.enabledService:
self.enabledService += [&#039;enablesieve&#039;]
else:
self.disabledService += [&#039;enablesieve&#039;]

if &#039;enablemanagesievesecured&#039; in self.enabledService:
self.enabledService += [&#039;enablesievesecured&#039;]
else:
self.disabledService += [&#039;enablesievesecured&#039;]</code></pre></div><p>我看到这段代码，原则上是勾选了enablemanagesieve，那么enablesieve也会生效，<br />同样勾选了enablemanagesievesecured&#039;，enablesievesecured亦会生效，<br />但不知道为什么，只要保存，后面两个字段都为0了。</p>]]></content>
			<author>
				<name><![CDATA[thatday]]></name>
				<uri>http://www.iredmail.org/forum/user15597.html</uri>
			</author>
			<updated>2012-10-23T09:18:21Z</updated>
			<id>http://www.iredmail.org/forum/post18785.html#p18785</id>
		</entry>
</feed>
