webmail.sh
上传用户:huihesys
上传日期:2007-01-04
资源大小:3877k
文件大小:3k
- #!/bin/sh
- #
- # Define WebMail paths (for plugins and other data)
- # First the base library path (where the *.jar-files are)
- #LIB_PATH=`cd ../lib && pwd`
- LIB_PATH=../lib
- # Plugin classes
- PLUGIN_PATH=${LIB_PATH}/plugins
- # Authenticator plugins
- AUTH_PATH=${LIB_PATH}/authenticators
- # WebMail template zip files
- TEMPLATE_PATH=${LIB_PATH}/templates
- # WebMail configuration and logfiles
- DATA_PATH=../data
- # Path to WebMail XML/DTD data
- XML_PATH=${LIB_PATH}/xml
- #
- # Storage implementation to use (currently only SimpleStorage and MySQLStorage)
- STORAGE=net.wastl.webmail.storage.simple.SimpleStorage
- #STORAGE=net.wastl.webmail.storage.mysql.MySQLStorage
- #
- # For SQL, a login, password and db-host is needed
- SQL_LOGIN=webmail
- SQL_PASS=webmail
- SQL_HOST=localhost
- SQL_DB=webmail
- #
- # Define memory sizes to allow WebMail
- MEM_MIN=20M
- MEM_MAX=50M
- #
- # Set the thread type
- THREADS="native"
- #THREADS="green"
- export THREADS
- # Usually you don't have to change anything below
- ######################################################################
- # Set maximum number of file descriptors to 1024
- # Necessary as Solaris only allows 64 as default which is not enough
- # for WebMail
- if [ `ulimit -n` -lt 1024 ]; then
- ulimit -n 1024
- fi
- # Set the CLASSPATH environment
- # Add all .jar files in ../lib
- for JARFILE in ${LIB_PATH}/*.jar ${LIB_PATH}/ssl/*.jar; do
- CLASSPATH=${JARFILE}:${CLASSPATH}
- done
- # Add Plugin and Auth-path and the path to the locale specific files
- CLASSPATH=${CLASSPATH}:${PLUGIN_PATH}:${AUTH_PATH}:${TEMPLATE_PATH}
- export CLASSPATH
- # Assemble flags we need to pass to WebMail.
- # Mainly definitions for System.getProperty(...) and memory sizes
- JFLAGS="-mx${MEM_MAX} -ms${MEM_MIN} -Dwebmail.plugin.path=${PLUGIN_PATH} -Dwebmail.auth.path=${AUTH_PATH} -Dwebmail.data.path=${DATA_PATH} -Dwebmail.lib.path=${LIB_PATH} -Dwebmail.template.path=${TEMPLATE_PATH} -Dwebmail.storage=${STORAGE} -Djava.library.path=${LIB_PATH} -Dwebmail.storage.sqlhost=${SQL_HOST} -Dwebmail.storage.sqllogin=${SQL_LOGIN} -Dwebmail.storage.sqlpass=${SQL_PASS} -Dwebmail.storage.sqldb=${SQL_DB} -Dwebmail.xml.path=${XML_PATH}"
- export JFLAGS
- #
- # Do we want to use a different Java binary?
- if [ "$JAVA" = "" ]; then
- JAVA="java"
- export JAVA
- fi
- #
- # Perhaps we have to reconfigure the path in webmail.xml where the DTD can be
- # found.
- mv ${DATA_PATH}/webmail.xml /tmp/webmail.tmp
- cat /tmp/webmail.tmp | sed -e "s|<!DOCTYPE SYSDATA SYSTEM ".*">|<!DOCTYPE SYSDATA SYSTEM "${LIB_PATH}/xml/sysdata.dtd">|" > ${DATA_PATH}/webmail.xml
- #
- # Now, start WebMail!
- $JAVA $JFLAGS net.wastl.webmail.standalone.WebMailServer $1 $2 $3 $4 $5 $6 $7 $8 $9