| org.apache.james.James
James | public class James extends AbstractLogEnabled implements Contextualizable,Serviceable,Configurable,JamesMBean,Initializable,MailServer,MailetContext(Code) | | 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
version: This is $Revision: 494012 $ |
Method Summary | |
public boolean | addUser(String userName, String password) Adds a user to this mail server. | public void | bounce(Mail mail, 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. | public void | bounce(Mail mail, 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. | public void | configure(Configuration conf) | public void | contextualize(Context context) | public Object | getAttribute(String key) | public Iterator | getAttributeNames() | public String | getId() Return a new mail id. | public Collection | getMailServers(String host) | public int | getMajorVersion() | public int | getMinorVersion() | public MailAddress | getPostmaster() Returns the address of the postmaster for this server. | public Iterator | getSMTPHostAddresses(String domainName) Performs DNS lookups as needed to find servers which should or might
support SMTP.
Returns an Iterator over HostAddress, a specialized subclass of
javax.mail.URLName, which provides location information for
servers that are specified as mail handlers for the given
hostname. | public String | getServerInfo() | public synchronized MailRepository | getUserInbox(String userName) | public void | initialize() | public boolean | isLocalServer(String serverName) Check whether the mail domain in question is to be
handled by this server. | public boolean | isLocalUser(String name) | public void | log(String message) | public void | log(String message, Throwable t) | public static void | main(String[] args) The main method. | public void | removeAttribute(String key) | public void | sendMail(MimeMessage message) | public void | sendMail(MailAddress sender, Collection recipients, MimeMessage message) | public void | sendMail(MailAddress sender, Collection recipients, MimeMessage message, String state) | public void | sendMail(MailAddress sender, Collection recipients, InputStream msg) | public void | sendMail(Mail mail) | public void | service(ServiceManager comp) | public void | setAttribute(String key, Object object) | public void | storeMail(MailAddress sender, MailAddress recipient, MimeMessage msg) This method has been moved to LocalDelivery (the only client of the method). |
localDeliveryMailet | protected Mailet localDeliveryMailet(Code) | | Currently used by storeMail to avoid code duplication (we moved store logic to that mailet).
TODO We should remove this and its initialization when we remove storeMail method.
|
myContext | protected Context myContext(Code) | | The Avalon context used by the instance
|
addUser | public boolean addUser(String userName, String password)(Code) | | Adds a user to this mail server. Currently just adds user to a
UsersRepository.
Parameters: userName - String representing user name, that is the portion ofan email address before the '@'. Parameters: password - String plaintext password boolean true if user added succesfully, else false. |
bounce | public void bounce(Mail mail, String message) throws MessagingException(Code) | | This generates a response to the Return-Path address, or the address of
the message's sender if the Return-Path is not available. Note that
this is different than a mail-client's reply, which would use the
Reply-To or From header. This will send the bounce with the server's
postmaster as the sender.
|
bounce | public void bounce(Mail mail, String message, MailAddress bouncer) throws MessagingException(Code) | | This generates a response to the Return-Path address, or the
address of the message's sender if the Return-Path is not
available. Note that this is different than a mail-client's
reply, which would use the Reply-To or From header.
Bounced messages are attached in their entirety (headers and
content) and the resulting MIME part type is "message/rfc822".
The attachment to the subject of the original message (or "No
Subject" if there is no subject in the original message)
There are outstanding issues with this implementation revolving
around handling of the return-path header.
MIME layout of the bounce message:
multipart (mixed)/
contentPartRoot (body) = mpContent (alternative)/
part (body) = message
part (body) = original
|
configure | public void configure(Configuration conf)(Code) | | See Also: org.apache.avalon.framework.configuration.Configurable.configure(Configuration) |
contextualize | public void contextualize(Context context)(Code) | | See Also: org.apache.avalon.framework.context.Contextualizable.contextualize(Context) |
getId | public String getId()(Code) | | Return a new mail id.
a new mail id |
getMailServers | public Collection getMailServers(String host)(Code) | | Get the prioritized list of mail servers for a given host.
TODO: This needs to be made a more specific ordered subtype of Collection.
Parameters: host - |
getMajorVersion | public int getMajorVersion()(Code) | | Return the major version number for the server
the major vesion number for the server |
getMinorVersion | public int getMinorVersion()(Code) | | Return the minor version number for the server
the minor vesion number for the server |
getPostmaster | public MailAddress getPostmaster()(Code) | | Returns the address of the postmaster for this server.
the MailAddress for the postmaster |
getSMTPHostAddresses | public Iterator getSMTPHostAddresses(String domainName)(Code) | | Performs DNS lookups as needed to find servers which should or might
support SMTP.
Returns an Iterator over HostAddress, a specialized subclass of
javax.mail.URLName, which provides location information for
servers that are specified as mail handlers for the given
hostname. This is done using MX records, and the HostAddress
instances are returned sorted by MX priority. If no host is
found for domainName, the Iterator returned will be empty and the
first call to hasNext() will return false.
See Also: org.apache.james.DNSServer.getSMTPHostAddresses(String) since: Mailet API v2.2.0a16-unstable Parameters: domainName - - the domain for which to find mail servers an Iterator over HostAddress instances, sorted by priority |
getServerInfo | public String getServerInfo()(Code) | | Return the type of the server
the type of the server |
getUserInbox | public synchronized MailRepository getUserInbox(String userName)(Code) | | Retrieve the mail repository for a user
For POP3 server only - at the moment.
Parameters: userName - the name of the user whose inbox is to be retrieved the POP3 inbox for the user |
initialize | public void initialize() throws Exception(Code) | | See Also: org.apache.avalon.framework.activity.Initializable.initialize |
isLocalServer | public boolean isLocalServer(String serverName)(Code) | | Check whether the mail domain in question is to be
handled by this server.
Parameters: serverName - the name of the server to check whether the server is local |
isLocalUser | public boolean isLocalUser(String name)(Code) | | Returns whether that account has a local inbox on this server
Parameters: name - the name to be checked whether the account has a local inbox |
log | public void log(String message)(Code) | | Log a message to the Mailet logger
Parameters: message - the message to pass to the Mailet logger |
log | public void log(String message, Throwable t)(Code) | | Log a message and a Throwable to the Mailet logger
Parameters: message - the message to pass to the Mailet logger Parameters: t - the Throwable to be logged |
main | public static void main(String[] args)(Code) | | The main method. Should never be invoked, as James must be called
from within an Avalon framework container.
Parameters: args - the command line arguments |
removeAttribute | public void removeAttribute(String key)(Code) | | |
sendMail | public void sendMail(MimeMessage message) throws MessagingException(Code) | | Place a mail on the spool for processing
Parameters: message - the message to send throws: MessagingException - if an exception is caught while placing the mailon the spool |
sendMail | public void sendMail(MailAddress sender, Collection recipients, MimeMessage message) throws MessagingException(Code) | | Place a mail on the spool for processing
Parameters: sender - the sender of the mail Parameters: recipients - the recipients of the mail Parameters: message - the message to send throws: MessagingException - if an exception is caught while placing the mailon the spool |
sendMail | public void sendMail(MailAddress sender, Collection recipients, MimeMessage message, String state) throws MessagingException(Code) | | Place a mail on the spool for processing
Parameters: sender - the sender of the mail Parameters: recipients - the recipients of the mail Parameters: message - the message to send Parameters: state - the state of the message throws: MessagingException - if an exception is caught while placing the mailon the spool |
sendMail | public void sendMail(MailAddress sender, Collection recipients, InputStream msg) throws MessagingException(Code) | | Place a mail on the spool for processing
Parameters: sender - the sender of the mail Parameters: recipients - the recipients of the mail Parameters: msg - an InputStream containing the message throws: MessagingException - if an exception is caught while placing the mailon the spool |
sendMail | public void sendMail(Mail mail) throws MessagingException(Code) | | Place a mail on the spool for processing
Parameters: mail - the mail to place on the spool throws: MessagingException - if an exception is caught while placing the mailon the spool |
service | public void service(ServiceManager comp)(Code) | | See Also: org.apache.avalon.framework.service.Serviceable.service(ServiceManager) |
|
|