Re: [Dovecot] can't download attachment from the wiki

2008-07-05 Thread Andrew Schulman
> >>> Hi.  At http://wiki.dovecot.org/ManageSieve#line-229 , I want to
> >>> download the patch that's supposed to fix two problems in Avelsieve.
> >>> Unfortunately, when I click on the link to the patch, I always get
> >>> an error message:
> >>>
> >>> You are not allowed to do AttachFile on this page.
> >>
> >> Ouch, sorry, I advised Timo to disable AttachFile because somebody
> >> was using the dovecot wiki to distribute some key files for something
> >> that had nothing to do with dovecot.
> >
> > Johannes, thanks.  While we're waiting for that to get sorted out,
> > could someone be so kind as to email me the patch?  Thanks, Andrew.
>
> Ok, that is not practical. I've recovered it from my mail discussion
> with Hanspeter Kunz who provided the definitive version of this patch.
> I've put it online here:
>
> http://www.rename-it.nl/dovecot/client-patches/avelsieve-1.9.7-dovecot.d
>iff

Stephan, thank you.  I applied the patch and it seems to work fine.

For anyone else who wants the patch, I'm attaching it here in diff -urN 
format.

I hope we can get attachment downloads working soon in the wiki.

Thanks,
Andrew.

diff -urNb avelsieve.orig/include/managesieve.lib.php avelsieve/include/managesieve.lib.php
--- avelsieve.orig/include/managesieve.lib.php	2008-05-20 13:13:29.0 -0400
+++ avelsieve/include/managesieve.lib.php	2008-07-05 06:46:18.0 -0400
@@ -82,6 +82,12 @@
* a comma seperated list of allowed auth types, in order of preference
*/
   var $auth_types;
+
+  /** 
+   * options
+   */
+  var $broken_tls;
+
   /**
* type of authentication attempted
*/
@@ -311,6 +317,9 @@
 else
 $this->auth = $auth;
 $this->auth_types=$auth_types;	/* Allowed authentication types */
+
+$this->broken_tls = false;
+
 $this->fp=0;
 $this->line="";
 $this->retval="";
@@ -484,6 +493,10 @@
 } /* end if */
 elseif(is_string($this->modules))
 $this->capabilites[$this->cap_type][$this->module]=true;
+
+// set broken_tls. Older cyrus servers do not respond with 
+// capabilities after STARTTLS
+$broken_tls = true;
 }
 
 if(sieve::status($this->line) == F_NO){		//here we should do some returning of error codes?
@@ -504,8 +517,13 @@
 return false;
 } else {
 $this->loggedin = true;
-// RFC says that we need to ask for the capabilities again
+// RFC says that we get an unsolicited capability response after TLS negotiation. Older Cyrus
+// did not do this. If the server has old/broken TLS we need to send a CAPABILITY command,
+// otherwise we just parse the unsolicited capability response. 
+if ( $this->broken_tls )
 $this->sieve_get_capability();
+else
+$this->sieve_read_capability_response();
 $this->loggedin = false;
 }
 }
