ports/51425: New port: Websieve, a web based Cyrus IMAP user admin client

Oliver Eikemeier eikemeier at fillmore-labs.com
Sat Apr 26 00:40:11 UTC 2003


>Number:         51425
>Category:       ports
>Synopsis:       New port: Websieve, a web based Cyrus IMAP user admin client
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 25 17:40:08 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
Fillmore Labs - http://www.fillmore-labs.com
>Environment:
System: FreeBSD www.fillmore-labs.com 4.8-STABLE FreeBSD 4.8-STABLE #0: Sun Apr 6 14:21:01 CEST 2003 root at nuuk.fillmore-labs.com:/usr/obj/usr/src/sys/FILLMORE-LABS i386

>Description:

Websieve is a web based Cyrus IMAP user admin client. The project is hosted at
http://sourceforge.net/projects/websieve/

The port leaves room for improvements, but solves my current needs. It is
split in two parts:

mail/websieve - the perl cgi script
mail/p5-IMAP-Sieve - supporting perl module, also known as 'perlsieve'

>How-To-Repeat:
>Fix:

--- websieve.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	websieve
#	websieve/Makefile
#	websieve/files
#	websieve/files/patch-funclib.pl
#	websieve/files/patch-websieve.pl
#	websieve/files/patch-websieve.conf
#	websieve/distinfo
#	websieve/pkg-descr
#	websieve/pkg-plist
#	websieve/pkg-message
#
echo c - websieve
mkdir -p websieve > /dev/null 2>&1
echo x - websieve/Makefile
sed 's/^X//' >websieve/Makefile << 'END-of-websieve/Makefile'
X# New ports collection makefile for:	websieve
X# Date created:		25 Apr 2003
X# Whom:			Oliver Eikemeier <eikemeier at fillmore-labs.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	websieve
XPORTVERSION=	0.61
XCATEGORIES=	mail
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	${PORTNAME}
X
XMAINTAINER=	eikemeier at fillmore-labs.com
XCOMMENT=	Web based Cyrus IMAP user admin client
X
XRUN_DEPENDS=	${SITE_PERL}/IMAP/Admin.pm:${PORTSDIR}/mail/p5-IMAP-Admin \
X		${SITE_PERL}/IMAP/Sieve.pm:mail/p5-IMAP-Sieve \
X		${SITE_PERL}/CGI/Cache.pm:${PORTSDIR}/www/p5-CGI-Cache
X.if defined(WITH_APACHE2)
XRUN_DEPENDS+=	${LOCALBASE}/www/cgi-bin:${PORTSDIR}/www/apache2
X.else
XRUN_DEPENDS+=	${LOCALBASE}/www/cgi-bin:${PORTSDIR}/www/apache13
X.endif
X
XWRKSRC=		${WRKDIR}/${PORTNAME}
X
XUSE_REINPLACE=	yes
XUSE_PERL5_RUN=	yes
X
XNO_BUILD=	yes
X
Xpost-configure:
X		@${REINPLACE_CMD} -e "s,require[ 	]*'\./\([^']*\)',require '${PREFIX}/etc/websieve/\1'," \
X			${WRKSRC}/websieve.pl
X
Xdo-install:
X		${INSTALL_SCRIPT} ${WRKSRC}/websieve.pl ${PREFIX}/www/cgi-bin
X		${MKDIR} ${PREFIX}/etc/websieve
X		${INSTALL_DATA} ${WRKSRC}/websieve.conf ${PREFIX}/etc/websieve/websieve.conf.sample
X		${INSTALL_DATA} ${WRKSRC}/funclib.pl ${PREFIX}/etc/websieve
X
Xpost-install:
X		@${SED} 's,%%PREFIX%%,${PREFIX},g' ${PKGMESSAGE}
X
X.include <bsd.port.mk>
END-of-websieve/Makefile
echo c - websieve/files
mkdir -p websieve/files > /dev/null 2>&1
echo x - websieve/files/patch-funclib.pl
sed 's/^X//' >websieve/files/patch-funclib.pl << 'END-of-websieve/files/patch-funclib.pl'
X--- funclib.pl.orig	Mon Sep 24 14:50:50 2001
X+++ funclib.pl	Wed Apr 23 19:24:59 2003
X@@ -51,7 +51,7 @@
X 	$IMAPERROR=$imap->{'Error'} unless (defined(@tmp) && scalar(@tmp) > 1);
X 	return  unless (defined(@tmp) && scalar(@tmp) > 1);
X #recreate array and remove extra spaces - fixes array properly
X-	@tmp=($tmp[3],$tmp[4],$tmp[5]);
X+#	@tmp=($tmp[3],$tmp[4],$tmp[5]);
X 	return @tmp;
X        	
X }
END-of-websieve/files/patch-funclib.pl
echo x - websieve/files/patch-websieve.pl
sed 's/^X//' >websieve/files/patch-websieve.pl << 'END-of-websieve/files/patch-websieve.pl'
X--- websieve.pl.orig	Mon Sep 17 01:23:49 2001
X+++ websieve.pl	Fri Apr 25 19:49:30 2003
X@@ -301,7 +301,7 @@
X 	}
X 
X 	print "</TABLE></TD></TABLE>";
X-	print "<b>NOTE:&nbspYou will lose ALL changes made to a script in advanced mode if you switch back to basic mode.</b>" if ($mode eq 'advanced' && $op eq 'advanced');
X+	print "<b>NOTE: You will lose ALL changes made to a script in advanced mode if you switch back to basic mode.</b>" if ($mode eq 'advanced' && $op eq 'advanced');
X }
X 
X 
X@@ -405,7 +405,7 @@
X 		else {
X 		    $change=1 ;
X 		    param('mbx',$mbx);
X-		    print hidden('mbx');
X+		    #print hidden('mbx');
X 		}
X 	}
X 	if (!$mbx || !(( $acl && $useracl) || $maxquota)) {
X@@ -547,7 +547,7 @@
X 	}
X 	@tmpbox=@mailboxes;
X         print "<TR><TD >",popup_menu('selectedmbx',[@aclview],' ') if ($shortacl);
X-	print "&nbsp&nbsp".submit('Select Folder')."&nbsp".submit('Up One Level')."</TD></TR>" if ($shortacl && $ismanager);
X+	print "  ".submit('Select Folder')." ".submit('Up One Level')."</TD></TR>" if ($shortacl && $ismanager);
X 
X 	print "</TABLE>";
X 	print "</TD></TABLE>";
X@@ -567,10 +567,10 @@
X 	if (!$ismanager) {
X                 print popup_menu('mbx',[@tmpbox],' ')."</TD></TR>";
X 	} else {
X-		print textfield("mbx","",48)."&nbsp&nbsp&nbsp".submit("Select","Select $subtext")."&nbsp&nbsp(Wildcards allowed [*])</TD></TR>";
X+		print textfield("mbx","",48)."   ".submit("Select","Select $subtext")."  (Wildcards allowed [*])</TD></TR>";
X 	}
X 	print "<TR><TD $cb ><b>Foreign User ID:</b></TD>";
X-        print "<TD $cb>".textfield("acluser")."&nbsp(User ID to assign access rights) &nbsp".submit("Set Acl")."</TD></TR>";
X+        print "<TD $cb>".textfield("acluser")." (User ID to assign access rights)  ".submit("Set Acl")."</TD></TR>";
X 
X 	print "<TD><b> General Rights:</b></TD><TD $cb>".radio_group('rights',[@rights],"-",'',\%rightshash)."</TD></TR>";	
X 	print "<TR><TD $cb><b>Specific Rights:</b></TD><TD $cb>".checkbox_group('acl',[@acls],'','',\%aclhash)."</TD></TR>";
X@@ -580,7 +580,7 @@
X 		param('aclmaxquota',$imapquota[2]);	
X 		print "<TR><TD><$cb><B>Disk Quota Limit (KB):</b></TD><TD $cb>";
X 		print textfield('aclmaxquota',$imapquota[2],20,40);
X-	   print "&nbsp&nbsp<b>Disk Quota Used (KB):</b>&nbsp&nbsp".$imapquota[1]."&nbsp&nbsp".submit("Set Quota")."</TD></TR>";
X+	   print "  <b>Disk Quota Used (KB):</b>  ".$imapquota[1]."  ".submit("Set Quota")."</TD></TR>";
X 	}
X 	print "</TABLE>";
X 	print "</TD></TABLE>",br;
X@@ -592,10 +592,10 @@
X 	param('delmailbox','');
X 	param('newmbx','');
X 	param('partition','');
X-	print "<TR><TD $cb ><b>$subtext to Create:</b></TD><TD $cb>".textfield("newmbx")."&nbsp&nbsp";
X+	print "<TR><TD $cb ><b>$subtext to Create:</b></TD><TD $cb>".textfield("newmbx")."  ";
X 	print "<b>Partition: </b>",textfield("partition") if $ismanager;
X-	print"&nbsp&nbsp". submit('Create Mailbox',"Create $subtext")."&nbsp&nbsp</TR>";
X-	print "<TR><TD $cb ><b>$subtext to Delete:</b></TD><TD $cb>".textfield("delmailbox")."&nbsp&nbsp&nbsp".submit("Delete This Mailbox","Delete $subtext")."</tr>" if $ismanager;
X+	print"  ". submit('Create Mailbox',"Create $subtext")."  </TR>";
X+	print "<TR><TD $cb ><b>$subtext to Delete:</b></TD><TD $cb>".textfield("delmailbox")."   ".submit("Delete This Mailbox","Delete $subtext")."</tr>" if $ismanager;
X 
X 	print "</TABLE>";
X 	print "</TD></TABLE>";
X@@ -1046,7 +1046,7 @@
X 	if (!$rulecount) {
X 		print " [No Rules avalailable]<br>";
X 	}
X-	print "<hr><center>",submit('Save Changes'),"&nbsp&nbsp",submit("Refresh"),"&nbsp&nbsp",reset("Reset Values"),"</center>";
X+	print "<hr><center>",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset("Reset Values"),"</center>";
X 
X 	} # if viewrules
X      if (($op eq 'addrule'  || $modrule) && ($op ne 'forward')) {
X@@ -1057,8 +1057,8 @@
X 	print "<center><b>New Rule Entry for user: </b>$uid</center></TD></TR><TR $cb><TD>";
X 	print "<TABLE >";
X 	print "<TR $cb><TD><b>Rule#: </b>[$rulecount]";
X-		print "&nbsp&nbsp<b>Priority: </b>",textfield("rules.priority.$rulecount",$spriority,2);
X-		print "&nbsp&nbsp<b>Status: </b>",popup_menu("rules.ruletype.$rulecount",[@ruletype],'ENABLED'),"</TD><TD></TR>";
X+		print "  <b>Priority: </b>",textfield("rules.priority.$rulecount",$spriority,2);
X+		print "  <b>Status: </b>",popup_menu("rules.ruletype.$rulecount",[@ruletype],'ENABLED'),"</TD><TD></TR>";
X 	my @checked;
X 	my @checkvalues=("copy","keep");
X 	push @checkvalues,"regex" if $useregex;
X@@ -1096,23 +1096,23 @@
X 			param("rules.searchflg.$rulecount","$ssearchflg");
X 			print popup_menu("rules.searchflg.$rulecount",[@flgsts],$ssearchflg,\%searchflghash);	
X 		}	
X-		print " field(s):</b></TD><TD $cb>&nbsp 'from' contains ",
X+		print " field(s):</b></TD><TD $cb>  'from' contains ",
X 		"</TD><TD $cb >";
X 		param("rules.from.$rulecount","$sfrom");
X 		print textfield("rules.from.$rulecount","$sfrom",50),"</TD></TR>";
X 		
X ############# TO field
X 		print "<TR>";		
X-		print "<TD $cb align=right>&nbsp</TD><TD $cb >";
X-		print "&nbsp 'to' contains ",
X+		print "<TD $cb align=right> </TD><TD $cb >";
X+		print "  'to' contains ",
X 		"</TD><TD $cb >";
X 		param("rules.to.$rulecount","$sto");
X 		print textfield("rules.to.$rulecount","$sto",50),"</TD></TR>";
X 
X ########### SUBJECT field
X 		print "<TR></TD>";
X-		print "<TD $cb align=right>&nbsp</TD><TD $cb>";
X-		print "&nbsp 'subject' contains ",
X+		print "<TD $cb align=right> </TD><TD $cb>";
X+		print "  'subject' contains ",
X 		"</TD><TD $cb>";
X 		param("rules.subject.$rulecount","$ssubject");
X 		print textfield("rules.subject.$rulecount","$ssubject",50),"</TD></TR>";
X@@ -1154,26 +1154,26 @@
X 
X ############## Action REDIRECT 
X 		param("rules.forward.$rulecount","$sdest1");
X-		print "<TD $cb>&nbsp</TD><TD $cb><input type=radio $check1 name=rules.desttype.$rulecount value=\"address\"> Forward To </TD><TD $cb>";
X+		print "<TD $cb> </TD><TD $cb><input type=radio $check1 name=rules.desttype.$rulecount value=\"address\"> Forward To </TD><TD $cb>";
X 		print textfield("rules.forward.$rulecount",$sdest1,50)," (Email Address) </TD></TR><TR>";
X 
X ############### Action REPLY WITH	
X 		if ($usereply) {
X 
X 			param("rules.reply.$rulecount","$sdest2") if (defined $sdest2);
X-			print "<TD $cb>&nbsp</TD><TD $cb valign=top><input type=radio $check2 name=rules.desttype.$rulecount value=\"reply\"> Reply With  </TD><TD $cb>";
X+			print "<TD $cb> </TD><TD $cb valign=top><input type=radio $check2 name=rules.desttype.$rulecount value=\"reply\"> Reply With  </TD><TD $cb>";
X 			print textarea("rules.reply.$rulecount",$sdest2,2,43)," (Text Message) </TD></TR>";
X 
X 		}
X ############## Action Reject  
X 	     if ($usereject) { 
X 	        	param("rules.reject.$rulecount","$sdest3");
X-		        print "<TD $cb>&nbsp</TD><TD $cb valign=top><input type=radio $check3 name=rules.desttype.$rulecount value=\"reject\"> Reject </TD><TD $cb>";
X+		        print "<TD $cb> </TD><TD $cb valign=top><input type=radio $check3 name=rules.desttype.$rulecount value=\"reject\"> Reject </TD><TD $cb>";
X 		        print textarea("rules.reject.$rulecount",$sdest3,2,43)," (Text Message) </TD></TR>";
X 	     }
X ############## Action Discard  
X 	     if ($usediscard) { 
X-		        print "<TD $cb>&nbsp</TD><TD $cb valign=top><input type=radio $check4 name=rules.desttype.$rulecount value=\"discard\"> Discard </TD><TD $cb>&nbsp</TD></TR>";
X+		        print "<TD $cb> </TD><TD $cb valign=top><input type=radio $check4 name=rules.desttype.$rulecount value=\"discard\"> Discard </TD><TD $cb> </TD></TR>";
X 	     }
X 
X ############### Action CustomCode	
X@@ -1196,7 +1196,7 @@
X 	print hr,"<TABLE ><TR><TD >$wild</TD></TABLE>";
X 
X 	$rulecount--;
X-	print hr,"<center>",submit("Save Rule "),"&nbsp&nbsp",reset('Clear'),"</center>";
X+	print hr,"<center>",submit("Save Rule "),"  ",reset('Clear'),"</center>";
X 
X       } # if addrule
X 
X@@ -1248,7 +1248,7 @@
X 	print "<TD $cb><b>Server: </b>$imapserver</TD><TD $cb><b>Userid: </b>$uid</TD>"; 
X 	print "<TD $cb><b>Used Quota: </b>";
X 	if ($percent ne "") {
X-		print "[<b>$quota[1]</b> kbytes used /<b> $quota[2]</b> kbytes available.($percent\% usage)]</TD>";
X+		print "[<b>$quota[1]</b> kbytes used /<b> $quota[2]</b> kbytes available. ($percent\% usage)]</TD>";
X 	} else {
X 		print "<TD $cb><b>$quota[1]</b> No limits</TD>";
X 	};
X@@ -1387,7 +1387,7 @@
X 	print start_form(-action=>$program_url);
X 	$gomodifyit = 'yes';
X 	 print hidden('s',$sencode_params) if $useservercookie;
X-	 print "<center>",submit('Save Changes'),"&nbsp&nbsp",submit("Refresh"),"&nbsp&nbsp",reset('Reset Values'),"</center>" if $op;
X+	 print "<center>",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"</center>" if $op;
X 	param('op',$op);
X 	if (param('action') && param('action') eq 'deletembx') {
X 		&deleteimapmailbox;
X@@ -1407,7 +1407,7 @@
X 	&initscripts(%scripts);
X 	if ($op eq 'setacl') {
X 	 	&viewacl if $useacl;
X-		print "<hr><center>",submit('Save Changes'),"&nbsp&nbsp",submit("Refresh"),"&nbsp&nbsp",reset('Reset Values'),"</center>";
X+		print "<hr><center>",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"</center>";
X 
X 	}
X 	if ($mode =~ /basic/i && $op ne 'setacl') {
X@@ -1420,7 +1420,7 @@
X #		print "printing $op<br>";
X 
X 		&printscript($scripts{'script'}) ;
X-	print "<hr><center>",submit('Save Changes'),"&nbsp&nbsp",submit("Refresh"),"&nbsp&nbsp",reset('Reset Values'),"</center>";
X+	print "<hr><center>",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"</center>";
X 
X 
X 	}
END-of-websieve/files/patch-websieve.pl
echo x - websieve/files/patch-websieve.conf
sed 's/^X//' >websieve/files/patch-websieve.conf << 'END-of-websieve/files/patch-websieve.conf'
X--- websieve.conf.orig	Fri Apr 25 15:55:52 2003
X+++ websieve.conf	Fri Apr 25 16:02:55 2003
X@@ -1,10 +1,10 @@
X #Websieve configuration file
X 
X #set $useldapextras=1 to use Jules Agee's ldap administration functions
X-$useldapextras=1;
X+$useldapextras=0;
X 
X #set $useauth=1 to use ldap (for ldap password changes)
X-$useauth=1;
X+$useauth=0;
X $LDAP_SERVER='localhost';
X $LDAP_BASEDN='o=toshiba of canada,c=ca';
X $ENCRYPT_PASS=1;
X@@ -16,17 +16,17 @@
X # You can write you own functions to change passwords on a different auth
X # mechanism such as on a MysSql server, Qualcomm poppassd server, etc.
X 
X-require "./custom.pl";
X+#require "/usr/local/etc/websieve/custom.pl";
X 
X #secret key - CHANGE THIS to some random data!!!!
X $skey = "your secret key CEDEFEKJKIIEIOO***#KIKIDKKEUIULJLJKJ";
X #use RC4 algorithm for encryption instead of rot13
X $userc4=1;
X #cyrus admin user id that is used for general mailbox administration
X-$cyrusadminuid='admin';
X+$cyrusadminuid='cyrus';
X 
X # default imap server host name 
X-$imapserver='imap.toshiba.ca';
X+$imapserver='localhost';
X 
X #make sure you set this to your program virtual name and path
X #$program_url = "/cgi-bin/websieve.pl" ;      # URL for this program
X@@ -36,7 +36,7 @@
X $imapport='143';
X 
X #your mail domain
X-$maildomain='test.toshiba.ca' ;
X+$maildomain='example.com' ;
X 
X #default FQHN of the  mail server for use in vacation addresses
X $mailhostappend="imap.$maildomain";
X@@ -60,10 +60,8 @@
X #$sieveport,$imapport,$maildomain, $imapserver and $usexxxSSL will be used instead.
X 
X %server_hosts=(
X-"imap.toshiba.ca"=>['Local Server','143','2000','toshiba.ca','imap.toshiba.ca'],
X-"otherhost"=>['Some otherhost','993','2000','maildomain2','vacationhost2','ssl_imap'],
X-"mtl.toshiba.ca"=>['Mtl Server','143','2000','toshiba.ca','mtl.toshiba.ca'],
X-"otherhostname"=>['other Imap Server','143','2000','other.toshiba.ca','vacationhost3']
X+"localhost"=>['Local Server','143','2000','example.com','example.com'],
X+"127.0.0.1"=>['Secure Server','993','2000','example.com','example.com','ssl_imap']
X );
X 
X # show server selection option at login otherwise defaults to $imapserver
X@@ -85,7 +83,7 @@
X $header1="Mail Account Management";
X 
X # This is the address that supports your mail server
X-$problem_email="administrator\@$maildomain" ;
X+$problem_email="postmaster\@$maildomain" ;
X 
X # list of additional namespaces on IMAP server
X @namespaces = ("public2");
X@@ -183,7 +181,7 @@
X 
X # Menu selections 
X $LOGOUTURL="<a href=$program_url?op=logout>[LOGOUT]</a>" if !$LOGOUTURL;
X-$HOMEURL="<a href=/index.html>[HOME]</a>";
X+$HOMEURL="<a href=/>[HOME]</a>";
X $HELPURL="<a href=/mailhelp.html>[HELP]</a>";
X $VIEWRULESURL="<a href=$program_url?op=viewrules>[View/Edit Rules]</a>";
X $FORWARDALLURL="<a href=$program_url?op=forward>[Forward Mail]</a>";
END-of-websieve/files/patch-websieve.conf
echo x - websieve/distinfo
sed 's/^X//' >websieve/distinfo << 'END-of-websieve/distinfo'
XMD5 (websieve-0.61.tar.gz) = 5f2d01a2479f8cdd8e2ea4fd1a09163e
END-of-websieve/distinfo
echo x - websieve/pkg-descr
sed 's/^X//' >websieve/pkg-descr << 'END-of-websieve/pkg-descr'
XA web based easy to use interface for creating Sieve scripts on an Cyrus
XIMAP mail server as well as allowing users to set access controls, create
Xnew mailboxes and view their mail quota. Also give administrators full
Xadministrative capabilities.
X
XAuthor: Alain Turbide <aturbide at toshiba.ca>
X
X
XWWW: http://sourceforge.net/projects/websieve
END-of-websieve/pkg-descr
echo x - websieve/pkg-plist
sed 's/^X//' >websieve/pkg-plist << 'END-of-websieve/pkg-plist'
Xwww/cgi-bin/websieve.pl
Xetc/websieve/websieve.conf.sample
Xetc/websieve/funclib.pl
X at dirrm etc/websieve
END-of-websieve/pkg-plist
echo x - websieve/pkg-message
sed 's/^X//' >websieve/pkg-message << 'END-of-websieve/pkg-message'
XWebsieve has been installed at <http://localhost/cgi-bin/websieve.pl>
X
XHowever, before you can use the program, you should copy the file
X"websieve.conf.sample" in %%PREFIX%%/etc/websieve to "websieve.conf"
Xedit it to suit your needs. Use "openssl rand -base64 39" to create
Xa new secret key.
END-of-websieve/pkg-message
exit
--- websieve.shar ends here ---


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	p5-IMAP-Sieve
#	p5-IMAP-Sieve/files
#	p5-IMAP-Sieve/files/patch-Sieve.pm
#	p5-IMAP-Sieve/files/patch-MANIFEST
#	p5-IMAP-Sieve/Makefile
#	p5-IMAP-Sieve/distinfo
#	p5-IMAP-Sieve/pkg-descr
#	p5-IMAP-Sieve/pkg-plist
#
echo c - p5-IMAP-Sieve
mkdir -p p5-IMAP-Sieve > /dev/null 2>&1
echo c - p5-IMAP-Sieve/files
mkdir -p p5-IMAP-Sieve/files > /dev/null 2>&1
echo x - p5-IMAP-Sieve/files/patch-Sieve.pm
sed 's/^X//' >p5-IMAP-Sieve/files/patch-Sieve.pm << 'END-of-p5-IMAP-Sieve/files/patch-Sieve.pm'
X--- Sieve.pm.orig	Sat Jun 23 22:42:48 2001
X+++ Sieve.pm	Thu Apr 24 18:10:29 2003
X@@ -93,7 +93,7 @@
X 							 Proto => 'tcp',
X 							 Reuse => 1); })
X     	{
X-		$self->_error("initialize", "could'nt establish a Sieve connection to",$self->{'Server'});				
X+		$self->_error("initialize", "couldn't establish a Sieve connection to",$self->{'Server'});				
X 		return;
X     	}
X     } # if SSL
X@@ -110,6 +110,7 @@
X     if (/\r$/) {
X 	chop;
X     }
X+    my $starttls = 0;
X     if (/IMPLEMENTATION/) {
X 	$self->{'Implementation'}=$1 if /^"IMPLEMENTATION" +"(.*)"/;
X     	#version 2 of cyrus imap/timsieved
X@@ -119,6 +120,7 @@
X         while (!/^OK/) {
X 	   $self->{'Capability'}=$1 if /^"SASL" +"(.*)"/;
X 	   $self->{'Sieve'}=$1 if /^"SIEVE" +"(.*)"/;
X+	   $starttls=1 if /"STARTTLS"/;
X 	   $_ = $self->_read;
X ##	   $_=$self->_read;
X 	}
X@@ -126,6 +128,55 @@
X     else {
X 	$self->{'Capability'}=$_;
X     }
X+    if (!defined($self->{'SSL'}) && $starttls) {
X+	my $cwd= cwd;
X+	my %ssl_defaults = (
X+			  'SSL_use_cert' => 0,
X+			  'SSL_verify_mode' => 0x00,
X+			  'SSL_key_file' => $cwd."/certs/client-key.pem",
X+			  'SSL_cert_file' => $cwd."/certs/client-cert.pem",
X+			  'SSL_ca_path' => $cwd."/certs",
X+			  'SSL_ca_file' => $cwd."/certs/ca-cert.pem",
X+			  'SSL_version' => 'tlsv1'
X+			  );
X+	my @ssl_options;
X+	my $ssl_key;
X+	my $key;
X+	foreach $ssl_key (keys(%ssl_defaults)) {
X+		if (!defined($self->{$ssl_key})) {
X+			$self->{$ssl_key} = $ssl_defaults{$ssl_key};
X+		}
X+	}
X+	foreach $ssl_key (keys(%{$self})) {
X+		if ($ssl_key =~ /^SSL_/) {
X+			push @ssl_options, $ssl_key,$self->{$ssl_key};
X+		}
X+	}
X+        my $SSL_try="use IO::Socket::SSL";
X+	eval $SSL_try;
X+#	$IO::Socket::SSL::DEBUG = 4;
X+	if ($self->{'Socket'}->isa('IO::Socket::SSL')) {
X+	    $self->_error("starttls", "TLS already started");
X+	    $self->close;
X+	    return;
X+	}
X+	print $fh "STARTTLS\r\n";
X+	$_ = $self->_read;
X+	if (/OK/) {
X+
X+	    #IO::Socket::SSL::context_init({@ssl_options});
X+	    if (!IO::Socket::SSL::socket_to_SSL($self->{'Socket'}, {@ssl_options}))
X+    		{
X+			$self->_error("starttls", "couldn't secure connection to",$self->{'Server'});
X+	    		$self->close;
X+			return;
X+    		}
X+	} else {
X+	    $self->close;
X+	    $self->_error("starttls", "Unknown error",$_);
X+	    return;
X+	}
X+    }
X     $userpass = "$self->{'Proxy'}\x00".$self->{'Login'}."\x00".$self->{'Password'};
X     $encode=encode_base64($userpass);
X     $len=length($encode);
X@@ -196,7 +247,7 @@
X 			}
X 		}
X 		else {
X-			if (($char eq "\n") or ($char eq "\r")) {
X+			if ($char eq "\n") {
X 				if (length($buffer) ==0) {
X 					# remove any cr or nl leftover
X 				}
X@@ -204,7 +255,7 @@
X 					return $buffer;
X 				}
X 			}
X-			else {
X+			elsif ($char ne "\r") {
X 				$buffer.=$char;
X 			}
X 		}
END-of-p5-IMAP-Sieve/files/patch-Sieve.pm
echo x - p5-IMAP-Sieve/files/patch-MANIFEST
sed 's/^X//' >p5-IMAP-Sieve/files/patch-MANIFEST << 'END-of-p5-IMAP-Sieve/files/patch-MANIFEST'
X--- MANIFEST.orig	Fri Apr 25 18:47:03 2003
X+++ MANIFEST	Fri Apr 25 18:47:12 2003
X@@ -2,7 +2,6 @@
X GPL2.txt
X LGPL2.txt
X test.pl
X-testssl.pl
X Sieve.pm
X Changes
X MANIFEST
END-of-p5-IMAP-Sieve/files/patch-MANIFEST
echo x - p5-IMAP-Sieve/Makefile
sed 's/^X//' >p5-IMAP-Sieve/Makefile << 'END-of-p5-IMAP-Sieve/Makefile'
X# New ports collection makefile for:	p5-IMAP-Sieve
X# Date created:		25 Apr 2003
X# Whom:			Oliver Eikemeier <eikemeier at fillmore-labs.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	IMAP-Sieve
XPORTVERSION=	0.4.9
XCATEGORIES=	mail perl5
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	websieve
XPKGNAMEPREFIX=	p5-
XDISTNAME=	websieve-0.61
X
XMAINTAINER=	eikemeier at fillmore-labs.com
XCOMMENT=	Perl module to edit Sieve scripts on an Cyrus IMAP server
X
XRUN_DEPENDS=	${SITE_PERL}/IO/Socket/SSL.pm:${PORTSDIR}/security/p5-IO-Socket-SSL \
X		${SITE_PERL}/${PERL_ARCH}/IO.pm:${PORTSDIR}/devel/p5-IO
X
XWRKSRC=		${WRKDIR}/${PERLSIEVENAME}
X
XPERL_CONFIGURE=	yes
X
XPERLSIEVENAME=	perlsieve-${PORTVERSION}
XPERLSIEVESUFX=	b
X
Xpost-extract:
X	@if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${WRKDIR}/websieve/${PERLSIEVENAME}${PERLSIEVESUFX}${EXTRACT_SUFX} ${EXTRACT_AFTER_ARGS}); \
X	then \
X		exit 1; \
X	fi
X
Xpre-configure:
X	${RM} ${WRKSRC}/testssl.pl
X
X.include <bsd.port.mk>
END-of-p5-IMAP-Sieve/Makefile
echo x - p5-IMAP-Sieve/distinfo
sed 's/^X//' >p5-IMAP-Sieve/distinfo << 'END-of-p5-IMAP-Sieve/distinfo'
XMD5 (websieve-0.61.tar.gz) = 5f2d01a2479f8cdd8e2ea4fd1a09163e
END-of-p5-IMAP-Sieve/distinfo
echo x - p5-IMAP-Sieve/pkg-descr
sed 's/^X//' >p5-IMAP-Sieve/pkg-descr << 'END-of-p5-IMAP-Sieve/pkg-descr'
XA Perl module used by websieve for creating Sieve scripts on an Cyrus
XIMAP mail server. Sometimes also referenced as 'perlsieve'.
X
XAuthor: Alain Turbide <aturbide at toshiba.ca>
X
X
XWWW: http://sourceforge.net/projects/websieve
END-of-p5-IMAP-Sieve/pkg-descr
echo x - p5-IMAP-Sieve/pkg-plist
sed 's/^X//' >p5-IMAP-Sieve/pkg-plist << 'END-of-p5-IMAP-Sieve/pkg-plist'
X%%SITE_PERL%%/IMAP/Sieve.pm
X%%SITE_PERL%%/%%PERL_ARCH%%/auto/IMAP/Sieve/.packlist
X at dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/IMAP/Sieve
X at unexec rmdir %D%%SITE_PERL%%/%%PERL_ARCH%%/auto/IMAP 2>/dev/null || true
X at unexec rmdir %D%%SITE_PERL%%/IMAP 2>/dev/null || true
END-of-p5-IMAP-Sieve/pkg-plist
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list