Hi, I did a little more work on the design and fixed some mistakes. Attached is an updated design.
awaiting comments ... -- anagha --- Danny Angus <[EMAIL PROTECTED]> wrote: > Hi, > > I'm pleased to say, as I'm sure you've all realised, > that we have two > students who's proposals have been accepted by > Google. > > I would like to commend *all* of our several SoC > applicants for the quality > of their proposals, I'm only sorry that we couldn't > have had more accepted. > > Anne Srivnas' proposal for a web based Admin Console > for James, and Anagha > Mudigonda's proposal for FastFail are being funded. > Each of the students has now posted a message about > their proposal to this > list. > > Although other projects than James may have made > different provision for > their students I am proposing that James treats ours > as any other > contributor, and hopefully their good work and > dedication will result in > their proposal and election as commiters as per the > meritocracy we > practise. > > Obviously the two funded students should be much > more productive than the > wage slaves amongst us, and so I would ask everyone > to extend a bit of good > will and a little extra effort to help them use > their time productively so > that this can be a sucess for all of us. > > > > d. > > > > *************************************************************************** > The information in this e-mail is confidential and > for use by the addressee(s) only. If you are not the > intended recipient (or responsible for delivery of > the message to the intended recipient) please notify > us immediately on 0141 306 2050 and delete the > message from your computer. You may not copy or > forward it or use or disclose its contents to any > other person. As Internet communications are capable > of data corruption Student Loans Company Limited > does not accept any responsibility for changes made > to this message after it was sent. For this reason > it may be inappropriate to rely on advice or > opinions contained in an e-mail without obtaining > written confirmation of it. Neither Student Loans > Company Limited or the sender accepts any liability > or responsibility for viruses as it is your > responsibility to scan attachments (if any). > Opinions and views expressed in this e-mail are > those of the sender and may not reflect the opinions > and views of The Student Loans Company Limit > ed. > > This footnote also confirms that this email message > has been swept for the presence of computer viruses. > > ************************************************************************** > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Asatoma Satgamaya (Lead me From falsehood to truth) Tamasoma Jyotirgamaya (From darkness to light) Mryutorma Amrutangamaya (From death to immortality) __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Introduction:The redesign of the SMTP protocol handler has the following design goals - to enable in-protocol handling - to have enough flexibility to implement SMTP protocol extensions without changing protocol handling code. The new framework is designed to address these. The framework contains the following classes - CommandHandler - ConnectionHandler - SMTPSession - SMTPProtocolHandler - SMTPOutputStream - SMTPInputStream - an XML configuration file. The main change: - Introduction of SMTPSession as a new interface. - Things are more CommandHandler centric. The command handler has access to the SMTPSession. So, the command handler now has freedom to close a message or even close a session. But the SMTPSession interface is implemented in the james core code. Class ConnectionHandler ----------------------- 1. Registers to handle a connection 2. Registers to handle a message interface ConnectionHandler { void init(String configStr); void processConnection(String local_hostname, int local_port, String remote_hostname, int remote_port); void setSMTPSession(SMTPSession session); void processMessage(Mail Obj); } Class CommandHandler -------------------- A Commandhandler class 1. Registers to handle a command ( may process or validate the command arguments) 2. Registers to handle a message (validate message or modify message header or body)(this is needed for situations like SPF failure, where the headers are updated if SPF fails.) interface CommandHandler { void init(String configStr); void processCommand(String cmdString); void setSMTPSession(SMTPSession session); void processMessage(Mail Obj); } Description: There can be more than one command handler registered for a command. CommandHandlers can be registered to validate commands or modify message. CommandHandler's *process* methods can trigger events like message start , message end and message abort and session end, session abort. Class SMTPSession ----------------- The SMTP protocol session maintains the state information and ensures that the commands are executed in proper order. Also it provides controlled access to I/O streams. The SMTP session can be in one of the 4 states: 1. SESSION_START ( as soon as the client connects to server) 2. SESSION_END ( as soon as the client Sends QUIT command or closes connection) 3. MESSAGE_START ( as soon as the client issues MAIL FROM command) 4. MESSAGE_END ( as soon as the client sends message after DATA command) These states are more like triggers. For instance, all the message handlers get triggered on MESSAGE_END. interface SMTPSession { //Write Response void WriteResponse(String respString); //Register connection handlers void registerConnectionHandler(ConnectionHandler connHandler); //Register connectionhandlers to handle Message void registerMessageHandler(ConnectionHandler connHandler); //Register commandhandlers to command void registerCommandHandler(String cmdPrefix, CommandHandler cmdHandler); //Register commandhandlers to handle Message void registerMessageHandler(CommandHandler cmdHandler); //Command sequence handling void addCommandSequenceMap(string command, String[] predecessorCmds, string failMessage); // bool isCommandAllowed(String cmdString); //State information String getSender(); String[] getRecepients(); String setSender(String sender); String addRecepient(String recepient); String addRecepient(String[] recepients); String removeRecepient(String[] recepient); String removeRecepient(String recepient); //Message state modifier void startMessage(); void endMessage(); void abortMessage(); //Message state modifier void endSession(); void startSession(); void abortSession(); int getState(); //SESSION_START, SESSION_END, MESSAGE_BEGIN, MESSAGE_END void reset(); SMTPInputStream getInputStream(); // object with no permission to close stream SMTPOutputStream getOutputStream(); // Output stream object with no permission to close stream } SMTPSession is per connection and is accessible to all commandhandlers. If a command handler needs to modify the message, it registers with SMTPSession object. And SMTPsession object registers after the message is received passes the message to all the registered commandhandlers for processing. class SMTPProtocolHandler ------------------------- class SMTPProtocolHandler implements SMTPSession { //load all handlers and configure these //configure the command sequence //wait for SMTP connection //Create session state object //check if the command is allowed else respond with the failure message //then loop thru the command handlers registered with the command and process the command //When Message end is triggered, call all the handlers registered for the message } XML Configuration ----------------- <smtpserver enabled="true"> <!-- port 25 is the well-known/IANA registered port for SMTP --> <port>25</port> <!-- NEW CONFIGURATION --> <Protocolhandler class="org.apache.james.SMTPHandler"> <Session class=org.apache.james.SMTPSession> <command name="MAIL" commandSequence="HELO,EHLO"/> <command name="RCPT" commandSequence="RCPT"/> <event sessionStartCommand=""/> <event sessionEndCommand="QUIT"/> <event MessageBeginCommand="MAIL"/> <event MessageEndCommand="DATA"/> </Session> <!-- registers with Protocol handler to handle "MAIL" command --> <CommandHandler class="org.apache.james.MAILCommandHandler"> config.. </CommandHandler> <!-- registers with protocol handler to handle "MAIL" command also registers with protocol handler to handle Message (SPFhandler adds a SPF details into Message header) --> <CommandHandler name="SPFHandler"> config... </CommandHandler> <CommandHandler name="org.apache.james.RCPTCommandHandler"> config </CommandHandler> <CommandHandler name="RecepientValidator"> config </CommandHandler> </protocolhandler> </smtpserver> Since the classes are loaded based on XML configuration, the default handlers can be replaced by custom handlers whenever needed. Ease of use of the framework ------------------------------ 1. New commands can be added (for eg: STARTTLS) Add new command handlers and modifiying the config to include new command sequence. 2. New Validations (SPF validation) Add a new command handler.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]