diff --git a/deploy/.gitignore b/deploy/.gitignore
new file mode 100644
index 0000000..ccbb9df
--- /dev/null
+++ b/deploy/.gitignore
@@ -0,0 +1 @@
+www/
diff --git a/deploy/deploy-all b/deploy/deploy-all
new file mode 100755
index 0000000..a6239b2
--- /dev/null
+++ b/deploy/deploy-all
@@ -0,0 +1,9 @@
+./server-shutdown tunnel
+./server-deploy tomcat
+./server-deploy james
+./server-deploy mail-user
+./server-deploy mail-key
+./server-deploy tools
+./web-deploy
+
+./server-deploy tunnel
diff --git a/deploy/dev-deploy-all b/deploy/dev-deploy-all
new file mode 100755
index 0000000..bce5771
--- /dev/null
+++ b/deploy/dev-deploy-all
@@ -0,0 +1,6 @@
+./dev-server-deploy tomcat
+./dev-server-deploy james
+./dev-server-deploy mail-user
+./dev-server-deploy mail-key
+./dev-server-deploy tools
+
diff --git a/deploy/dev-server-deploy b/deploy/dev-server-deploy
new file mode 100755
index 0000000..9897238
--- /dev/null
+++ b/deploy/dev-server-deploy
@@ -0,0 +1,24 @@
+if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
+
+server="red"
+
+echo stopping...
+ssh $1@$server "cd deploy && ./shutdown"
+
+echo transfering
+rsync -avzL --delete $1/ $1@$server:deploy
+
+echo cataloging
+ssh $1@$server "cd deploy && ./catalog"
+
+echo starting...
+ssh $1@$server "cd deploy && ./run"
+
+echo tailing...
+sleep 2
+ssh $1@$server "tail run.log"
+
+echo ...
+echo "***** remember to restart mail-user if you restart-james *****"
+
+
diff --git a/deploy/dev-tomcat-restart b/deploy/dev-tomcat-restart
new file mode 100755
index 0000000..a7489ca
--- /dev/null
+++ b/deploy/dev-tomcat-restart
@@ -0,0 +1,5 @@
+
+server="red"
+
+echo restarting...
+ssh tomcat@$server "cd deploy && ./restart"
diff --git a/deploy/dev-watch b/deploy/dev-watch
new file mode 100755
index 0000000..49d044b
--- /dev/null
+++ b/deploy/dev-watch
@@ -0,0 +1,5 @@
+if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
+
+server="red"
+
+ssh $1@$server "tail -n 100 -f run.log"
diff --git a/deploy/dev-web-deploy b/deploy/dev-web-deploy
new file mode 100755
index 0000000..af4b9c1
--- /dev/null
+++ b/deploy/dev-web-deploy
@@ -0,0 +1,2 @@
+rsync -avL --exclude="WEB-INF" --delete ../gwt/war/ tprepscius@red:www/
+
diff --git a/deploy/dev-web-deploy-s3 b/deploy/dev-web-deploy-s3
new file mode 100755
index 0000000..13388c6
--- /dev/null
+++ b/deploy/dev-web-deploy-s3
@@ -0,0 +1,7 @@
+./web-deploy
+s3cmd sync www/ s3://www.mailiverse.com/beta/ --acl-public --delete-removed
+
+echo putting files with cache control headers
+s3cmd put www/index.html s3://www.mailiverse.com/beta/ --acl-public --add-header "Cache-Control: max-age:3600"
+s3cmd put www/mailiverse_gwt/mailiverse_gwt.nocache.js s3://www.mailiverse.com/beta/mailiverse_gwt/ --acl-public --add-header "Cache-Control: no-cache"
+echo done
diff --git a/deploy/james. b/deploy/james.
new file mode 100644
index 0000000..e69de29
diff --git a/deploy/james/apache-james-conf/META-INF/jpa-mappings-template.xml b/deploy/james/apache-james-conf/META-INF/jpa-mappings-template.xml
new file mode 100644
index 0000000..9d9647a
--- /dev/null
+++ b/deploy/james/apache-james-conf/META-INF/jpa-mappings-template.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/META-INF/org/apache/james/README b/deploy/james/apache-james-conf/META-INF/org/apache/james/README
new file mode 100644
index 0000000..2d2c855
--- /dev/null
+++ b/deploy/james/apache-james-conf/META-INF/org/apache/james/README
@@ -0,0 +1,6 @@
+You can place here any configuration file you find in
+http://svn.apache.org/repos/asf/james/mailbox/trunk/spring/src/main/resources/META-INF/org/apache/james/
+
+This will override the configuration loaded from classpath from mailbox-spring.jar.
+
+If you create a file, ensure that the configuration in that file in complete (we don't support partial file-based configuration).
diff --git a/deploy/james/apache-james-conf/META-INF/org/apache/james/spring-mailbox-authenticator.xml b/deploy/james/apache-james-conf/META-INF/org/apache/james/spring-mailbox-authenticator.xml
new file mode 100644
index 0000000..900b3ed
--- /dev/null
+++ b/deploy/james/apache-james-conf/META-INF/org/apache/james/spring-mailbox-authenticator.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/META-INF/org/apache/james/spring-mailbox-hbase.xml b/deploy/james/apache-james-conf/META-INF/org/apache/james/spring-mailbox-hbase.xml
new file mode 100644
index 0000000..9f98924
--- /dev/null
+++ b/deploy/james/apache-james-conf/META-INF/org/apache/james/spring-mailbox-hbase.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/META-INF/org/apache/james/spring-server.xml b/deploy/james/apache-james-conf/META-INF/org/apache/james/spring-server.xml
new file mode 100644
index 0000000..5d1e360
--- /dev/null
+++ b/deploy/james/apache-james-conf/META-INF/org/apache/james/spring-server.xml
@@ -0,0 +1,373 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/META-INF/org/apache/james/spring-server.xml.bak b/deploy/james/apache-james-conf/META-INF/org/apache/james/spring-server.xml.bak
new file mode 100644
index 0000000..e652fc7
--- /dev/null
+++ b/deploy/james/apache-james-conf/META-INF/org/apache/james/spring-server.xml.bak
@@ -0,0 +1,419 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ACL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/META-INF/persistence-template.xml b/deploy/james/apache-james-conf/META-INF/persistence-template.xml
new file mode 100644
index 0000000..f49cf2a
--- /dev/null
+++ b/deploy/james/apache-james-conf/META-INF/persistence-template.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+ META-INF/jpa-mappings-template.xml
+
+
+ org.apache.james.mailbox.jpa.mail.model.JPAMailbox
+ org.apache.james.mailbox.jpa.mail.model.JPAUserFlag
+ org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMessage
+ org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMessage
+
+
+
+
+ org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMessage
+
+ org.apache.james.mailbox.jpa.mail.model.JPAProperty
+ org.apache.james.mailbox.jpa.user.model.JPASubscription
+
+
+ org.apache.james.domainlist.jpa.model.JPADomain
+
+
+ org.apache.james.user.jpa.model.JPAUser
+
+
+ org.apache.james.rrt.jpa.model.JPARecipientRewrite
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/META-INF/persistence.xml b/deploy/james/apache-james-conf/META-INF/persistence.xml
new file mode 100644
index 0000000..fbabf68
--- /dev/null
+++ b/deploy/james/apache-james-conf/META-INF/persistence.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+ org.apache.james.mailbox.jpa.mail.model.JPAMailbox
+ org.apache.james.mailbox.jpa.mail.model.JPAUserFlag
+ org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMessage
+ org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMessage
+ org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMessage
+ org.apache.james.mailbox.jpa.mail.model.JPAProperty
+ org.apache.james.mailbox.jpa.user.model.JPASubscription
+ org.apache.james.domainlist.jpa.model.JPADomain
+ org.apache.james.user.jpa.model.JPAUser
+ org.apache.james.rrt.jpa.model.JPARecipientRewrite
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/dnsservice-template.conf b/deploy/james/apache-james-conf/dnsservice-template.conf
new file mode 100644
index 0000000..cf38e9f
--- /dev/null
+++ b/deploy/james/apache-james-conf/dnsservice-template.conf
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ false
+
+
+ 50000
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/domainlist.conf b/deploy/james/apache-james-conf/domainlist.conf
new file mode 100644
index 0000000..83c9ac9
--- /dev/null
+++ b/deploy/james/apache-james-conf/domainlist.conf
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+ localhost
+
+
+
+
diff --git a/deploy/james/apache-james-conf/fetchmail-template.conf b/deploy/james/apache-james-conf/fetchmail-template.conf
new file mode 100644
index 0000000..3c6a890
--- /dev/null
+++ b/deploy/james/apache-james-conf/fetchmail-template.conf
@@ -0,0 +1,288 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+
+
+ fetchmail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pop.server.com
+
+
+ 600000
+
+
+
+ pop3
+
+
+ INBOX
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ wibble@localhost, flobble@localhost
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/hbase-site-template.xml b/deploy/james/apache-james-conf/hbase-site-template.xml
new file mode 100644
index 0000000..1010762
--- /dev/null
+++ b/deploy/james/apache-james-conf/hbase-site-template.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/imapserver-template.conf b/deploy/james/apache-james-conf/imapserver-template.conf
new file mode 100644
index 0000000..2ef7555
--- /dev/null
+++ b/deploy/james/apache-james-conf/imapserver-template.conf
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ imapserver
+
+
+
+
+
+
+ 0.0.0.0:143
+
+ 200
+
+
+
+
+ file://conf/keystore
+ yoursecret
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ 0
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/james-database-derby.properties b/deploy/james/apache-james-conf/james-database-derby.properties
new file mode 100644
index 0000000..10d0a2a
--- /dev/null
+++ b/deploy/james/apache-james-conf/james-database-derby.properties
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# This template file can be used as example for James Server configuration
+# DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# See http://james.apache.org/server/3/config.html for usage
+
+# Use derby as default
+database.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
+database.url=jdbc:derby:../var/store/derby;create=true
+database.username=app
+database.password=app
+
+# Supported adapters are:
+# DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE
+vendorAdapter.database=DERBY
+
+# Use streaming for Blobs
+# This is only supported on a limited set of databases atm. You should check if its supported by your DB before enable
+# it.
+#
+# See:
+# http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_mapping_jpa.html #7.11. LOB Streaming
+#
+openjpa.streaming=false
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/james-database-mysql.properties b/deploy/james/apache-james-conf/james-database-mysql.properties
new file mode 100644
index 0000000..f21abf2
--- /dev/null
+++ b/deploy/james/apache-james-conf/james-database-mysql.properties
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# This template file can be used as example for James Server configuration
+# DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# See http://james.apache.org/server/3/config.html for usage
+
+# Use derby as default
+database.driverClassName=com.mysql.jdbc.Driver
+database.url=jdbc:mysql://localhost/james
+database.username=james
+database.password=JAMES_DB_PASSWORD
+
+# Supported adapters are:
+# DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE
+vendorAdapter.database=MYSQL
+
+# Use streaming for Blobs
+# This is only supported on a limited set of databases atm. You should check if its supported by your DB before enable
+# it.
+#
+# See:
+# http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_mapping_jpa.html #7.11. LOB Streaming
+#
+openjpa.streaming=false
diff --git a/deploy/james/apache-james-conf/james-database-template.properties b/deploy/james/apache-james-conf/james-database-template.properties
new file mode 100644
index 0000000..10d0a2a
--- /dev/null
+++ b/deploy/james/apache-james-conf/james-database-template.properties
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# This template file can be used as example for James Server configuration
+# DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# See http://james.apache.org/server/3/config.html for usage
+
+# Use derby as default
+database.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
+database.url=jdbc:derby:../var/store/derby;create=true
+database.username=app
+database.password=app
+
+# Supported adapters are:
+# DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE
+vendorAdapter.database=DERBY
+
+# Use streaming for Blobs
+# This is only supported on a limited set of databases atm. You should check if its supported by your DB before enable
+# it.
+#
+# See:
+# http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_mapping_jpa.html #7.11. LOB Streaming
+#
+openjpa.streaming=false
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/james-database.properties b/deploy/james/apache-james-conf/james-database.properties
new file mode 120000
index 0000000..c118bfb
--- /dev/null
+++ b/deploy/james/apache-james-conf/james-database.properties
@@ -0,0 +1 @@
+james-database-mysql.properties
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/jcr-repository-template.xml b/deploy/james/apache-james-conf/jcr-repository-template.xml
new file mode 100644
index 0000000..96f99f7
--- /dev/null
+++ b/deploy/james/apache-james-conf/jcr-repository-template.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/jmx-template.properties b/deploy/james/apache-james-conf/jmx-template.properties
new file mode 100644
index 0000000..a1dbdf8
--- /dev/null
+++ b/deploy/james/apache-james-conf/jmx-template.properties
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# This template file can be used as example for James Server configuration
+# DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# This template file can be used as example for James Server configuration
+# DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# See http://james.apache.org/server/3/config.html for usage
+
+jmx.address=127.0.0.1
+jmx.port=9999
diff --git a/deploy/james/apache-james-conf/keystore b/deploy/james/apache-james-conf/keystore
new file mode 120000
index 0000000..84deb41
--- /dev/null
+++ b/deploy/james/apache-james-conf/keystore
@@ -0,0 +1 @@
+../../../keys/james/final/mail_mailiverse_com.jks
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lib/JavaPNS_2.2.jar b/deploy/james/apache-james-conf/lib/JavaPNS_2.2.jar
new file mode 120000
index 0000000..a985528
--- /dev/null
+++ b/deploy/james/apache-james-conf/lib/JavaPNS_2.2.jar
@@ -0,0 +1 @@
+../../../../java/lib/JavaPNS_2.2.jar
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lib/README.txt b/deploy/james/apache-james-conf/lib/README.txt
new file mode 100644
index 0000000..d536d44
--- /dev/null
+++ b/deploy/james/apache-james-conf/lib/README.txt
@@ -0,0 +1 @@
+# Put every jar you want to have included in the classpath in here
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lib/activation-1.1.1.jar b/deploy/james/apache-james-conf/lib/activation-1.1.1.jar
new file mode 120000
index 0000000..80643fc
--- /dev/null
+++ b/deploy/james/apache-james-conf/lib/activation-1.1.1.jar
@@ -0,0 +1 @@
+../../../../java/lib/activation-1.1.1.jar
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lib/aws-java-sdk.jar b/deploy/james/apache-james-conf/lib/aws-java-sdk.jar
new file mode 120000
index 0000000..0d8c11d
--- /dev/null
+++ b/deploy/james/apache-james-conf/lib/aws-java-sdk.jar
@@ -0,0 +1 @@
+../../../../java/lib/aws-java-sdk.jar
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lib/bcprov-jdk15on-148.jar b/deploy/james/apache-james-conf/lib/bcprov-jdk15on-148.jar
new file mode 120000
index 0000000..815cbac
--- /dev/null
+++ b/deploy/james/apache-james-conf/lib/bcprov-jdk15on-148.jar
@@ -0,0 +1 @@
+../../../../java/lib/bcprov-jdk15on-148.jar
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lib/dropbox-java-sdk.jar b/deploy/james/apache-james-conf/lib/dropbox-java-sdk.jar
new file mode 120000
index 0000000..8b5ef40
--- /dev/null
+++ b/deploy/james/apache-james-conf/lib/dropbox-java-sdk.jar
@@ -0,0 +1 @@
+../../../../java/lib/dropbox-java-sdk-1.3.jar
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lib/httpclient-4.1.1.jar b/deploy/james/apache-james-conf/lib/httpclient-4.1.1.jar
new file mode 120000
index 0000000..0b12abd
--- /dev/null
+++ b/deploy/james/apache-james-conf/lib/httpclient-4.1.1.jar
@@ -0,0 +1 @@
+../../../../java/lib/httpclient-4.1.1.jar
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lib/httpcore-4.1.jar b/deploy/james/apache-james-conf/lib/httpcore-4.1.jar
new file mode 120000
index 0000000..f95d93e
--- /dev/null
+++ b/deploy/james/apache-james-conf/lib/httpcore-4.1.jar
@@ -0,0 +1 @@
+../../../../java/lib/httpcore-4.1.jar
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lib/jackson-core-asl-1.8.9.jar b/deploy/james/apache-james-conf/lib/jackson-core-asl-1.8.9.jar
new file mode 120000
index 0000000..8dad5b8
--- /dev/null
+++ b/deploy/james/apache-james-conf/lib/jackson-core-asl-1.8.9.jar
@@ -0,0 +1 @@
+../../../../java/lib/jackson-core-asl-1.8.9.jar
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lib/jackson-mapper-asl-1.8.9.jar b/deploy/james/apache-james-conf/lib/jackson-mapper-asl-1.8.9.jar
new file mode 120000
index 0000000..01d06d7
--- /dev/null
+++ b/deploy/james/apache-james-conf/lib/jackson-mapper-asl-1.8.9.jar
@@ -0,0 +1 @@
+../../../../java/lib/jackson-mapper-asl-1.8.9.jar
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lib/json_simple-1.1.jar b/deploy/james/apache-james-conf/lib/json_simple-1.1.jar
new file mode 120000
index 0000000..12822b4
--- /dev/null
+++ b/deploy/james/apache-james-conf/lib/json_simple-1.1.jar
@@ -0,0 +1 @@
+../../../../java/lib/json_simple-1.1.jar
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lib/mysql-connector-java-3.1.14-bin.jar b/deploy/james/apache-james-conf/lib/mysql-connector-java-3.1.14-bin.jar
new file mode 120000
index 0000000..8608460
--- /dev/null
+++ b/deploy/james/apache-james-conf/lib/mysql-connector-java-3.1.14-bin.jar
@@ -0,0 +1 @@
+../../../../java/lib/mysql-connector-java-3.1.14-bin.jar
\ No newline at end of file
diff --git a/deploy/james/apache-james-conf/lmtpserver-template.conf b/deploy/james/apache-james-conf/lmtpserver-template.conf
new file mode 100644
index 0000000..15bb62f
--- /dev/null
+++ b/deploy/james/apache-james-conf/lmtpserver-template.conf
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ lmtpserver
+
+
+ 127.0.0.1:24
+
+ 200
+
+
+
+
+
+
+
+
+ 1200
+
+
+ 0
+
+
+ 0
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/log4j-template.properties b/deploy/james/apache-james-conf/log4j-template.properties
new file mode 100644
index 0000000..fde91d0
--- /dev/null
+++ b/deploy/james/apache-james-conf/log4j-template.properties
@@ -0,0 +1,140 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# This template file can be used as example for James Server configuration
+# DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# See http://james.apache.org/server/3/config.html for usage
+
+log4j.rootLogger=DEBUG
+
+log4j.appender.CONS=org.apache.log4j.ConsoleAppender
+log4j.appender.CONS.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONS.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.FILE.File=../log/james-server.log
+log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.MAILBOXMANAGER=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.MAILBOXMANAGER.File=../log/mailboxmanager.log
+log4j.appender.MAILBOXMANAGER.DatePattern='.'yyyy-MM-dd
+log4j.appender.MAILBOXMANAGER.layout=org.apache.log4j.PatternLayout
+log4j.appender.MAILBOXMANAGER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.IMAPSERVER=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.IMAPSERVER.File=../log/imapserver.log
+log4j.appender.IMAPSERVER.DatePattern='.'yyyy-MM-dd
+log4j.appender.IMAPSERVER.layout=org.apache.log4j.PatternLayout
+log4j.appender.IMAPSERVER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.MAILETCONTAINER=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.MAILETCONTAINER.File=../log/mailetcontainer.log
+log4j.appender.MAILETCONTAINER.DatePattern='.'yyyy-MM-dd
+log4j.appender.MAILETCONTAINER.layout=org.apache.log4j.PatternLayout
+log4j.appender.MAILETCONTAINER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.DNSSERVICE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.DNSSERVICE.File=../log/dnsservice.log
+log4j.appender.DNSSERVICE.DatePattern='.'yyyy-MM-dd
+log4j.appender.DNSSERVICE.layout=org.apache.log4j.PatternLayout
+log4j.appender.DNSSERVICE.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.POP3SERVER=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.POP3SERVER.File=../log/pop3server.log
+log4j.appender.POP3SERVER.DatePattern='.'yyyy-MM-dd
+log4j.appender.POP3SERVER.layout=org.apache.log4j.PatternLayout
+log4j.appender.POP3SERVER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.SMTPSERVER=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.SMTPSERVER.File=../log/smtpserver.log
+log4j.appender.SMTPSERVER.DatePattern='.'yyyy-MM-dd
+log4j.appender.SMTPSERVER.layout=org.apache.log4j.PatternLayout
+log4j.appender.SMTPSERVER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.LMTPSERVER=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.LMTPSERVER.File=../log/lmtpserver.log
+log4j.appender.LMTPSERVER.DatePattern='.'yyyy-MM-dd
+log4j.appender.LMTPSERVER.layout=org.apache.log4j.PatternLayout
+log4j.appender.LMTPSERVER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.MAILREPOSITORYSTORE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.MAILREPOSITORYSTORE.File=../log/mailrepositorystore.log
+log4j.appender.MAILREPOSITORYSTORE.DatePattern='.'yyyy-MM-dd
+log4j.appender.MAILREPOSITORYSTORE.layout=org.apache.log4j.PatternLayout
+log4j.appender.MAILREPOSITORYSTORE.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.USERSREPOSITORY=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.USERSREPOSITORY.File=../log/usersrepository.log
+log4j.appender.USERSREPOSITORY.DatePattern='.'yyyy-MM-dd
+log4j.appender.USERSREPOSITORY.layout=org.apache.log4j.PatternLayout
+log4j.appender.USERSREPOSITORY.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.FETCHMAIL=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.FETCHMAIL.File=../log/fetchmail.log
+log4j.appender.FETCHMAIL.DatePattern='.'yyyy-MM-dd
+log4j.appender.FETCHMAIL.layout=org.apache.log4j.PatternLayout
+log4j.appender.FETCHMAIL.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.DOMAINLIST=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.DOMAINLIST.File=../log/domainlist.log
+log4j.appender.DOMAINLIST.DatePattern='.'yyyy-MM-dd
+log4j.appender.DOMAINLIST.layout=org.apache.log4j.PatternLayout
+log4j.appender.DOMAINLIST.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.VIRTUALUSERTABLE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.VIRTUALUSERTABLE.File=../log/virtualusertable.log
+log4j.appender.VIRTUALUSERTABLE.DatePattern='.'yyyy-MM-dd
+log4j.appender.VIRTUALUSERTABLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.VIRTUALUSERTABLE.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.MAILQUEUEFACTORY=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.MAILQUEUEFACTORY.File=../log/mailqueuefactory.log
+log4j.appender.MAILQUEUEFACTORY.DatePattern='.'yyyy-MM-dd
+log4j.appender.MAILQUEUEFACTORY.layout=org.apache.log4j.PatternLayout
+log4j.appender.MAILQUEUEFACTORY.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.logger.org.apache.jackrabbit=ERROR, CONS, FILE
+
+log4j.logger.org.apache.xbean.spring=WARN, CONS, FILE
+log4j.logger.org.apache.activemq=WARN, CONS, FILE
+
+log4j.logger.org.apache.camel=WARN, CONS, FILE
+log4j.logger.org.springframework=WARN, CONS, FILE
+log4j.logger.org.apache.james=INFO, CONS, FILE
+
+log4j.logger.james=WARN, CONS, FILE
+log4j.logger=DEBUG, CONS, FILE
+
+log4j.logger.james.mailboxmanager=INFO, MAILBOXMANAGER
+log4j.logger.james.imapserver=INFO, IMAPSERVER
+log4j.logger.james.mailetcontainer=INFO, MAILETCONTAINER
+log4j.logger.james.mailetcontext=INFO, MAILETCONTAINER
+log4j.logger.james.mailspooler=INFO, MAILETCONTAINER
+log4j.logger.james.mailprocessor=INFO, MAILETCONTAINER
+log4j.logger.james.dnsservice=INFO, DNSSERVICE
+log4j.logger.james.pop3server=INFO, POP3SERVER
+log4j.logger.james.smtpserver=INFO, SMTPSERVER
+log4j.logger.james.lmtpserver=INFO, LMTPSERVER
+log4j.logger.james.mailrepositorystore=INFO, MAILREPOSITORYSTORE
+log4j.logger.james.usersrepository=INFO, USERSREPOSITORY
+log4j.logger.james.fetchmail=INFO, FETCHMAIL
+log4j.logger.james.domainlist=INFO, DOMAINLIST
+log4j.logger.james.virtualusertable=INFO, VIRTUALUSERTABLE
+log4j.logger.james.mailqueuefactory=INFO, MAILQUEUEFACTORY
+
diff --git a/deploy/james/apache-james-conf/log4j.properties b/deploy/james/apache-james-conf/log4j.properties
new file mode 100644
index 0000000..b888953
--- /dev/null
+++ b/deploy/james/apache-james-conf/log4j.properties
@@ -0,0 +1,151 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# See http://james.apache.org/server/3/config.html for usage
+
+log4j.rootLogger=DEBUG
+
+log4j.appender.CONS=org.apache.log4j.ConsoleAppender
+log4j.appender.CONS.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONS.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.FILE.File=../log/james-server.log
+log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.MAILBOXMANAGER=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.MAILBOXMANAGER.File=../log/mailboxmanager.log
+log4j.appender.MAILBOXMANAGER.DatePattern='.'yyyy-MM-dd
+log4j.appender.MAILBOXMANAGER.layout=org.apache.log4j.PatternLayout
+log4j.appender.MAILBOXMANAGER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.IMAPSERVER=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.IMAPSERVER.File=../log/imapserver.log
+log4j.appender.IMAPSERVER.DatePattern='.'yyyy-MM-dd
+log4j.appender.IMAPSERVER.layout=org.apache.log4j.PatternLayout
+log4j.appender.IMAPSERVER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.MAILETCONTAINER=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.MAILETCONTAINER.File=../log/mailetcontainer.log
+log4j.appender.MAILETCONTAINER.DatePattern='.'yyyy-MM-dd
+log4j.appender.MAILETCONTAINER.layout=org.apache.log4j.PatternLayout
+log4j.appender.MAILETCONTAINER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.DNSSERVICE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.DNSSERVICE.File=../log/dnsservice.log
+log4j.appender.DNSSERVICE.DatePattern='.'yyyy-MM-dd
+log4j.appender.DNSSERVICE.layout=org.apache.log4j.PatternLayout
+log4j.appender.DNSSERVICE.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.POP3SERVER=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.POP3SERVER.File=../log/pop3server.log
+log4j.appender.POP3SERVER.DatePattern='.'yyyy-MM-dd
+log4j.appender.POP3SERVER.layout=org.apache.log4j.PatternLayout
+log4j.appender.POP3SERVER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.SMTPSERVER=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.SMTPSERVER.File=../log/smtpserver.log
+log4j.appender.SMTPSERVER.DatePattern='.'yyyy-MM-dd
+log4j.appender.SMTPSERVER.layout=org.apache.log4j.PatternLayout
+log4j.appender.SMTPSERVER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.LMTPSERVER=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.LMTPSERVER.File=../log/lmtpserver.log
+log4j.appender.LMTPSERVER.DatePattern='.'yyyy-MM-dd
+log4j.appender.LMTPSERVER.layout=org.apache.log4j.PatternLayout
+log4j.appender.LMTPSERVER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.MAILREPOSITORYSTORE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.MAILREPOSITORYSTORE.File=../log/mailrepositorystore.log
+log4j.appender.MAILREPOSITORYSTORE.DatePattern='.'yyyy-MM-dd
+log4j.appender.MAILREPOSITORYSTORE.layout=org.apache.log4j.PatternLayout
+log4j.appender.MAILREPOSITORYSTORE.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.USERSREPOSITORY=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.USERSREPOSITORY.File=../log/usersrepository.log
+log4j.appender.USERSREPOSITORY.DatePattern='.'yyyy-MM-dd
+log4j.appender.USERSREPOSITORY.layout=org.apache.log4j.PatternLayout
+log4j.appender.USERSREPOSITORY.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.FETCHMAIL=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.FETCHMAIL.File=../log/fetchmail.log
+log4j.appender.FETCHMAIL.DatePattern='.'yyyy-MM-dd
+log4j.appender.FETCHMAIL.layout=org.apache.log4j.PatternLayout
+log4j.appender.FETCHMAIL.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.DOMAINLIST=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.DOMAINLIST.File=../log/domainlist.log
+log4j.appender.DOMAINLIST.DatePattern='.'yyyy-MM-dd
+log4j.appender.DOMAINLIST.layout=org.apache.log4j.PatternLayout
+log4j.appender.DOMAINLIST.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.VIRTUALUSERTABLE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.VIRTUALUSERTABLE.File=../log/virtualusertable.log
+log4j.appender.VIRTUALUSERTABLE.DatePattern='.'yyyy-MM-dd
+log4j.appender.VIRTUALUSERTABLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.VIRTUALUSERTABLE.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.appender.MAILQUEUEFACTORY=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.MAILQUEUEFACTORY.File=../log/mailqueuefactory.log
+log4j.appender.MAILQUEUEFACTORY.DatePattern='.'yyyy-MM-dd
+log4j.appender.MAILQUEUEFACTORY.layout=org.apache.log4j.PatternLayout
+log4j.appender.MAILQUEUEFACTORY.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
+
+log4j.logger.org.apache.jackrabbit=ERROR, CONS, FILE
+
+log4j.logger.org.apache.xbean.spring=WARN, CONS, FILE
+log4j.logger.org.apache.activemq=WARN, CONS, FILE
+
+log4j.logger.org.apache.camel=WARN, CONS, FILE
+log4j.logger.org.springframework=WARN, CONS, FILE
+log4j.logger.org.apache.james=INFO, CONS, FILE
+
+# tjp
+log4j.logger.mail.server.handler=DEBUG, CONS, FILE
+log4j.logger.org.apache.james.smtpserver.SendMailHandler=DEBUG, CONS, FILE
+
+log4j.logger.james=DEBUG, CONS, FILE
+log4j.logger=DEBUG, CONS, FILE
+
+log4j.logger.james.mailboxmanager=INFO, MAILBOXMANAGER
+log4j.logger.james.imapserver=INFO, IMAPSERVER
+log4j.logger.james.mailetcontainer=DEBUG, MAILETCONTAINER
+log4j.logger.james.mailspooler=DEBUG, MAILETCONTAINER
+log4j.logger.james.mailprocessor=DEBUG, MAILETCONTAINER
+log4j.logger.james.dnsservice=INFO, DNSSERVICE
+log4j.logger.james.pop3server=OFF, POP3SERVER
+
+
+#changed additivty tjp
+log4j.logger.james.mailetcontext=DEBUG, MAILETCONTAINER
+#log4j.additivity.james.mailetcontext = false
+
+#changed additivty tjp
+log4j.logger.james.smtpserver=DEBUG, SMTPSERVER
+#log4j.additivity.james.smtpserver = false
+
+#changed additivty tjp
+log4j.logger.james.lmtpserver=DEBUG, LMTPSERVER
+#log4j.additivity.james.lmtpserver = false
+
+log4j.logger.james.mailrepositorystore=INFO, MAILREPOSITORYSTORE
+log4j.logger.james.usersrepository=INFO, USERSREPOSITORY
+log4j.logger.james.fetchmail=INFO, FETCHMAIL
+log4j.logger.james.domainlist=INFO, DOMAINLIST
+log4j.logger.james.virtualusertable=INFO, VIRTUALUSERTABLE
+log4j.logger.james.mailqueuefactory=INFO, MAILQUEUEFACTORY
diff --git a/deploy/james/apache-james-conf/mailbox-jcr-template.cnd b/deploy/james/apache-james-conf/mailbox-jcr-template.cnd
new file mode 100644
index 0000000..fd625fd
--- /dev/null
+++ b/deploy/james/apache-james-conf/mailbox-jcr-template.cnd
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+
+
+
+
+[jamesMailbox:user] > mix:created
+ mixin
+ - jamesMailbox:user (String)
+ - jamesMailbox:subscriptionMailboxes (STRING) multiple
+ + * (nt:unstructured) multiple
+
+
+[jamesMailbox:messageHeader] > mix:created, mix:lockable
+ mixin
+ - jamesMailbox:headerFieldName (STRING) mandatory
+ - jamesMailbox:headerValue(STRING) mandatory
+ - jamesMailbox:headerLineNumber (LONG) mandatory
+
+[jamesMailbox:messageProperty] > mix:created
+ mixin
+ - jamesMailbox:propertyNamespace (STRING) mandatory
+ - jamesMailbox:propertyLocalName (STRING) mandatory
+ - jamesMailbox:propertyValue(STRING) mandatory
+ - jamesMailbox:propertyOrder (Long) mandatory
+
+[jamesMailbox:message] > mix:referenceable, mix:created, mix:created
+ mixin
+ - jamesMailbox:mailboxUUID (String) mandatory
+ - jamesMailbox:uid (LONG) mandatory
+ - jamesMailbox:modSeq (LONG)
+ - jamesMailbox:size (LONG) mandatory
+ - jamesMailbox:answered (BOOLEAN)
+ - jamesMailbox:deleted (BOOLEAN)
+ - jamesMailbox:draft (BOOLEAN)
+ - jamesMailbox:flagged (BOOLEAN)
+ - jamesMailbox:recent (BOOLEAN)
+ - jamesMailbox:seen (BOOLEAN)
+ - jamesMailbox:internalDate (DATE)
+ - jamesMailbox:userFlags (STRING) multiple
+ - jamesMailbox:messageBodyStartOctet (LONG) mandatory
+ - jamesMailbox:messageTextualLineCount (LONG)
+ - jamesMailbox:messageSubType (String) mandatory
+ + messageHeader (nt:unstructured) multiple
+ + messageProperty (nt:unstructured) multiple
+
+[jamesMailbox:mailbox] > mix:referenceable, mix:lockable, mix:created
+ mixin
+ - jamesMailbox:mailboxUidValidity (LONG)
+ - jamesMailbox:mailboxName (STRING)
+ - jamesMailbox:mailboxLastUid (LONG)
+ - jamesMailbox:mailboxNamespace (STRING)
+ - jamesMailbox:mailboxUser (STRING)
+ + * (nt:unstructured) multiple
diff --git a/deploy/james/apache-james-conf/mailbox-maildir-template.properties b/deploy/james/apache-james-conf/mailbox-maildir-template.properties
new file mode 100644
index 0000000..fb759ab
--- /dev/null
+++ b/deploy/james/apache-james-conf/mailbox-maildir-template.properties
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# This template file can be used as example for James Server configuration
+# DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# See http://james.apache.org/server/3/config.html for usage
+
+maildir.folder=../var/store/maildir/%domain/%user
diff --git a/deploy/james/apache-james-conf/mailbox.conf b/deploy/james/apache-james-conf/mailbox.conf
new file mode 100644
index 0000000..a53cec6
--- /dev/null
+++ b/deploy/james/apache-james-conf/mailbox.conf
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ memory
+
diff --git a/deploy/james/apache-james-conf/mailetcontainer-template.conf b/deploy/james/apache-james-conf/mailetcontainer-template.conf
new file mode 100644
index 0000000..b4d85aa
--- /dev/null
+++ b/deploy/james/apache-james-conf/mailetcontainer-template.conf
@@ -0,0 +1,675 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ postmaster@localhost
+
+
+
+
+ 20
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ virus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ transport
+
+
+
+ true
+
+
+
+
+
+
+ transport
+
+
+
+
+
+
+
+
+
+
+
+
+
+ transport
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ spam
+ 550 Requested action not taken: rejected - see http://njabl.org/
+
+
+
+
+
+
+
+
+
+
+ transport
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ file://var/mail/error/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sent
+ false
+
+
+
+
+
+
+
+
+ local-address-error
+ 550 - Requested action not taken: no such user here
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ relay-denied
+ 550 - Requested action not taken: relaying denied
+
+
+
+
+
+ outgoing
+
+
+
+ 5 minutes
+ 10 minutes
+ 45 minutes
+ 2 hours
+ 3 hours
+ 6 hours
+ 25
+
+
+
+ 0
+
+
+ 10
+
+
+ true
+
+
+
+
+ bounces
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ file://var/mail/spam/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true, bouncing
+
+
+
+
+ heads
+ none
+ Warning: We were unable to deliver the message below because it was found infected by virus(es).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ file://var/mail/address-error/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ file://var/mail/relay-denied/
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/mailetcontainer.conf b/deploy/james/apache-james-conf/mailetcontainer.conf
new file mode 100644
index 0000000..6ccaa53
--- /dev/null
+++ b/deploy/james/apache-james-conf/mailetcontainer.conf
@@ -0,0 +1,662 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ postmaster@mailiverse.com
+
+
+
+
+ 20
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ virus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ transport
+
+
+
+ true
+
+
+
+
+
+
+ transport
+
+
+
+
+
+
+
+
+
+
+
+
+
+ transport
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ spam
+ 550 Requested action not taken: rejected - see http://njabl.org/
+
+
+
+
+
+
+
+
+
+
+ transport
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sent
+ false
+
+
+
+
+ true
+ 1 minutes
+ 10 minutes
+ 45 minutes
+ 2 hours
+ 3 hours
+ 6 hours
+ 25
+
+
+
+
+
+ local-address-error
+ 550 - Requested action not taken: no such user here
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+ false
+ *
+ outgoing
+
+
+
+ 5 minutes
+ 10 minutes
+ 45 minutes
+ 2 hours
+ 3 hours
+ 6 hours
+ 25
+
+
+
+ 0
+
+
+ 10
+
+
+ true
+
+
+
+
+ bounces
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ outgoing.mailiverse.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true, bouncing
+
+
+
+
+ heads
+ none
+ Warning: We were unable to deliver the message below because it was found infected by virus(es).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ file://var/mail/address-error/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ file://var/mail/relay-denied/
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ This is Mailiverse. I'm not able to deliver this message.
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/mailrepositorystore-template.conf b/deploy/james/apache-james-conf/mailrepositorystore-template.conf
new file mode 100644
index 0000000..291fa24
--- /dev/null
+++ b/deploy/james/apache-james-conf/mailrepositorystore-template.conf
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ file
+
+
+
+
+
+
+
+
+
+ db
+
+
+ file://conf/sqlResources.xml
+
+
+
+
+
+
+
+
+
+
+
+ dbfile
+
+
+ file://conf/sqlResources.xml
+ file://var/dbmail
+
+
+
+
+
+
+ mbox
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/pop3server-template.conf b/deploy/james/apache-james-conf/pop3server-template.conf
new file mode 100644
index 0000000..83d1558
--- /dev/null
+++ b/deploy/james/apache-james-conf/pop3server-template.conf
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pop3server
+
+
+
+
+ 0.0.0.0:110
+
+ 200
+
+
+
+
+ file://conf/keystore
+ yoursecret
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+
+
+
+
+
+
+
+
+
+ 1200
+
+
+ 0
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/recipientrewritetable-template.conf b/deploy/james/apache-james-conf/recipientrewritetable-template.conf
new file mode 100644
index 0000000..b5399be
--- /dev/null
+++ b/deploy/james/apache-james-conf/recipientrewritetable-template.conf
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ 10
+
+
diff --git a/deploy/james/apache-james-conf/smtpserver-template.conf b/deploy/james/apache-james-conf/smtpserver-template.conf
new file mode 100644
index 0000000..86ae510
--- /dev/null
+++ b/deploy/james/apache-james-conf/smtpserver-template.conf
@@ -0,0 +1,323 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ smtpserver
+
+
+
+
+
+ 0.0.0.0:25
+
+ 200
+
+
+
+
+ file://conf/keystore
+ yoursecret
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+
+ SunX509
+
+
+
+
+
+
+
+
+
+
+ 360
+
+
+ 0
+
+
+ 0
+
+
+
+
+
+
+ 127.0.0.0/8
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/smtpserver.conf b/deploy/james/apache-james-conf/smtpserver.conf
new file mode 100644
index 0000000..b86d9d7
--- /dev/null
+++ b/deploy/james/apache-james-conf/smtpserver.conf
@@ -0,0 +1,314 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ smtpserver
+
+
+
+
+
+ 0.0.0.0:10025
+
+ 200
+
+
+
+ file://conf/keystore
+ password
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+
+ SunX509
+
+
+
+
+
+
+
+ mail.mailiverse.com
+
+
+ 360
+
+
+ 0
+
+
+ 0
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+ query.bondedsender.org.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/sqlResources-template.xml b/deploy/james/apache-james-conf/sqlResources-template.xml
new file mode 100644
index 0000000..f3ed58d
--- /dev/null
+++ b/deploy/james/apache-james-conf/sqlResources-template.xml
@@ -0,0 +1,938 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${table}
+
+
+ SELECT username, pwdHash, pwdAlgorithm, useForwarding,
+ forwardDestination, useAlias, alias
+ FROM ${table}
+ ORDER BY username
+
+
+
+
+
+ SELECT username, pwdHash, pwdAlgorithm, useForwarding,
+ forwardDestination, useAlias, alias
+ FROM ${table}
+ WHERE lower(username) = ?
+
+
+
+ SELECT username, pwdHash, pwdAlgorithm, useForwarding,
+ forwardDestination, useAlias, alias
+ FROM ${table}
+ WHERE username = ?
+
+
+
+ INSERT INTO ${table}
+ (username, pwdHash, pwdAlgorithm, useForwarding, forwardDestination, useAlias, alias)
+ VALUES (?,?,?,?,?,?,?)
+
+
+
+ UPDATE ${table} SET
+ pwdHash = ?, pwdAlgorithm = ?, useForwarding = ?, forwardDestination = ?, useAlias = ?, alias = ?
+ WHERE username = ?
+
+
+
+ DELETE FROM ${table} WHERE username = ?
+
+
+ CREATE CACHED TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), useForwarding INTEGER, forwardDestination VARCHAR(255), useAlias INTEGER, alias VARCHAR(255), PRIMARY KEY(username))
+ CREATE TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), useForwarding SMALLINT, forwardDestination VARCHAR(255), useAlias SMALLINT, alias VARCHAR(255), PRIMARY KEY(username))
+
+
+
+
+ ${table}
+
+
+ SELECT username, pwdHash, pwdAlgorithm
+ FROM ${table}
+
+
+
+ INSERT INTO ${table}
+ (username, pwdHash, pwdAlgorithm)
+ VALUES (?,?,?)
+
+
+
+ UPDATE ${table} SET
+ pwdHash = ?, pwdAlgorithm = ?
+ WHERE username = ?
+
+
+
+ DELETE FROM ${table} WHERE username = ?
+
+
+ CREATE CACHED TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), PRIMARY KEY(username))
+ CREATE TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), PRIMARY KEY(username))
+
+
+
+
+
+
+ ${table}
+
+
+ SELECT listSubscriber
+ FROM ${table}
+ WHERE listName = '${key}'
+
+
+
+ INSERT INTO ${table}
+ (listSubscriber, listName)
+ VALUES (?, '${key}')
+
+
+
+ UPDATE ${table} SET
+ listSubscriber = ?
+ WHERE listSubscriber = ? AND listName = '${key}'
+
+
+
+ DELETE FROM ${table}
+ WHERE listSubscriber = ? AND listName = '${key}'
+
+
+
+ CREATE CACHED TABLE ${table} (listName VARCHAR(64) NOT NULL, listSubscriber VARCHAR(255) NOT NULL, PRIMARY KEY(listName, listSubscriber))
+ CREATE TABLE ${table} (listName VARCHAR(64) NOT NULL, listSubscriber VARCHAR(255) NOT NULL, PRIMARY KEY(listName, listSubscriber))
+
+
+
+
+
+ SELECT count(*) FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ UPDATE ${table} SET message_state = ?, error_message = ?, sender = ?, recipients = ?, remote_host = ?, remote_addr = ?, last_updated = ? WHERE message_name = ? AND repository_name = ?
+
+
+ UPDATE ${table} SET message_body = ? WHERE message_name = ? AND repository_name = ?
+
+
+ UPDATE ${table} SET message_attributes = ? WHERE message_name = ? AND repository_name = ?
+
+
+ INSERT INTO ${table} (message_name,
+ repository_name, message_state, error_message, sender, recipients,
+ remote_host, remote_addr, last_updated, message_body,
+ message_attributes) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
+
+
+ SELECT message_state, error_message, sender, recipients, remote_host, remote_addr, last_updated FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ SELECT message_body FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ SELECT message_attributes FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+
+ SELECT datalength(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT dbms_lob.getlength(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ DELETE FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ SELECT message_name, message_state, last_updated FROM ${table} WHERE repository_name = ? ORDER BY last_updated ASC
+
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (100) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (255) NULL ,
+ recipients text NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body longblob NOT NULL ,
+ message_attributes longblob NULL ,
+ last_updated datetime NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE CACHED TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (255) NULL ,
+ recipients varchar NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body varchar NOT NULL ,
+ message_attributes varchar NULL ,
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE CACHED TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (255) NULL ,
+ recipients varchar NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body varchar NOT NULL ,
+ message_attributes varchar NULL ,
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE [${table}] (
+ [message_name] [varchar] (200) NOT NULL,
+ [repository_name] [varchar] (255) NOT NULL,
+ [message_state] [varchar] (30) NOT NULL ,
+ [error_message] [varchar] (1000) NULL ,
+ [sender] [varchar] (255) NULL ,
+ [recipients] [text] NOT NULL ,
+ [remote_host] [varchar] (255) NOT NULL ,
+ [remote_addr] [varchar] (20) NOT NULL ,
+ [message_body] [image] NOT NULL ,
+ [message_attributes] [image] NULL ,
+ [last_updated] [datetime] NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar2(200) NOT NULL ,
+ repository_name varchar2(255) NOT NULL ,
+ message_state varchar2(30) NOT NULL ,
+ error_message varchar2(200) NULL ,
+ sender varchar2(255) ,
+ recipients varchar2(1000) NOT NULL ,
+ remote_host varchar2(100) NOT NULL ,
+ remote_addr varchar2(20) NOT NULL ,
+ message_body blob NOT NULL ,
+ message_attributes blob NULL ,
+ last_updated date NOT NULL ,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (255) NULL ,
+ recipients text NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body bytea NOT NULL ,
+ message_attributes bytea NULL ,
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (200) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (200) NULL ,
+ recipients long NOT NULL ,
+ remote_host varchar (100) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body long byte NOT NULL ,
+ message_attributes long byte NULL ,
+ last_updated date NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar(200) NOT NULL ,
+ repository_name varchar(255) NOT NULL ,
+ message_state varchar(30) NOT NULL ,
+ error_message varchar(200) ,
+ sender varchar(255) ,
+ recipients varchar(1000) NOT NULL ,
+ remote_host varchar(100) NOT NULL ,
+ remote_addr varchar(20) NOT NULL ,
+ message_body blob NOT NULL ,
+ message_attributes blob ,
+ last_updated timestamp NOT NULL ,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) ,
+ sender varchar (255) ,
+ recipients LONG VARCHAR NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body LONG BYTE NOT NULL ,
+ message_attributes LONG BYTE ,
+ last_updated DATE NOT NULL
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) ,
+ sender varchar (255) ,
+ recipients long varchar NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body blob NOT NULL ,
+ message_attributes blob ,
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+
+
+
+ bayesiananalysis_ham
+ bayesiananalysis_spam
+ bayesiananalysis_messagecounts
+
+
+ SELECT HAMCOUNT, SPAMCOUNT FROM bayesiananalysis_messagecounts
+
+
+ INSERT INTO bayesiananalysis_messagecounts (HAMCOUNT, SPAMCOUNT) VALUES (0,0)
+
+
+ UPDATE bayesiananalysis_messagecounts SET HAMCOUNT=(HAMCOUNT + ?)
+
+
+ UPDATE bayesiananalysis_messagecounts SET SPAMCOUNT=(SPAMCOUNT + ?)
+
+
+ SELECT TOKEN, OCCURRENCES FROM bayesiananalysis_ham
+
+
+ SELECT TOKEN, OCCURRENCES FROM bayesiananalysis_spam
+
+
+ INSERT INTO bayesiananalysis_ham (TOKEN, OCCURRENCES) VALUES (?,?)
+
+
+ INSERT INTO bayesiananalysis_spam (TOKEN, OCCURRENCES) VALUES (?,?)
+
+
+ UPDATE bayesiananalysis_ham SET OCCURRENCES=(OCCURRENCES + ?) WHERE (TOKEN=?)
+
+
+ UPDATE bayesiananalysis_spam SET OCCURRENCES=(OCCURRENCES + ?) WHERE (TOKEN=?)
+
+
+ DELETE FROM bayesiananalysis_ham
+
+
+ DELETE FROM bayesiananalysis_spam
+
+
+ DELETE FROM bayesiananalysis_messagecounts
+
+
+
+
+ CREATE TABLE bayesiananalysis_ham (
+ token varchar(128) binary NOT NULL default '',
+ occurrences int(11) NOT NULL default '0',
+ PRIMARY KEY (token)
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [bayesiananalysis_ham] (
+ [token] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL,
+ [occurrences] [int] NOT NULL default (0),
+ PRIMARY KEY (token)
+ )
+
+
+ CREATE TABLE bayesiananalysis_ham (
+ token varchar(128) NOT NULL,
+ occurrences INTEGER NOT NULL default 0,
+ PRIMARY KEY (token)
+ )
+
+
+ CREATE TABLE bayesiananalysis_ham (
+ token varchar(128) NOT NULL,
+ occurrences int NOT NULL default 0,
+ PRIMARY KEY (token)
+ )
+
+
+
+
+ CREATE TABLE bayesiananalysis_spam (
+ token varchar(128) binary NOT NULL default '',
+ occurrences int(11) NOT NULL default '0',
+ PRIMARY KEY (token)
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [bayesiananalysis_spam] (
+ [token] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL,
+ [occurrences] [int] NOT NULL default (0),
+ PRIMARY KEY (token)
+ )
+
+
+ CREATE TABLE bayesiananalysis_spam (
+ token varchar (128) NOT NULL,
+ occurrences INTEGER NOT NULL default 0,
+ PRIMARY KEY (token)
+ )
+
+
+ CREATE TABLE bayesiananalysis_spam (
+ token varchar (128) NOT NULL,
+ occurrences int NOT NULL default 0,
+ PRIMARY KEY (token)
+ )
+
+
+
+
+ CREATE TABLE bayesiananalysis_messagecounts (
+ hamcount int(11) NOT NULL default '0',
+ spamcount int(11) NOT NULL default '0'
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [bayesiananalysis_messagecounts] (
+ [hamcount] [int] NOT NULL default (0),
+ [spamcount] [int] NOT NULL default (0)
+ )
+
+
+ CREATE TABLE bayesiananalysis_messagecounts (
+ hamcount INTEGER NOT NULL default 0,
+ spamcount INTEGER NOT NULL default 0
+ )
+
+
+ CREATE TABLE bayesiananalysis_messagecounts (
+ hamcount int NOT NULL default 0,
+ spamcount int NOT NULL default 0
+ )
+
+
+
+
+
+ whitelist
+
+
+ SELECT localUser, localHost FROM whitelist where (localUser=? AND localHost=? AND remoteUser=? AND remoteHost=?)
+
+
+ SELECT remoteUser, remoteHost FROM whitelist where (localUser=? AND localHost=?) ORDER BY remoteUser, remoteHost
+
+
+ INSERT INTO whitelist (localUser, localHost, remoteUser, remoteHost) VALUES (?,?,?,?)
+
+
+ DELETE FROM whitelist where (localUser=? AND localHost=? AND remoteUser=? AND remoteHost=?)
+
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+ CREATE CACHED TABLE ${table} (
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) character set latin1 NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) character set latin1 NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [whitelist] (
+ [localUser] [varchar] (64) NOT NULL,
+ [localHost] [varchar] (255) NOT NULL,
+ [remoteUser] [varchar] (64) NOT NULL,
+ [remoteHost] [varchar] (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+
+
+
+
+ networkWhitelist
+
+
+ SELECT network FROM networkWhitelist where (localUser=? AND localHost=?)
+
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost)
+ )
+
+ CREATE CACHED TABLE ${table} (
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) character set latin1 NOT NULL,
+ network varchar (255) NOT NULL
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [networkWhitelist] (
+ [localUser] [varchar] (64) NOT NULL,
+ [localHost] [varchar] (255) NOT NULL,
+ [network] [varchar] (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+
+
+
+
+ greylist
+
+
+ SELECT create_time,count FROM greylist WHERE ipaddress = ? AND sender = ? AND recip = ?
+
+
+ INSERT INTO greylist (ipaddress,sender,recip,count,create_time) values (?,?,?,?,?)
+
+
+ DELETE FROM greylist WHERE create_time < ? AND count = 0
+
+
+ DELETE FROM greylist WHERE create_time < ?
+
+
+ UPDATE greylist SET create_time = ? , count = ? WHERE ipaddress = ? AND sender = ? AND recip = ?
+
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time datetime NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE CACHED TABLE ${table} (
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time timestamo NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time datetime NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [greylist] (
+ [ipaddress] [varchar] (20) NOT NULL,
+ [sender] [varchar] (255) NOT NULL,
+ [recip] [varchar] (255) NOT NULL,
+ [count] [int] NOT NULL,
+ [create_time] [datetime] NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar2(20) NOT NULL,
+ sender varchar2(255) NOT NULL,
+ recip varchar2(255) NOT NULL,
+ count int NOT NULL,
+ create_time datetime NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time timestamp NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time date NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time timestamp NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time date NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time timestamp NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+
+
+
+
+ select RecipientRewriteTable.target_address,(RecipientRewriteTable."user" || '@' ||RecipientRewriteTable.domain) from RecipientRewriteTable, RecipientRewriteTable as VUTDomains where ((RecipientRewriteTable."user") like ? or (RecipientRewriteTable."user") = '*') and (RecipientRewriteTable.domain like ? or (RecipientRewriteTable.domain = '*')) order by 2 desc
+ select RecipientRewriteTable.target_address from RecipientRewriteTable, RecipientRewriteTable as VUTDomains where (RecipientRewriteTable.user like ? or RecipientRewriteTable.user = '*') and (RecipientRewriteTable.domain like ? or (RecipientRewriteTable.domain = '*')) order by concat(RecipientRewriteTable.user,'@',RecipientRewriteTable.domain) desc limit 1
+ select RecipientRewriteTable.target_address from RecipientRewriteTable, RecipientRewriteTable as VUTDomains where (RecipientRewriteTable.user like ? or RecipientRewriteTable.user = '*') and (RecipientRewriteTable.domain like ? or (RecipientRewriteTable.domain = '*')) order by (RecipientRewriteTable.user || '@' || RecipientRewriteTable.domain) desc limit 1
+
+ select RecipientRewriteTable.target_address from RecipientRewriteTable where RecipientRewriteTable."user" = ? and RecipientRewriteTable.domain = ?
+ select RecipientRewriteTable.target_address from RecipientRewriteTable where RecipientRewriteTable.user = ? and RecipientRewriteTable.domain = ?
+
+ delete from RecipientRewriteTable where RecipientRewriteTable."user" = ? and RecipientRewriteTable.domain = ? and RecipientRewriteTable.target_address = ?
+
+ update RecipientRewriteTable set RecipientRewriteTable.target_address = ? where RecipientRewriteTable."user" = ? and RecipientRewriteTable.domain = ?
+
+ insert into RecipientRewriteTable values(?,?,?)
+
+ select * from RecipientRewriteTable
+
+
+
+ CREATE TABLE RecipientRewriteTable (
+ user varchar(64) NOT NULL default '',
+ domain varchar(255) NOT NULL default '',
+ target_address varchar(255) NOT NULL default '',
+ PRIMARY KEY (user,domain)
+ )
+
+
+
+
+ CREATE TABLE RecipientRewriteTable (
+ "user" varchar(64) NOT NULL default '',
+ domain varchar(255) NOT NULL default '',
+ target_address varchar(255) NOT NULL default '',
+ PRIMARY KEY ("user",domain)
+ )
+
+
+ CREATE TABLE RecipientRewriteTable (
+ "user" varchar (64) NOT NULL default '',
+ domain varchar (255) NOT NULL default '',
+ target_address varchar (255) NOT NULL default '',
+ PRIMARY KEY ("user",domain)
+ )
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/sqlResources.xml b/deploy/james/apache-james-conf/sqlResources.xml
new file mode 100644
index 0000000..f3ed58d
--- /dev/null
+++ b/deploy/james/apache-james-conf/sqlResources.xml
@@ -0,0 +1,938 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${table}
+
+
+ SELECT username, pwdHash, pwdAlgorithm, useForwarding,
+ forwardDestination, useAlias, alias
+ FROM ${table}
+ ORDER BY username
+
+
+
+
+
+ SELECT username, pwdHash, pwdAlgorithm, useForwarding,
+ forwardDestination, useAlias, alias
+ FROM ${table}
+ WHERE lower(username) = ?
+
+
+
+ SELECT username, pwdHash, pwdAlgorithm, useForwarding,
+ forwardDestination, useAlias, alias
+ FROM ${table}
+ WHERE username = ?
+
+
+
+ INSERT INTO ${table}
+ (username, pwdHash, pwdAlgorithm, useForwarding, forwardDestination, useAlias, alias)
+ VALUES (?,?,?,?,?,?,?)
+
+
+
+ UPDATE ${table} SET
+ pwdHash = ?, pwdAlgorithm = ?, useForwarding = ?, forwardDestination = ?, useAlias = ?, alias = ?
+ WHERE username = ?
+
+
+
+ DELETE FROM ${table} WHERE username = ?
+
+
+ CREATE CACHED TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), useForwarding INTEGER, forwardDestination VARCHAR(255), useAlias INTEGER, alias VARCHAR(255), PRIMARY KEY(username))
+ CREATE TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), useForwarding SMALLINT, forwardDestination VARCHAR(255), useAlias SMALLINT, alias VARCHAR(255), PRIMARY KEY(username))
+
+
+
+
+ ${table}
+
+
+ SELECT username, pwdHash, pwdAlgorithm
+ FROM ${table}
+
+
+
+ INSERT INTO ${table}
+ (username, pwdHash, pwdAlgorithm)
+ VALUES (?,?,?)
+
+
+
+ UPDATE ${table} SET
+ pwdHash = ?, pwdAlgorithm = ?
+ WHERE username = ?
+
+
+
+ DELETE FROM ${table} WHERE username = ?
+
+
+ CREATE CACHED TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), PRIMARY KEY(username))
+ CREATE TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), PRIMARY KEY(username))
+
+
+
+
+
+
+ ${table}
+
+
+ SELECT listSubscriber
+ FROM ${table}
+ WHERE listName = '${key}'
+
+
+
+ INSERT INTO ${table}
+ (listSubscriber, listName)
+ VALUES (?, '${key}')
+
+
+
+ UPDATE ${table} SET
+ listSubscriber = ?
+ WHERE listSubscriber = ? AND listName = '${key}'
+
+
+
+ DELETE FROM ${table}
+ WHERE listSubscriber = ? AND listName = '${key}'
+
+
+
+ CREATE CACHED TABLE ${table} (listName VARCHAR(64) NOT NULL, listSubscriber VARCHAR(255) NOT NULL, PRIMARY KEY(listName, listSubscriber))
+ CREATE TABLE ${table} (listName VARCHAR(64) NOT NULL, listSubscriber VARCHAR(255) NOT NULL, PRIMARY KEY(listName, listSubscriber))
+
+
+
+
+
+ SELECT count(*) FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ UPDATE ${table} SET message_state = ?, error_message = ?, sender = ?, recipients = ?, remote_host = ?, remote_addr = ?, last_updated = ? WHERE message_name = ? AND repository_name = ?
+
+
+ UPDATE ${table} SET message_body = ? WHERE message_name = ? AND repository_name = ?
+
+
+ UPDATE ${table} SET message_attributes = ? WHERE message_name = ? AND repository_name = ?
+
+
+ INSERT INTO ${table} (message_name,
+ repository_name, message_state, error_message, sender, recipients,
+ remote_host, remote_addr, last_updated, message_body,
+ message_attributes) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
+
+
+ SELECT message_state, error_message, sender, recipients, remote_host, remote_addr, last_updated FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ SELECT message_body FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ SELECT message_attributes FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+
+ SELECT datalength(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT dbms_lob.getlength(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ DELETE FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ SELECT message_name, message_state, last_updated FROM ${table} WHERE repository_name = ? ORDER BY last_updated ASC
+
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (100) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (255) NULL ,
+ recipients text NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body longblob NOT NULL ,
+ message_attributes longblob NULL ,
+ last_updated datetime NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE CACHED TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (255) NULL ,
+ recipients varchar NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body varchar NOT NULL ,
+ message_attributes varchar NULL ,
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE CACHED TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (255) NULL ,
+ recipients varchar NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body varchar NOT NULL ,
+ message_attributes varchar NULL ,
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE [${table}] (
+ [message_name] [varchar] (200) NOT NULL,
+ [repository_name] [varchar] (255) NOT NULL,
+ [message_state] [varchar] (30) NOT NULL ,
+ [error_message] [varchar] (1000) NULL ,
+ [sender] [varchar] (255) NULL ,
+ [recipients] [text] NOT NULL ,
+ [remote_host] [varchar] (255) NOT NULL ,
+ [remote_addr] [varchar] (20) NOT NULL ,
+ [message_body] [image] NOT NULL ,
+ [message_attributes] [image] NULL ,
+ [last_updated] [datetime] NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar2(200) NOT NULL ,
+ repository_name varchar2(255) NOT NULL ,
+ message_state varchar2(30) NOT NULL ,
+ error_message varchar2(200) NULL ,
+ sender varchar2(255) ,
+ recipients varchar2(1000) NOT NULL ,
+ remote_host varchar2(100) NOT NULL ,
+ remote_addr varchar2(20) NOT NULL ,
+ message_body blob NOT NULL ,
+ message_attributes blob NULL ,
+ last_updated date NOT NULL ,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (255) NULL ,
+ recipients text NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body bytea NOT NULL ,
+ message_attributes bytea NULL ,
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (200) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (200) NULL ,
+ recipients long NOT NULL ,
+ remote_host varchar (100) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body long byte NOT NULL ,
+ message_attributes long byte NULL ,
+ last_updated date NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar(200) NOT NULL ,
+ repository_name varchar(255) NOT NULL ,
+ message_state varchar(30) NOT NULL ,
+ error_message varchar(200) ,
+ sender varchar(255) ,
+ recipients varchar(1000) NOT NULL ,
+ remote_host varchar(100) NOT NULL ,
+ remote_addr varchar(20) NOT NULL ,
+ message_body blob NOT NULL ,
+ message_attributes blob ,
+ last_updated timestamp NOT NULL ,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) ,
+ sender varchar (255) ,
+ recipients LONG VARCHAR NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body LONG BYTE NOT NULL ,
+ message_attributes LONG BYTE ,
+ last_updated DATE NOT NULL
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) ,
+ sender varchar (255) ,
+ recipients long varchar NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body blob NOT NULL ,
+ message_attributes blob ,
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+
+
+
+ bayesiananalysis_ham
+ bayesiananalysis_spam
+ bayesiananalysis_messagecounts
+
+
+ SELECT HAMCOUNT, SPAMCOUNT FROM bayesiananalysis_messagecounts
+
+
+ INSERT INTO bayesiananalysis_messagecounts (HAMCOUNT, SPAMCOUNT) VALUES (0,0)
+
+
+ UPDATE bayesiananalysis_messagecounts SET HAMCOUNT=(HAMCOUNT + ?)
+
+
+ UPDATE bayesiananalysis_messagecounts SET SPAMCOUNT=(SPAMCOUNT + ?)
+
+
+ SELECT TOKEN, OCCURRENCES FROM bayesiananalysis_ham
+
+
+ SELECT TOKEN, OCCURRENCES FROM bayesiananalysis_spam
+
+
+ INSERT INTO bayesiananalysis_ham (TOKEN, OCCURRENCES) VALUES (?,?)
+
+
+ INSERT INTO bayesiananalysis_spam (TOKEN, OCCURRENCES) VALUES (?,?)
+
+
+ UPDATE bayesiananalysis_ham SET OCCURRENCES=(OCCURRENCES + ?) WHERE (TOKEN=?)
+
+
+ UPDATE bayesiananalysis_spam SET OCCURRENCES=(OCCURRENCES + ?) WHERE (TOKEN=?)
+
+
+ DELETE FROM bayesiananalysis_ham
+
+
+ DELETE FROM bayesiananalysis_spam
+
+
+ DELETE FROM bayesiananalysis_messagecounts
+
+
+
+
+ CREATE TABLE bayesiananalysis_ham (
+ token varchar(128) binary NOT NULL default '',
+ occurrences int(11) NOT NULL default '0',
+ PRIMARY KEY (token)
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [bayesiananalysis_ham] (
+ [token] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL,
+ [occurrences] [int] NOT NULL default (0),
+ PRIMARY KEY (token)
+ )
+
+
+ CREATE TABLE bayesiananalysis_ham (
+ token varchar(128) NOT NULL,
+ occurrences INTEGER NOT NULL default 0,
+ PRIMARY KEY (token)
+ )
+
+
+ CREATE TABLE bayesiananalysis_ham (
+ token varchar(128) NOT NULL,
+ occurrences int NOT NULL default 0,
+ PRIMARY KEY (token)
+ )
+
+
+
+
+ CREATE TABLE bayesiananalysis_spam (
+ token varchar(128) binary NOT NULL default '',
+ occurrences int(11) NOT NULL default '0',
+ PRIMARY KEY (token)
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [bayesiananalysis_spam] (
+ [token] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL,
+ [occurrences] [int] NOT NULL default (0),
+ PRIMARY KEY (token)
+ )
+
+
+ CREATE TABLE bayesiananalysis_spam (
+ token varchar (128) NOT NULL,
+ occurrences INTEGER NOT NULL default 0,
+ PRIMARY KEY (token)
+ )
+
+
+ CREATE TABLE bayesiananalysis_spam (
+ token varchar (128) NOT NULL,
+ occurrences int NOT NULL default 0,
+ PRIMARY KEY (token)
+ )
+
+
+
+
+ CREATE TABLE bayesiananalysis_messagecounts (
+ hamcount int(11) NOT NULL default '0',
+ spamcount int(11) NOT NULL default '0'
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [bayesiananalysis_messagecounts] (
+ [hamcount] [int] NOT NULL default (0),
+ [spamcount] [int] NOT NULL default (0)
+ )
+
+
+ CREATE TABLE bayesiananalysis_messagecounts (
+ hamcount INTEGER NOT NULL default 0,
+ spamcount INTEGER NOT NULL default 0
+ )
+
+
+ CREATE TABLE bayesiananalysis_messagecounts (
+ hamcount int NOT NULL default 0,
+ spamcount int NOT NULL default 0
+ )
+
+
+
+
+
+ whitelist
+
+
+ SELECT localUser, localHost FROM whitelist where (localUser=? AND localHost=? AND remoteUser=? AND remoteHost=?)
+
+
+ SELECT remoteUser, remoteHost FROM whitelist where (localUser=? AND localHost=?) ORDER BY remoteUser, remoteHost
+
+
+ INSERT INTO whitelist (localUser, localHost, remoteUser, remoteHost) VALUES (?,?,?,?)
+
+
+ DELETE FROM whitelist where (localUser=? AND localHost=? AND remoteUser=? AND remoteHost=?)
+
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+ CREATE CACHED TABLE ${table} (
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) character set latin1 NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) character set latin1 NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [whitelist] (
+ [localUser] [varchar] (64) NOT NULL,
+ [localHost] [varchar] (255) NOT NULL,
+ [remoteUser] [varchar] (64) NOT NULL,
+ [remoteHost] [varchar] (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+
+
+
+
+ networkWhitelist
+
+
+ SELECT network FROM networkWhitelist where (localUser=? AND localHost=?)
+
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost)
+ )
+
+ CREATE CACHED TABLE ${table} (
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) character set latin1 NOT NULL,
+ network varchar (255) NOT NULL
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [networkWhitelist] (
+ [localUser] [varchar] (64) NOT NULL,
+ [localHost] [varchar] (255) NOT NULL,
+ [network] [varchar] (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+
+
+
+
+ greylist
+
+
+ SELECT create_time,count FROM greylist WHERE ipaddress = ? AND sender = ? AND recip = ?
+
+
+ INSERT INTO greylist (ipaddress,sender,recip,count,create_time) values (?,?,?,?,?)
+
+
+ DELETE FROM greylist WHERE create_time < ? AND count = 0
+
+
+ DELETE FROM greylist WHERE create_time < ?
+
+
+ UPDATE greylist SET create_time = ? , count = ? WHERE ipaddress = ? AND sender = ? AND recip = ?
+
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time datetime NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE CACHED TABLE ${table} (
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time timestamo NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time datetime NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [greylist] (
+ [ipaddress] [varchar] (20) NOT NULL,
+ [sender] [varchar] (255) NOT NULL,
+ [recip] [varchar] (255) NOT NULL,
+ [count] [int] NOT NULL,
+ [create_time] [datetime] NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar2(20) NOT NULL,
+ sender varchar2(255) NOT NULL,
+ recip varchar2(255) NOT NULL,
+ count int NOT NULL,
+ create_time datetime NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time timestamp NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time date NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time timestamp NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time date NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time timestamp NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+
+
+
+
+ select RecipientRewriteTable.target_address,(RecipientRewriteTable."user" || '@' ||RecipientRewriteTable.domain) from RecipientRewriteTable, RecipientRewriteTable as VUTDomains where ((RecipientRewriteTable."user") like ? or (RecipientRewriteTable."user") = '*') and (RecipientRewriteTable.domain like ? or (RecipientRewriteTable.domain = '*')) order by 2 desc
+ select RecipientRewriteTable.target_address from RecipientRewriteTable, RecipientRewriteTable as VUTDomains where (RecipientRewriteTable.user like ? or RecipientRewriteTable.user = '*') and (RecipientRewriteTable.domain like ? or (RecipientRewriteTable.domain = '*')) order by concat(RecipientRewriteTable.user,'@',RecipientRewriteTable.domain) desc limit 1
+ select RecipientRewriteTable.target_address from RecipientRewriteTable, RecipientRewriteTable as VUTDomains where (RecipientRewriteTable.user like ? or RecipientRewriteTable.user = '*') and (RecipientRewriteTable.domain like ? or (RecipientRewriteTable.domain = '*')) order by (RecipientRewriteTable.user || '@' || RecipientRewriteTable.domain) desc limit 1
+
+ select RecipientRewriteTable.target_address from RecipientRewriteTable where RecipientRewriteTable."user" = ? and RecipientRewriteTable.domain = ?
+ select RecipientRewriteTable.target_address from RecipientRewriteTable where RecipientRewriteTable.user = ? and RecipientRewriteTable.domain = ?
+
+ delete from RecipientRewriteTable where RecipientRewriteTable."user" = ? and RecipientRewriteTable.domain = ? and RecipientRewriteTable.target_address = ?
+
+ update RecipientRewriteTable set RecipientRewriteTable.target_address = ? where RecipientRewriteTable."user" = ? and RecipientRewriteTable.domain = ?
+
+ insert into RecipientRewriteTable values(?,?,?)
+
+ select * from RecipientRewriteTable
+
+
+
+ CREATE TABLE RecipientRewriteTable (
+ user varchar(64) NOT NULL default '',
+ domain varchar(255) NOT NULL default '',
+ target_address varchar(255) NOT NULL default '',
+ PRIMARY KEY (user,domain)
+ )
+
+
+
+
+ CREATE TABLE RecipientRewriteTable (
+ "user" varchar(64) NOT NULL default '',
+ domain varchar(255) NOT NULL default '',
+ target_address varchar(255) NOT NULL default '',
+ PRIMARY KEY ("user",domain)
+ )
+
+
+ CREATE TABLE RecipientRewriteTable (
+ "user" varchar (64) NOT NULL default '',
+ domain varchar (255) NOT NULL default '',
+ target_address varchar (255) NOT NULL default '',
+ PRIMARY KEY ("user",domain)
+ )
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/usersrepository-template.conf b/deploy/james/apache-james-conf/usersrepository-template.conf
new file mode 100644
index 0000000..3f68ed3
--- /dev/null
+++ b/deploy/james/apache-james-conf/usersrepository-template.conf
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MD5
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deploy/james/apache-james-conf/usersrepository23-template.conf b/deploy/james/apache-james-conf/usersrepository23-template.conf
new file mode 100644
index 0000000..5709494
--- /dev/null
+++ b/deploy/james/apache-james-conf/usersrepository23-template.conf
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+ true
+ false
+
+
diff --git a/deploy/james/apache-james-conf/wrapper.conf b/deploy/james/apache-james-conf/wrapper.conf
new file mode 100644
index 0000000..20a29d9
--- /dev/null
+++ b/deploy/james/apache-james-conf/wrapper.conf
@@ -0,0 +1,234 @@
+#********************************************************************
+# Wrapper Properties
+#********************************************************************
+# Java Application
+wrapper.java.command=java
+wrapper.working.dir=.
+
+# Java Main class. This class must implement the WrapperListener interface
+# or guarantee that the WrapperManager class is initialized. Helper
+# classes are provided to do this for you. See the Integration section
+# of the documentation for details.
+wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
+set.default.REPO_DIR=../lib
+set.default.APP_BASE=.
+
+# Java Classpath (include wrapper.jar) Add class path elements as
+# needed starting from 1
+wrapper.java.classpath.1=%REPO_DIR%/wrapper.jar
+wrapper.java.classpath.2=../conf
+wrapper.java.classpath.3=%REPO_DIR%/apache-james-3.0-beta4.jar
+wrapper.java.classpath.4=%REPO_DIR%/james-server-cli-3.0-beta4.jar
+wrapper.java.classpath.5=%REPO_DIR%/commons-cli-1.2.jar
+wrapper.java.classpath.6=%REPO_DIR%/james-server-core-3.0-beta4.jar
+wrapper.java.classpath.7=%REPO_DIR%/apache-mailet-2.4.jar
+wrapper.java.classpath.8=%REPO_DIR%/apache-mailet-base-1.1.jar
+wrapper.java.classpath.9=%REPO_DIR%/commons-io-2.0.1.jar
+wrapper.java.classpath.10=%REPO_DIR%/mail-1.4.4.jar
+wrapper.java.classpath.11=%REPO_DIR%/james-server-data-api-3.0-beta4.jar
+wrapper.java.classpath.12=%REPO_DIR%/james-server-dnsservice-library-3.0-beta4.jar
+wrapper.java.classpath.13=%REPO_DIR%/james-server-filesystem-api-3.0-beta4.jar
+wrapper.java.classpath.14=%REPO_DIR%/apache-jsieve-manager-api-0.5.jar
+wrapper.java.classpath.15=%REPO_DIR%/james-server-lifecycle-api-3.0-beta4.jar
+wrapper.java.classpath.16=%REPO_DIR%/commons-configuration-1.6.jar
+wrapper.java.classpath.17=%REPO_DIR%/commons-lang-2.6.jar
+wrapper.java.classpath.18=%REPO_DIR%/james-server-mailetcontainer-api-3.0-beta4.jar
+wrapper.java.classpath.19=%REPO_DIR%/james-server-queue-api-3.0-beta4.jar
+wrapper.java.classpath.20=%REPO_DIR%/james-server-container-spring-3.0-beta4.jar
+wrapper.java.classpath.21=%REPO_DIR%/apache-james-mailbox-api-0.4.jar
+wrapper.java.classpath.22=%REPO_DIR%/apache-james-mailbox-tool-0.4.jar
+wrapper.java.classpath.23=%REPO_DIR%/geronimo-annotation_1.0_spec-1.1.1.jar
+wrapper.java.classpath.24=%REPO_DIR%/protocols-api-1.6.2.jar
+wrapper.java.classpath.25=%REPO_DIR%/spring-core-3.1.0.RELEASE.jar
+wrapper.java.classpath.26=%REPO_DIR%/spring-asm-3.1.0.RELEASE.jar
+wrapper.java.classpath.27=%REPO_DIR%/spring-beans-3.1.0.RELEASE.jar
+wrapper.java.classpath.28=%REPO_DIR%/spring-context-3.1.0.RELEASE.jar
+wrapper.java.classpath.29=%REPO_DIR%/spring-expression-3.1.0.RELEASE.jar
+wrapper.java.classpath.30=%REPO_DIR%/spring-web-3.1.0.RELEASE.jar
+wrapper.java.classpath.31=%REPO_DIR%/log4j-1.2.16.jar
+wrapper.java.classpath.32=%REPO_DIR%/james-server-lifecycle-spring-3.0-beta4.jar
+wrapper.java.classpath.33=%REPO_DIR%/geronimo-annotation_1.1_spec-1.0.1.jar
+wrapper.java.classpath.34=%REPO_DIR%/geronimo-jpa_2.0_spec-1.0.jar
+wrapper.java.classpath.35=%REPO_DIR%/slf4j-api-1.6.1.jar
+wrapper.java.classpath.36=%REPO_DIR%/slf4j-log4j12-1.6.1.jar
+wrapper.java.classpath.37=%REPO_DIR%/jcl-over-slf4j-1.6.1.jar
+wrapper.java.classpath.38=%REPO_DIR%/commons-daemon-1.0.5.jar
+wrapper.java.classpath.39=%REPO_DIR%/camel-core-2.5.0.jar
+wrapper.java.classpath.40=%REPO_DIR%/commons-logging-api-1.1.jar
+wrapper.java.classpath.41=%REPO_DIR%/commons-management-1.0.jar
+wrapper.java.classpath.42=%REPO_DIR%/camel-spring-2.5.0.jar
+wrapper.java.classpath.43=%REPO_DIR%/spring-aop-3.1.0.RELEASE.jar
+wrapper.java.classpath.44=%REPO_DIR%/xbean-spring-3.6.jar
+wrapper.java.classpath.45=%REPO_DIR%/commons-logging-1.0.3.jar
+wrapper.java.classpath.46=%REPO_DIR%/spring-jms-3.1.0.RELEASE.jar
+wrapper.java.classpath.47=%REPO_DIR%/aopalliance-1.0.jar
+wrapper.java.classpath.48=%REPO_DIR%/spring-orm-3.1.0.RELEASE.jar
+wrapper.java.classpath.49=%REPO_DIR%/spring-tx-3.1.0.RELEASE.jar
+wrapper.java.classpath.50=%REPO_DIR%/spring-jdbc-3.1.0.RELEASE.jar
+wrapper.java.classpath.51=%REPO_DIR%/james-server-mailetcontainer-camel-3.0-beta4.jar
+wrapper.java.classpath.52=%REPO_DIR%/james-server-mailbox-adapter-3.0-beta4.jar
+wrapper.java.classpath.53=%REPO_DIR%/apache-james-mailbox-store-0.4.jar
+wrapper.java.classpath.54=%REPO_DIR%/apache-james-mailbox-maildir-0.4.jar
+wrapper.java.classpath.55=%REPO_DIR%/james-server-dnsservice-api-3.0-beta4.jar
+wrapper.java.classpath.56=%REPO_DIR%/james-server-dnsservice-dnsjava-3.0-beta4.jar
+wrapper.java.classpath.57=%REPO_DIR%/dnsjava-2.1.1.jar
+wrapper.java.classpath.58=%REPO_DIR%/james-server-protocols-library-3.0-beta4.jar
+wrapper.java.classpath.59=%REPO_DIR%/protocols-netty-1.6.2.jar
+wrapper.java.classpath.60=%REPO_DIR%/netty-3.3.1.Final.jar
+wrapper.java.classpath.61=%REPO_DIR%/james-server-util-3.0-beta4.jar
+wrapper.java.classpath.62=%REPO_DIR%/james-server-data-library-3.0-beta4.jar
+wrapper.java.classpath.63=%REPO_DIR%/james-server-data-ldap-3.0-beta4.jar
+wrapper.java.classpath.64=%REPO_DIR%/james-server-protocols-smtp-3.0-beta4.jar
+wrapper.java.classpath.65=%REPO_DIR%/protocols-smtp-1.6.2.jar
+wrapper.java.classpath.66=%REPO_DIR%/apache-jspf-resolver-1.0.0.jar
+wrapper.java.classpath.67=%REPO_DIR%/james-server-protocols-imap4-3.0-beta4.jar
+wrapper.java.classpath.68=%REPO_DIR%/apache-james-imap-api-0.3.jar
+wrapper.java.classpath.69=%REPO_DIR%/jutf7-1.0.0.jar
+wrapper.java.classpath.70=%REPO_DIR%/apache-james-imap-message-0.3.jar
+wrapper.java.classpath.71=%REPO_DIR%/james-server-protocols-lmtp-3.0-beta4.jar
+wrapper.java.classpath.72=%REPO_DIR%/protocols-lmtp-1.6.2.jar
+wrapper.java.classpath.73=%REPO_DIR%/james-server-protocols-pop3-3.0-beta4.jar
+wrapper.java.classpath.74=%REPO_DIR%/protocols-pop3-1.6.2.jar
+wrapper.java.classpath.75=%REPO_DIR%/james-server-fetchmail-3.0-beta4.jar
+wrapper.java.classpath.76=%REPO_DIR%/james-server-queue-file-3.0-beta4.jar
+wrapper.java.classpath.77=%REPO_DIR%/james-server-queue-jms-3.0-beta4.jar
+wrapper.java.classpath.78=%REPO_DIR%/geronimo-jms_1.1_spec-1.0.jar
+wrapper.java.classpath.79=%REPO_DIR%/james-server-queue-activemq-3.0-beta4.jar
+wrapper.java.classpath.80=%REPO_DIR%/activemq-core-5.4.2.jar
+wrapper.java.classpath.81=%REPO_DIR%/activeio-core-3.1.2.jar
+wrapper.java.classpath.82=%REPO_DIR%/kahadb-5.4.2.jar
+wrapper.java.classpath.83=%REPO_DIR%/activemq-protobuf-1.1.jar
+wrapper.java.classpath.84=%REPO_DIR%/geronimo-j2ee-management_1.1_spec-1.0.1.jar
+wrapper.java.classpath.85=%REPO_DIR%/james-server-mailets-3.0-beta4.jar
+wrapper.java.classpath.86=%REPO_DIR%/apache-jsieve-mailet-0.5.jar
+wrapper.java.classpath.87=%REPO_DIR%/apache-jsieve-core-0.5.jar
+wrapper.java.classpath.88=%REPO_DIR%/geronimo-javamail_1.4_mail-1.6.jar
+wrapper.java.classpath.89=%REPO_DIR%/geronimo-activation_1.1_spec-1.0.2.jar
+wrapper.java.classpath.90=%REPO_DIR%/apache-standard-mailets-1.1.jar
+wrapper.java.classpath.91=%REPO_DIR%/commons-httpclient-3.0.1.jar
+wrapper.java.classpath.92=%REPO_DIR%/commons-collections-3.2.1.jar
+wrapper.java.classpath.93=%REPO_DIR%/derby-10.7.1.1.jar
+wrapper.java.classpath.94=%REPO_DIR%/apache-james-mailbox-jpa-0.4.jar
+wrapper.java.classpath.95=%REPO_DIR%/openjpa-2.1.0.jar
+wrapper.java.classpath.96=%REPO_DIR%/serp-1.13.1.jar
+wrapper.java.classpath.97=%REPO_DIR%/geronimo-jta_1.1_spec-1.1.1.jar
+wrapper.java.classpath.98=%REPO_DIR%/commons-pool-1.5.5.jar
+wrapper.java.classpath.99=%REPO_DIR%/jasypt-1.7.1.jar
+wrapper.java.classpath.100=%REPO_DIR%/apache-james-mailbox-spring-0.4.jar
+wrapper.java.classpath.101=%REPO_DIR%/apache-james-mailbox-hbase-0.4.jar
+wrapper.java.classpath.102=%REPO_DIR%/commons-dbcp-1.4.jar
+wrapper.java.classpath.103=%REPO_DIR%/jcr-2.0.jar
+wrapper.java.classpath.104=%REPO_DIR%/apache-james-mailbox-lucene-0.4.jar
+wrapper.java.classpath.105=%REPO_DIR%/apache-mime4j-core-0.7.2.jar
+wrapper.java.classpath.106=%REPO_DIR%/apache-mime4j-dom-0.7.2.jar
+wrapper.java.classpath.107=%REPO_DIR%/lucene-core-3.1.0.jar
+wrapper.java.classpath.108=%REPO_DIR%/lucene-analyzers-3.1.0.jar
+wrapper.java.classpath.109=%REPO_DIR%/lucene-smartcn-3.1.0.jar
+wrapper.java.classpath.110=%REPO_DIR%/apache-james-mailbox-jcr-0.4.jar
+wrapper.java.classpath.111=%REPO_DIR%/jackrabbit-jcr-commons-2.2.5.jar
+wrapper.java.classpath.112=%REPO_DIR%/apache-james-mailbox-memory-0.4.jar
+wrapper.java.classpath.113=%REPO_DIR%/james-server-data-file-3.0-beta4.jar
+wrapper.java.classpath.114=%REPO_DIR%/james-server-data-jpa-3.0-beta4.jar
+wrapper.java.classpath.115=%REPO_DIR%/commons-codec-1.5.jar
+wrapper.java.classpath.116=%REPO_DIR%/james-server-data-jdbc-3.0-beta4.jar
+wrapper.java.classpath.117=%REPO_DIR%/james-server-data-hbase-3.0-beta4.jar
+wrapper.java.classpath.118=%REPO_DIR%/james-server-data-jcr-3.0-beta4.jar
+wrapper.java.classpath.119=%REPO_DIR%/apache-james-imap-processor-0.3.jar
+
+# Java Library Path (location of Wrapper.DLL or libwrapper.so)
+wrapper.java.library.path.1=lib
+
+# Java Additional Parameters
+#wrapper.java.additional.1=
+wrapper.java.additional.14=-Djames.message.usememorycopy=false
+wrapper.java.additional.13=-Dmail.mime.address.strict=false
+wrapper.java.additional.12=-Dmail.mime.decodeparameters=true
+wrapper.java.additional.11=-Dmail.mime.encodeparameters=true
+wrapper.java.additional.10=-Dmail.mime.base64.ignoreerrors=true
+wrapper.java.additional.9=-Dmail.mime.multipart.allowempty=true
+wrapper.java.additional.8=-Dmail.mime.uudecode.ignoremissingbeginend=true
+wrapper.java.additional.7=-Dmail.mime.uudecode.ignoreerrors=true
+wrapper.java.additional.6=-Dmail.mime.ignoreunknownencoding=true
+wrapper.java.additional.5=-Dmail.mime.multipart.ignoremissingboundaryparameter=true
+wrapper.java.additional.4=-Dmail.mime.multipart.ignoremissingendboundary=true
+wrapper.java.additional.3=-Dcom.sun.management.jmxremote.authenticate=false
+wrapper.java.additional.2=-Dcom.sun.management.jmxremote=true
+wrapper.java.additional.1=-XX:+HeapDumpOnOutOfMemoryError
+
+# Initial Java Heap Size (in MB)
+#wrapper.java.initmemory=3
+wrapper.java.initmemory=128
+
+# Maximum Java Heap Size (in MB)
+#wrapper.java.maxmemory=64
+wrapper.java.maxmemory=512
+
+# Application parameters. Add parameters as needed starting from 1
+wrapper.app.parameter.1=org.apache.james.app.spring.JamesAppSpringMain
+wrapper.app.parameter.2=start
+
+#********************************************************************
+# Wrapper Logging Properties
+#********************************************************************
+# Format of output for the console. (See docs for formats)
+wrapper.console.format=PM
+
+# Log Level for console output. (See docs for log levels)
+wrapper.console.loglevel=INFO
+
+# Log file to use for wrapper output logging.
+wrapper.logfile=log/wrapper.log
+
+# Format of output for the log file. (See docs for formats)
+wrapper.logfile.format=LPTM
+
+# Log Level for log file output. (See docs for log levels)
+wrapper.logfile.loglevel=INFO
+
+# Maximum size that the log file will be allowed to grow to before
+# the log is rolled. Size is specified in bytes. The default value
+# of 0, disables log rolling. May abbreviate with the 'k' (kb) or
+# 'm' (mb) suffix. For example: 10m = 10 megabytes.
+wrapper.logfile.maxsize=0
+
+# Maximum number of rolled log files which will be allowed before old
+# files are deleted. The default value of 0 implies no limit.
+wrapper.logfile.maxfiles=0
+
+# Log Level for sys/event log output. (See docs for log levels)
+wrapper.syslog.loglevel=NONE
+
+#********************************************************************
+# Wrapper Windows Properties
+#********************************************************************
+# Title to use when running as a console
+wrapper.console.title=Apache James Server App
+
+#********************************************************************
+# Wrapper Windows NT/2000/XP Service Properties
+#********************************************************************
+# WARNING - Do not modify any of these properties when an application
+# using this configuration file has been installed as a service.
+# Please uninstall the service before modifying this section. The
+# service can then be reinstalled.
+
+# Name of the service
+wrapper.ntservice.name=james
+
+# Display name of the service
+wrapper.ntservice.displayname=Apache James Server App
+
+# Description of the service
+wrapper.ntservice.description=An advanced email server
+
+# Service dependencies. Add dependencies as needed starting from 1
+wrapper.ntservice.dependency.1=
+
+# Mode in which the service is installed. AUTO_START or DEMAND_START
+wrapper.ntservice.starttype=AUTO_START
+
+# Allow the service to interact with the desktop.
+wrapper.ntservice.interactive=false
+
+configuration.directory.in.classpath.first=../conf
+wrapper.java.library.path=../lib
diff --git a/deploy/james/apache-james-mailbox-memory.jar b/deploy/james/apache-james-mailbox-memory.jar
new file mode 120000
index 0000000..2777218
--- /dev/null
+++ b/deploy/james/apache-james-mailbox-memory.jar
@@ -0,0 +1 @@
+../../james/apache-james-mailbox-memory/target/apache-james-mailbox-memory-0.4.jar
\ No newline at end of file
diff --git a/deploy/james/apache-james-server-mailets.jar b/deploy/james/apache-james-server-mailets.jar
new file mode 100644
index 0000000..c555b57
Binary files /dev/null and b/deploy/james/apache-james-server-mailets.jar differ
diff --git a/deploy/james/catalog b/deploy/james/catalog
new file mode 100755
index 0000000..58e0f33
--- /dev/null
+++ b/deploy/james/catalog
@@ -0,0 +1,5 @@
+cd ~
+mkdir -p deploy-catalog
+V=`date "+%Y%m%d_%H%M%S"`
+
+tar -czf deploy-catalog/deploy_$V.tar.gz deploy
diff --git a/deploy/james/resources/mail.server.push/ios-push-certificate-dev.p12 b/deploy/james/resources/mail.server.push/ios-push-certificate-dev.p12
new file mode 120000
index 0000000..8579c77
--- /dev/null
+++ b/deploy/james/resources/mail.server.push/ios-push-certificate-dev.p12
@@ -0,0 +1 @@
+../../../../keys/apns/ios-push-certificate-dev.p12
\ No newline at end of file
diff --git a/deploy/james/resources/mail.server.push/ios-push-certificate-prod.p12 b/deploy/james/resources/mail.server.push/ios-push-certificate-prod.p12
new file mode 120000
index 0000000..34f009f
--- /dev/null
+++ b/deploy/james/resources/mail.server.push/ios-push-certificate-prod.p12
@@ -0,0 +1 @@
+../../../../keys/apns/ios-push-certificate-prod.p12
\ No newline at end of file
diff --git a/deploy/james/resources/passwords/mail b/deploy/james/resources/passwords/mail
new file mode 120000
index 0000000..5dd88cb
--- /dev/null
+++ b/deploy/james/resources/passwords/mail
@@ -0,0 +1 @@
+../../../../passwords/mail
\ No newline at end of file
diff --git a/deploy/james/resources/passwords/mail-pbe b/deploy/james/resources/passwords/mail-pbe
new file mode 120000
index 0000000..b1e108a
--- /dev/null
+++ b/deploy/james/resources/passwords/mail-pbe
@@ -0,0 +1 @@
+../../../../passwords/mail-pbe
\ No newline at end of file
diff --git a/deploy/james/resources/passwords/mail_extra b/deploy/james/resources/passwords/mail_extra
new file mode 120000
index 0000000..1a710aa
--- /dev/null
+++ b/deploy/james/resources/passwords/mail_extra
@@ -0,0 +1 @@
+../../../../passwords/mail_extra
\ No newline at end of file
diff --git a/deploy/james/resources/passwords/push-certificate b/deploy/james/resources/passwords/push-certificate
new file mode 120000
index 0000000..f47d229
--- /dev/null
+++ b/deploy/james/resources/passwords/push-certificate
@@ -0,0 +1 @@
+../../../../passwords/push-certificate
\ No newline at end of file
diff --git a/deploy/james/run b/deploy/james/run
new file mode 100755
index 0000000..2260b54
--- /dev/null
+++ b/deploy/james/run
@@ -0,0 +1,9 @@
+./setup
+
+cd ~/apache-james/bin/
+
+echo -------------------------------------------------- >> ~/run.log
+date >> ~/run.log
+echo -------------------------------------------------- >> ~/run.log
+
+nohup ./run.sh >> ~/run.log 2>&1 &
diff --git a/deploy/james/run-block b/deploy/james/run-block
new file mode 100755
index 0000000..70a654f
--- /dev/null
+++ b/deploy/james/run-block
@@ -0,0 +1 @@
+cd apache-james/bin/ && ./run.sh
diff --git a/deploy/james/setup b/deploy/james/setup
new file mode 100755
index 0000000..b8aba4e
--- /dev/null
+++ b/deploy/james/setup
@@ -0,0 +1,6 @@
+cd ~
+ln -fs deploy/resources
+ln -fs deploy/apache-james-conf
+ln -fs deploy/apache-james-mailbox-memory.jar
+ln -fs deploy/apache-james-server-mailets.jar
+
diff --git a/deploy/james/shutdown b/deploy/james/shutdown
new file mode 100755
index 0000000..6b7f05f
--- /dev/null
+++ b/deploy/james/shutdown
@@ -0,0 +1,2 @@
+killall -w -user james java
+
diff --git a/deploy/mail-key. b/deploy/mail-key.
new file mode 100644
index 0000000..e69de29
diff --git a/deploy/mail-key/catalog b/deploy/mail-key/catalog
new file mode 100755
index 0000000..58e0f33
--- /dev/null
+++ b/deploy/mail-key/catalog
@@ -0,0 +1,5 @@
+cd ~
+mkdir -p deploy-catalog
+V=`date "+%Y%m%d_%H%M%S"`
+
+tar -czf deploy-catalog/deploy_$V.tar.gz deploy
diff --git a/deploy/mail-key/resources/key.streamserver/keystore.jks b/deploy/mail-key/resources/key.streamserver/keystore.jks
new file mode 120000
index 0000000..7a5124f
--- /dev/null
+++ b/deploy/mail-key/resources/key.streamserver/keystore.jks
@@ -0,0 +1 @@
+../../../../keys/key/keystore.jks
\ No newline at end of file
diff --git a/deploy/mail-key/resources/passwords/mail b/deploy/mail-key/resources/passwords/mail
new file mode 120000
index 0000000..5dd88cb
--- /dev/null
+++ b/deploy/mail-key/resources/passwords/mail
@@ -0,0 +1 @@
+../../../../passwords/mail
\ No newline at end of file
diff --git a/deploy/mail-key/resources/passwords/mail_extra b/deploy/mail-key/resources/passwords/mail_extra
new file mode 120000
index 0000000..1a710aa
--- /dev/null
+++ b/deploy/mail-key/resources/passwords/mail_extra
@@ -0,0 +1 @@
+../../../../passwords/mail_extra
\ No newline at end of file
diff --git a/deploy/mail-key/run b/deploy/mail-key/run
new file mode 100755
index 0000000..834485f
--- /dev/null
+++ b/deploy/mail-key/run
@@ -0,0 +1,7 @@
+./setup
+
+echo "----------------------------------------------" >> ../run.log
+date >> ../run.log
+echo "----------------------------------------------" >> ../run.log
+
+nohup java -jar KeyStreamServer.jar >> ../run.log 2>&1 &
diff --git a/deploy/mail-key/setup b/deploy/mail-key/setup
new file mode 100755
index 0000000..e66315d
--- /dev/null
+++ b/deploy/mail-key/setup
@@ -0,0 +1,3 @@
+cd ~
+ln -fs deploy/resources
+
diff --git a/deploy/mail-key/shutdown b/deploy/mail-key/shutdown
new file mode 100755
index 0000000..4bdb020
--- /dev/null
+++ b/deploy/mail-key/shutdown
@@ -0,0 +1 @@
+killall -user mail-key java
diff --git a/deploy/mail-user. b/deploy/mail-user.
new file mode 100644
index 0000000..e69de29
diff --git a/deploy/mail-user/catalog b/deploy/mail-user/catalog
new file mode 100755
index 0000000..58e0f33
--- /dev/null
+++ b/deploy/mail-user/catalog
@@ -0,0 +1,5 @@
+cd ~
+mkdir -p deploy-catalog
+V=`date "+%Y%m%d_%H%M%S"`
+
+tar -czf deploy-catalog/deploy_$V.tar.gz deploy
diff --git a/deploy/mail-user/resources/mail.streamserver/keystore.jks b/deploy/mail-user/resources/mail.streamserver/keystore.jks
new file mode 120000
index 0000000..a400e5e
--- /dev/null
+++ b/deploy/mail-user/resources/mail.streamserver/keystore.jks
@@ -0,0 +1 @@
+../../../../keys/mail/keystore.jks
\ No newline at end of file
diff --git a/deploy/mail-user/resources/passwords/captcha b/deploy/mail-user/resources/passwords/captcha
new file mode 120000
index 0000000..ed95472
--- /dev/null
+++ b/deploy/mail-user/resources/passwords/captcha
@@ -0,0 +1 @@
+../../../../passwords/captcha
\ No newline at end of file
diff --git a/deploy/mail-user/resources/passwords/mail b/deploy/mail-user/resources/passwords/mail
new file mode 120000
index 0000000..5dd88cb
--- /dev/null
+++ b/deploy/mail-user/resources/passwords/mail
@@ -0,0 +1 @@
+../../../../passwords/mail
\ No newline at end of file
diff --git a/deploy/mail-user/resources/passwords/mail-pbe b/deploy/mail-user/resources/passwords/mail-pbe
new file mode 120000
index 0000000..b1e108a
--- /dev/null
+++ b/deploy/mail-user/resources/passwords/mail-pbe
@@ -0,0 +1 @@
+../../../../passwords/mail-pbe
\ No newline at end of file
diff --git a/deploy/mail-user/resources/passwords/mail_extra b/deploy/mail-user/resources/passwords/mail_extra
new file mode 120000
index 0000000..1a710aa
--- /dev/null
+++ b/deploy/mail-user/resources/passwords/mail_extra
@@ -0,0 +1 @@
+../../../../passwords/mail_extra
\ No newline at end of file
diff --git a/deploy/mail-user/run b/deploy/mail-user/run
new file mode 100755
index 0000000..453f277
--- /dev/null
+++ b/deploy/mail-user/run
@@ -0,0 +1,7 @@
+./setup
+
+echo ---------------------------------------- >> ../run.log
+date >> ../run.log
+echo ---------------------------------------- >> ../run.log
+
+nohup java -jar MailStreamServer.jar >> ~/run.log 2>&1 &
diff --git a/deploy/mail-user/setup b/deploy/mail-user/setup
new file mode 100755
index 0000000..e66315d
--- /dev/null
+++ b/deploy/mail-user/setup
@@ -0,0 +1,3 @@
+cd ~
+ln -fs deploy/resources
+
diff --git a/deploy/mail-user/shutdown b/deploy/mail-user/shutdown
new file mode 100755
index 0000000..7b192d2
--- /dev/null
+++ b/deploy/mail-user/shutdown
@@ -0,0 +1 @@
+killall -user mail-user java
diff --git a/deploy/restart-all b/deploy/restart-all
new file mode 100755
index 0000000..77f5f8a
--- /dev/null
+++ b/deploy/restart-all
@@ -0,0 +1,5 @@
+./server-restart tomcat
+./server-restart james
+./server-restart mail-user
+./server-restart mail-key
+
diff --git a/deploy/server-deploy b/deploy/server-deploy
new file mode 100755
index 0000000..ca440a7
--- /dev/null
+++ b/deploy/server-deploy
@@ -0,0 +1,24 @@
+if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
+
+server="blue"
+
+echo stopping...
+ssh $1@$server "cd deploy && ./shutdown"
+
+echo transfering
+rsync -avzL --delete $1/ $1@$server:deploy
+
+echo cataloging
+ssh $1@$server "cd deploy && ./catalog"
+
+echo starting...
+ssh $1@$server "cd deploy && ./run"
+
+echo tailing...
+sleep 2
+ssh $1@$server "tail run.log"
+
+echo ...
+echo "***** remember to restart mail-user if you restart-james *****"
+
+
diff --git a/deploy/server-restart b/deploy/server-restart
new file mode 100755
index 0000000..1f23982
--- /dev/null
+++ b/deploy/server-restart
@@ -0,0 +1,20 @@
+if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
+
+server="blue"
+
+echo stopping...
+ssh $1@$server "cd deploy && ./shutdown"
+
+sleep 2
+
+echo starting...
+ssh $1@$server "cd deploy && ./run"
+
+echo tailing...
+sleep 2
+ssh $1@$server "tail run.log"
+
+echo ...
+echo "***** remember to restart mail-user if you restart-james *****"
+
+
diff --git a/deploy/server-shutdown b/deploy/server-shutdown
new file mode 100755
index 0000000..d1a35c3
--- /dev/null
+++ b/deploy/server-shutdown
@@ -0,0 +1,8 @@
+if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
+
+server="blue"
+
+echo stopping...
+ssh $1@$server "cd deploy && ./shutdown"
+
+
diff --git a/deploy/startWebServer b/deploy/startWebServer
new file mode 100755
index 0000000..e7373cc
--- /dev/null
+++ b/deploy/startWebServer
@@ -0,0 +1 @@
+cd www && python -m SimpleHTTPServer 80
diff --git a/deploy/tomcat-restart b/deploy/tomcat-restart
new file mode 100755
index 0000000..b27ae35
--- /dev/null
+++ b/deploy/tomcat-restart
@@ -0,0 +1,5 @@
+
+server="blue"
+
+echo restarting...
+ssh tomcat@$server "cd deploy && ./restart"
diff --git a/deploy/tomcat. b/deploy/tomcat.
new file mode 100644
index 0000000..e69de29
diff --git a/deploy/tomcat/catalog b/deploy/tomcat/catalog
new file mode 100755
index 0000000..58e0f33
--- /dev/null
+++ b/deploy/tomcat/catalog
@@ -0,0 +1,5 @@
+cd ~
+mkdir -p deploy-catalog
+V=`date "+%Y%m%d_%H%M%S"`
+
+tar -czf deploy-catalog/deploy_$V.tar.gz deploy
diff --git a/deploy/tomcat/resources/mail.server.push/keystore.jks b/deploy/tomcat/resources/mail.server.push/keystore.jks
new file mode 120000
index 0000000..41a30e1
--- /dev/null
+++ b/deploy/tomcat/resources/mail.server.push/keystore.jks
@@ -0,0 +1 @@
+../../../../keys/push/keystore.jks
\ No newline at end of file
diff --git a/deploy/tomcat/resources/mail.server.relay/keystore.jks b/deploy/tomcat/resources/mail.server.relay/keystore.jks
new file mode 120000
index 0000000..44f10b5
--- /dev/null
+++ b/deploy/tomcat/resources/mail.server.relay/keystore.jks
@@ -0,0 +1 @@
+../../../../keys/localrelay/keystore.jks
\ No newline at end of file
diff --git a/deploy/tomcat/resources/mail.server.relay/truststore.jks b/deploy/tomcat/resources/mail.server.relay/truststore.jks
new file mode 120000
index 0000000..381c98b
--- /dev/null
+++ b/deploy/tomcat/resources/mail.server.relay/truststore.jks
@@ -0,0 +1 @@
+../../../../keys/localrelay/truststore.jks
\ No newline at end of file
diff --git a/deploy/tomcat/resources/passwords/BucketCreate-AWS-AccessKey b/deploy/tomcat/resources/passwords/BucketCreate-AWS-AccessKey
new file mode 120000
index 0000000..e90eaf6
--- /dev/null
+++ b/deploy/tomcat/resources/passwords/BucketCreate-AWS-AccessKey
@@ -0,0 +1 @@
+../../../../passwords/BucketCreate-AWS-AccessKey
\ No newline at end of file
diff --git a/deploy/tomcat/resources/passwords/BucketCreate-AWS-SecretKey b/deploy/tomcat/resources/passwords/BucketCreate-AWS-SecretKey
new file mode 120000
index 0000000..7276a3b
--- /dev/null
+++ b/deploy/tomcat/resources/passwords/BucketCreate-AWS-SecretKey
@@ -0,0 +1 @@
+../../../../passwords/BucketCreate-AWS-SecretKey
\ No newline at end of file
diff --git a/deploy/tomcat/resources/passwords/captcha b/deploy/tomcat/resources/passwords/captcha
new file mode 120000
index 0000000..ed95472
--- /dev/null
+++ b/deploy/tomcat/resources/passwords/captcha
@@ -0,0 +1 @@
+../../../../passwords/captcha
\ No newline at end of file
diff --git a/deploy/tomcat/resources/passwords/mail_extra b/deploy/tomcat/resources/passwords/mail_extra
new file mode 120000
index 0000000..1a710aa
--- /dev/null
+++ b/deploy/tomcat/resources/passwords/mail_extra
@@ -0,0 +1 @@
+../../../../passwords/mail_extra
\ No newline at end of file
diff --git a/deploy/tomcat/resources/web-server-url b/deploy/tomcat/resources/web-server-url
new file mode 100644
index 0000000..3c3f56b
--- /dev/null
+++ b/deploy/tomcat/resources/web-server-url
@@ -0,0 +1 @@
+mailiverse.com
diff --git a/deploy/tomcat/restart b/deploy/tomcat/restart
new file mode 100755
index 0000000..72028c8
--- /dev/null
+++ b/deploy/tomcat/restart
@@ -0,0 +1,5 @@
+cd ~/tomcat/bin
+
+./shutdown.sh
+sleep 5
+./startup.sh
diff --git a/deploy/tomcat/run b/deploy/tomcat/run
new file mode 100755
index 0000000..44ba3c3
--- /dev/null
+++ b/deploy/tomcat/run
@@ -0,0 +1 @@
+./setup
diff --git a/deploy/tomcat/setup b/deploy/tomcat/setup
new file mode 100755
index 0000000..e66315d
--- /dev/null
+++ b/deploy/tomcat/setup
@@ -0,0 +1,3 @@
+cd ~
+ln -fs deploy/resources
+
diff --git a/deploy/tomcat/shutdown b/deploy/tomcat/shutdown
new file mode 100755
index 0000000..e69de29
diff --git a/deploy/tools. b/deploy/tools.
new file mode 100644
index 0000000..e69de29
diff --git a/deploy/tools/catalog b/deploy/tools/catalog
new file mode 100755
index 0000000..58e0f33
--- /dev/null
+++ b/deploy/tools/catalog
@@ -0,0 +1,5 @@
+cd ~
+mkdir -p deploy-catalog
+V=`date "+%Y%m%d_%H%M%S"`
+
+tar -czf deploy-catalog/deploy_$V.tar.gz deploy
diff --git a/deploy/tools/db-backup b/deploy/tools/db-backup
new file mode 100755
index 0000000..761b089
--- /dev/null
+++ b/deploy/tools/db-backup
@@ -0,0 +1,7 @@
+V=`date "+%Y%m%d_%H%M%S"`
+mysqldump -u root -p --all-databases > all.database.$V.sql
+
+scp all.database.$V.sql mailiverse-backup@red:db-backup && rm all.database.$V.sql
+
+ssh mailiverse-backup@red ./db-backup-finished
+
diff --git a/deploy/tools/resources/key.streamserver b/deploy/tools/resources/key.streamserver
new file mode 120000
index 0000000..0155727
--- /dev/null
+++ b/deploy/tools/resources/key.streamserver
@@ -0,0 +1 @@
+../../mail-key/resources/key.streamserver
\ No newline at end of file
diff --git a/deploy/tools/resources/mail.auth/truststore.jks b/deploy/tools/resources/mail.auth/truststore.jks
new file mode 120000
index 0000000..0127257
--- /dev/null
+++ b/deploy/tools/resources/mail.auth/truststore.jks
@@ -0,0 +1 @@
+../../../../keys/mail/truststore.jks
\ No newline at end of file
diff --git a/deploy/tools/resources/mail.server.push b/deploy/tools/resources/mail.server.push
new file mode 120000
index 0000000..d3e2ebb
--- /dev/null
+++ b/deploy/tools/resources/mail.server.push
@@ -0,0 +1 @@
+../../james/resources/mail.server.push
\ No newline at end of file
diff --git a/deploy/tools/resources/mail.streamserver b/deploy/tools/resources/mail.streamserver
new file mode 120000
index 0000000..bf253d0
--- /dev/null
+++ b/deploy/tools/resources/mail.streamserver
@@ -0,0 +1 @@
+../../mail-user/resources/mail.streamserver
\ No newline at end of file
diff --git a/deploy/tools/resources/passwords/BucketCreate-AWS-AccessKey b/deploy/tools/resources/passwords/BucketCreate-AWS-AccessKey
new file mode 120000
index 0000000..e90eaf6
--- /dev/null
+++ b/deploy/tools/resources/passwords/BucketCreate-AWS-AccessKey
@@ -0,0 +1 @@
+../../../../passwords/BucketCreate-AWS-AccessKey
\ No newline at end of file
diff --git a/deploy/tools/resources/passwords/BucketCreate-AWS-SecretKey b/deploy/tools/resources/passwords/BucketCreate-AWS-SecretKey
new file mode 120000
index 0000000..7276a3b
--- /dev/null
+++ b/deploy/tools/resources/passwords/BucketCreate-AWS-SecretKey
@@ -0,0 +1 @@
+../../../../passwords/BucketCreate-AWS-SecretKey
\ No newline at end of file
diff --git a/deploy/tools/resources/passwords/captcha b/deploy/tools/resources/passwords/captcha
new file mode 120000
index 0000000..ed95472
--- /dev/null
+++ b/deploy/tools/resources/passwords/captcha
@@ -0,0 +1 @@
+../../../../passwords/captcha
\ No newline at end of file
diff --git a/deploy/tools/resources/passwords/james b/deploy/tools/resources/passwords/james
new file mode 120000
index 0000000..98726bd
--- /dev/null
+++ b/deploy/tools/resources/passwords/james
@@ -0,0 +1 @@
+../../../../passwords/james
\ No newline at end of file
diff --git a/deploy/tools/resources/passwords/mail b/deploy/tools/resources/passwords/mail
new file mode 120000
index 0000000..5dd88cb
--- /dev/null
+++ b/deploy/tools/resources/passwords/mail
@@ -0,0 +1 @@
+../../../../passwords/mail
\ No newline at end of file
diff --git a/deploy/tools/resources/passwords/mail-pbe b/deploy/tools/resources/passwords/mail-pbe
new file mode 120000
index 0000000..b1e108a
--- /dev/null
+++ b/deploy/tools/resources/passwords/mail-pbe
@@ -0,0 +1 @@
+../../../../passwords/mail-pbe
\ No newline at end of file
diff --git a/deploy/tools/resources/passwords/mail_extra b/deploy/tools/resources/passwords/mail_extra
new file mode 120000
index 0000000..1a710aa
--- /dev/null
+++ b/deploy/tools/resources/passwords/mail_extra
@@ -0,0 +1 @@
+../../../../passwords/mail_extra
\ No newline at end of file
diff --git a/deploy/tools/resources/passwords/push-certificate b/deploy/tools/resources/passwords/push-certificate
new file mode 120000
index 0000000..f47d229
--- /dev/null
+++ b/deploy/tools/resources/passwords/push-certificate
@@ -0,0 +1 @@
+../../../../passwords/push-certificate
\ No newline at end of file
diff --git a/deploy/tools/run b/deploy/tools/run
new file mode 100755
index 0000000..44ba3c3
--- /dev/null
+++ b/deploy/tools/run
@@ -0,0 +1 @@
+./setup
diff --git a/deploy/tools/setup b/deploy/tools/setup
new file mode 100755
index 0000000..e66315d
--- /dev/null
+++ b/deploy/tools/setup
@@ -0,0 +1,3 @@
+cd ~
+ln -fs deploy/resources
+
diff --git a/deploy/tools/shutdown b/deploy/tools/shutdown
new file mode 100755
index 0000000..e69de29
diff --git a/deploy/tunnel. b/deploy/tunnel.
new file mode 100644
index 0000000..e69de29
diff --git a/deploy/tunnel/nginx/install-nginx b/deploy/tunnel/nginx/install-nginx
new file mode 100755
index 0000000..76c701d
--- /dev/null
+++ b/deploy/tunnel/nginx/install-nginx
@@ -0,0 +1,18 @@
+apt-get install build-essential
+
+rm -rf nginx-build
+mkdir nginx-build
+cd nginx-build
+wget http://nginx.org/download/nginx-1.3.15.tar.gz
+wget http://downloads.sourceforge.net/project/pcre/pcre/8.32/pcre-8.32.tar.gz
+wget http://zlib.net/zlib-1.2.7.tar.gz
+wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz
+
+tar -xzf nginx-1.3.15.tar.gz
+tar -xzf pcre-8.32.tar.gz
+tar -xzf zlib-1.2.7.tar.gz
+tar -xzf openssl-1.0.1e.tar.gz
+
+cd nginx-1.3.15
+./configure --with-http_ssl_module --with-pcre=../pcre-8.32 --with-zlib=../zlib-1.2.7 --with-openssl=../openssl-1.0.1e
+make install
diff --git a/deploy/tunnel/nginx/install-nginx-conf b/deploy/tunnel/nginx/install-nginx-conf
new file mode 100755
index 0000000..d30884f
--- /dev/null
+++ b/deploy/tunnel/nginx/install-nginx-conf
@@ -0,0 +1,5 @@
+mkdir /usr/local/nginx
+mkdir /usr/local/nginx/conf
+cp nginx.conf /usr/local/nginx/conf
+cp nginx-ssl.* /usr/local/nginx/conf
+
diff --git a/deploy/tunnel/nginx/nginx-ssl.crt b/deploy/tunnel/nginx/nginx-ssl.crt
new file mode 120000
index 0000000..fef4f37
--- /dev/null
+++ b/deploy/tunnel/nginx/nginx-ssl.crt
@@ -0,0 +1 @@
+../../../keys/nginx/final.crt
\ No newline at end of file
diff --git a/deploy/tunnel/nginx/nginx-ssl.key b/deploy/tunnel/nginx/nginx-ssl.key
new file mode 120000
index 0000000..20ddbc7
--- /dev/null
+++ b/deploy/tunnel/nginx/nginx-ssl.key
@@ -0,0 +1 @@
+../../../keys/nginx/final.key
\ No newline at end of file
diff --git a/deploy/tunnel/nginx/nginx.conf b/deploy/tunnel/nginx/nginx.conf
new file mode 100644
index 0000000..5398e88
--- /dev/null
+++ b/deploy/tunnel/nginx/nginx.conf
@@ -0,0 +1,60 @@
+
+#user nobody;
+worker_processes 1;
+
+#error_log logs/error.log;
+#error_log logs/error.log notice;
+#error_log logs/error.log info;
+
+#pid logs/nginx.pid;
+
+
+events {
+ worker_connections 1024;
+}
+
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+
+ #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ # '$status $body_bytes_sent "$http_referer" '
+ # '"$http_user_agent" "$http_x_forwarded_for"';
+
+ #access_log logs/access.log main;
+
+ sendfile on;
+ #tcp_nopush on;
+
+ #keepalive_timeout 0;
+ keepalive_timeout 65;
+
+ gzip on;
+
+ # HTTPS server
+ #
+ server {
+ listen 443;
+ server_name mail.mailiverse.com;
+
+ ssl on;
+ ssl_certificate nginx-ssl.crt;
+ ssl_certificate_key nginx-ssl.key;
+
+ ssl_session_timeout 5m;
+
+ ssl_protocols SSLv2 SSLv3 TLSv1;
+ ssl_ciphers HIGH:!aNULL:!MD5;
+ ssl_prefer_server_ciphers on;
+
+ location / {
+ proxy_pass http://192.168.2.1:8080; # my existing apache instance
+ proxy_set_header Host $host;
+
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection upgrade;
+ }
+ }
+}
diff --git a/deploy/tunnel/nginx/nginx.conf-old b/deploy/tunnel/nginx/nginx.conf-old
new file mode 100644
index 0000000..54997d9
--- /dev/null
+++ b/deploy/tunnel/nginx/nginx.conf-old
@@ -0,0 +1,19 @@
+server {
+
+ listen 443; # default_server doesn't work
+ server_name mail.mailiverse.com;
+
+ ssl on;
+ ssl_certificate /etc/nginx/conf.d/nginx-ssl.crt;
+ ssl_certificate_key /etc/nginx/conf.d/nginx-ssl.key;
+ ssl_session_cache shared:SSL:10m;
+
+ location / {
+
+ proxy_pass http://192.168.2.1:8080; # my existing apache instance
+ proxy_set_header Host $host;
+
+ # re-write redirects to http as to https, example: /home
+ proxy_redirect http:// https://;
+ }
+}
diff --git a/deploy/tunnel/run b/deploy/tunnel/run
new file mode 100755
index 0000000..7b149be
--- /dev/null
+++ b/deploy/tunnel/run
@@ -0,0 +1,4 @@
+if [ "$HOSTNAME" == "blue" ] ; then
+ echo running proxy
+ nohup ./run-tunnel-sudo > ~/run.log 2>&1 &
+fi
diff --git a/deploy/tunnel/run-tunnel b/deploy/tunnel/run-tunnel
new file mode 100755
index 0000000..a2b7341
--- /dev/null
+++ b/deploy/tunnel/run-tunnel
@@ -0,0 +1,4 @@
+DIR="$( cd "$( dirname "$0" )" && pwd )"
+cd $DIR/vpn-ssh
+
+while [ "true" ]; echo starting; do ./run-server; echo died; sleep 30; done;
diff --git a/deploy/tunnel/run-tunnel-sudo b/deploy/tunnel/run-tunnel-sudo
new file mode 100755
index 0000000..2268239
--- /dev/null
+++ b/deploy/tunnel/run-tunnel-sudo
@@ -0,0 +1 @@
+sudo /bin/bash /home/tunnel/deploy/run-tunnel
diff --git a/deploy/tunnel/shutdown b/deploy/tunnel/shutdown
new file mode 100755
index 0000000..d46e9ad
--- /dev/null
+++ b/deploy/tunnel/shutdown
@@ -0,0 +1,2 @@
+sudo /bin/bash /home/tunnel/deploy/stop-tunnel
+
diff --git a/deploy/tunnel/stop-tunnel b/deploy/tunnel/stop-tunnel
new file mode 100755
index 0000000..8b626d0
--- /dev/null
+++ b/deploy/tunnel/stop-tunnel
@@ -0,0 +1,2 @@
+pkill -f "/bin/bash /home/tunnel/deploy/run-tunnel"
+killall autossh
diff --git a/deploy/tunnel/sudoers.d-tunnel b/deploy/tunnel/sudoers.d-tunnel
new file mode 100644
index 0000000..c2c21f3
--- /dev/null
+++ b/deploy/tunnel/sudoers.d-tunnel
@@ -0,0 +1 @@
+tunnel ALL = (root) NOPASSWD :/bin/bash /home/tunnel/deploy/run-tunnel,/bin/bash /home/tunnel/deploy/stop-tunnel
diff --git a/deploy/tunnel/vpn-ssh/HOST b/deploy/tunnel/vpn-ssh/HOST
new file mode 100644
index 0000000..30157b7
--- /dev/null
+++ b/deploy/tunnel/vpn-ssh/HOST
@@ -0,0 +1,5 @@
+HOSTNAME=mail.mailiverse.com
+HOST=`nslookup $HOSTNAME | grep Address | tail -n 1 | cut -d " " -f 2`
+
+export HOST
+
diff --git a/deploy/tunnel/vpn-ssh/client/run b/deploy/tunnel/vpn-ssh/client/run
new file mode 100755
index 0000000..2995d46
--- /dev/null
+++ b/deploy/tunnel/vpn-ssh/client/run
@@ -0,0 +1,18 @@
+#####
+# client vpn
+#
+# Timothy Prepscius v20130326
+#####
+
+# Allow the client to forward ips
+echo 1 > /proc/sys/net/ipv4/ip_forward
+
+# bring up the tap
+ifconfig tap0 up
+# put an ip on it so we can listen
+ifconfig tap0 192.168.2.1
+
+# route all traffic from 192.168.2.1 through 192.168.2.5
+ip rule add from 192.168.2.1 table 42
+ip route add default via 192.168.2.5 table 42
+
diff --git a/deploy/tunnel/vpn-ssh/client/run-to-log b/deploy/tunnel/vpn-ssh/client/run-to-log
new file mode 100755
index 0000000..74cdf1e
--- /dev/null
+++ b/deploy/tunnel/vpn-ssh/client/run-to-log
@@ -0,0 +1,2 @@
+DIR="$( cd "$( dirname "$0" )" && pwd )"
+$DIR/run > ~tunnel/client-run.log 2>&1
diff --git a/deploy/tunnel/vpn-ssh/dossh b/deploy/tunnel/vpn-ssh/dossh
new file mode 100755
index 0000000..dba9f89
--- /dev/null
+++ b/deploy/tunnel/vpn-ssh/dossh
@@ -0,0 +1,3 @@
+source ./HOST
+
+ssh -i green.pem root@$HOST $@
diff --git a/deploy/tunnel/vpn-ssh/green.pem b/deploy/tunnel/vpn-ssh/green.pem
new file mode 100644
index 0000000..6357d5d
--- /dev/null
+++ b/deploy/tunnel/vpn-ssh/green.pem
@@ -0,0 +1 @@
+PRIVATE-KEY from ec2
diff --git a/deploy/tunnel/vpn-ssh/install b/deploy/tunnel/vpn-ssh/install
new file mode 100755
index 0000000..13e8215
--- /dev/null
+++ b/deploy/tunnel/vpn-ssh/install
@@ -0,0 +1,5 @@
+source ./HOST
+
+scp -i green.pem ../nginx-ssl.* root@$HOST:
+scp -i green.pem server/* root@$HOST:
+ssh -i green.pem root@$HOST ./install
diff --git a/deploy/tunnel/vpn-ssh/reinstall b/deploy/tunnel/vpn-ssh/reinstall
new file mode 100755
index 0000000..5bb51d0
--- /dev/null
+++ b/deploy/tunnel/vpn-ssh/reinstall
@@ -0,0 +1,4 @@
+source ./HOST
+
+scp -i green.pem ../nginx/* root@$HOST:
+scp -i green.pem server/* root@$HOST:
diff --git a/deploy/tunnel/vpn-ssh/run-server b/deploy/tunnel/vpn-ssh/run-server
new file mode 100755
index 0000000..3045b72
--- /dev/null
+++ b/deploy/tunnel/vpn-ssh/run-server
@@ -0,0 +1,11 @@
+source ./HOST
+
+autossh \
+ -i green.pem root@$HOST \
+ -D 23232 \
+ -w 0:0 \
+ -o Tunnel=ethernet \
+ -o ServerAliveInterval=30 \
+ -o PermitLocalCommand=yes \
+ -o LocalCommand="./client/run-to-log" \
+ ./run-to-log
diff --git a/deploy/tunnel/vpn-ssh/server/install b/deploy/tunnel/vpn-ssh/server/install
new file mode 100755
index 0000000..9bca8ab
--- /dev/null
+++ b/deploy/tunnel/vpn-ssh/server/install
@@ -0,0 +1,7 @@
+apt-get update
+apt-get install telnet
+
+echo "PermitTunnel yes" >> /etc/ssh/sshd_config
+/etc/init.d/ssh restart
+
+./install-nginx
diff --git a/deploy/tunnel/vpn-ssh/server/run b/deploy/tunnel/vpn-ssh/server/run
new file mode 100755
index 0000000..76e9888
--- /dev/null
+++ b/deploy/tunnel/vpn-ssh/server/run
@@ -0,0 +1,42 @@
+#####
+# server dmz
+#
+# Timothy Prepscius v20130326
+
+# Allow the server to forward ips
+echo 1 > /proc/sys/net/ipv4/ip_forward
+
+# bring up the tap
+ifconfig tap0 up
+# put an ip on it so we can route traffic through it
+ifconfig tap0 192.168.2.5
+
+# route all traffic for 192.168.2.* through it
+# this is done implicitly when we add the ip to the tap0
+#ip route add 192.168.2.0/24 dev tap0
+
+#####
+# server iptables
+
+iptables -F
+iptables -t nat -F
+
+# forward traffic between DMZ and LAN
+iptables -A FORWARD -i eth0 -o tap0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
+iptables -A FORWARD -i tap0 -o eth0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
+
+# Route incoming port to DMZ server 192.168.2.1
+#iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 8000 -j DNAT --to-destination 192.168.2.1:8000
+
+# do not need since nginx is performing this
+#iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 80 -j DNAT --to-destination 192.168.2.1:8080
+
+iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 25 -j DNAT --to-destination 192.168.2.1:10025
+iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 7000 -j DNAT --to-destination 192.168.2.1:7000
+iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 7001 -j DNAT --to-destination 192.168.2.1:7001
+
+# When the traffic goes back out, make sure it has our IP and not the DMZ
+iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
+
+### End Server ####
+
diff --git a/deploy/tunnel/vpn-ssh/server/run-to-log b/deploy/tunnel/vpn-ssh/server/run-to-log
new file mode 100755
index 0000000..60f48d6
--- /dev/null
+++ b/deploy/tunnel/vpn-ssh/server/run-to-log
@@ -0,0 +1,2 @@
+DIR="$( cd "$( dirname "$0" )" && pwd )"
+./run > run.log 2>&1
diff --git a/deploy/watch b/deploy/watch
new file mode 100755
index 0000000..5339267
--- /dev/null
+++ b/deploy/watch
@@ -0,0 +1,5 @@
+if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
+
+server="blue"
+
+ssh $1@$server "tail -n 100 -f run.log"
diff --git a/deploy/web-deploy b/deploy/web-deploy
new file mode 100755
index 0000000..88ddd69
--- /dev/null
+++ b/deploy/web-deploy
@@ -0,0 +1,2 @@
+rsync -avL --exclude="WEB-INF" --delete ../gwt/war/ ./www/
+
diff --git a/deploy/web-deploy-ftp b/deploy/web-deploy-ftp
new file mode 100755
index 0000000..a96db9c
--- /dev/null
+++ b/deploy/web-deploy-ftp
@@ -0,0 +1,2 @@
+./web-deploy
+sitecopy --update mailiverse.com -k
diff --git a/deploy/web-deploy-s3 b/deploy/web-deploy-s3
new file mode 100755
index 0000000..4debe9c
--- /dev/null
+++ b/deploy/web-deploy-s3
@@ -0,0 +1,8 @@
+./web-deploy
+s3cmd sync www/ s3://www.mailiverse.com/ --acl-public --delete-removed
+
+echo putting files with cache control headers
+s3cmd put www/*.html s3://www.mailiverse.com/ --acl-public --add-header "Cache-Control: max-age:3600"
+s3cmd put www/*.txt s3://www.mailiverse.com/ --acl-public --add-header "Cache-Control: max-age:3600"
+s3cmd put www/mailiverse_gwt/mailiverse_gwt.nocache.js s3://www.mailiverse.com/mailiverse_gwt/ --acl-public --add-header "Cache-Control: no-cache"
+echo done
diff --git a/deploy/websockets. b/deploy/websockets.
new file mode 100644
index 0000000..e69de29
diff --git a/deploy/websockets/proxy-tcp.js b/deploy/websockets/proxy-tcp.js
new file mode 100644
index 0000000..2d57366
--- /dev/null
+++ b/deploy/websockets/proxy-tcp.js
@@ -0,0 +1,83 @@
+var WebSocket = require('ws');
+var WebSocketServer = WebSocket.Server;
+var http = require('http');
+var net = require('net');
+
+var server =
+ http.createServer(function (req, res) {
+ res.writeHead(200, {'Content-Type': 'text/plain'});
+ res.end('Not implemented');
+ });
+
+server.listen(8081, "0.0.0.0", null);
+closeServer = function() { self._server.close(); };
+
+var incrementingId = 0;
+
+function createWebSocket(path, ws) {
+ console.log('connection');
+
+ ws.xStringVal = (new Date()) + ":" + incrementingId++;
+ ws.xString = function() { return ws.xStringVal; };
+ ws.proxy = net.createConnection(path);
+ ws.proxy.buffer = "";
+ ws.proxy.connected = false;
+ ws.proxy.outQueue = [];
+ ws.proxy.inQueue = [];
+
+ ws.proxy.sendQueue = function() {
+ if (!this.connected) {
+ while (this.outQueue.length > 0)
+ {
+ var message = ws.proxy.outQueue.shift();
+ console.log(ws.xString() + ' C -> ' + message);
+ ws.proxy.write(message.trim() + "\r\n");
+ }
+ }
+ };
+
+ ws.proxy.receiveQueue = function() {
+ while (this.inQueue.length > 0)
+ {
+ var message = ws.proxy.inQueue.shift();
+ console.log(ws.xString() + ' <- S ' + message);
+ ws.send(message.trim() + "\r\n");
+ }
+ };
+
+ ws.proxy.queueAndReceive = function() {
+ var retPos = -1;
+ while ((retPos=this.buffer.indexOf("\n"))!=-1)
+ {
+ var next = this.buffer.substring(0, retPos);
+ this.buffer = this.buffer.substring(retPos+1);
+ this.inQueue.push(next.trim());
+ }
+
+ this.receiveQueue();
+ };
+
+ ws.proxy.on('data', function(message) {
+ console.log(ws.xString() + ' <- Q ' + message);
+ this.buffer += message;
+ ws.proxy.queueAndReceive();
+ });
+ ws.proxy.on('close', function() { console.log(ws.xString() + ' close S'); ws.close() });
+ ws.proxy.on('open', function() { ws.proxy.connected = true; ws.proxy.sendQueue(); });
+
+ ws.on('message', function(message) {
+ console.log(ws.xString() + ' Q ->', message);
+ ws.proxy.outQueue.push(message);
+ ws.proxy.sendQueue();
+ });
+
+ ws.on('close', function() { console.log(ws.xString() + ' C close'); ws.proxy.end(); });
+}
+
+
+wss = new WebSocketServer({server:server, path:"/Mailiverse/KeyServer"});
+wss.on('connection', function(ws) { createWebSocket(7000, ws); });
+
+wss = new WebSocketServer({server:server, path:"/Mailiverse/MailServer"});
+wss.on('connection', function(ws) { createWebSocket(7001, ws); });
+
diff --git a/deploy/websockets/proxy-ws.js b/deploy/websockets/proxy-ws.js
new file mode 100644
index 0000000..05f9dd1
--- /dev/null
+++ b/deploy/websockets/proxy-ws.js
@@ -0,0 +1,54 @@
+var WebSocket = require('ws');
+var WebSocketServer = WebSocket.Server;
+var http = require('http');
+
+var server =
+ http.createServer(function (req, res) {
+ res.writeHead(200, {'Content-Type': 'text/plain'});
+ res.end('Not implemented');
+ });
+
+server.listen(8081, "0.0.0.0", null);
+closeServer = function() { self._server.close(); };
+
+function createWebSocket(path, ws) {
+ console.log('connection');
+
+ ws.proxy = new WebSocket(path);
+ ws.proxy.queue = [];
+
+ ws.proxy.on('message', function(message) { console.log('<- P ' + message); ws.send(message); });
+ ws.proxy.on('close', function() { console.log('close P'); ws.close() });
+ ws.proxy.on('open', function() {
+ while (ws.proxy.queue.length > 0)
+ {
+ var message = ws.proxy.queue.shift();
+ console.log('C -> ' + message);
+ ws.proxy.send(message);
+ }
+ ws.proxy.queue = null;
+ });
+
+ ws.on('message', function(message) {
+ if (ws.proxy.queue != null)
+ {
+ console.log('C q ' + message);
+ ws.proxy.queue.push(message);
+ }
+ else
+ {
+ console.log('C -> ' + message);
+ ws.proxy.send(message);
+ }
+ });
+
+ ws.on('close', function() { console.log('C close'); ws.proxy.close(); });
+}
+
+
+wss = new WebSocketServer({server:server, path:"Mailiverse/KeyServer"});
+wss.on('connection', function(ws) { createWebSocket('ws://red:8080/Mailiverse/KeyServer', ws); });
+
+wss = new WebSocketServer({server:server, path:"Mailiverse/MailServer"});
+wss.on('connection', function(ws) { createWebSocket('ws://red:8080/Mailiverse/MailServer', ws); });
+
diff --git a/deploy/websockets/proxy.js b/deploy/websockets/proxy.js
new file mode 120000
index 0000000..c60c2f1
--- /dev/null
+++ b/deploy/websockets/proxy.js
@@ -0,0 +1 @@
+proxy-tcp.js
\ No newline at end of file
diff --git a/deploy/websockets/run b/deploy/websockets/run
new file mode 100755
index 0000000..4d5eda3
--- /dev/null
+++ b/deploy/websockets/run
@@ -0,0 +1,11 @@
+./setup
+
+cd ~/server
+
+echo ---------------------------------------- >> ../run.log
+date >> ~/run.log
+echo ---------------------------------------- >> ../run.log
+
+node proxy.js >> ~/run.log 2>&1 &
+
+
diff --git a/deploy/websockets/setup b/deploy/websockets/setup
new file mode 100755
index 0000000..8519eb5
--- /dev/null
+++ b/deploy/websockets/setup
@@ -0,0 +1,3 @@
+cd ~
+cp deploy/proxy.js server/proxy.js
+
diff --git a/deploy/websockets/shutdown b/deploy/websockets/shutdown
new file mode 100755
index 0000000..5edcb3d
--- /dev/null
+++ b/deploy/websockets/shutdown
@@ -0,0 +1,2 @@
+killall -user websockets node
+