# 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 X# X# $FreeBSD$ X# X XPORTNAME= websieve XPORTVERSION= 0.61 XCATEGORIES= mail XMASTER_SITES= ${MASTER_SITE_SOURCEFORGE} XMASTER_SITE_SUBDIR= ${PORTNAME} X XMAINTAINER= eikemeier@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 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 ""; X- print "NOTE: You will lose ALL changes made to a script in advanced mode if you switch back to basic mode." if ($mode eq 'advanced' && $op eq 'advanced'); X+ print "NOTE: You will lose ALL changes made to a script in advanced mode if you switch back to basic mode." 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 "",popup_menu('selectedmbx',[@aclview],' ') if ($shortacl); X- print "  ".submit('Select Folder')." ".submit('Up One Level')."" if ($shortacl && $ismanager); X+ print "  ".submit('Select Folder')." ".submit('Up One Level')."" if ($shortacl && $ismanager); X X print ""; X print ""; X@@ -567,10 +567,10 @@ X if (!$ismanager) { X print popup_menu('mbx',[@tmpbox],' ').""; X } else { X- print textfield("mbx","",48)."   ".submit("Select","Select $subtext")."  (Wildcards allowed [*])"; X+ print textfield("mbx","",48)."   ".submit("Select","Select $subtext")."  (Wildcards allowed [*])"; X } X print "Foreign User ID:"; X- print "".textfield("acluser")." (User ID to assign access rights)  ".submit("Set Acl").""; X+ print "".textfield("acluser")." (User ID to assign access rights)  ".submit("Set Acl").""; X X print " General Rights:".radio_group('rights',[@rights],"-",'',\%rightshash).""; X print "Specific Rights:".checkbox_group('acl',[@acls],'','',\%aclhash).""; X@@ -580,7 +580,7 @@ X param('aclmaxquota',$imapquota[2]); X print "<$cb>Disk Quota Limit (KB):"; X print textfield('aclmaxquota',$imapquota[2],20,40); X- print "  Disk Quota Used (KB):  ".$imapquota[1]."  ".submit("Set Quota").""; X+ print "  Disk Quota Used (KB):  ".$imapquota[1]."  ".submit("Set Quota").""; X } X print ""; X print "",br; X@@ -592,10 +592,10 @@ X param('delmailbox',''); X param('newmbx',''); X param('partition',''); X- print "$subtext to Create:".textfield("newmbx")."  "; X+ print "$subtext to Create:".textfield("newmbx")."  "; X print "Partition: ",textfield("partition") if $ismanager; X- print"  ". submit('Create Mailbox',"Create $subtext")."  "; X- print "$subtext to Delete:".textfield("delmailbox")."   ".submit("Delete This Mailbox","Delete $subtext")."" if $ismanager; X+ print"  ". submit('Create Mailbox',"Create $subtext")."  "; X+ print "$subtext to Delete:".textfield("delmailbox")."   ".submit("Delete This Mailbox","Delete $subtext")."" if $ismanager; X X print ""; X print ""; X@@ -1046,7 +1046,7 @@ X if (!$rulecount) { X print " [No Rules avalailable]
"; X } X- print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset("Reset Values"),"
"; X+ print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset("Reset Values"),"
"; X X } # if viewrules X if (($op eq 'addrule' || $modrule) && ($op ne 'forward')) { X@@ -1057,8 +1057,8 @@ X print "
New Rule Entry for user: $uid
"; X print ""; X print ""; X+ print "  Priority: ",textfield("rules.priority.$rulecount",$spriority,2); X+ print "  Status: ",popup_menu("rules.ruletype.$rulecount",[@ruletype],'ENABLED'),""; 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):"; X X ############# TO field X print ""; X- print ""; X X ########### SUBJECT field X print ""; X- print ""; X@@ -1154,26 +1154,26 @@ X X ############## Action REDIRECT X param("rules.forward.$rulecount","$sdest1"); X- print ""; X X ############### Action REPLY WITH X if ($usereply) { X X param("rules.reply.$rulecount","$sdest2") if (defined $sdest2); X- print ""; X X } X ############## Action Reject X if ($usereject) { X param("rules.reject.$rulecount","$sdest3"); X- print ""; X } X ############## Action Discard X if ($usediscard) { X- print ""; X+ print ""; X } X X ############### Action CustomCode X@@ -1196,7 +1196,7 @@ X print hr,"
Rule#: [$rulecount]"; X- print "  Priority: ",textfield("rules.priority.$rulecount",$spriority,2); X- print "  Status: ",popup_menu("rules.ruletype.$rulecount",[@ruletype],'ENABLED'),"
  'from' contains ", X+ print " field(s):  'from' contains ", X ""; X param("rules.from.$rulecount","$sfrom"); X print textfield("rules.from.$rulecount","$sfrom",50),"
 "; X- print "  'to' contains ", X+ print " "; X+ print "  'to' contains ", X ""; X param("rules.to.$rulecount","$sto"); X print textfield("rules.to.$rulecount","$sto",50),"
 "; X- print "  'subject' contains ", X+ print " "; X+ print "  'subject' contains ", X ""; X param("rules.subject.$rulecount","$ssubject"); X print textfield("rules.subject.$rulecount","$ssubject",50),"
  Forward To "; X+ print "  Forward To "; X print textfield("rules.forward.$rulecount",$sdest1,50)," (Email Address)
  Reply With "; X+ print "  Reply With "; X print textarea("rules.reply.$rulecount",$sdest2,2,43)," (Text Message)
  Reject "; X+ print "  Reject "; X print textarea("rules.reject.$rulecount",$sdest3,2,43)," (Text Message)
  Discard  
  Discard  
$wild
"; X X $rulecount--; X- print hr,"
",submit("Save Rule "),"  ",reset('Clear'),"
"; X+ print hr,"
",submit("Save Rule "),"  ",reset('Clear'),"
"; X X } # if addrule X X@@ -1248,7 +1248,7 @@ X print "Server: $imapserverUserid: $uid"; X print "Used Quota: "; X if ($percent ne "") { X- print "[$quota[1] kbytes used / $quota[2] kbytes available.($percent\% usage)]"; X+ print "[$quota[1] kbytes used / $quota[2] kbytes available. ($percent\% usage)]"; X } else { X print "$quota[1] No limits"; 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 "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"
" if $op; X+ print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"
" 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 "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"
"; X+ print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"
"; X X } X if ($mode =~ /basic/i && $op ne 'setacl') { X@@ -1420,7 +1420,7 @@ X # print "printing $op
"; X X &printscript($scripts{'script'}) ; X- print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"
"; X+ print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"
"; 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="[LOGOUT]" if !$LOGOUTURL; X-$HOMEURL="[HOME]"; X+$HOMEURL="[HOME]"; X $HELPURL="[HELP]"; X $VIEWRULESURL="[View/Edit Rules]"; X $FORWARDALLURL="[Forward Mail]"; 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 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@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 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