From nobody@FreeBSD.org  Mon Jun  5 15:55:57 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 53BFC16AF1C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  5 Jun 2006 15:55:57 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1DE4343D46
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  5 Jun 2006 15:55:57 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k55Ftuui073403
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 5 Jun 2006 15:55:56 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k55Fttl8073401;
	Mon, 5 Jun 2006 15:55:55 GMT
	(envelope-from nobody)
Message-Id: <200606051555.k55Fttl8073401@www.freebsd.org>
Date: Mon, 5 Jun 2006 15:55:55 GMT
From: Sergey Starosek <star@sunbay.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: p5-IMAP-Sieve fails PLAIN authentication against timsieved (cyrus-imapd)
X-Send-Pr-Version: www-2.3

>Number:         98537
>Category:       ports
>Synopsis:       mail/p5-IMAP-Sieve fails PLAIN authentication against timsieved (cyrus-imapd)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kuriyama
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 05 16:00:35 GMT 2006
>Closed-Date:    Sat Mar 10 08:51:11 GMT 2007
>Last-Modified:  Sat Mar 10 09:00:11 GMT 2007
>Originator:     Sergey Starosek
>Release:        6.0-RELEASE
>Organization:
Sunbay Software Crimea Ltd.
>Environment:
>Description:
After upgrading to cyrus-imapd to version 2.3.6, websieve-0.63.a stopped working failing to authenticate user with the following error:

Jun  5 18:37:06 host sieve[64799]: starttls: TLSv1 with cipher AES256-SHA (256/256 bits new) no authentication
Jun  5 18:37:07 host sieve[64799]: badlogin: localhost.example.com[127.0.0.1] PLAIN error base64 decoding string

Websieve in this case reports the following error:

System Error: IMAP::Sieve [ Login incorrect while connecting to localhost ]: NO "Authentication Error"
Wrong Password! 

Quick search via Google gave a hint that probably base64 encoded string contains a eol marker at position 76. Patching Sieve.pm solves a problem.

>How-To-Repeat:
Install cyrus-imap (with SASL and PLAIN auth support) and websieve from ports.
Try to login with valid user account.

>Fix:
Here's a patch which solves the problem by defining empty eol separator while calling encode_base64()

--- Sieve.pm.orig	Mon Jun  5 18:50:26 2006
+++ Sieve.pm	Mon Jun  5 18:50:49 2006
@@ -178,7 +178,7 @@
 	}
     }
     $userpass = "$self->{'Proxy'}\x00".$self->{'Login'}."\x00".$self->{'Password'};
-    $encode=encode_base64($userpass);
+    $encode=encode_base64($userpass, '');
     $len=length($encode);
     print $fh "AUTHENTICATE \"PLAIN\" {$len+}\r\n";

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->kuriyama 
Responsible-Changed-By: erwin 
Responsible-Changed-When: Mon Jun 5 16:08:24 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98537 
State-Changed-From-To: open->closed 
State-Changed-By: kuriyama 
State-Changed-When: Sat Mar 10 08:50:53 UTC 2007 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98537 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/98537: commit references a PR
Date: Sat, 10 Mar 2007 08:50:30 +0000 (UTC)

 kuriyama    2007-03-10 08:50:24 UTC
 
   FreeBSD ports repository
 
   Modified files:
     mail/p5-IMAP-Sieve   Makefile 
     mail/p5-IMAP-Sieve/files patch-Sieve.pm 
   Log:
   - Fix broken PLAIN authentication against timsieved.
   
   PR:             ports/98537
   Submitted by:   Sergey Starosek <star@sunbay.com>
   
   Revision  Changes    Path
   1.6       +1 -1      ports/mail/p5-IMAP-Sieve/Makefile
   1.2       +7 -4      ports/mail/p5-IMAP-Sieve/files/patch-Sieve.pm
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