@@ -817,14 +835,11 @@
   }
 
   /**
-   * Return an array of available capabilities.
+   * Read incoming capability response.
*
* @return array
*/
-  function sieve_get_capability() {
-if($this->loggedin==false)
-return false;
-fputs($this->fp, "CAPABILITY\r\n"); 
+  function sieve_read_capability_response() {
 $this->line=fgets($this->fp,1024);
 
 $tmp = array();
@@ -876,8 +891,20 @@
 return $this->capabilities['modules'];
   }
 
-}
+  /**
+   * Return an array of available capabilities.
+   *
+   * @return array
+   */
+  function sieve_get_capability() {
 
+if($this->loggedin==false)
+return false;
+fputs($this->fp, "CAPABILITY\r\n");
+
+return $this->sieve_read_capability_response();
+  }
+}
 
 /**
  * The following functions are support functions and might be handy to the
diff -urNb avelsieve.orig/table.php avelsieve/table.php
--- avelsieve.orig/table.php	2008-05-20 13:13:29.0 -0400
+++ avelsieve/table.php	2008-07-05 06:52:47.0 -0400
@@ -162,6 +162,7 @@
 	if (!$conservative) {
 		$s->login();
 		if(sizeof($rules) == 0) {
+		$s->setactive('');
 $s->delete('phpscript');
 			}  else {
 		$newscript = makesieverule($rules);


Re: [Dovecot] can't download attachment from the wiki

2008-07-01 Thread Stephan Bosch

Hi Andrew and Dimitrij,

The following discussion took place on the Dovecot mailinglist. Dimitrij 
recently had a similar problem which I 'solved' by pointing him to the 
broken url.


Andrew Schulman schreef:

Hi.  At http://wiki.dovecot.org/ManageSieve#line-229 , I want to
download the patch that's supposed to fix two problems in Avelsieve. 
Unfortunately, when I click on the link to the patch, I always get an

error message:

You are not allowed to do AttachFile on this page.
  

Ouch, sorry, I advised Timo to disable AttachFile because somebody was
using the dovecot wiki to distribute some key files for something that
had nothing to do with dovecot.

Johannes, thanks.  While we're waiting for that to get sorted out, could 
someone be so kind as to email me the patch?  Thanks, Andrew.
  
Ok, that is not practical. I've recovered it from my mail discussion 
with Hanspeter Kunz who provided the definitive version of this patch. 
I've put it online here:


http://www.rename-it.nl/dovecot/client-patches/avelsieve-1.9.7-dovecot.diff

I hope this resolves Adrew's and Dimitrij's problems.

Regards,

--
Stephan Bosch
[EMAIL PROTECTED]





Re: [Dovecot] can't download attachment from the wiki

2008-06-30 Thread Johannes Berg
On Mon, 2008-06-30 at 17:32 -0400, Andrew Schulman wrote:
> > > Hi.  At http://wiki.dovecot.org/ManageSieve#line-229 , I want to
> > > download the patch that's supposed to fix two problems in Avelsieve. 
> > > Unfortunately, when I click on the link to the patch, I always get an
> > > error message:
> > >
> > > You are not allowed to do AttachFile on this page.
> >
> > Ouch, sorry, I advised Timo to disable AttachFile because somebody was
> > using the dovecot wiki to distribute some key files for something that
> > had nothing to do with dovecot.
> 
> Johannes, thanks.  While we're waiting for that to get sorted out, could 
> someone be so kind as to email me the patch?  Thanks, Andrew.

Sorry, I can't, I can't access the wiki outside of the regular web
interface either.

johannes


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] can't download attachment from the wiki

2008-06-30 Thread Andrew Schulman
> > Hi.  At http://wiki.dovecot.org/ManageSieve#line-229 , I want to
> > download the patch that's supposed to fix two problems in Avelsieve. 
> > Unfortunately, when I click on the link to the patch, I always get an
> > error message:
> >
> > You are not allowed to do AttachFile on this page.
>
> Ouch, sorry, I advised Timo to disable AttachFile because somebody was
> using the dovecot wiki to distribute some key files for something that
> had nothing to do with dovecot.

Johannes, thanks.  While we're waiting for that to get sorted out, could 
someone be so kind as to email me the patch?  Thanks, Andrew.



Re: [Dovecot] can't download attachment from the wiki

2008-06-26 Thread Johannes Berg
On Thu, 2008-06-26 at 18:37 -0400, Andrew Schulman wrote:
> Hi.  At http://wiki.dovecot.org/ManageSieve#line-229 , I want to download
> the patch that's supposed to fix two problems in Avelsieve.  Unfortunately,
> when I click on the link to the patch, I always get an error message:
> 
> You are not allowed to do AttachFile on this page.
> 
> Annoying.  I've created an account and logged in, but still no joy.  Can
> anyone suggest how or where else I can get that patch?

Ouch, sorry, I advised Timo to disable AttachFile because somebody was
using the dovecot wiki to distribute some key files for something that
had nothing to do with dovecot.

Timo, consider upgrading to 1.7, it is released now, working fine on all
my wikis (including some fairly high-profile sites like
wireless.kernel.org) and supports email notification for attachments as
well as "TextChas" like your "please enter dovecot in this box".

johannes


signature.asc
Description: This is a digitally signed message part


[Dovecot] can't download attachment from the wiki

2008-06-26 Thread Andrew Schulman
Hi.  At http://wiki.dovecot.org/ManageSieve#line-229 , I want to download
the patch that's supposed to fix two problems in Avelsieve.  Unfortunately,
when I click on the link to the patch, I always get an error message:

You are not allowed to do AttachFile on this page.

Annoying.  I've created an account and logged in, but still no joy.  Can
anyone suggest how or where else I can get that patch?

Thanks,
Andrew.