|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.james.James
public class 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 Mailet |
localDeliveryMailet
Currently used by storeMail to avoid code duplication (we moved store logic to that mailet). |
protected org.apache.avalon.framework.context.Context |
myContext
The Avalon context used by the instance |
| 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)
Deprecated. we deprecated this in the MailServer interface and this is an implementation this component depends already depends on a UsersRepository: clients could directly use the addUser of the usersRepository. |
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 |
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()
Return a new mail id. |
java.util.Collection |
getMailServers(java.lang.String host)
Get the prioritized list of mail servers for a given host. |
int |
getMajorVersion()
Return the major version number for the server |
int |
getMinorVersion()
Return the minor version number for the server |
MailAddress |
getPostmaster()
Returns the address of the postmaster for this server. |
java.lang.String |
getServerInfo()
Return the type of the server |
java.util.Iterator |
getSMTPHostAddresses(java.lang.String domainName)
Performs DNS lookups as needed to find servers which should or might support SMTP. |
MailRepository |
getUserInbox(java.lang.String userName)
Retrieve the mail repository for a user For POP3 server only - at the moment. |
void |
initialize()
|
boolean |
isLocalServer(java.lang.String serverName)
Check whether the mail domain in question is to be handled by this server. |
boolean |
isLocalUser(java.lang.String name)
Returns whether that account has a local inbox on this server |
void |
log(java.lang.String message)
Log a message to the Mailet logger |
void |
log(java.lang.String message,
java.lang.Throwable t)
Log a message and a Throwable to the Mailet logger |
static void |
main(java.lang.String[] args)
The main method. |
void |
removeAttribute(java.lang.String key)
Removes the attribute with the given name from the mailet context. |
void |
sendMail(Mail mail)
Place a mail on the spool for processing |
void |
sendMail(MailAddress sender,
java.util.Collection recipients,
java.io.InputStream msg)
Place a mail on the spool for processing |
void |
sendMail(MailAddress sender,
java.util.Collection recipients,
javax.mail.internet.MimeMessage message)
Place a mail on the spool for processing |
void |
sendMail(MailAddress sender,
java.util.Collection recipients,
javax.mail.internet.MimeMessage message,
java.lang.String state)
Place a mail on the spool for processing |
void |
sendMail(javax.mail.internet.MimeMessage message)
Place a mail on the spool for processing |
void |
service(org.apache.avalon.framework.service.ServiceManager comp)
|
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 msg)
Deprecated. since 2.2.0 look at the LocalDelivery code to find out how to do the local delivery. |
| 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.framework.context.Context myContext
protected Mailet localDeliveryMailet
| Constructor Detail |
|---|
public James()
| Method Detail |
|---|
public void contextualize(org.apache.avalon.framework.context.Context context)
contextualize in interface org.apache.avalon.framework.context.ContextualizableContextualizable.contextualize(Context)public void service(org.apache.avalon.framework.service.ServiceManager comp)
service in interface org.apache.avalon.framework.service.ServiceableServiceable.service(ServiceManager)public void configure(org.apache.avalon.framework.configuration.Configuration conf)
configure in interface org.apache.avalon.framework.configuration.ConfigurableConfigurable.configure(Configuration)
public void initialize()
throws java.lang.Exception
initialize in interface org.apache.avalon.framework.activity.Initializablejava.lang.ExceptionInitializable.initialize()
public void sendMail(javax.mail.internet.MimeMessage message)
throws javax.mail.MessagingException
sendMail in interface MailServersendMail in interface MailetContextmessage - the message to send
javax.mail.MessagingException - if an exception is caught while placing the mail
on the spool
public void sendMail(MailAddress sender,
java.util.Collection recipients,
javax.mail.internet.MimeMessage message)
throws javax.mail.MessagingException
sendMail in interface MailServersendMail in interface MailetContextsender - the sender of the mailrecipients - the recipients of the mailmessage - the message to send
javax.mail.MessagingException - if an exception is caught while placing the mail
on the spool
public void sendMail(MailAddress sender,
java.util.Collection recipients,
javax.mail.internet.MimeMessage message,
java.lang.String state)
throws javax.mail.MessagingException
sendMail in interface MailetContextsender - the sender of the mailrecipients - the recipients of the mailmessage - the message to sendstate - the state of the message
javax.mail.MessagingException - if an exception is caught while placing the mail
on the spool
public void sendMail(MailAddress sender,
java.util.Collection recipients,
java.io.InputStream msg)
throws javax.mail.MessagingException
sendMail in interface MailServersender - the sender of the mailrecipients - the recipients of the mailmsg - an InputStream containing the message
javax.mail.MessagingException - if an exception is caught while placing the mail
on the spool
public void sendMail(Mail mail)
throws javax.mail.MessagingException
sendMail in interface MailServersendMail in interface MailetContextmail - the mail to place on the spool
javax.mail.MessagingException - if an exception is caught while placing the mail
on the spoolpublic MailRepository getUserInbox(java.lang.String userName)
Retrieve the mail repository for a user
For POP3 server only - at the moment.
getUserInbox in interface MailServeruserName - the name of the user whose inbox is to be retrieved
public java.lang.String getId()
getId in interface MailServerpublic static void main(java.lang.String[] args)
args - the command line argumentspublic java.util.Collection getMailServers(java.lang.String host)
Get the prioritized list of mail servers for a given host.
TODO: This needs to be made a more specific ordered subtype of Collection.
getMailServers in interface MailetContexthost -
public java.lang.Object getAttribute(java.lang.String key)
MailetContextThe 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 MailetContextkey - - a String specifying the name of the attribute
public void setAttribute(java.lang.String key,
java.lang.Object object)
MailetContextAttribute names should follow the same convention as package names. The Java Mailet API specification reserves names matching java.*, javax.*, and sun.*.
setAttribute in interface MailetContextkey - - 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 MailetContextkey - - 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 MailetContextmail - - 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 MailetContextmail - - 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.MessagingExceptionpublic boolean isLocalUser(java.lang.String name)
isLocalUser in interface MailetContextname - the name to be checked
public MailAddress getPostmaster()
getPostmaster in interface MailetContextMailAddress for the postmasterpublic int getMajorVersion()
getMajorVersion in interface MailetContextpublic int getMinorVersion()
getMinorVersion in interface MailetContextpublic boolean isLocalServer(java.lang.String serverName)
isLocalServer in interface MailServerisLocalServer in interface MailetContextserverName - the name of the server to check
public java.lang.String getServerInfo()
getServerInfo in interface MailetContextpublic void log(java.lang.String message)
log in interface MailetContextmessage - the message to pass to the Mailet logger
public void log(java.lang.String message,
java.lang.Throwable t)
log in interface MailetContextmessage - the message to pass to the Mailet loggert - the Throwable to be logged
public boolean addUser(java.lang.String userName,
java.lang.String password)
addUser in interface JamesMBeanaddUser in interface MailServeruserName - String representing user name, that is the portion of
an email address before the '@password - String plaintext password
public java.util.Iterator getSMTPHostAddresses(java.lang.String domainName)
getSMTPHostAddresses in interface MailetContextdomainName - - the domain for which to find mail servers
org.apache.james.DNSServer#getSMTPHostAddresses(String)
public void storeMail(MailAddress sender,
MailAddress recipient,
javax.mail.internet.MimeMessage msg)
throws javax.mail.MessagingException
storeMail in interface MailetContextsender - - 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 mailbox
javax.mail.MessagingException - - if the message fails to parseMailetContext.storeMail(org.apache.mailet.MailAddress, org.apache.mailet.MailAddress, javax.mail.internet.MimeMessage)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||