Neokernel API

com.neokernel.email Namespace

Namespace Hierarchy

Classes

Class Description
AutoReplyAgent This agent sets itself up to receive messages from a ReceiveEmailAgent and automatically respond to the sender using the SendEmailAgent. In most cases, this will be subclassed and the getReply method should be overridden.
EmailBugReportAgent This agent registers itself with the Service Manager as a BugReportInterface and periodically submits the bug reports collects as an email message to a list of recipients using the SendEmailInterface registered with the Service Manager as "send_email".
Emailer This subclass of Thread sends Email using the ESMTPSender class. This Thread will sleep until the send(IMessage) method is called, which causes the Thread to wake up. Upon wakeup, the Thread checks the queue for IMessages to send and sends them. Messages that return an error when attempting to deliver the message will be dropped from the queue. If the SMTP host which this Thread uses to relay the message is down, all the messages are added back into the Queue. The mesage queue has a max size of 500 messages.
EmailHeader This class provides a set of static methods for parsing and manipulating headers in an email message. *
EmailReporter This is a Reporter Agent that extends FileLoggerAgent in order to log AK agent output to sequentially named text files. Upon loading, this agent replaces the default Reporter.
EmailTools Defines a set of static methods useful for parsing email information.
ESMTPException This exception is thrown by the ESMTPSender in the event that the message that is to be sent is refused by the SMTP server.
ESMTPReceiver This class implements the ESMTP protocol for the server side. It will listen to a socket and await connections that talk the ESMTP/SMTP protocol.
ESMTPReceiver.FakeWriter  
ESMTPSender This class implements the ESMTP protocol for the client side. Given a socket, it will connect to a server which talks ESMTP/SMTP and send messages
Message Message is an IMessage that represents an RFC822 compliant message. A Message is required to have at least the 'To' and 'From' headers (though these headers may be empty)
MessageTools This helper class provides a suite of utility methods for accessing and changing an IMessage.
MIMEMessage MIMEMessage is an IMessage that represents a MIME compliant message as specified in RFCs 2045 - 2049. A MIME Message has some extra headers and a unique separator that gets inserted.
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 for a good reference on DNS).
ReceiveEmailHandler This class is used by the ReceiveEmailAgent to process threaded SMTP socket connections.
ReceivePOP3EmailAgent This agent periodically checks for new POP3 messages, passing routing the message to the registered RequestAgent matching the message recipient's email address.
RequestDumperAgent This is a simple agent which dumps the contents of the requests it receives. This can be used for debugging messages received by the ReceiveEmailAgent.
RequestFilterAgent This agent proxies requests to another request agent and in the process, it caches the props for each request. When this agent starts up, it grabs a reference to the RequestAgent that its requests are proxying to from the ServiceManager, then registers itself. Cached requests are filtered depending on the filter_interval property and the requests that made it through the filter are emailed to the list of email addresses provided by the recipients property. Note: It may be a bad idea for this agent to proxy AgentRequests that may contain references to resources that needs to be released. The props from AgentRequests are not released for garbage collection until the filtering has been done.
SendEmailAgent

This agent queues up email messages and sends them to the smtp_host at regular intervals. There are a variety of properties that can be configured which define how and when these messages are sent. This agent implements the SendEmailInterface and registers with the Service Manager for other agents to use.

The SendEmailAgent supports the following properties:

service_name
The name this agent uses to register with Service Manager. The default value is send_email
max_queue_size
Max size of the message queue. Default value is 100
smtp_sleep_ms
Number of milliseconds to wait before checking the queue for new messages to send. Default value is 5000
smtp_host
Hostname or IP address of the SMTP server. Default value is localhost
smtp_port
Port to use for SMTP communications. Default value is 25
smtp_timeout_ms
SMTP timeout in milliseconds. Default value is 30000
auth_username
Username to use for SMTP communications (optional). Default value is none
auth_password
Password to use for SMTP communications (optional). Default value is none

Interfaces

Interface Description
BugReportInterface This interface describes functionality for reporting bugs.
IMessage IMessage represents an abstract message containing a message body and an arbitrary number of headers.
IMessageSender IMessageSender is an interface for those classes that support a sendMessage() method for sending an IMessage
SendEmailInterface This interface describes functionality for sending email messages.