My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package org.joe_e.servlet.mail.notjoe_e;

import java.io.File;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import javax.servlet.http.HttpSession;

import org.joe_e.servlet.Dispatcher;
import org.joe_e.servlet.SessionInitializer;
import org.joe_e.servlet.mail.AccountManager;
import org.joe_e.servlet.mail.AuthenticationAgent;

public class SessionInit implements SessionInitializer {

private final String accountsFile = "/home/akshayk/accounts/";
private final String mailboxes = "/var/mail/vhosts/boink.joe-e.org/";

public void fillHttpSession(HttpSession session) {
try {
Dispatcher.logMsg("Initializing session with AuthenticationAgent and AccountManager");
session.setAttribute("auth", new AuthenticationAgent(MessageDigest.getInstance("sha"), new File(accountsFile), new File(mailboxes), new TransportAgent()));
session.setAttribute("manager", new AccountManager(MessageDigest.getInstance("sha"), new File(accountsFile), new PostfixClient()));
} catch (NoSuchAlgorithmException e) {
Dispatcher.logMsg("NoSuchAlgorithmException when instantiating AuthAgent and AccountManager");
}
}

}

Change log

r365 by krish.akshay on Jan 29, 2010   Diff
small bug fixes, also made AuthAgent
return (mailbox, transportAgent) pair so
that you must be authenticated to send a
message
Go to: 
Project members, sign in to write a code review

Older revisions

r361 by krish.akshay on Jan 29, 2010   Diff
preventing log-injection attacks by
sanitizing strings being written to
the logger
r326 by krish.akshay on Nov 2, 2009   Diff
lots of changes at the last minute,
they are not well done... namely
running Caja on all inputs, made a
capability to send mail, to verify
that only compose can do that
r322 by krish.akshay on Oct 28, 2009   Diff
a  bunch of changes from boink that
are needed to deploy the app on boink
All revisions of this file

File info

Size: 1155 bytes, 29 lines
Powered by Google Project Hosting