From 58187416e9cf3105f1890387fbea4887bf13eb5a Mon Sep 17 00:00:00 2001 From: Norikatsu Shigemura Date: Sat, 26 Apr 2003 21:50:25 +0000 Subject: Add websieve 0.61, web based Cyrus IMAP user admin client. PR: 51425 Submitted by: Oliver Eikemeier --- mail/websieve/Makefile | 48 ++++++++ mail/websieve/distinfo | 1 + mail/websieve/files/patch-funclib.pl | 11 ++ mail/websieve/files/patch-websieve.conf | 76 +++++++++++++ mail/websieve/files/patch-websieve.pl | 190 ++++++++++++++++++++++++++++++++ mail/websieve/pkg-descr | 9 ++ mail/websieve/pkg-message | 6 + mail/websieve/pkg-plist | 4 + 8 files changed, 345 insertions(+) create mode 100644 mail/websieve/Makefile create mode 100644 mail/websieve/distinfo create mode 100644 mail/websieve/files/patch-funclib.pl create mode 100644 mail/websieve/files/patch-websieve.conf create mode 100644 mail/websieve/files/patch-websieve.pl create mode 100644 mail/websieve/pkg-descr create mode 100644 mail/websieve/pkg-message create mode 100644 mail/websieve/pkg-plist (limited to 'mail/websieve') diff --git a/mail/websieve/Makefile b/mail/websieve/Makefile new file mode 100644 index 000000000000..a9842531ecb4 --- /dev/null +++ b/mail/websieve/Makefile @@ -0,0 +1,48 @@ +# New ports collection makefile for: websieve +# Date created: 25 Apr 2003 +# Whom: Oliver Eikemeier +# +# $FreeBSD$ +# + +PORTNAME= websieve +PORTVERSION= 0.61 +CATEGORIES= mail +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= ${PORTNAME} + +MAINTAINER= eikemeier@fillmore-labs.com +COMMENT= Web based Cyrus IMAP user admin client + +RUN_DEPENDS= ${SITE_PERL}/IMAP/Admin.pm:${PORTSDIR}/mail/p5-IMAP-Admin \ + ${SITE_PERL}/IMAP/Sieve.pm:mail/p5-IMAP-Sieve \ + ${SITE_PERL}/CGI/Cache.pm:${PORTSDIR}/www/p5-CGI-Cache +.if defined(WITH_APACHE2) +RUN_DEPENDS+= ${LOCALBASE}/www/cgi-bin:${PORTSDIR}/www/apache2 +.else +RUN_DEPENDS+= ${LOCALBASE}/www/cgi-bin:${PORTSDIR}/www/apache13 +.endif + +WRKSRC= ${WRKDIR}/${PORTNAME} +PKGMESSAGE= ${WRKDIR}/pkg-message + +USE_REINPLACE= yes +USE_PERL5_RUN= yes + +NO_BUILD= yes + +post-configure: + @${REINPLACE_CMD} -e "s,require[ ]*'\./\([^']*\)',require '${PREFIX}/etc/websieve/\1'," \ + ${WRKSRC}/websieve.pl + +do-install: + @${INSTALL_SCRIPT} ${WRKSRC}/websieve.pl ${PREFIX}/www/cgi-bin + @${MKDIR} ${PREFIX}/etc/websieve + @${INSTALL_DATA} ${WRKSRC}/websieve.conf ${PREFIX}/etc/websieve/websieve.conf.sample + @${INSTALL_DATA} ${WRKSRC}/funclib.pl ${PREFIX}/etc/websieve + @@${SED} 's,%%PREFIX%%,${PREFIX},g' ${.CURDIR}/pkg-message > ${PKGMESSAGE} + +post-install: + @${CAT} ${PKGMESSAGE} + +.include diff --git a/mail/websieve/distinfo b/mail/websieve/distinfo new file mode 100644 index 000000000000..6e94d0e47405 --- /dev/null +++ b/mail/websieve/distinfo @@ -0,0 +1 @@ +MD5 (websieve-0.61.tar.gz) = 5f2d01a2479f8cdd8e2ea4fd1a09163e diff --git a/mail/websieve/files/patch-funclib.pl b/mail/websieve/files/patch-funclib.pl new file mode 100644 index 000000000000..be0e951d1e2f --- /dev/null +++ b/mail/websieve/files/patch-funclib.pl @@ -0,0 +1,11 @@ +--- funclib.pl.orig Mon Sep 24 14:50:50 2001 ++++ funclib.pl Wed Apr 23 19:24:59 2003 +@@ -51,7 +51,7 @@ + $IMAPERROR=$imap->{'Error'} unless (defined(@tmp) && scalar(@tmp) > 1); + return unless (defined(@tmp) && scalar(@tmp) > 1); + #recreate array and remove extra spaces - fixes array properly +- @tmp=($tmp[3],$tmp[4],$tmp[5]); ++# @tmp=($tmp[3],$tmp[4],$tmp[5]); + return @tmp; + + } diff --git a/mail/websieve/files/patch-websieve.conf b/mail/websieve/files/patch-websieve.conf new file mode 100644 index 000000000000..13e7ccb3fcf7 --- /dev/null +++ b/mail/websieve/files/patch-websieve.conf @@ -0,0 +1,76 @@ +--- websieve.conf.orig Fri Apr 25 15:55:52 2003 ++++ websieve.conf Fri Apr 25 16:02:55 2003 +@@ -1,10 +1,10 @@ + #Websieve configuration file + + #set $useldapextras=1 to use Jules Agee's ldap administration functions +-$useldapextras=1; ++$useldapextras=0; + + #set $useauth=1 to use ldap (for ldap password changes) +-$useauth=1; ++$useauth=0; + $LDAP_SERVER='localhost'; + $LDAP_BASEDN='o=toshiba of canada,c=ca'; + $ENCRYPT_PASS=1; +@@ -16,17 +16,17 @@ + # You can write you own functions to change passwords on a different auth + # mechanism such as on a MysSql server, Qualcomm poppassd server, etc. + +-require "./custom.pl"; ++#require "/usr/local/etc/websieve/custom.pl"; + + #secret key - CHANGE THIS to some random data!!!! + $skey = "your secret key CEDEFEKJKIIEIOO***#KIKIDKKEUIULJLJKJ"; + #use RC4 algorithm for encryption instead of rot13 + $userc4=1; + #cyrus admin user id that is used for general mailbox administration +-$cyrusadminuid='admin'; ++$cyrusadminuid='cyrus'; + + # default imap server host name +-$imapserver='imap.toshiba.ca'; ++$imapserver='localhost'; + + #make sure you set this to your program virtual name and path + #$program_url = "/cgi-bin/websieve.pl" ; # URL for this program +@@ -36,7 +36,7 @@ + $imapport='143'; + + #your mail domain +-$maildomain='test.toshiba.ca' ; ++$maildomain='example.com' ; + + #default FQHN of the mail server for use in vacation addresses + $mailhostappend="imap.$maildomain"; +@@ -60,10 +60,8 @@ + #$sieveport,$imapport,$maildomain, $imapserver and $usexxxSSL will be used instead. + + %server_hosts=( +-"imap.toshiba.ca"=>['Local Server','143','2000','toshiba.ca','imap.toshiba.ca'], +-"otherhost"=>['Some otherhost','993','2000','maildomain2','vacationhost2','ssl_imap'], +-"mtl.toshiba.ca"=>['Mtl Server','143','2000','toshiba.ca','mtl.toshiba.ca'], +-"otherhostname"=>['other Imap Server','143','2000','other.toshiba.ca','vacationhost3'] ++"localhost"=>['Local Server','143','2000','example.com','example.com'], ++"127.0.0.1"=>['Secure Server','993','2000','example.com','example.com','ssl_imap'] + ); + + # show server selection option at login otherwise defaults to $imapserver +@@ -85,7 +83,7 @@ + $header1="Mail Account Management"; + + # This is the address that supports your mail server +-$problem_email="administrator\@$maildomain" ; ++$problem_email="postmaster\@$maildomain" ; + + # list of additional namespaces on IMAP server + @namespaces = ("public2"); +@@ -183,7 +181,7 @@ + + # Menu selections + $LOGOUTURL="[LOGOUT]" if !$LOGOUTURL; +-$HOMEURL="[HOME]"; ++$HOMEURL="[HOME]"; + $HELPURL="[HELP]"; + $VIEWRULESURL="[View/Edit Rules]"; + $FORWARDALLURL="[Forward Mail]"; diff --git a/mail/websieve/files/patch-websieve.pl b/mail/websieve/files/patch-websieve.pl new file mode 100644 index 000000000000..2a59764d89c7 --- /dev/null +++ b/mail/websieve/files/patch-websieve.pl @@ -0,0 +1,190 @@ +--- websieve.pl.orig Mon Sep 17 01:23:49 2001 ++++ websieve.pl Fri Apr 25 19:49:30 2003 +@@ -301,7 +301,7 @@ + } + + print ""; +- 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'); ++ 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'); + } + + +@@ -405,7 +405,7 @@ + else { + $change=1 ; + param('mbx',$mbx); +- print hidden('mbx'); ++ #print hidden('mbx'); + } + } + if (!$mbx || !(( $acl && $useracl) || $maxquota)) { +@@ -547,7 +547,7 @@ + } + @tmpbox=@mailboxes; + print "",popup_menu('selectedmbx',[@aclview],' ') if ($shortacl); +- print "  ".submit('Select Folder')." ".submit('Up One Level')."" if ($shortacl && $ismanager); ++ print "  ".submit('Select Folder')." ".submit('Up One Level')."" if ($shortacl && $ismanager); + + print ""; + print ""; +@@ -567,10 +567,10 @@ + if (!$ismanager) { + print popup_menu('mbx',[@tmpbox],' ').""; + } else { +- print textfield("mbx","",48)."   ".submit("Select","Select $subtext")."  (Wildcards allowed [*])"; ++ print textfield("mbx","",48)."   ".submit("Select","Select $subtext")."  (Wildcards allowed [*])"; + } + print "Foreign User ID:"; +- print "".textfield("acluser")." (User ID to assign access rights)  ".submit("Set Acl").""; ++ print "".textfield("acluser")." (User ID to assign access rights)  ".submit("Set Acl").""; + + print " General Rights:".radio_group('rights',[@rights],"-",'',\%rightshash).""; + print "Specific Rights:".checkbox_group('acl',[@acls],'','',\%aclhash).""; +@@ -580,7 +580,7 @@ + param('aclmaxquota',$imapquota[2]); + print "<$cb>Disk Quota Limit (KB):"; + print textfield('aclmaxquota',$imapquota[2],20,40); +- print "  Disk Quota Used (KB):  ".$imapquota[1]."  ".submit("Set Quota").""; ++ print "  Disk Quota Used (KB):  ".$imapquota[1]."  ".submit("Set Quota").""; + } + print ""; + print "",br; +@@ -592,10 +592,10 @@ + param('delmailbox',''); + param('newmbx',''); + param('partition',''); +- print "$subtext to Create:".textfield("newmbx")."  "; ++ print "$subtext to Create:".textfield("newmbx")."  "; + print "Partition: ",textfield("partition") if $ismanager; +- print"  ". submit('Create Mailbox',"Create $subtext")."  "; +- print "$subtext to Delete:".textfield("delmailbox")."   ".submit("Delete This Mailbox","Delete $subtext")."" if $ismanager; ++ print"  ". submit('Create Mailbox',"Create $subtext")."  "; ++ print "$subtext to Delete:".textfield("delmailbox")."   ".submit("Delete This Mailbox","Delete $subtext")."" if $ismanager; + + print ""; + print ""; +@@ -1046,7 +1046,7 @@ + if (!$rulecount) { + print " [No Rules avalailable]
"; + } +- print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset("Reset Values"),"
"; ++ print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset("Reset Values"),"
"; + + } # if viewrules + if (($op eq 'addrule' || $modrule) && ($op ne 'forward')) { +@@ -1057,8 +1057,8 @@ + print "
New Rule Entry for user: $uid
"; + print ""; + print ""; ++ print "  Priority: ",textfield("rules.priority.$rulecount",$spriority,2); ++ print "  Status: ",popup_menu("rules.ruletype.$rulecount",[@ruletype],'ENABLED'),""; + my @checked; + my @checkvalues=("copy","keep"); + push @checkvalues,"regex" if $useregex; +@@ -1096,23 +1096,23 @@ + param("rules.searchflg.$rulecount","$ssearchflg"); + print popup_menu("rules.searchflg.$rulecount",[@flgsts],$ssearchflg,\%searchflghash); + } +- print " field(s):"; + + ############# TO field + print ""; +- print ""; + + ########### SUBJECT field + print ""; +- print ""; +@@ -1154,26 +1154,26 @@ + + ############## Action REDIRECT + param("rules.forward.$rulecount","$sdest1"); +- print ""; + + ############### Action REPLY WITH + if ($usereply) { + + param("rules.reply.$rulecount","$sdest2") if (defined $sdest2); +- print ""; + + } + ############## Action Reject + if ($usereject) { + param("rules.reject.$rulecount","$sdest3"); +- print ""; + } + ############## Action Discard + if ($usediscard) { +- print ""; ++ print ""; + } + + ############### Action CustomCode +@@ -1196,7 +1196,7 @@ + print hr,"
Rule#: [$rulecount]"; +- print "  Priority: ",textfield("rules.priority.$rulecount",$spriority,2); +- print "  Status: ",popup_menu("rules.ruletype.$rulecount",[@ruletype],'ENABLED'),"
  'from' contains ", ++ print " field(s):  'from' contains ", + ""; + param("rules.from.$rulecount","$sfrom"); + print textfield("rules.from.$rulecount","$sfrom",50),"
 "; +- print "  'to' contains ", ++ print " "; ++ print "  'to' contains ", + ""; + param("rules.to.$rulecount","$sto"); + print textfield("rules.to.$rulecount","$sto",50),"
 "; +- print "  'subject' contains ", ++ print " "; ++ print "  'subject' contains ", + ""; + param("rules.subject.$rulecount","$ssubject"); + print textfield("rules.subject.$rulecount","$ssubject",50),"
  Forward To "; ++ print "  Forward To "; + print textfield("rules.forward.$rulecount",$sdest1,50)," (Email Address)
  Reply With "; ++ print "  Reply With "; + print textarea("rules.reply.$rulecount",$sdest2,2,43)," (Text Message)
  Reject "; ++ print "  Reject "; + print textarea("rules.reject.$rulecount",$sdest3,2,43)," (Text Message)
  Discard  
  Discard  
