|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLogEnabled | +--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)
This generates a response to the Return-Path address, or the address of the message's sender if the Return-Path is not available. |
void |
bounce(Mail mail,
java.lang.String message,
MailAddress bouncer)
This generates a response to the Return-Path address, or the address of the message's sender if the Return-Path is not available. |
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 address of the postmaster for this server. |
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)
Returns whether that account has a local inbox on this server |
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.AbstractLogEnabled |
enableLogging, getLogger, 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
java.lang.Exception
public void sendMail(javax.mail.internet.MimeMessage message) throws javax.mail.MessagingException
MailetContext
sendMail
in interface MailetContext
message
- - the MimeMessage of the headers and body content of the outgoing message
javax.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
sender
- - the sender of the messagerecipients
- - a Collection of String objects of recipientsmessage
- - the MimeMessage of the headers and body content of
the outgoing message
javax.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
sender
- - the sender of the messagerecipients
- - a Collection of MailAddress objects of recipientsmessage
- - the MimeMessage of the headers and body content of the outgoing messagestate
- - the state of the message, indicates which processor to use
javax.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
sender
- - the sender of the messagerecipients
- - a Collection of String objects of recipientsmsg
- - an InputStream containing the headers and body content of
the outgoing message
javax.mail.MessagingException
- - if the message fails to parsepublic void sendMail(Mail mail) throws javax.mail.MessagingException
MailServer
sendMail
in interface MailServer
javax.mail.MessagingException
- - if the message fails to parsepublic MailRepository getUserInbox(java.lang.String userName)
getUserInbox
in interface MailServer
public 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
host
- - the domain name for which to find mail servers
public 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
key
- - a String specifying the name of the attribute
public 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
key
- - 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
key
- - a String specifying the name of the attribute to be removedpublic java.util.Iterator getAttributeNames()
MailetContext
getAttributeNames
in interface MailetContext
public void bounce(Mail mail, java.lang.String message) throws javax.mail.MessagingException
bounce
in interface 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 bounced
javax.mail.MessagingException
public void bounce(Mail mail, java.lang.String message, MailAddress bouncer) throws javax.mail.MessagingException
bounce
in interface 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 message
javax.mail.MessagingException
public boolean isLocalUser(java.lang.String name)
isLocalUser
in interface MailetContext
name
- - user identifier.
public MailAddress getPostmaster()
getPostmaster
in interface MailetContext
public void storeMail(MailAddress sender, MailAddress recipient, javax.mail.internet.MimeMessage message)
MailetContext
storeMail
in interface MailetContext
sender
- - the sender of the incoming messagerecipient
- - the user who is receiving this message (as a complete email address)message
- - the MimeMessage to store in a local mailboxpublic int getMajorVersion()
MailetContext
getMajorVersion
in interface MailetContext
public int getMinorVersion()
MailetContext
getMinorVersion
in interface MailetContext
public boolean isLocalServer(java.lang.String serverName)
MailServer
isLocalServer
in interface 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
public void log(java.lang.String message)
MailetContext
log
in interface MailetContext
public void log(java.lang.String message, java.lang.Throwable t)
MailetContext
log
in interface MailetContext
message
- - a String that describes the 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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |