jSyncManager Simple Java Server

org.jSyncManager.SJS.Adapters.SMTPServer
Class SMTPServer

java.lang.Object
  extended by java.lang.Thread
      extended by org.jSyncManager.SJS.API.AbstractAdapter
          extended by org.jSyncManager.SJS.API.AbstractRequestResponseAdapter
              extended by org.jSyncManager.SJS.Adapters.SMTPServer.AbstractSMTPServer
                  extended by org.jSyncManager.SJS.Adapters.SMTPServer.SMTPServer
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
MailDeliveryTest

public class SMTPServer
extends AbstractSMTPServer

This class extends the AbstractSMTPServer class by providing methods to handle incoming message data

Author:
Torben Werner

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jSyncManager.SJS.Adapters.SMTPServer.AbstractSMTPServer
AbstractSMTPServer.CommandData, AbstractSMTPServer.CommandEhlo, AbstractSMTPServer.CommandExpn, AbstractSMTPServer.CommandHelo, AbstractSMTPServer.CommandHelp, AbstractSMTPServer.CommandMail, AbstractSMTPServer.CommandNoop, AbstractSMTPServer.CommandQuit, AbstractSMTPServer.CommandRcpt, AbstractSMTPServer.CommandRset, AbstractSMTPServer.CommandVrfy, AbstractSMTPServer.SmtpCommand, AbstractSMTPServer.State
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.lang.String domain
          Stores the name that the user has identified themselves as in HELO
protected  SMTPServer server
          Stores a self reference, for use by the commands if they need to access server methods
 
Fields inherited from class org.jSyncManager.SJS.Adapters.SMTPServer.AbstractSMTPServer
atDomainRegex, commands, currentMask, domainRegex, INVALID_ADDR_SYNTAX, INVALID_SEQUENCE, INVALID_SYNTAX, mailAddrExpr, PARAM_NOT_IMPLEMENTED, rcptAddrExpr, relayPattern, state, validEmailChars
 
Fields inherited from class org.jSyncManager.SJS.API.AbstractAdapter
props
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SMTPServer()
          Constructor, initializes config values, sets up mailbox
 
Method Summary
protected  java.lang.String getAddress(java.lang.String address)
          Detects source routes,and strips them off to return just the address Source routes are of the form &064;one,&064;two:joe@three.com Will also return qouted strings directly without param checking
 java.lang.String[] getDomains()
          Gets a list of domains.
 java.io.File getMboxForUser(java.lang.String username)
          Gets a user's mbox file object.
 java.lang.String[] getUsers()
          Gets a list of users.
 void init()
          Load configuration values, setup mailbox
protected  java.lang.String processData()
          General summary
protected  java.lang.String processEhlo(java.lang.String args)
          General summary
protected  java.lang.String processExpn(java.lang.String args)
          General summary
protected  java.lang.String processHelo(java.lang.String args)
          General summary
protected  java.lang.String processHelp(java.lang.String args)
          General summary
protected  java.lang.String processMail(java.lang.String args)
          General summary
protected  java.lang.String processMessageFinished()
          General summary
protected  void processMessagePart(java.lang.String args)
          General summary
protected  java.lang.String processNoop()
          General summary
protected  java.lang.String processQuit()
          General summary
protected  java.lang.String processRcpt(java.util.List<java.lang.String> relays, java.lang.String addr)
          Checking recipent's email address
protected  java.lang.String processRset()
          General summary
protected  java.lang.String processVrfy(java.lang.String args)
          General summary
 
Methods inherited from class org.jSyncManager.SJS.Adapters.SMTPServer.AbstractSMTPServer
getCommands, getConnectionHeaderString, getCurrentMask, getMailAddrExpr, getRcptAddrExpr, getStateLong, initCommands, processRequest
 
Methods inherited from class org.jSyncManager.SJS.API.AbstractRequestResponseAdapter
disconnect, getTimeoutMessage, processConnection
 
Methods inherited from class org.jSyncManager.SJS.API.AbstractAdapter
connectionPermitted, getConnectionManagerInterface, getInetAddress, getLogManager, getProperty, processConnection, run, setLogManager, setThreadGroup
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

server

protected SMTPServer server
Stores a self reference, for use by the commands if they need to access server methods


domain

protected java.lang.String domain
Stores the name that the user has identified themselves as in HELO

Constructor Detail

SMTPServer

public SMTPServer()
Constructor, initializes config values, sets up mailbox

Method Detail

init

public void init()
Load configuration values, setup mailbox


processData

protected java.lang.String processData()
General summary

Specified by:
processData in class AbstractSMTPServer
Returns:
returned

processEhlo

protected java.lang.String processEhlo(java.lang.String args)
                                throws java.lang.Exception
General summary

Specified by:
processEhlo in class AbstractSMTPServer
Parameters:
args - parameter value
Returns:
returned
Throws:
java.lang.Exception - exception

processExpn

protected java.lang.String processExpn(java.lang.String args)
General summary

Specified by:
processExpn in class AbstractSMTPServer
Parameters:
args - parameter value
Returns:
returned

processHelo

protected java.lang.String processHelo(java.lang.String args)
                                throws java.lang.Exception
General summary

Specified by:
processHelo in class AbstractSMTPServer
Parameters:
args - parameter value
Returns:
returned
Throws:
java.lang.Exception - exception

processHelp

protected java.lang.String processHelp(java.lang.String args)
General summary

Specified by:
processHelp in class AbstractSMTPServer
Parameters:
args - parameter value
Returns:
returned

processMail

protected java.lang.String processMail(java.lang.String args)
General summary

Specified by:
processMail in class AbstractSMTPServer
Parameters:
args - parameter value
Returns:
returned

processMessageFinished

protected java.lang.String processMessageFinished()
General summary

Specified by:
processMessageFinished in class AbstractSMTPServer
Returns:
returned

processMessagePart

protected void processMessagePart(java.lang.String args)
General summary

Specified by:
processMessagePart in class AbstractSMTPServer
Parameters:
args - parameter value

processNoop

protected java.lang.String processNoop()
General summary

Specified by:
processNoop in class AbstractSMTPServer
Returns:
returned

processQuit

protected java.lang.String processQuit()
                                throws java.lang.Exception
General summary

Specified by:
processQuit in class AbstractSMTPServer
Returns:
returned
Throws:
java.lang.Exception - exception

processRcpt

protected java.lang.String processRcpt(java.util.List<java.lang.String> relays,
                                       java.lang.String addr)
Checking recipent's email address

Specified by:
processRcpt in class AbstractSMTPServer
Parameters:
relays - parameter value
addr - parameter value
Returns:
the correct message or the error message

processRset

protected java.lang.String processRset()
General summary

Specified by:
processRset in class AbstractSMTPServer
Returns:
returned

processVrfy

protected java.lang.String processVrfy(java.lang.String args)
General summary

Specified by:
processVrfy in class AbstractSMTPServer
Parameters:
args - parameter value
Returns:
returned

getAddress

protected java.lang.String getAddress(java.lang.String address)
Detects source routes,and strips them off to return just the address Source routes are of the form &064;one,&064;two:joe@three.com Will also return qouted strings directly without param checking

Parameters:
address - address that may contain a source route, of the form "address>" (<address> with the first < taken off)
Returns:
the address that no longer contains a source route, null if the address is invalid

getMboxForUser

public java.io.File getMboxForUser(java.lang.String username)
Gets a user's mbox file object.

Parameters:
username - parameter value
Returns:
file object if user exists or null otherwise

getUsers

public java.lang.String[] getUsers()
Gets a list of users.

Returns:
string array of usernames

getDomains

public java.lang.String[] getDomains()
Gets a list of domains.

Returns:
string array of domains

jSyncManager Simple Java Server

Copyright (c) 2004 Brad BARCLAY. All Rights Reserved.