You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ma...@apache.org on 2012/05/02 18:05:29 UTC
svn commit: r1333089 [1/2] - in /james/hupa/trunk:
client/src/main/java/org/apache/hupa/
client/src/main/java/org/apache/hupa/client/mvp/
client/src/test/java/org/apache/hupa/client/guice/
mock/src/main/java/org/apache/hupa/server/guice/ mock/src/main/...
Author: manolo
Date: Wed May 2 16:05:26 2012
New Revision: 1333089
URL: http://svn.apache.org/viewvc?rev=1333089&view=rev
Log:
Many changes in order to decouple mock stuff, so as Hupa could be delivered with and without the mock module.
Fix demo-mode previously broken, now all demo classes are injected via guice injection, and mock classes are loaded using reflection.
Fix multipart messages inside mixed messages with text and html attachments.
Refresh folders when removing messages in view.
Added:
james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockConstants.java
- copied, changed from r1332199, james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/DemoModeConstants.java
james/hupa/trunk/mock/src/main/resources/mime/10.msg
james/hupa/trunk/mock/src/main/resources/mime/9.msg
james/hupa/trunk/server/bin/
james/hupa/trunk/server/bin/lib/
james/hupa/trunk/server/bin/pom.xml
james/hupa/trunk/server/bin/src/
james/hupa/trunk/server/bin/src/main/
james/hupa/trunk/server/bin/src/main/java/
james/hupa/trunk/server/bin/src/main/java/org/
james/hupa/trunk/server/bin/src/main/java/org/apache/
james/hupa/trunk/server/bin/src/main/java/org/apache/hupa/
james/hupa/trunk/server/bin/src/main/java/org/apache/hupa/server/
james/hupa/trunk/server/bin/src/main/java/org/apache/hupa/server/guice/
james/hupa/trunk/server/bin/src/main/java/org/apache/hupa/server/guice/demo/
james/hupa/trunk/server/bin/src/main/java/org/apache/hupa/server/guice/providers/
james/hupa/trunk/server/bin/src/main/java/org/apache/hupa/server/handler/
james/hupa/trunk/server/bin/src/main/java/org/apache/hupa/server/preferences/
james/hupa/trunk/server/bin/src/main/java/org/apache/hupa/server/rf/
james/hupa/trunk/server/bin/src/main/java/org/apache/hupa/server/servlet/
james/hupa/trunk/server/bin/src/main/java/org/apache/hupa/server/utils/
james/hupa/trunk/server/bin/src/main/webapp/
james/hupa/trunk/server/bin/src/main/webapp/WEB-INF/
james/hupa/trunk/server/bin/src/main/webapp/WEB-INF/conf/
james/hupa/trunk/server/bin/src/main/webapp/WEB-INF/conf/config.properties
james/hupa/trunk/server/bin/src/reporting-site/
james/hupa/trunk/server/bin/src/reporting-site/site.xml
james/hupa/trunk/server/bin/src/site/
james/hupa/trunk/server/bin/src/site/site.xml
james/hupa/trunk/server/bin/src/test/
james/hupa/trunk/server/bin/src/test/java/
james/hupa/trunk/server/bin/src/test/java/org/
james/hupa/trunk/server/bin/src/test/java/org/apache/
james/hupa/trunk/server/bin/src/test/java/org/apache/hupa/
james/hupa/trunk/server/bin/src/test/java/org/apache/hupa/server/
james/hupa/trunk/server/bin/src/test/java/org/apache/hupa/server/guice/
james/hupa/trunk/server/bin/src/test/java/org/apache/hupa/server/handler/
james/hupa/trunk/server/bin/src/test/java/org/apache/hupa/server/integration/
james/hupa/trunk/server/bin/src/test/java/org/apache/hupa/server/mock/
james/hupa/trunk/server/bin/src/test/java/org/apache/hupa/server/preferences/
james/hupa/trunk/server/bin/src/test/java/org/apache/hupa/server/servlet/
james/hupa/trunk/server/bin/src/test/java/org/apache/hupa/server/utils/
james/hupa/trunk/server/bin/target/
james/hupa/trunk/server/bin/target/generated-sources/
james/hupa/trunk/server/bin/target/generated-sources/annotations/
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/demo/
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/demo/DemoGuiceServerModule.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/providers/
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/providers/DefaultUserSettingsProvider.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/providers/JavaMailSessionProvider.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/providers/LogProvider.java
Removed:
james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/DemoModeConstants.java
Modified:
james/hupa/trunk/client/src/main/java/org/apache/hupa/Launcher.java
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java
james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceClientTestModule.java
james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/AbstractGuiceTestModule.java
james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java
james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java
james/hupa/trunk/mock/src/main/resources/mime/3.msg
james/hupa/trunk/mock/src/main/resources/mime/8.msg
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/IMAPStoreCache.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServerModule.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServletConfig.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSendMessageHandler.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSessionHandler.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ForwardMessageHandler.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/GetMessageDetailsHandler.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/IdleHandler.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/LogoutUserHandler.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/PrepareNewMessageHandler.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ReplyMessageHandler.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/InImapUserPreferencesStorage.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/DownloadAttachmentServlet.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/ConfigurationProperties.java
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/SessionUtils.java
james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceServerTestModule.java
james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/ServerModulTest.java
james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbtractSendMessageHandlerTest.java
james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/GetMessageDetailsHandlerTest.java
james/hupa/trunk/server/src/test/java/org/apache/hupa/server/integration/StoreBugTest.java
james/hupa/trunk/server/src/test/java/org/apache/hupa/server/preferences/InImapUserPreferencesStorageTest.java
james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/SConsts.java
james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/Util.java
james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/editor/Editor.java
Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/Launcher.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/Launcher.java?rev=1333089&r1=1333088&r2=1333089&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/Launcher.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/Launcher.java Wed May 2 16:05:26 2012
@@ -18,6 +18,7 @@
****************************************************************/
package org.apache.hupa;
+import java.net.InetSocketAddress;
import java.net.URL;
import java.security.ProtectionDomain;
@@ -30,15 +31,21 @@ import org.eclipse.jetty.webapp.WebAppCo
*/
public final class Launcher {
public static void main(String[] args) throws Exception {
- int port = Integer.parseInt(System.getProperty("port", "8282"));
- Server server = new Server(port);
+
+ int port = Integer.parseInt(System.getProperty("port", "8282"));
+ String bindAddress = System.getProperty("host", "0.0.0.0");
+
+ InetSocketAddress a = new InetSocketAddress(bindAddress, port);
+ Server server = new Server(a);
+
ProtectionDomain domain = Launcher.class.getProtectionDomain();
URL location = domain.getCodeSource().getLocation();
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/");
webapp.setWar(location.toExternalForm());
+
server.setHandler(webapp);
server.start();
server.join();
}
-}
\ No newline at end of file
+}
Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java?rev=1333089&r1=1333088&r2=1333089&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java Wed May 2 16:05:26 2012
@@ -238,7 +238,8 @@ public class IMAPMessageListPresenter ex
dispatcher.execute(new DeleteAllMessages(folder), new HupaCallback<DeleteMessageResult>(dispatcher, eventBus) {
public void callback(DeleteMessageResult result) {
display.reset();
- eventBus.fireEvent(new DecreaseUnseenEvent(user,folder,result.getCount()));
+ display.reloadData();
+// eventBus.fireEvent(new DecreaseUnseenEvent(user,folder,result.getCount()));
}
});
}
Modified: james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceClientTestModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceClientTestModule.java?rev=1333089&r1=1333088&r2=1333089&view=diff
==============================================================================
--- james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceClientTestModule.java (original)
+++ james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceClientTestModule.java Wed May 2 16:05:26 2012
@@ -26,9 +26,8 @@ import org.apache.commons.logging.Log;
import org.apache.hupa.server.IMAPStoreCache;
import org.apache.hupa.server.InMemoryIMAPStoreCache;
import org.apache.hupa.server.guice.AbstractGuiceTestModule;
-import org.apache.hupa.server.guice.DefaultUserSettingsProvider;
-import org.apache.hupa.server.guice.DemoModeConstants;
-import org.apache.hupa.server.guice.JavaMailSessionProvider;
+import org.apache.hupa.server.guice.providers.DefaultUserSettingsProvider;
+import org.apache.hupa.server.guice.providers.JavaMailSessionProvider;
import org.apache.hupa.server.handler.AbstractSendMessageHandler;
import org.apache.hupa.server.handler.ContactsHandler;
import org.apache.hupa.server.handler.CreateFolderHandler;
@@ -43,6 +42,7 @@ import org.apache.hupa.server.handler.Lo
import org.apache.hupa.server.handler.LogoutUserHandler;
import org.apache.hupa.server.handler.ReplyMessageHandler;
import org.apache.hupa.server.handler.SendMessageHandler;
+import org.apache.hupa.server.mock.MockConstants;
import org.apache.hupa.server.mock.MockHttpSessionProvider;
import org.apache.hupa.server.mock.MockIMAPStore;
import org.apache.hupa.server.mock.MockLogProvider;
@@ -64,7 +64,7 @@ public class GuiceClientTestModule exten
@Override
protected void configureHandlers() {
- Names.bindProperties(binder(), DemoModeConstants.demoProperties);
+ Names.bindProperties(binder(), MockConstants.mockProperties);
bind(Session.class).toProvider(JavaMailSessionProvider.class);
bind(HttpSession.class).toProvider(MockHttpSessionProvider.class);
Modified: james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/AbstractGuiceTestModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/AbstractGuiceTestModule.java?rev=1333089&r1=1333088&r2=1333089&view=diff
==============================================================================
--- james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/AbstractGuiceTestModule.java (original)
+++ james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/AbstractGuiceTestModule.java Wed May 2 16:05:26 2012
@@ -75,7 +75,6 @@ import com.google.inject.name.Named;
*
*/
public abstract class AbstractGuiceTestModule extends ActionHandlerModule {
-
protected static class TestUser extends User {
private static final long serialVersionUID = 1L;
Copied: james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockConstants.java (from r1332199, james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/DemoModeConstants.java)
URL: http://svn.apache.org/viewvc/james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockConstants.java?p2=james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockConstants.java&p1=james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/DemoModeConstants.java&r1=1332199&r2=1333089&rev=1333089&view=diff
==============================================================================
--- james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/DemoModeConstants.java (original)
+++ james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockConstants.java Wed May 2 16:05:26 2012
@@ -17,10 +17,8 @@
* under the License. *
****************************************************************/
-package org.apache.hupa.server.guice;
+package org.apache.hupa.server.mock;
-import org.apache.hupa.server.mock.MockIMAPStore;
-import org.apache.hupa.server.mock.MockSMTPTransport;
import org.apache.hupa.shared.data.Settings;
import org.apache.hupa.shared.data.User;
@@ -29,7 +27,7 @@ import java.util.Properties;
/**
* Constants and properties used for mock mode
*/
-public class DemoModeConstants {
+public class MockConstants {
public final static Settings mockSettings = new Settings() {
private static final long serialVersionUID = 1L;
@@ -41,41 +39,28 @@ public class DemoModeConstants {
}
};
- public final static Properties demoProperties = new Properties() {
+ public final static Properties mockProperties = new Properties() {
private static final long serialVersionUID = 1L;
{
- put("Username",MockIMAPStore.MOCK_LOGIN);
- put("Password",MockIMAPStore.MOCK_LOGIN);
+ put("Username", MockIMAPStore.MOCK_LOGIN);
+ put("Password", MockIMAPStore.MOCK_LOGIN);
+ put("DefaultUserSessionId", "DEMO_ID");
- put("IMAPServerAddress", MockSMTPTransport.MOCK_HOST);
- put("IMAPServerPort", "143");
- put("IMAPS", "false");
-
- put("TrustStore", "my-truststore");
- put("TrustStorePassword", "my-truststore-password");
-
- put("SMTPServerAddress", MockSMTPTransport.MOCK_HOST);
- put("SMTPServerPort", "25");
- put("SMTPS", "false");
- put("SMTPAuth", "false");
+ put("IMAPServerAddress", MockIMAPStore.MOCK_HOST);
+ put("SMTPServerAddress", MockIMAPStore.MOCK_HOST);
put("SessionDebug", "false");
- put("IMAPConnectionPoolSize", "4");
- put("IMAPConnectionPoolTimeout", "300000");
-
put("DefaultInboxFolder", MockIMAPStore.MOCK_INBOX_FOLDER);
put("DefaultTrashFolder", MockIMAPStore.MOCK_TRASH_FOLDER);
put("DefaultSentFolder", MockIMAPStore.MOCK_SENT_FOLDER);
put("DefaultDraftsFolder", MockIMAPStore.MOCK_DRAFTS_FOLDER);
put("PostFetchMessageCount", "0");
-
- put("DefaultUserSessionId", "DEMO_ID");
}
};
- public final static Settings demoUserSettings = new Settings() {
+ public final static Settings mockUserSettings = new Settings() {
private static final long serialVersionUID = 1L;
{
setInboxFolderName(MockIMAPStore.MOCK_INBOX_FOLDER);
@@ -85,13 +70,12 @@ public class DemoModeConstants {
}
};
- public final static User demoUser = new User() {
+ public final static User mockUser = new User() {
private static final long serialVersionUID = 1L;
{
setName(MockIMAPStore.MOCK_LOGIN);
setPassword(MockIMAPStore.MOCK_LOGIN);
- setSettings(demoUserSettings);
+ setSettings(mockUserSettings);
}
};
-
}
Modified: james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java?rev=1333089&r1=1333088&r2=1333089&view=diff
==============================================================================
--- james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java (original)
+++ james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java Wed May 2 16:05:26 2012
@@ -39,12 +39,13 @@ public class MockIMAPStore extends IMAPS
public final static String MOCK_SENT_FOLDER = "Mock-Sent";
public final static String MOCK_TRASH_FOLDER = "Mock-Trash";
public final static String MOCK_DRAFTS_FOLDER = "Mock-Drafts";
+ public static final String MOCK_HOST = "hupa.demo";
public final static String MOCK_LOGIN = "demo";
private Map<String, String> validLogins = new HashMap<String, String>();
private boolean connected = false;
private List<MockIMAPFolder> folders = new ArrayList<MockIMAPFolder>();
private List<String> capList;
- static final URLName demoUrl = new URLName(null, MockSMTPTransport.MOCK_HOST, 0, null, null, null);
+ static final URLName demoUrl = new URLName(null, MOCK_HOST, 0, null, null, null);
/**
* Default constructor, it creates the folder structure and loads messages for demo
@@ -59,7 +60,7 @@ public class MockIMAPStore extends IMAPS
*/
public MockIMAPStore(Session session, URLName url) {
super(session, url);
- if (url != null && MockSMTPTransport.MOCK_HOST.equals(url.getHost())) {
+ if (url != null && MOCK_HOST.equals(url.getHost())) {
validLogins.put(MOCK_LOGIN, MOCK_LOGIN);
try {
new MockIMAPFolder(MOCK_INBOX_FOLDER, this).create(Folder.HOLDS_FOLDERS | Folder.HOLDS_MESSAGES);
Modified: james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java?rev=1333089&r1=1333088&r2=1333089&view=diff
==============================================================================
--- james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java (original)
+++ james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java Wed May 2 16:05:26 2012
@@ -31,9 +31,7 @@ import javax.mail.URLName;
public class MockSMTPTransport extends Transport {
- public static final String MOCK_HOST = "mock-host";
-
- static final URLName mockUrl = new URLName(null, MOCK_HOST, 0, null, null, null);
+ static final URLName mockUrl = new URLName(null, "mock-smtp", 0, null, null, null);
public MockSMTPTransport(Session session) {
super(session, mockUrl);
Added: james/hupa/trunk/mock/src/main/resources/mime/10.msg
URL: http://svn.apache.org/viewvc/james/hupa/trunk/mock/src/main/resources/mime/10.msg?rev=1333089&view=auto
==============================================================================
--- james/hupa/trunk/mock/src/main/resources/mime/10.msg (added)
+++ james/hupa/trunk/mock/src/main/resources/mime/10.msg Wed May 2 16:05:26 2012
@@ -0,0 +1,53 @@
+MIME-Version: 1.0
+Received: by 10.239.187.211 with SMTP id m19mr254638hbh.10.1263556376695; Fri,
+ 15 Jan 2010 03:52:56 -0800 (PST)
+Date: Fri, 15 Jan 2010 12:52:56 +0100
+Message-ID: <a1...@mail.gmail.com>
+Subject: Listado de temas a tratar
+From: Juan Palomo <ju...@palomo.com>
+To: =?ISO-8859-1?Q?No hay ma=F1ana?= <he...@hupa.org>
+Content-Type: multipart/mixed; boundary=001485f7c300fc945d047d32a46a
+X-Virus-Checked: Checked by ClamAV on apache.org
+
+--001485f7c300fc945d047d32a46a
+Content-Type: multipart/alternative; boundary=001485f7c300fc9454047d32a468
+
+--001485f7c300fc9454047d32a468
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: quoted-printable
+
+
+Mira el documento adjunto.
+
+
+--=20
+Mirai Espa=F1a S.L.
+Calle Fuencarral 6, 4=BA
+28004, Madrid
+Tel. 91 5913500
+Fax. 91 4473032
+http://www.miraiespana.com/
+-
+Visit http://www.hotelsearch.com/ !!
+
+--001485f7c300fc9454047d32a468
+Content-Type: text/html; charset=ISO-8859-1
+Content-Transfer-Encoding: quoted-printable
+
+Hola<br>
+Mira el documento adjunto.<br>
+
+<span>-- <br>
+<a href='http://www.mycompany.com>My Company !!</a>
+<br>
+</span>
+
+--001485f7c300fc9454047d32a468--
+--001485f7c300fc945d047d32a46a
+Content-Type: text/plain; charset=ISO-8859-1; name="Tareas.txt"
+Content-Disposition: attachment; filename="Latin.txt"
+Content-Length: 866
+X-Attachment-Id: f_g4gwsd0h0
+
+Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
+--001485f7c300fc945d047d32a46a--
Modified: james/hupa/trunk/mock/src/main/resources/mime/3.msg
URL: http://svn.apache.org/viewvc/james/hupa/trunk/mock/src/main/resources/mime/3.msg?rev=1333089&r1=1333088&r2=1333089&view=diff
==============================================================================
--- james/hupa/trunk/mock/src/main/resources/mime/3.msg (original)
+++ james/hupa/trunk/mock/src/main/resources/mime/3.msg Wed May 2 16:05:26 2012
@@ -20,12 +20,12 @@ Content-Transfer-Encoding: 7bit
<table border="0" cellpadding="0" cellspacing="0" style="width: 896px">
-<tr><td align="center" style="font: normal 11px Verdana, sans-serif; color: #333;"><a href="http://mdftfxek.cn" style="text-decoration: none; color: #0099ff;">Click here</a> to view as a web page. </td></tr>
+<tr><td align="center" style="font: normal 11px Verdana, sans-serif; color: #333;"><a href="#" style="text-decoration: none; color: #0099ff;">Click here</a> to view as a web page. </td></tr>
<tr><td align="center">
<br />
- <a href="http://mdftfxek.cn">
- <img alt="View image in browser now" width="618" height="326" src="http://mediapix.ru/pics/4154ded47deaf59b8dad0cc69294fc5b.gif" style="border-width: 0px" /></a></td></tr>
+ <a href="#">
+ <img alt="View image in browser now" width="618" height="326" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBhQSERUUExQWFRMVGRgYFxcYFxgbGhgYGhoYGBgYGhgYHCYfHBkjHhweHy8gIycpLCwsGB4xNTAqNSYrLCkBCQoKDgwOGg8PGiwkHyQqLCksKikpKSksKSwsLCkpLCwpKSksKSwsKSwpKSksKSkpKSksLCkpLCwsLCksLCwsKf/AABEIAL4BCQMBIgACEQEDEQH/xAAcAAADAQEBAQEBAAAAAAAAAAAEBQYHAwIBAAj/xABEEAABAgQDBQUFBQYEBgMAAAABAhEAAwQhBTFBBhJRYXEigZGhsRMywdHwBxRCUuEVFiNicvEzgpLSJENTk6LCFyU0/8QAGQEAAwEBA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cToI+yvs/ms4UN74xZ4XhiZYsM8zqTzh/IkNuB/e3stN3kReEP9OGPJ4YzFRSyOoKPEEpCVITNAyO8yu85GGAw+sI/wgD/WPlFrQBwHZyLwwWpITvEco7kE0JhPLdTGcRxKqlzBLXKUgnLeuDzBFj3Qnx+nO7vLJUr06DSNxxPCkTpagRZ2voWBBHj6xmu1WChUrfy/C3Ma9/CMK80JuarhWGpy2cq07iCfd3QLcQG9RlFJSzAd24O6nW28dXvm3PTnGYYLiJlTPZ5pUW6HjFzTTD8ILC/IVOypxNx9IBBObWYjjlDCkr1JUxJYBzxGduresJKYqYscgVa6MdIOl1BWE713Zzqw0hpFxAMo8KxhASd43JdWrZAaZAACAts8KROp1MzgFSTwIDt0LN4QFVSlSwLhlKPhcgdLcdI8TZ61pKHzBD8HBDwtcW7EMv6mMTd6U
t0/Qh/hu1cs2WCg9HHzEeNq8BXITvb6VJ6EH5RMYfJ3jETFkycBLAqslmaJT41KV7sxJ729YPl4in8yfEfOI2iwEKD21ijw7AEJ3FAApXcPmCM9Motxl/cldV9SmwqUZyhchOp+Xzij/Y8r8nmfnCzDk7gAEHfe1cYNla4m1n//2Q==" style="border-width: 0px" /></a></td></tr>
<tr><td valign="top" style="border-right: 1px solid #e5e4e4; padding-right: 10px">
@@ -33,10 +33,10 @@ Content-Transfer-Encoding: 7bit
<tr><td align="center" style="font: normal 9px Verdana, sans-serif; color: #999; padding-top: 20px">
-<a href="http://mdftfxek.cn" style="font: 9px Verdana, sans-serif; text-decoration: none; color: #0099ff">Unsubscribe</a> |
-<a href="http://mdftfxek.cn" style="font: 9px Verdana, sans-serif; text-decoration: none; color: #0099ff">Change e-mail address</a> |
-<a href="http://mdftfxek.cn" style="font: 9px Verdana, sans-serif; text-decoration: none; color: #0099ff">Privacy Policy</a> |
-<a href="http://mdftfxek.cn" style="font: 9px Verdana, sans-serif; text-decoration: none; color: #0099ff">About Us</a><br /><br />
+<a href="#" style="font: 9px Verdana, sans-serif; text-decoration: none; color: #0099ff">Unsubscribe</a> |
+<a href="#" style="font: 9px Verdana, sans-serif; text-decoration: none; color: #0099ff">Change e-mail address</a> |
+<a href="#" style="font: 9px Verdana, sans-serif; text-decoration: none; color: #0099ff">Privacy Policy</a> |
+<a href="#" style="font: 9px Verdana, sans-serif; text-decoration: none; color: #0099ff">About Us</a><br /><br />
Copyright ® 2009 umew Inc. All rights reserved.<br />
</td></tr>
Modified: james/hupa/trunk/mock/src/main/resources/mime/8.msg
URL: http://svn.apache.org/viewvc/james/hupa/trunk/mock/src/main/resources/mime/8.msg?rev=1333089&r1=1333088&r2=1333089&view=diff
==============================================================================
--- james/hupa/trunk/mock/src/main/resources/mime/8.msg (original)
+++ james/hupa/trunk/mock/src/main/resources/mime/8.msg Wed May 2 16:05:26 2012
@@ -1,13 +1,11 @@
-Return-Path: <mc...@altercore.com>
-Delivered-To: mcm@altercore.com
Received: from localhost (EHLO Arizona) ([127.0.0.1])
by Arizona (JAMES SMTP Server ) with ESMTP ID 1913414975
- for <mc...@altercore.com>;
+ for <mcm>;
Fri, 27 Apr 2012 01:05:23 +0200 (CEST)
-From: mcm@altercore.com
-To: mcm@altercore.com
+From: mcm@example.com
+To: mcm@example.com
Message-ID: <32...@Arizona>
-Subject: local
+Subject: Inline image
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_Part_1_1578022692.1335524723695"
Added: james/hupa/trunk/mock/src/main/resources/mime/9.msg
URL: http://svn.apache.org/viewvc/james/hupa/trunk/mock/src/main/resources/mime/9.msg?rev=1333089&view=auto
==============================================================================
--- james/hupa/trunk/mock/src/main/resources/mime/9.msg (added)
+++ james/hupa/trunk/mock/src/main/resources/mime/9.msg Wed May 2 16:05:26 2012
@@ -0,0 +1,148 @@
+MIME-Version: 1.0
+Content-Type: text/html;
+ charset="ISO-8859-1"
+Content-Transfer-Encoding: quoted-printable
+Date: Tue, 3 Jan 2012 05:03:32 -0800
+From: "Voices That Matter" <vo...@e.informit.biz>
+Reply-To: "Voices That Matter" <vo...@informit.com>
+Subject: Android Conference - Early Bird Pricing thru January 13
+List-Unsubscribe: http://e.pearson.info/pub/optout?_ri_=X0Gzc2X%3DUQpglLjHJlTQ4rQGyy4Qisn8Qso3Q44LOKQGQaQvzbf&_ei_=8312wfG0Xb9X%3DzgDBAB688qzgSRGqWUWCq6BRYqA77GBUCzgCCzgTVGf6beX6990G11X%3DuHghthxupjHpLkiHgHQJhu
+X-sgxh1: uHghthxupjHpLkiHgHQJhu
+X-rext: 3.interact2.Wj.EPPW.pkgC.khU.WWewd.E.H.NqM
+X-cid: ptg.10897410.149588
+To: test@james.apache.org
+Message-ID: <0....@om-fen.rsys1.com>
+
+<html>
+<head>
+<title>Voices That Matter: Android Developers Conference</title>
+<meta http-equiv=3D=22Content-Type=22 content=3D=22text/html; charset=3Diso=
+-8859-1=22>
+
+<style type=3D=22text/css=22>
+<=21--body =7B=20
+background-color : =23FFFFFF;=20
+width : 100%;
+font-family : Arial, Helvetica;=20
+=7D -->
+</style>
+</head>
+
+<body>
+<table width=3D=22640=22 border=3D=220=22 cellpadding=3D=226=22 cellspacing=
+=3D=224=22 style=3D=22border:1px solid =23999;=22>
+<tr>=20
+<td><div align=3D=22center=22><a rilt=3D=22AndroidBanner=22 href=3D=22http:=
+//e=2Epearson=2Einfo/pub/cc?_ri_=3DX0Gzc2X%3DUQpglLjHJlTQ4rQGyy4Qisn8Qso3Q4=
+4LOKQGQaQvzbfVXtpKX%3DSRDSCCYC&_ei_=3D8312wfG0Xb9X%3DzgDBAB688qzgSRGqWUWCq6=
+BRYqA77GBUCzgCCzgTVGf6beX6990G11X%3DuHghthxupjHpLkiHgHQJhu=2E=22><img src=
+=3D=22http://ptgmedia=2Epearsoncmg=2Ecom/imprint_downloads/informit/images/=
+conferences/VTMAndroid2012/AndroidHeader640=2Ejpg=22 width=3D=22640=22 heig=
+ht=3D=22123=22 alt=3D=22Voices That Matter: Android Developers Conference=
+=22 border=3D=220=22 /></a></div></td>
+</tr>
+<tr>
+ <td valign=3D=22top=22 align=3D=22center=22><p><font color=3D=22=2389ac46=
+=22 size=3D=225=22><strong>Top Five Reasons to Register Now</strong></font>=
+<font size=3D=222=22><br>
+ </font></p></td>
+</tr>
+
+<tr>
+<td width=3D=22635=22 height=3D=22406=22 valign=3D=22top=22>
+<p><font size=3D=222=22>5=2E We have extended our Early Bird pricing for a=
+ll of you holiday season procrastinators=2E You can save =24200 by register=
+ing before January 13=2E Save even more with the Friends of Pearson Priorit=
+y Code=2E Register with this Priority Code =96 <strong>ANDMAL7</strong> =96=
+ and save another =24150=2E <a rilt=3D=22vtm_android_register_link1=22 href=
+=3D=22http://e=2Epearson=2Einfo/pub/cc?_ri_=3DX0Gzc2X%3DUQpglLjHJlTQ4rQGyy4=
+Qisn8Qso3Q44LOKQGQaQvzbfVXtpKX%3DSRDSCCYD&_ei_=3D8312wfG0Xb9X%3DzgDBAB688qz=
+gSRGqWUWCq6BRYqA77GBUCzgCCzgTVGf6beX6990G11X%3DuHghthxupjHpLkiHgHQJhu=2E=22=
+>Sign up before January 13 and combine the goodness</a>=21
+<p>4=2E Have the chance to meet and hang out with leading authors, and con=
+ference chairs, Shane Conder and Lauren Darcey=2E Get your books signed, as=
+k questions and propose new ideas=2E Plus, meet the Google folks who are wo=
+rking on Android today and every day=2E=20
+<p>3=2E Improve your application development skills with ideas from Eric B=
+urke (of Square), Chris Haseman (of Tumblr) and Chirag Mehta (of Amazon)=2E
+<p>2=2E You will be inspired=2E You=92ll have a chance to see how others a=
+re leveraging the robust functionality of the Android platform=2E And how o=
+thers are marketing their apps=2E You will go back to your office, your fre=
+e-lance gig, your own projects with new ideas and new energy=2E <a rilt=3D=
+=22vtm_android_register_link2=22 href=3D=22http://e=2Epearson=2Einfo/pub/cc=
+?_ri_=3DX0Gzc2X%3DUQpglLjHJlTQ4rQGyy4Qisn8Qso3Q44LOKQGQaQvzbfVXtpKX%3DSRDSC=
+CYD&_ei_=3D8312wfG0Xb9X%3DzgDBAB688qzgSRGqWUWCq6BRYqA77GBUCzgCCzgTVGf6beX69=
+90G11X%3DuHghthxupjHpLkiHgHQJhu=2E=22>Reserve your place today</a>=2E
+<p>1=2E Did we mention special savings?? Combine our Friends of Pearson (<=
+strong>ANDMAL7</strong>) discount with Early Bird pricing and you can atten=
+d the two-day conference (including breakfast, breaks, lunch and a party) f=
+or only =24445=2E <a rilt=3D=22vtm_android_register_link3=22 href=3D=22http=
+://e=2Epearson=2Einfo/pub/cc?_ri_=3DX0Gzc2X%3DUQpglLjHJlTQ4rQGyy4Qisn8Qso3Q=
+44LOKQGQaQvzbfVXtpKX%3DSRDSCCYD&_ei_=3D8312wfG0Xb9X%3DzgDBAB688qzgSRGqWUWCq=
+6BRYqA77GBUCzgCCzgTVGf6beX6990G11X%3DuHghthxupjHpLkiHgHQJhu=2E=22>Act now=
+=2E Early Bird pricing expires on January 13</a>=21 </p>=09
+=09
+=09
+</font></td>
+</tr>
+
+<td height=3D=22179=22>
+<font size=3D=221=22 face=3D=22arial,helvetica=22>
+<hr>
+</font>
+<table width=3D=22432=22 align=3D=22center=22>
+ <tr>
+ <td> </td>
+ <td width=3D=22250=22 rowspan=3D=224=22 style=3D=22padding-left:1em;=22=
+><a rilt=3D=22HTML5Cover=22 href=3D=22http://e=2Epearson=2Einfo/pub/cc?_ri_=
+=3DX0Gzc2X%3DUQpglLjHJlTQ4rQGyy4Qisn8Qso3Q44LOKQGQaQvzbfVXtpKX%3DSRDSCCAR&_=
+ei_=3D8312wfG0Xb9X%3DzgDBAB688qzgSRGqWUWCq6BRYqA77GBUCzgCCzgTVGf6beX6990G11=
+X%3DuHghthxupjHpLkiHgHQJhu=2E=22><img src=3D=22http://ptgmedia=2Epearsoncmg=
+=2Ecom/imprint_downloads/informit/images/video/PBMVideoBanner=2Egif=22 alt=
+=3D=22Video Tutorials=22 border=3D=220=22 style=3D=22border-width: 0px; bor=
+der-style: solid; border-color: =23ccc;=22 /></a></td>
+ </tr>
+ <tr>
+ <td width=3D=22170=22><font size=3D=222=22><img src=3D=22http://ptgmedi=
+a=2Epearsoncmg=2Ecom/imprint_downloads/informit/promotions/iPhoneApps/faceb=
+ook_32=2Epng=22 style=3D=22float:left; margin: -1px 5px 1px 1px;=22 alt=3D=
+=22Facebook=22 /><a style=3D=22color: =23f15a22;=22 rilt=3D=22Facebook=22 h=
+ref=3D=22http://e=2Epearson=2Einfo/pub/cc?_ri_=3DX0Gzc2X%3DUQpglLjHJlTQ4rQG=
+yy4Qisn8Qso3Q44LOKQGQaQvzbfVXtpKX%3DSRDSCCAS&_ei_=3D8312wfG0Xb9X%3DzgDBAB68=
+8qzgSRGqWUWCq6BRYqA77GBUCzgCCzgTVGf6beX6990G11X%3DuHghthxupjHpLkiHgHQJhu=2E=
+=22><font face=3D=22arial,helvetica=22><strong>Like us on Facebook</strong=
+></font></a></font></td>
+ </tr>
+ <tr>
+ <td><font size=3D=222=22><img src=3D=22http://ptgmedia=2Epearsoncmg=2Ec=
+om/imprint_downloads/informit/images/twitter_32=2Epng=22 style=3D=22float:l=
+eft; margin: -1px 5px 1px 1px;=22 alt=3D=22Twitter=22 /><a style=3D=22color=
+: =23f15a22;=22 rilt=3D=22Twitter=22 href=3D=22http://e=2Epearson=2Einfo/pu=
+b/cc?_ri_=3DX0Gzc2X%3DUQpglLjHJlTQ4rQGyy4Qisn8Qso3Q44LOKQGQaQvzbfVXtpKX%3DS=
+RDSCCAT&_ei_=3D8312wfG0Xb9X%3DzgDBAB688qzgSRGqWUWCq6BRYqA77GBUCzgCCzgTVGf6b=
+eX6990G11X%3DuHghthxupjHpLkiHgHQJhu=2E=22><font face=3D=22arial,helvetica=
+=22><strong>Talk to us on Twitter</strong></font></a></font></td>
+ </tr>
+ =20
+</table>
+<font size=3D=221=22 face=3D=22arial,helvetica=22><br />
+<p align=3D=22center=22>Pearson Education, 800 East 96th Street, Indianapol=
+is, IN 46240<br />
+ © All rights reserved=2E<br>
+ <a rilt=3D=22Unsubscribe=22 href=3D=22http://e=2Epearson=2Einfo/pub/cc?_r=
+i_=3DX0Gzc2X%3DUQpglLjHJlTQ4rQGyy4Qisn8Qso3Q44LOKQGQaQvzbfVXtpKX%3DSRDSCCAU=
+&_ei_=3D8312wfG0Xb9X%3DzgDBAB688qzgSRGqWUWCq6BRYqA77GBUCzgCCzgTVGf6beX6990G=
+11X%3DuHghthxupjHpLkiHgHQJhu=2E=22>Unsubscribe</a></p>
+</font></td>
+
+</tr></table><br>
+<br><img border=3D=220=22 width=3D=223=22 height=3D=223=22 src=3D=22http://=
+e=2Epearson=2Einfo/pub/as?_ri_=3DX0Gzc2X%3DUQpglLjHJlTQ4rQGyy4Qisn8Qso3Q44L=
+OKQGQaQvzbfVXHkMX%3Dw&_ei_=3D8312wfG0Xb9X%3DzgDBAB688qzgSRGqWUWCq6BRYqA77GB=
+UCzgCCzgTVGf6beX6990G11X%3DuHghthxupjHpLkiHgHQJhu=2E=22>
+
+
+</body>
+</html>
+
+
Added: james/hupa/trunk/server/bin/pom.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/bin/pom.xml?rev=1333089&view=auto
==============================================================================
--- james/hupa/trunk/server/bin/pom.xml (added)
+++ james/hupa/trunk/server/bin/pom.xml Wed May 2 16:05:26 2012
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.hupa</groupId>
+ <artifactId>hupa-parent</artifactId>
+ <version>0.0.2-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>hupa-server</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache James Hupa Server</name>
+ <description>Servercode implementation to access IMAP Mailbox</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.hupa</groupId>
+ <artifactId>hupa-mock</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hupa</groupId>
+ <artifactId>hupa-shared</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>aopalliance</groupId>
+ <artifactId>aopalliance</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>logkit</groupId>
+ <artifactId>logkit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>net.customware.gwt.dispatch
+ </groupId>
+ <artifactId>gwt-dispatch</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtupload</groupId>
+ <artifactId>gwtupload</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.guice</groupId>
+ <artifactId>guice</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.guice</groupId>
+ <artifactId>guice-assistedinject</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.guice</groupId>
+ <artifactId>guice-servlet</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <outputDirectory>war/WEB-INF/classes</outputDirectory>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webXml>src/main/webapp/WEB-INF/web.xml</webXml>
+ <webResources>
+ <resource>
+ <directory>war</directory>
+ <excludes>
+ <exclude>**/hupa/*</exclude>
+ </excludes>
+ </resource>
+ </webResources>
+ <warName>${project.name}</warName>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: james/hupa/trunk/server/bin/src/main/webapp/WEB-INF/conf/config.properties
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/bin/src/main/webapp/WEB-INF/conf/config.properties?rev=1333089&view=auto
==============================================================================
--- james/hupa/trunk/server/bin/src/main/webapp/WEB-INF/conf/config.properties (added)
+++ james/hupa/trunk/server/bin/src/main/webapp/WEB-INF/conf/config.properties Wed May 2 16:05:26 2012
@@ -0,0 +1,57 @@
+#############################################################################
+# 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.
+#############################################################################
+
+# The IP or domainname of the IMAP server
+IMAPServerAddress=imap.gmail.com
+# The port of the IMAP server
+IMAPServerPort=993
+# Set the connections amount which will get maximal opened per user for processing requests
+# Setting it higher can improve performance, but be sure that the IMAPServer will maybe have some limit
+IMAPConnectionPoolSize=4
+# Set the timeout for connections in milliseconds
+IMAPConnectionPoolTimeout=300000
+# Use SSL/TLS to connect to the IMAP server
+IMAPS=true
+# The Truststore when using self-signed certificates on the server
+# TrustStore=my-truststore
+# The Truststore's password
+# TrustStorePassword=changeit
+
+DefaultSentFolder=[Gmail]\Sent
+DefaultTrashFolder=[Gmail]\Trash
+DefaultDraftsFolder=[Gmail]\Drafts
+DefaultInboxFolder=INBOX
+
+# Number of Messages to post fetch
+PostFetchMessageCount=0
+
+# Log IMAP and SMTP dialog, Logger has to be in debug mode
+SessionDebug=true
+
+# The IP or domainname of the SMTP server
+SMTPServerAddress=smtp.gmail.com
+# The port of the SMTP server
+SMTPServerPort=465
+# Use AUTH for SMTP
+SMTPAuth=true
+# Use SSL/TLS to connect to the SMTP server
+SMTPS=true
+
+## Remove these lines to use Gmail IMAP AND SMTP
+# IMAPServerAddress=demo-mode
+# SMTPServerAddress=demo-mode
+
Added: james/hupa/trunk/server/bin/src/reporting-site/site.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/bin/src/reporting-site/site.xml?rev=1333089&view=auto
==============================================================================
--- james/hupa/trunk/server/bin/src/reporting-site/site.xml (added)
+++ james/hupa/trunk/server/bin/src/reporting-site/site.xml Wed May 2 16:05:26 2012
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<project name="${project.name}">
+ <body>
+ <menu ref="parent" />
+ <menu ref="reports" />
+ </body>
+</project>
Added: james/hupa/trunk/server/bin/src/site/site.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/bin/src/site/site.xml?rev=1333089&view=auto
==============================================================================
--- james/hupa/trunk/server/bin/src/site/site.xml (added)
+++ james/hupa/trunk/server/bin/src/site/site.xml Wed May 2 16:05:26 2012
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<project name="Hupa">
+ <body>
+ <!-- This is a "dummy" site because of this bug: -->
+ <!-- http://jira.codehaus.org/browse/MSITE-345 -->
+ <menu ref="parent" />
+ <menu ref="reports" />
+ </body>
+</project>
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/IMAPStoreCache.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/IMAPStoreCache.java?rev=1333089&r1=1333088&r2=1333089&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/IMAPStoreCache.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/IMAPStoreCache.java Wed May 2 16:05:26 2012
@@ -19,15 +19,20 @@
package org.apache.hupa.server;
-import com.sun.mail.imap.IMAPStore;
+import javax.mail.MessagingException;
+import javax.mail.NoSuchProviderException;
+import javax.mail.Session;
+import javax.mail.Transport;
import org.apache.hupa.shared.data.User;
-import javax.mail.MessagingException;
+import com.sun.mail.imap.IMAPStore;
public interface IMAPStoreCache {
public void delete(String username);
public void delete(User user);
public IMAPStore get(String username,String password) throws MessagingException;
public IMAPStore get(User user) throws MessagingException;
+ public Transport getMailTransport(boolean useSSL) throws NoSuchProviderException;
+ public Session getMailSession();
}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java?rev=1333089&r1=1333088&r2=1333089&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java Wed May 2 16:05:26 2012
@@ -26,10 +26,9 @@ import java.util.Properties;
import javax.mail.MessagingException;
import javax.mail.NoSuchProviderException;
import javax.mail.Session;
+import javax.mail.Transport;
import org.apache.commons.logging.Log;
-import org.apache.hupa.server.mock.MockIMAPStore;
-import org.apache.hupa.server.mock.MockSMTPTransport;
import org.apache.hupa.shared.data.User;
import com.google.inject.Inject;
@@ -38,9 +37,9 @@ import com.google.inject.name.Named;
import com.sun.mail.imap.IMAPStore;
@Singleton
-public class InMemoryIMAPStoreCache implements IMAPStoreCache{
+public class InMemoryIMAPStoreCache implements IMAPStoreCache {
- private Session session;
+ protected Session session;
protected Log logger;
private final Map<String, CachedIMAPStore> pool = new HashMap<String ,CachedIMAPStore>();
private String address;
@@ -48,8 +47,16 @@ public class InMemoryIMAPStoreCache impl
private boolean useSSL = false;
@Inject
- public InMemoryIMAPStoreCache(Log logger, @Named("IMAPServerAddress") String address, @Named("IMAPServerPort") int port, @Named("IMAPS") boolean useSSL, @Named("IMAPConnectionPoolSize") int connectionPoolSize, @Named("IMAPConnectionPoolTimeout") int timeout, @Named("SessionDebug") boolean debug,
- @Named("TrustStore") String truststore, @Named("TrustStorePassword") String truststorePassword, Session session) {
+ public InMemoryIMAPStoreCache(Log logger,
+ @Named("IMAPServerAddress") String address,
+ @Named("IMAPServerPort") int port,
+ @Named("IMAPS") boolean useSSL,
+ @Named("IMAPConnectionPoolSize") int connectionPoolSize,
+ @Named("IMAPConnectionPoolTimeout") int timeout,
+ @Named("SessionDebug") boolean debug,
+ @Named("TrustStore") String truststore,
+ @Named("TrustStorePassword") String truststorePassword,
+ Session session) {
this.logger = logger;
this.address = address;
this.port = port;
@@ -75,7 +82,6 @@ public class InMemoryIMAPStoreCache impl
} else {
props.setProperty("mail.imap.connectionpoolsize", connectionPoolSize + "");
props.setProperty("mail.imap.connectionpooltimeout", timeout + "");
-
}
System.setProperty("mail.mime.decodetext.strict", "false");
@@ -129,16 +135,8 @@ public class InMemoryIMAPStoreCache impl
return cstore.getStore();
}
- private CachedIMAPStore createCachedIMAPStore() throws NoSuchProviderException {
- CachedIMAPStore cstore;
- if (MockSMTPTransport.MOCK_HOST.equals(this.address)) {
- cstore = new CachedIMAPStore(new MockIMAPStore(session), 300);
- } else if (useSSL) {
- cstore = new CachedIMAPStore((IMAPStore)session.getStore("imaps"),300);
- } else {
- cstore = new CachedIMAPStore((IMAPStore)session.getStore("imap"),300);
- }
- return cstore;
+ public CachedIMAPStore createCachedIMAPStore() throws NoSuchProviderException {
+ return new CachedIMAPStore((IMAPStore)session.getStore(useSSL ? "imaps" : "imap"),300);
}
/*
@@ -164,6 +162,13 @@ public class InMemoryIMAPStoreCache impl
}
pool.remove(username);
}
-
+
+ public Transport getMailTransport(boolean useSSL) throws NoSuchProviderException {
+ return session.getTransport(useSSL ? "smtps" : "smtp");
+ }
+
+ public Session getMailSession() {
+ return session;
+ }
}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServerModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServerModule.java?rev=1333089&r1=1333088&r2=1333089&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServerModule.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServerModule.java Wed May 2 16:05:26 2012
@@ -19,11 +19,6 @@
package org.apache.hupa.server.guice;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
import java.util.Properties;
import javax.mail.Session;
@@ -33,6 +28,9 @@ import net.customware.gwt.dispatch.serve
import org.apache.commons.logging.Log;
import org.apache.hupa.server.IMAPStoreCache;
import org.apache.hupa.server.InMemoryIMAPStoreCache;
+import org.apache.hupa.server.guice.providers.DefaultUserSettingsProvider;
+import org.apache.hupa.server.guice.providers.JavaMailSessionProvider;
+import org.apache.hupa.server.guice.providers.LogProvider;
import org.apache.hupa.server.handler.CheckSessionHandler;
import org.apache.hupa.server.handler.ContactsHandler;
import org.apache.hupa.server.handler.CreateFolderHandler;
@@ -58,7 +56,6 @@ import org.apache.hupa.server.preference
import org.apache.hupa.server.servlet.DownloadAttachmentServlet;
import org.apache.hupa.server.servlet.MessageSourceServlet;
import org.apache.hupa.server.servlet.UploadAttachmentServlet;
-import org.apache.hupa.server.utils.ConfigurationProperties;
import org.apache.hupa.shared.data.Settings;
import org.apache.hupa.shared.rpc.CheckSession;
import org.apache.hupa.shared.rpc.Contacts;
@@ -91,27 +88,19 @@ import com.google.inject.name.Names;
*/
public class GuiceServerModule extends ActionHandlerModule {
- public static final String SYS_PROP_CONFIG_FILE = "hupa.config.file";
-
- public static final String CONFIG_FILE_NAME = "config.properties";
- public static final String[] CONFIG_PROPERTIES = {
- System.getenv("HOME") + "/.hupa/" + CONFIG_FILE_NAME,
- "/etc/default/hupa"
- };
- public static final String CONF_DIR = "WEB-INF/conf/";
-
- private String configDir;
+ Properties properties;
+ public GuiceServerModule(Properties properties) {
+ this.properties = properties;
+ }
- public GuiceServerModule(String rootPath) {
- configDir = rootPath + "/" + CONF_DIR;
+ protected Class<? extends IMAPStoreCache> getIMAPStoreCacheClass() {
+ return InMemoryIMAPStoreCache.class;
}
@Override
protected void configureHandlers() {
- Properties properties;
try {
// Bind addresses and ports for imap and smtp
- properties = loadProperties();
Names.bindProperties(binder(), properties);
} catch (Exception e) {
throw new RuntimeException("Unable to to configure hupa server," +
@@ -140,8 +129,9 @@ public class GuiceServerModule extends A
bindHandler(TagMessage.class, TagMessagesHandler.class);
bindHandler(SetFlag.class, SetFlagsHandler.class);
bindHandler(Contacts.class, ContactsHandler.class);
- bind(IMAPStoreCache.class).to(InMemoryIMAPStoreCache.class).in(
- Singleton.class);
+
+ bind(IMAPStoreCache.class).to(getIMAPStoreCacheClass()).in(Singleton.class);
+
bind(Log.class).toProvider(LogProvider.class).in(Singleton.class);
bind(Settings.class).toProvider(DefaultUserSettingsProvider.class).in(
Singleton.class);
@@ -152,96 +142,4 @@ public class GuiceServerModule extends A
bind(UserPreferencesStorage.class).to(InImapUserPreferencesStorage.class);
bind(Properties.class).toInstance(properties);
}
-
- protected Properties loadProperties() throws Exception {
- Properties properties = null;
-
- String fileName = System.getProperty(SYS_PROP_CONFIG_FILE);
- if (fileName != null) {
- properties = loadProperties(fileName);
- }
-
- if (properties == null) {
- for (String name : CONFIG_PROPERTIES) {
- properties = loadProperties(name);
- if (properties != null)
- break;
- }
- }
-
- if (properties == null) {
- properties = loadProperties(configDir + CONFIG_FILE_NAME);
- }
-
- // Validate for mandatory and complete properties with default values
- return validateProperties(properties);
- }
-
- protected Properties validateProperties(Properties properties) {
- List<String> errors = new ArrayList<String>();
-
- // Test for mandatory and complete properties with default values when
- // missing
- for (ConfigurationProperties confProps : ConfigurationProperties
- .values()) {
- if (confProps.isMandatory()) {
- if (properties.get(confProps.getProperty()) == null) {
- errors.add("The mandatory Property '"
- + confProps.getProperty() + "' is not set.");
- }
- } else if (properties.get(confProps.getProperty()) == null) {
- properties.setProperty(confProps.getProperty(),
- confProps.getPropValue());
- }
- }
-
- // Test for unknown properties set in configuration
- for (Object key : properties.keySet()) {
- if (ConfigurationProperties.lookup((String) key) == null) {
- errors.add("The Property '" + key
- + "' has no configuration impacts, it's unknown");
- }
- }
- if (!errors.isEmpty()) {
- throw new IllegalArgumentException(errors.toString());
- }
-
- return properties;
- }
-
- protected Properties loadProperties(String name) {
-
- if (name == null)
- return null;
-
- Properties properties = null;
- File file = new File(name);
-
- // check if the file is absolute. If not prefix it with the default config dir
- if (file.isAbsolute() == false) {
- file = new File(configDir + File.separator + file.getName());
- }
- if (file.exists()) {
- FileInputStream fis = null;
- try {
- properties = new Properties();
- fis = new FileInputStream(file);
- properties.load(fis);
- } catch (Exception e) {
- properties = null;
- e.printStackTrace();
- } finally {
- if (fis != null) {
- try {
- fis.close();
- } catch (IOException e) {
- // Empty on purpose
- }
- }
- }
- }
-
- return properties;
- }
-
}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServletConfig.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServletConfig.java?rev=1333089&r1=1333088&r2=1333089&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServletConfig.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServletConfig.java Wed May 2 16:05:26 2012
@@ -20,9 +20,18 @@
package org.apache.hupa.server.guice;
-import javax.servlet.ServletContext;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
import javax.servlet.ServletContextEvent;
+import net.customware.gwt.dispatch.server.guice.ActionHandlerModule;
+
+import org.apache.commons.logging.Log;
+import org.apache.hupa.server.guice.demo.DemoGuiceServerModule;
+import org.apache.hupa.server.utils.ConfigurationProperties;
+
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
@@ -30,27 +39,84 @@ import com.google.inject.servlet.GuiceSe
/**
* Simple GuiceServletContextListener which just create the injector
*
- * @author norman
- *
*/
public class GuiceServletConfig extends GuiceServletContextListener{
- private ServletContext context;
- @Override
- public void contextDestroyed(ServletContextEvent servletContextEvent) {
- context = null;
- super.contextDestroyed(servletContextEvent);
- }
-
+ public static final String SYS_PROP_CONFIG_FILE = "hupa.config.file";
+ public static final String CONFIG_FILE_NAME = "config.properties";
+ public static final String CONFIG_DIR_IN_WAR = "WEB-INF/conf/";
+
+ private String servletContextRealPath = "";
+
+ private Properties demoProperties = null;
+ private String demoHostName = null;
+
@Override
public void contextInitialized(ServletContextEvent servletContextEvent) {
- context = servletContextEvent.getServletContext();
+ servletContextRealPath = servletContextEvent.getServletContext().getRealPath("/");
+
+ // We get the mock classes using reflection, so as we can package Hupa without mock stuff.
+ try {
+ Class<?> mockConstants = Class.forName("org.apache.hupa.server.mock.MockConstants");
+ demoProperties = (Properties)mockConstants.getField("mockProperties").get(null);
+ demoHostName = demoProperties.getProperty("IMAPServerAddress");
+ } catch (Exception noDemoAvailable) {
+ }
+
super.contextInitialized(servletContextEvent);
}
-
+
@Override
protected Injector getInjector() {
- return Guice.createInjector(new GuiceServerModule(context.getRealPath("/")),new DispatchServletModule());
- }
+ Properties prop = loadProperties();
+ ConfigurationProperties.validateProperties(prop);
+
+ boolean demo = prop.getProperty("IMAPServerAddress").equals(demoHostName);
+ ActionHandlerModule module = demo ? new DemoGuiceServerModule(prop) : new GuiceServerModule(prop);
+ Injector injector = Guice.createInjector(module, new DispatchServletModule());
+
+ String msg = ">> Started HUPA ";
+ if (demo) {
+ msg += "in DEMO-MODE";
+ } else {
+ msg += "with configuration -> " + prop;
+ }
+ injector.getInstance(Log.class).info(msg);
+
+ return injector;
+ }
+
+ /**
+ * Loads the first available configuration file.
+ *
+ * The preference order for the file is:
+ * 1.- file specified in a system property (-Dhupa.config.file=full_path_to_file)
+ * 2.- file in the user's home: $HOME/.hupa/config.properties
+ * 3.- global configuration in the os: /etc/default/hupa
+ * 4.- file provided in the .war distribution: "WEB-INF/conf/config.properties
+ * 5.- mock properties file which makes the Hupa work in demo mode.
+ *
+ * If the system property "mock-host" has been defined, and Hupa has been packaged
+ * with the mock stuff, we always return the demo-mode configuration.
+ *
+ */
+ public Properties loadProperties() {
+ Properties properties = null;
+ if (demoHostName == null || System.getProperty(demoHostName) == null) {
+ List<String> configurationList = new ArrayList<String>();
+ configurationList.add(System.getProperty(SYS_PROP_CONFIG_FILE));
+ configurationList.add(System.getProperty(System.getenv("HOME") + "/.hupa/" + CONFIG_FILE_NAME));
+ configurationList.add("/etc/default/hupa");
+ configurationList.add(servletContextRealPath + "/" + CONFIG_DIR_IN_WAR + CONFIG_FILE_NAME);
+
+ for (String name : configurationList) {
+ properties = ConfigurationProperties.loadProperties(name);
+ if (properties != null) {
+ break;
+ }
+ }
+ }
+ return properties == null ? demoProperties : properties;
+ }
}
Added: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/demo/DemoGuiceServerModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/demo/DemoGuiceServerModule.java?rev=1333089&view=auto
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/demo/DemoGuiceServerModule.java (added)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/demo/DemoGuiceServerModule.java Wed May 2 16:05:26 2012
@@ -0,0 +1,106 @@
+/****************************************************************
+ * 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. *
+ ****************************************************************/
+
+package org.apache.hupa.server.guice.demo;
+
+import java.lang.reflect.Constructor;
+import java.util.Properties;
+
+import javax.mail.NoSuchProviderException;
+import javax.mail.Session;
+import javax.mail.Transport;
+
+import org.apache.commons.logging.Log;
+import org.apache.hupa.server.CachedIMAPStore;
+import org.apache.hupa.server.IMAPStoreCache;
+import org.apache.hupa.server.InMemoryIMAPStoreCache;
+import org.apache.hupa.server.guice.GuiceServerModule;
+
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+import com.sun.mail.imap.IMAPStore;
+
+/**
+ * Module which binds the handlers and configurations for demo mode
+ */
+public class DemoGuiceServerModule extends GuiceServerModule {
+
+ public DemoGuiceServerModule(Properties properties) {
+ super(properties);
+ }
+
+ protected Class<? extends IMAPStoreCache> getIMAPStoreCacheClass() {
+ return DemoIMAPStoreCache.class;
+ }
+
+ /**
+ * IMAPStoreCache implementation for Demo mode.
+ *
+ * It uses mock module which emulates fake imap and smtp servers based on
+ * a set of example messages in filesystem and used for unit tests.
+ *
+ * We use here reflection so as we can deliver Hupa without mock stuff.
+ *
+ */
+ public static class DemoIMAPStoreCache extends InMemoryIMAPStoreCache {
+ @Inject
+ public DemoIMAPStoreCache(Log logger,
+ @Named("IMAPServerAddress") String address,
+ @Named("IMAPServerPort") int port,
+ @Named("IMAPS") boolean useSSL,
+ @Named("IMAPConnectionPoolSize") int connectionPoolSize,
+ @Named("IMAPConnectionPoolTimeout") int timeout,
+ @Named("SessionDebug") boolean debug,
+ @Named("TrustStore") String truststore,
+ @Named("TrustStorePassword") String truststorePassword,
+ Session session) {
+ super(logger, address, port, useSSL, connectionPoolSize, timeout,
+ debug, truststore, truststorePassword, session);
+ }
+
+ @Override
+ public CachedIMAPStore createCachedIMAPStore()
+ throws NoSuchProviderException {
+ try {
+ Class<?> clz =
+ Class.forName("org.apache.hupa.server.mock.MockIMAPStore");
+ Constructor<?> cons = clz.getConstructors()[0];
+ IMAPStore store = (IMAPStore) cons
+ .newInstance(new Object[] { session });
+ return new CachedIMAPStore(store, 300);
+ } catch (Exception e) {
+ }
+ return super.createCachedIMAPStore();
+ }
+
+ @Override
+ public Transport getMailTransport(boolean useSSL)
+ throws NoSuchProviderException {
+ try {
+ Class<?> clz =
+ Class.forName("org.apache.hupa.server.mock.MockSMTPTransport");
+ Constructor<?> cons = clz.getConstructors()[0];
+ return (Transport) cons.newInstance(new Object[] { session });
+ } catch (Exception e) {
+ }
+ return super.getMailTransport(useSSL);
+ }
+ }
+
+}
Added: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/providers/DefaultUserSettingsProvider.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/providers/DefaultUserSettingsProvider.java?rev=1333089&view=auto
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/providers/DefaultUserSettingsProvider.java (added)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/providers/DefaultUserSettingsProvider.java Wed May 2 16:05:26 2012
@@ -0,0 +1,58 @@
+/****************************************************************
+ * 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. *
+ ****************************************************************/
+
+package org.apache.hupa.server.guice.providers;
+
+import org.apache.hupa.shared.data.Settings;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.google.inject.name.Named;
+
+public class DefaultUserSettingsProvider implements Provider<Settings> {
+ private String inboxFolder;
+ private String sentFolder;
+ private String trashFolder;
+ private String draftFolder;
+ private int postCount;
+
+ @Inject
+ public DefaultUserSettingsProvider(@Named("DefaultInboxFolder") String inboxFolder, @Named("DefaultSentFolder") String sentFolder, @Named("DefaultTrashFolder") String trashFolder, @Named("DefaultDraftsFolder") String draftFolder, @Named("PostFetchMessageCount") int postCount) {
+ this.inboxFolder = inboxFolder;
+ this.sentFolder = sentFolder;
+ this.trashFolder = trashFolder;
+ this.draftFolder = draftFolder;
+ this.postCount = postCount;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.google.inject.Provider#get()
+ */
+ public Settings get() {
+ Settings settings = new Settings();
+ settings.setInboxFolderName(inboxFolder);
+ settings.setSentFolderName(sentFolder);
+ settings.setTrashFolderName(trashFolder);
+ settings.setDraftsFolderName(draftFolder);
+ settings.setPostFetchMessageCount(postCount);
+ return settings;
+ }
+
+}
Added: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/providers/JavaMailSessionProvider.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/providers/JavaMailSessionProvider.java?rev=1333089&view=auto
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/providers/JavaMailSessionProvider.java (added)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/providers/JavaMailSessionProvider.java Wed May 2 16:05:26 2012
@@ -0,0 +1,34 @@
+/****************************************************************
+ * 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. *
+ ****************************************************************/
+
+package org.apache.hupa.server.guice.providers;
+
+import java.util.Properties;
+
+import javax.mail.Session;
+
+import com.google.inject.Provider;
+
+public class JavaMailSessionProvider implements Provider<Session>{
+
+ public Session get() {
+ Session session = Session.getDefaultInstance(new Properties(), null);
+ return session;
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org