diff options
author | Jakub Moc <jakub@gentoo.org> | 2007-09-09 00:33:01 +0000 |
---|---|---|
committer | Jakub Moc <jakub@gentoo.org> | 2007-09-09 00:33:01 +0000 |
commit | 45060d860337ab1f1d3beb46266874e216ccd909 (patch) | |
tree | ca0902332781726e6f7791a0bb86359daa84b038 /net-mail | |
parent | Been InCVS for ages, remove (diff) | |
download | webapps-experimental-45060d860337ab1f1d3beb46266874e216ccd909.tar.gz webapps-experimental-45060d860337ab1f1d3beb46266874e216ccd909.tar.bz2 webapps-experimental-45060d860337ab1f1d3beb46266874e216ccd909.zip |
Move to net-mail
svn path=/experimental/; revision=473
Diffstat (limited to 'net-mail')
-rw-r--r-- | net-mail/web-cyradm/ChangeLog | 14 | ||||
-rw-r--r-- | net-mail/web-cyradm/Manifest | 5 | ||||
-rw-r--r-- | net-mail/web-cyradm/files/digest-web-cyradm-0.5.4-r2 | 1 | ||||
-rw-r--r-- | net-mail/web-cyradm/files/postinstall-en.txt | 57 | ||||
-rw-r--r-- | net-mail/web-cyradm/files/web-cyradm-0.5.4-1.FQUN.20041109.diff | 220 | ||||
-rw-r--r-- | net-mail/web-cyradm/web-cyradm-0.5.4-r2.ebuild | 163 |
6 files changed, 460 insertions, 0 deletions
diff --git a/net-mail/web-cyradm/ChangeLog b/net-mail/web-cyradm/ChangeLog new file mode 100644 index 0000000..9796df1 --- /dev/null +++ b/net-mail/web-cyradm/ChangeLog @@ -0,0 +1,14 @@ +# ChangeLog for net-mail/web-cyradm +# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + + 03 Jan 2006; <wrobel@gentoo.org> ChangeLog: + Repoman fixes. + + 28 Dec 2005; Gunnar Wrobel <php@gunnarwrobel.de> ChangeLog: + Minor cleanup of the web-cyradm ebuild + + 19 Dec 2005; <php@gunnarwrobel.de> ChangeLog: + Initial ebuild import into the overlay. Original ebuild from SteveB + <tp22a@softhome.net>. See bug #65318 + diff --git a/net-mail/web-cyradm/Manifest b/net-mail/web-cyradm/Manifest new file mode 100644 index 0000000..0bb685b --- /dev/null +++ b/net-mail/web-cyradm/Manifest @@ -0,0 +1,5 @@ +AUX postinstall-en.txt 1621 RMD160 03a426d474f69869c3bd7a8ea41766fe70f99921 SHA1 a044b7518ddeb29194e208f28aa4b29b792cbc8f SHA256 4007b12ef6d562b16e3d5e348bd544eb8a1789e34753b72a71adef0c5b9deee6 +AUX web-cyradm-0.5.4-1.FQUN.20041109.diff 8514 RMD160 3570eb4da03a5484a63ab794084ee6cd63562755 SHA1 ebb2a18ac149ff10a9c7927dc318eb9445bb6ffa SHA256 47f32c3190ed1a6e9ff79ab1cca2a2062971ca4f7f102f92b201180adb9fa2e3 +DIST web-cyradm-0.5.4-1.tar.gz 455900 RMD160 1a9aaeb42d91af6ea236d100bd4e643193a463c0 SHA1 c7a7ad87c6a5a50f71ebbe63b34e5f5b1423b748 SHA256 f42cca48eeeb4ef2eb02a1594e44ff31fbcfc9d75eb2314b239ed497f08c4e58 +EBUILD web-cyradm-0.5.4-r2.ebuild 4996 RMD160 9f222aa10266b17e55b5ee58b737d7a6f9d531b2 SHA1 e4179ff681210a44e960d17f63308a3adcc2d857 SHA256 84084c52306b8b99bdb995378c1f99417b3c99d3d445a6dd5063d4dbfcaca815 +MISC ChangeLog 446 RMD160 931fc26b0d7a0a232c78ab243b278824f3181ada SHA1 62459a13b970fe109d11377841019b4547078b29 SHA256 3ae595a632a772129e77f37e0da4b1b7009c0193e7f996ac7710c8e73a54ef5f diff --git a/net-mail/web-cyradm/files/digest-web-cyradm-0.5.4-r2 b/net-mail/web-cyradm/files/digest-web-cyradm-0.5.4-r2 new file mode 100644 index 0000000..f66f6b6 --- /dev/null +++ b/net-mail/web-cyradm/files/digest-web-cyradm-0.5.4-r2 @@ -0,0 +1 @@ +MD5 d06dc16899680c29b94a5460709b5fe0 web-cyradm-0.5.4-1.tar.gz 455900 diff --git a/net-mail/web-cyradm/files/postinstall-en.txt b/net-mail/web-cyradm/files/postinstall-en.txt new file mode 100644 index 0000000..73f2edf --- /dev/null +++ b/net-mail/web-cyradm/files/postinstall-en.txt @@ -0,0 +1,57 @@ +To complete installation, you must + +MySQL: +1. Create the needed MySQL database and tables and user: + mysql -u root -p < ${MY_SQLSCRIPTSDIR}/mysql/${PVR}_create.sql +2. Reload MySQL: + /etc/init.d/mysql restart +3. Change the password for the mail user! Inital password is + "secret" (without the qotes). + + * To change the password issue the following SQL commands: + * SET PASSWORD FOR 'mail'@'localhost' = PASSWORD('newpwd'); + * FLUSH PRIVILEGES; + * + * Replace host_name with the name of the server host and replace + * newpwd with your new password. + * + * Initial passwords for MySQL: + * User : mail + * Password : secret + * Role : MySQL database user + * + * User : admin + * Password : test + * Role : Superuser (for web interface) + * + * User : cyrus + * Password : secret + * Role : Domain user + + +PostgreSQL: +1. Create the needed PgSQL database and tables and user: + psql -U postgres -W -h 127.0.0.1 -f ${MY_SQLSCRIPTSDIR}/pgsql/${PVR}_create.sql +2. Reload PgSQL: + /etc/init.d/postgresql restart +3. Change the password for the mail user! Inital password is + "secret" (without the qotes). + + Initial passwords for PgSQL: + User : mail + Password : secret + Role : PgSQL database user + + +Config: + Enter the new password you set above in the configuration file + at ${MY_INSTALLDIR}/config/conf.php + The files also provides some other options that you may or may not wish to modify + to suit your mail setup. + + +Read the documentation at: + http://www.delouw.ch/linux/Postfix-Cyrus-Web-cyradm-HOWTO/html/index.html + + +Finally, point your browser to http://localhost/${PN}/. diff --git a/net-mail/web-cyradm/files/web-cyradm-0.5.4-1.FQUN.20041109.diff b/net-mail/web-cyradm/files/web-cyradm-0.5.4-1.FQUN.20041109.diff new file mode 100644 index 0000000..3cb9b9a --- /dev/null +++ b/net-mail/web-cyradm/files/web-cyradm-0.5.4-1.FQUN.20041109.diff @@ -0,0 +1,220 @@ +diff -aur web-cyradm-0.5.4-1/change_password.php web-cyradm/change_password.php +--- change_password.php 2004-03-21 11:02:01.000000000 -0800 ++++ change_password.php 2004-11-09 14:15:33.000000000 -0800 +@@ -13,20 +13,31 @@ + + if ($authorized AND $new_password == $confirm_password){ + +- $query = "select * from virtual where alias='$alias'"; +- $handle = DB::connect($DB['DSN'], true); +- if (DB::isError($handle)){ +- die (_("Database error")); +- } ++ //With ENABLE_FQUN there are no usernames in virtual ++ if(! $ENABLE_FQUN ) { ++ $query = "select * from virtual where alias='$alias'"; ++ $handle = DB::connect($DB['DSN'], true); ++ if (DB::isError($handle)){ ++ die (_("Database error")); ++ } + +- $result = $handle->query($query); +- $row = $result->fetchRow(DB_FETCHMODE_ASSOC, 0); +- $alias = $row['alias']; +- $dest = $row['dest']; +- $username = $row['username']; ++ $result = $handle->query($query); ++ $row = $result->fetchRow(DB_FETCHMODE_ASSOC, 0); ++ $alias = $row['alias']; ++ $dest = $row['dest']; ++ $username = $row['username']; ++ } + if (! empty($confirmed) && ("true" == $confirmed)){ + if ($new_password == $confirm_password && $new_password != ""){ +- $query = "select * from accountuser where username='$dest'"; ++ //With ENABLE_FQUN there is no dest, only username ++ if( $ENABLE_FQUN ) ++ { ++ $query = "select * from accountuser where username='$username'"; ++ } ++ else ++ { ++ $query = "select * from accountuser where username='$dest'"; ++ } + $handle = DB::connect($DB['DSN'], true); + if (DB::isError($handle)) { + die (_("Database error")); +@@ -57,6 +68,11 @@ + include WC_BASE . "/browseaccounts.php"; + } elseif ($PASSWORD_CHANGE_METHOD=="poppassd"){ + include WC_BASE . '/lib/poppassd.php'; ++ if( $ENABLE_FQUN ) ++ { ++ //username is the username ++ $dest = $username; ++ } + $daemon = new poppassd; + if ($daemon->change_password($dest, $password, $new_password)) { + print "<em><big>"._("Password changed")."</big></em><p><p>"; +@@ -68,7 +84,7 @@ + print "<b>"._("New passwords are not equal. Password not changed")."</b>"; + } + } +- } ++ } // end confirmed + if (empty($confirmed) || ($confirmed != "true")){ + // $test = ereg ("",$alias,$result_array); + +@@ -80,7 +96,9 @@ + <h3> + <?php print _("Change password for account");?> + <span style="color: red;"> +- <?php echo $dest;?> ++ <? ++ if ($ENABLE_FQUN) {echo $username;} else {echo $dest;} ++ ?> + </span> + </h3> + +diff -aur web-cyradm-0.5.4-1/config/conf.php.dist web-cyradm/config/conf.php.dist +--- config/conf.php 2004-04-04 10:17:02.000000000 -0700 ++++ config/conf.php 2004-11-09 20:07:09.000000000 -0800 +@@ -72,6 +72,24 @@ + #### + $DOMAIN_AS_PREFIX = 0; + ++# if you want to use cyrus 2.2.x's virtual domains support with fully ++# qualified usernames in the mailbox name you can set this option ++# ENABLE_FQUN to '1'. ++# NOTE: you must also set $CRYPT = "plain" unless you patch your sasl library ++# using the patch from http://frost.ath.cx/software/cyrus-sasl-patches/ ++# with sasl auxprop's sql/mysql plugin in which case you can use "crypt". ++# In your sasl smtpd.conf and your imapd.conf make your sql_statement and ++# sasl_sql_statement look like this: ++# select password from accountuser where username='%u@%r' or (username='%u' and domain_name='') ++# This will allow you to use a user with a non fully qualified username for ++# the admin user. ++# and add this line to your imapd.conf. ++#### imapd.conf: #### ++# virtdomains: yes ++ ++#### ++$ENABLE_FQUN = 0; ++ + # At the moment, web-cyradm supports two methods of password change: + # - through sql + # - poppassd +@@ -104,4 +122,3 @@ + + # Define reserved Emailadresses (Separated by comma): + $RESERVED="postmaster,root"; +- +diff -aur web-cyradm-0.5.4-1/newaccount.php web-cyradm/newaccount.php +--- newaccount.php 2003-08-14 11:58:12.000000000 -0700 ++++ newaccount.php 2004-11-09 16:10:13.000000000 -0800 +@@ -99,7 +99,7 @@ + + <table> + <?php +- if (!$DOMAIN_AS_PREFIX){ ++ if (!($DOMAIN_AS_PREFIX || $ENABLE_FQUN)){ + ?> + <tr> + <td> +@@ -129,7 +129,7 @@ + </td> + <!-- END Andreas Kreisl : freenames --> + </tr> +- <?php ++ <?php + } // End of if (!$DOMAIN_AS_PREFIX) + + $_fields = array( +@@ -193,17 +193,28 @@ + } else { + $seperator = '.'; + } ++ if ($ENABLE_FQUN){ ++ $username = $email; ++ $username = $username . "@" . $domain; ++ } + // check to see if there's an account with the same username + $query3="select * from accountuser where username='$username'"; + $result3=$handle->query($query3); + $cnt3=$result3->numRows(); +- if ($cnt3!=0) { ++ if ($cnt3!=0) { + print "<h3>" . + _("Sorry, the username already exists") . + "</h3><br>"; + include WC_BASE . "/browseaccounts.php"; + } else { +- if ($password == $confirm_password){ ++ // No Empty Password ++ if ( empty($password) && empty($confirm_password) ) ++ { ++ print "<h3>" . ++ _("Sorry, the password must not be empty") . ++ "</h3><br>"; ++ include WC_BASE . "/browseaccounts.php"; ++ } elseif ($password == $confirm_password){ + $pwd = new password; + $password = $pwd->encrypt($password, $CRYPT); + $query3="INSERT INTO accountuser (username, password, prefix, domain_name) VALUES ('" . $username . "','" . $password . "','" . $prefix . "','" . $domain . "')"; +@@ -217,10 +228,15 @@ + + $result=$handle->query($query3); + +- $query4 = "INSERT INTO virtual (alias, dest, username, status) values ( '" . $email . "@" . $domain . "' , '$username' , '$username' , '1')"; +- +- $result2 = $handle->query($query4); +- ++ // No need for virtual with the new ++ // virtual hosting capabilities in cyrus ++ if (!$ENABLE_FQUN){ ++ $query4 = "INSERT INTO virtual (alias, dest, username, status) values ( '" . $email . "@" . $domain . "' , '$username' , '$username' , '1')"; ++ ++ $result2 = $handle->query($query4); ++ } else { ++ $result2=$result; ++ } + if ($result and $result2){ + ?> + <h3> +diff -aur web-cyradm-0.5.4-1/search.php web-cyradm/search.php +--- search.php 2003-11-30 04:13:43.000000000 -0800 ++++ search.php 2004-11-09 14:17:06.000000000 -0800 +@@ -31,7 +31,15 @@ + } + + $query="SELECT * FROM domain a where domain_name LIKE '%$searchstring%' and $allowed_domains') ORDER BY domain_name"; +-$query2="SELECT distinct a.username, a.domain_name FROM virtual as v, accountuser as a where ((v.username LIKE '%$searchstring%') or (v.alias LIKE '%$searchstring%')) and (v.username=a.username) and $allowed_domains') ORDER BY username"; ++ ++// Query Usernames ++if( $ENABLE_FQUN ) { ++ // If ENABLE_FQUN there is no email in the virtual table ++ // accountuser.username == email ++ $query2="SELECT distinct a.username, a.domain_name FROM accountuser as a where a.username LIKE '%$searchstring%' and $allowed_domains' ) ORDER BY username"; ++} else { ++ $query2="SELECT distinct a.username, a.domain_name FROM virtual as v, accountuser as a where ((v.username LIKE '%$searchstring%') or (v.alias LIKE '%$searchstring%')) and (v.username=a.username) and $allowed_domains') ORDER BY username"; ++} + $query3="SELECT DISTINCT alias, username FROM virtual WHERE (((dest LIKE '%$searchstring%') OR (alias LIKE '%$searchstring%')) AND (dest <> username) AND (username<>'') ) AND $allowed_domains3') ORDER BY username"; + $result=$handle->query($query); + $result2=$handle->query($query2); +@@ -111,7 +119,15 @@ + if (!isset($row_pos)){ + $row_pos=0; + } +- $query="SELECT distinct a.username, a.domain_name FROM virtual as v, accountuser as a where ((v.username LIKE '%$searchstring%') or (v.alias LIKE '%$searchstring%')) and (v.username=a.username) and $allowed_domains') ORDER BY username"; ++ ++ // Query Usernames ++ if( $ENABLE_FQUN ) { ++ // If ENABLE_FQUN there is no email in the virtual table ++ // accountuser.username == email ++ $query="SELECT distinct a.username, a.domain_name FROM accountuser as a where a.username LIKE '%$searchstring%' and $allowed_domains' ) ORDER BY username"; ++ } else { ++ $query="SELECT distinct a.username, a.domain_name FROM virtual as v, accountuser as a where ((v.username LIKE '%$searchstring%') or (v.alias LIKE '%$searchstring%')) and (v.username=a.username) and $allowed_domains') ORDER BY username"; ++ } + $result=$handle->limitQuery($query,$row_pos,10); + $cnt=$result->numRows($result); + diff --git a/net-mail/web-cyradm/web-cyradm-0.5.4-r2.ebuild b/net-mail/web-cyradm/web-cyradm-0.5.4-r2.ebuild new file mode 100644 index 0000000..cd2a834 --- /dev/null +++ b/net-mail/web-cyradm/web-cyradm-0.5.4-r2.ebuild @@ -0,0 +1,163 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# Source: http://bugs.gentoo.org/show_bug.cgi?id=65318 +# Submitted-By: SteveB +# Reviewed-By: wrobel 2005-12-19 +# $Id$ + +inherit eutils webapp + +IUSE="mysql postgres pam" + +MY_PV="${PV}-1" + +DESCRIPTION="Web-based that glues topnotch mailing technologies like cyrus-imap and postfix together." +SRC_URI="http://www.web-cyradm.org/${PN}-${MY_PV}.tar.gz" +HOMEPAGE="http://www.web-cyradm.org/" + +LICENSE="GPL-2" +KEYWORDS="~x86" + +RDEPEND="mysql? ( >=dev-db/mysql-4.1.14 ) + postgres? ( >=dev-db/postgresql-8.0.4 ) + virtual/httpd-php + virtual/mta" + +DEPEND="${RDEPEND} + >=net-mail/cyrus-imapd-2.2.12 + >=dev-php/PEAR-DB-1.7.6 + pam? ( mysql? ( >=sys-auth/pam_mysql-0.5 ) + postgres? ( >=sys-auth/libnss-pgsql-1.0.0 ) )" + +S=${WORKDIR}/${PN}-${MY_PV} + +pkg_setup() { + local multiple_dbs="0" + local supported_dbs="mysql postgres" + for foo in ${supported_dbs}; do + if use ${foo}; then + let multiple_dbs="((multiple_dbs + 1 ))" + einfo " ${foo} database support in your USE flags." + fi + done + if [ "${multiple_dbs}" -gt "1" ]; then + echo + ewarn "You have multiple database backends active in your USE flags." + ewarn "Will default to MySQL as your ${PN} database backend." + ewarn "If you want to build with another database backend; hit Control-C now." + ewarn "Change your USE flag -mysql and emerge again." + echo + has_version ">=sys-apps/portage-2.0.50" && ( + einfo "It would be best practice to add the set of USE flags that you use for this" + einfo "package to the file: /etc/portage/package.use. Example:" + einfo "\`echo \"${CATEGORY}/${PN} -mysql postgres\" >> /etc/portage/package.use\`" + einfo "to build ${PN} with Postgres database as your ${PN} backend." + ) + echo + ewarn "Waiting 30 seconds before starting..." + ewarn "(Control-C to abort)..." + epause 3 + elif [ "${multiple_dbs}" -eq "0" ]; then + echo + ewarn "You did not select any SQL based database backend. ${PN} can not" + ewarn "run without any SQL based database backend. Please enable one of" + ewarn "of the following USE flags:" + ewarn " ${supported_dbs}" + echo + die "SQL database backend not selected" + fi + + webapp_pkg_setup +} + +src_unpack() { + unpack ${A} + cd ${S} + + # Remove .cvs* files and CVS directories + find ${S} -name .cvs\* -or \( -type d -name CVS -prune \) -exec rm -rf "{}" ";" + + # Rename the config file + mv -f ${S}/config/conf.php.dist ${S}/config/conf.php + + # http://www.shaolinux.org/web-cyradm-0.5.4-1.FQUN.20041109.diff + if use !pam; then + epatch ${FILESDIR}/web-cyradm-0.5.4-1.FQUN.20041109.diff + fi +} + +src_install() { + webapp_src_preinst + + local docs="COPYRIGHT ChangeLog README README.translations TO-BE-DONE doc/Postfix-Cyrus-Web-cyradm-HOWTO.txt" + + # handle documentation files + # + # NOTE that doc files go into /usr/share/doc as normal; they do NOT + # get installed per vhost! + dodoc ${docs} + dohtml doc/html/* + + # copy the app's main files + # + einfo "Installing main files" + + cp ${S}/*.php ${D}${MY_HTDOCSDIR} + cp -R ${S}/css ${D}${MY_HTDOCSDIR} + cp -R ${S}/images ${D}${MY_HTDOCSDIR} + cp -R ${S}/lib ${D}${MY_HTDOCSDIR} + cp -R ${S}/locale ${D}${MY_HTDOCSDIR} + cp -R ${S}/config ${D}${MY_HTDOCSDIR} + + # install the SQL scripts available to us + # + if use mysql; then + # Because of limitations in the webapp ECLASS we need to merge the + # insertuser SQL scripts into one file + # SQL Scripts: + # create_mysql.sql + # insertuser_mysql.sql + # upgrade-0.5.2-to-0.5.3_mysql.sql + # upgrade-0.5.3-to-0.5.4_mysql.sql + cp ${S}/scripts/insertuser_mysql.sql ${T}/merged_mysql.sql + echo >>${T}/merged_mysql.sql + sed -n "s:^create database:USE:gIp" ${S}/scripts/insertuser_mysql.sql >>${T}/merged_mysql.sql + echo >>${T}/merged_mysql.sql + cat ${S}/scripts/create_mysql.sql >>${T}/merged_mysql.sql + webapp_sqlscript mysql ${T}/merged_mysql.sql + webapp_sqlscript mysql ${S}/scripts/upgrade-0.5.3-to-0.5.4_mysql.sql 0.5.3 + elif use postgres; then + # Because of limitations in the webapp ECLASS we need to merge the + # insertuser SQL scripts into one file. + # SQL Scripts: + # create_pgsql.sql + # insertuser_pgsql.sql + # upgrade-0.5.3-to-0.5.4_pgsql.sql + cp ${S}/scripts/insertuser_pgsql.sql ${T}/merged_pgsql.sql + echo >>${T}/merged_pgsql.sql + sed -n "s:^create database:USE:gIp" ${S}/scripts/insertuser_pgsql.sql >>${T}/merged_pgsql.sql + echo >>${T}/merged_pgsql.sql + cat ${S}/scripts/create_pgsql.sql >>${T}/merged_pgsql.sql + webapp_sqlscript pgsql ${T}/merged_pgsql.sql + webapp_sqlscript pgsql ${S}/scripts/upgrade-0.5.3-to-0.5.4_pgsql.sql 0.5.3 + fi + + # + webapp_serverowned ${MY_HTDOCSDIR} + + # Identify the configuration files that this app uses + # + webapp_configfile ${MY_HTDOCSDIR}/config/conf.php + + # add the post-installation instructions + # + webapp_postinst_txt en ${FILESDIR}/postinstall-en.txt + + # all done + # + # now we let the eclass strut its stuff ;-) + # + webapp_src_install +} |