|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.props.Props
com.cometway.ak.Agent
com.cometway.email.ReceiveEmailAgent
public class ReceiveEmailAgent
This agent receives SMTP messages on a server socket (port 25 by default) and forwards them to RequestAgents registered to the Service Manager using the recipients email address (ie: name@domain) or email account name only (ie: name). On UNIX operating systems, root access is required to serve on port 25. You will also need to kill sendmail or any other SMTP servers that may already be using port 25. It may also be necessary to add a MX DNS entry for your server in order to allow SMTP messages to be routed properly to your server (read "DNS & BIND" from O'Reilly publishing more a good reference on DNS).
| Field Summary | |
|---|---|
protected java.util.Vector |
receivers
|
protected java.lang.Object |
waitSync
|
| Fields inherited from class com.cometway.ak.Agent |
|---|
agent_id, agentController, CREATING_STATE, debugReporter, DESTROYED_STATE, DESTROYING_STATE, errorReporter, FAILED_STATE, printlnReporter, props, RUNNING_STATE, STARTING_STATE, STOPPED_STATE, STOPPING_STATE, warningReporter |
| Constructor Summary | |
|---|---|
ReceiveEmailAgent()
|
|
| Method Summary | |
|---|---|
void |
handleClient(java.net.Socket client)
If the max_connections parameter has been not been exceeded, this method passes the socket connection to a ReceiveEmailHandler for further processing on its own Thread (owned by ESMTPReceiver). |
void |
initProps()
Sets the default Props for this agent: "bind_port" is the port this agent opens to listen for SMTP connections, "max_connections" is the maximum number of simultaneous SMTP connections this agent allows. |
void |
returnHandler(ReceiveEmailHandler handler)
This method is called when the ReceiveEmailHandler is no longer needed. |
void |
run()
Opens a server socket on the bind_port and listens for SMTP connections. |
void |
start()
Starts this agent by spawning a thread that listens for SMTP connections and passes them to REceiveEmailHandlers for further processing. |
| Methods inherited from class com.cometway.ak.Agent |
|---|
currentStateEquals, debug, destroy, error, error, getAgentController, getDateTimeStr, getProps, getServiceImpl, getStateMachineModel, println, register, registerService, setAgentController, setProps, stop, toString, unregister, unregisterService, warning, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Vector receivers
protected java.lang.Object waitSync
| Constructor Detail |
|---|
public ReceiveEmailAgent()
| Method Detail |
|---|
public void initProps()
initProps in interface AgentInterfaceinitProps in class Agentpublic void start()
start in interface AgentInterfacestart in class Agentpublic void run()
run in interface java.lang.Runnablepublic void handleClient(java.net.Socket client)
public void returnHandler(ReceiveEmailHandler handler)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||