$wild
"; + + $rulecount--; +- print hr,"
",submit("Save Rule "),"  ",reset('Clear'),"
"; ++ print hr,"
",submit("Save Rule "),"  ",reset('Clear'),"
"; + + } # if addrule + +@@ -1248,7 +1248,7 @@ + print "Server: $imapserverUserid: $uid"; + print "Used Quota: "; + if ($percent ne "") { +- print "[$quota[1] kbytes used / $quota[2] kbytes available.($percent\% usage)]"; ++ print "[$quota[1] kbytes used / $quota[2] kbytes available. ($percent\% usage)]"; + } else { + print "$quota[1] No limits"; + }; +@@ -1387,7 +1387,7 @@ + print start_form(-action=>$program_url); + $gomodifyit = 'yes'; + print hidden('s',$sencode_params) if $useservercookie; +- print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"
" if $op; ++ print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"
" if $op; + param('op',$op); + if (param('action') && param('action') eq 'deletembx') { + &deleteimapmailbox; +@@ -1407,7 +1407,7 @@ + &initscripts(%scripts); + if ($op eq 'setacl') { + &viewacl if $useacl; +- print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"
"; ++ print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"
"; + + } + if ($mode =~ /basic/i && $op ne 'setacl') { +@@ -1420,7 +1420,7 @@ + # print "printing $op
"; + + &printscript($scripts{'script'}) ; +- print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"
"; ++ print "
",submit('Save Changes'),"  ",submit("Refresh"),"  ",reset('Reset Values'),"
"; + + + } diff --git a/mail/websieve/pkg-descr b/mail/websieve/pkg-descr new file mode 100644 index 000000000000..3a975d03b93d --- /dev/null +++ b/mail/websieve/pkg-descr @@ -0,0 +1,9 @@ +A web based easy to use interface for creating Sieve scripts on an Cyrus +IMAP mail server as well as allowing users to set access controls, create +new mailboxes and view their mail quota. Also give administrators full +administrative capabilities. + +Author: Alain Turbide + + +WWW: http://sourceforge.net/projects/websieve diff --git a/mail/websieve/pkg-message b/mail/websieve/pkg-message new file mode 100644 index 000000000000..738f92c70493 --- /dev/null +++ b/mail/websieve/pkg-message @@ -0,0 +1,6 @@ +Websieve has been installed at + +However, before you can use the program, you should copy the file +"websieve.conf.sample" in %%PREFIX%%/etc/websieve to "websieve.conf" +edit it to suit your needs. Use "openssl rand -base64 39" to create +a new secret key. diff --git a/mail/websieve/pkg-plist b/mail/websieve/pkg-plist new file mode 100644 index 000000000000..322c9a7d4df4 --- /dev/null +++ b/mail/websieve/pkg-plist @@ -0,0 +1,4 @@ +www/cgi-bin/websieve.pl +etc/websieve/websieve.conf.sample +etc/websieve/funclib.pl +@dirrm etc/websieve -- cgit v1.2.3