|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.james.James
Core class for JAMES. Provides three primary services:
1) Instantiates resources, such as user repository, and protocol
handlers
2) Handles interactions between components
3) Provides container services for Mailets
Field Summary | |
protected org.apache.avalon.phoenix.BlockContext |
blockContext
|
Fields inherited from interface org.apache.james.services.MailServer |
ALL, MDA, ROLE |
Constructor Summary | |
James()
|
Method Summary | |
boolean |
addUser(java.lang.String userName,
java.lang.String password)
Adds a user to this mail server. |
void |
bounce(Mail mail,
java.lang.String message)
Bounces the message using a stanard format with the given message. |
void |
bounce(Mail mail,
java.lang.String message,
MailAddress bouncer)
Bounces the email message using the provided email address as the sender of the bounce. |
void |
compose(org.apache.avalon.framework.component.ComponentManager comp)
Override compose method of AbstractBlock to create new ComponentManager object |
void |
configure(org.apache.avalon.framework.configuration.Configuration conf)
|
void |
contextualize(org.apache.avalon.framework.context.Context context)
|
java.lang.Object |
getAttribute(java.lang.String key)
Returns the mailet container attribute with the given name, or null if there is no attribute by that name. |
java.util.Iterator |
getAttributeNames()
Returns an Iterator containing the attribute names available within this mailet context. |
java.lang.String |
getId()
|
java.util.Collection |
getMailServers(java.lang.String host)
Returns a Collection of Strings of hostnames or ip addresses that are specified as mail server listeners for the given hostname. |
int |
getMajorVersion()
Returns the minor version of the Mailet API that this mailet container supports. |
int |
getMinorVersion()
Returns the minor version of the Mailet API that this mailet container supports. |
MailAddress |
getPostmaster()
Returns the postmaster's address for this mailet context. |
java.lang.String |
getServerInfo()
Returns the name and version of the mailet container on which the mailet is running. |
MailRepository |
getUserInbox(java.lang.String userName)
For POP3 server only - at the momment. |
void |
initialize()
|
boolean |
isLocalServer(java.lang.String serverName)
Checks if a server is serviced by mail context |
boolean |
isLocalUser(java.lang.String name)
Checks if a user account is exists in the mail context. |
void |
log(java.lang.String message)
Writes the specified message to a mailet log file, usually an event log. |
void |
log(java.lang.String message,
java.lang.Throwable t)
Writes an explanatory message and a stack trace for a given Throwable exception to the mailet log file. |
static void |
main(java.lang.String[] args)
|
void |
removeAttribute(java.lang.String key)
Removes the attribute with the given name from the mailet context. |
void |
sendMail(Mail mail)
Pass a Mail to this MailServer for processing |
void |
sendMail(MailAddress sender,
java.util.Collection recipients,
java.io.InputStream msg)
Pass a MimeMessage to this MailServer for processing |
void |
sendMail(MailAddress sender,
java.util.Collection recipients,
javax.mail.internet.MimeMessage message)
Pass a MimeMessage to this MailServer for processing |
void |
sendMail(MailAddress sender,
java.util.Collection recipients,
javax.mail.internet.MimeMessage message,
java.lang.String state)
Send an outgoing message to the top of this mailet container queue for the appropriate processor that is specified. |
void |
sendMail(javax.mail.internet.MimeMessage message)
Send an outgoing message to the top of this mailet container's root queue. |
void |
setAttribute(java.lang.String key,
java.lang.Object object)
Binds an object to a given attribute name in this mailet context. |
void |
storeMail(MailAddress sender,
MailAddress recipient,
javax.mail.internet.MimeMessage message)
Stores mail into local accounts (POP3 by default) |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable |
getLogger, setLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.apache.avalon.phoenix.BlockContext blockContext
Constructor Detail |
public James()
Method Detail |
public void contextualize(org.apache.avalon.framework.context.Context context)
contextualize
in interface org.apache.avalon.framework.context.Contextualizable
public void configure(org.apache.avalon.framework.configuration.Configuration conf)
configure
in interface org.apache.avalon.framework.configuration.Configurable
public void compose(org.apache.avalon.framework.component.ComponentManager comp)
compose
in interface org.apache.avalon.framework.component.Composable
public void initialize() throws java.lang.Exception
initialize
in interface org.apache.avalon.framework.activity.Initializable
public void sendMail(javax.mail.internet.MimeMessage message) throws javax.mail.MessagingException
MailetContext
sendMail
in interface MailetContext
org.apache.mailet.MailetContext
msg
- - the MimeMessage of the headers and body content of the outgoing messagejavax.mail.MessagingException
- - if the message fails to parsepublic void sendMail(MailAddress sender, java.util.Collection recipients, javax.mail.internet.MimeMessage message) throws javax.mail.MessagingException
MailServer
sendMail
in interface MailServer
org.apache.james.services.MailServer
sender
- - the sender of the messagerecipients
- - a Collection of String objects of recipientsmsg
- - the MimeMessage of the headers and body content of
the outgoing messagejavax.mail.MessagingException
- - if the message fails to parsepublic void sendMail(MailAddress sender, java.util.Collection recipients, javax.mail.internet.MimeMessage message, java.lang.String state) throws javax.mail.MessagingException
MailetContext
sendMail
in interface MailetContext
org.apache.mailet.MailetContext
sender
- - the sender of the messagerecipients
- - a Collection of String objects of recipientsmsg
- - the MimeMessage of the headers and body content of the outgoing messagestate
- - the state of the message, indicates which processor to usejavax.mail.MessagingException
- - if the message fails to parsepublic void sendMail(MailAddress sender, java.util.Collection recipients, java.io.InputStream msg) throws javax.mail.MessagingException
MailServer
sendMail
in interface MailServer
org.apache.james.services.MailServer
sender
- - the sender of the messagerecipients
- - a Collection of String objects of recipientsmsg
- - an InputStream containing the headers and body content of
the outgoing messagejavax.mail.MessagingException
- - if the message fails to parsepublic void sendMail(Mail mail) throws javax.mail.MessagingException
MailServer
sendMail
in interface MailServer
org.apache.james.services.MailServer
sender
- - the sender of the messagerecipients
- - a Collection of String objects of recipientsmsg
- - an InputStream containing the headers and body content of
the outgoing messagejavax.mail.MessagingException
- - if the message fails to parsepublic MailRepository getUserInbox(java.lang.String userName)
getUserInbox
in interface MailServer
org.apache.james.services.MailServer
sender
- - the name of the userpublic java.lang.String getId()
getId
in interface MailServer
public static void main(java.lang.String[] args)
public java.util.Collection getMailServers(java.lang.String host)
MailetContext
getMailServers
in interface MailetContext
org.apache.mailet.MailetContext
host
- - the domain name for which to find mail serverspublic java.lang.Object getAttribute(java.lang.String key)
MailetContext
The attribute is returned as a java.lang.Object or some subclass. Attribute names should follow the same convention as package names. The Java Mailet API specification reserves names matching java.*, javax.*, and sun.*
getAttribute
in interface MailetContext
org.apache.mailet.MailetContext
name
- - a String specifying the name of the attributepublic void setAttribute(java.lang.String key, java.lang.Object object)
MailetContext
Attribute names should follow the same convention as package names. The Java Mailet API specification reserves names matching java.*, javax.*, and sun.*.
setAttribute
in interface MailetContext
org.apache.mailet.MailetContext
name
- - a String specifying the name of the attributeobject
- - an Object representing the attribute to be boundpublic void removeAttribute(java.lang.String key)
MailetContext
removeAttribute
in interface MailetContext
org.apache.mailet.MailetContext
name
- - a String specifying the name of the attribute to be removedpublic java.util.Iterator getAttributeNames()
MailetContext
getAttributeNames
in interface MailetContext
org.apache.mailet.MailetContext
public void bounce(Mail mail, java.lang.String message) throws javax.mail.MessagingException
MailetContext
bounce
in interface MailetContext
org.apache.mailet.MailetContext
mail
- - the message that is to be bounced and sender to whom to return the messagemessage
- - a descriptive message as to why the message bouncedpublic void bounce(Mail mail, java.lang.String message, MailAddress bouncer) throws javax.mail.MessagingException
MailetContext
bounce
in interface MailetContext
org.apache.mailet.MailetContext
mail
- - the message that is to be bounced and sender to whom to return the messagemessage
- - a descriptive message as to why the message bouncedbouncer
- - the address to give as the sender of the bounced messagepublic boolean isLocalUser(java.lang.String name)
MailetContext
isLocalUser
in interface MailetContext
org.apache.mailet.MailetContext
userAccount
- - user identifier.public MailAddress getPostmaster()
MailetContext
getPostmaster
in interface MailetContext
org.apache.mailet.MailetContext
public void storeMail(MailAddress sender, MailAddress recipient, javax.mail.internet.MimeMessage message)
MailetContext
storeMail
in interface MailetContext
org.apache.mailet.MailetContext
sender
- - the sender of the incoming messagerecipient
- - the user who is receiving this message (as a complete email address)msg
- - the MimeMessage to store in a local mailboxjavax.mail.MessagingException
- - if the message fails to parsepublic int getMajorVersion()
MailetContext
getMajorVersion
in interface MailetContext
org.apache.mailet.MailetContext
public int getMinorVersion()
MailetContext
getMinorVersion
in interface MailetContext
org.apache.mailet.MailetContext
public boolean isLocalServer(java.lang.String serverName)
MailServer
isLocalServer
in interface MailServer
org.apache.james.services.MailServer
serverName
- - name of server.public java.lang.String getServerInfo()
MailetContext
The form of the returned string is servername/versionnumber. For example, JAMES may return the string JAMES/1.2.
The mailet container may return other optional information after the primary string in parentheses, for example, JAMES/1.2 (JDK 1.3.0; Windows NT 4.0 x86).
getServerInfo
in interface MailetContext
org.apache.mailet.MailetContext
public void log(java.lang.String message)
MailetContext
log
in interface MailetContext
org.apache.mailet.MailetContext
msg
- - a String specifying the message to be written to the log filepublic void log(java.lang.String message, java.lang.Throwable t)
MailetContext
log
in interface MailetContext
org.apache.mailet.MailetContext
message
- - a String that describes the error or exceptionthrowable
- - the Throwable error or exceptionpublic boolean addUser(java.lang.String userName, java.lang.String password)
addUser
in interface MailServer
userName
- String representing user name, that is the portion of
an email address before the '@password
- String plaintext password
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |