org.apache.james.services
Interface MailServer

All Known Implementing Classes:
James

public interface MailServer

The interface for Phoenix blocks to the James MailServer

Version:
This is $Revision: 1.9 $
Author:
Federico Barbieri , Charles Benett

Field Summary
static String ALL
          Reserved user name meaning all users for multi-user mailboxes
static String MDA
          Reserved user name for the mail delivery agent for multi-user mailboxes
static String ROLE
          The component role used by components implementing this service
 
Method Summary
 boolean addUser(String userName, String password)
          Adds a new user to the mail system with userName.
 String getId()
          Generate a new identifier/name for a mail being processed by this server.
 MailRepository getUserInbox(String userName)
          Retrieve the primary mailbox for userName.
 boolean isLocalServer(String serverName)
          Checks if a server is serviced by mail context
 void sendMail(Mail mail)
          Pass a Mail to this MailServer for processing
 void sendMail(MailAddress sender, Collection recipients, InputStream msg)
          Pass a MimeMessage to this MailServer for processing
 void sendMail(MailAddress sender, Collection recipients, MimeMessage msg)
          Pass a MimeMessage to this MailServer for processing
 void sendMail(MimeMessage message)
          Pass a MimeMessage to this MailServer for processing
 

Field Detail

ROLE

public static final String ROLE
The component role used by components implementing this service

See Also:
Constant Field Values

MDA

public static final String MDA
Reserved user name for the mail delivery agent for multi-user mailboxes

See Also:
Constant Field Values

ALL

public static final String ALL
Reserved user name meaning all users for multi-user mailboxes

See Also:
Constant Field Values
Method Detail

sendMail

public void sendMail(MailAddress sender,
                     Collection recipients,
                     MimeMessage msg)
              throws MessagingException
Pass a MimeMessage to this MailServer for processing

Parameters:
sender - - the sender of the message
recipients - - a Collection of String objects of recipients
msg - - the MimeMessage of the headers and body content of the outgoing message
Throws:
MessagingException - - if the message fails to parse

sendMail

public void sendMail(MailAddress sender,
                     Collection recipients,
                     InputStream msg)
              throws MessagingException
Pass a MimeMessage to this MailServer for processing

Parameters:
sender - - the sender of the message
recipients - - a Collection of String objects of recipients
msg - - an InputStream containing the headers and body content of the outgoing message
Throws:
MessagingException - - if the message fails to parse

sendMail

public void sendMail(Mail mail)
              throws MessagingException
Pass a Mail to this MailServer for processing

Parameters:
mail - the Mail to be processed
Throws:
MessagingException

sendMail

public void sendMail(MimeMessage message)
              throws MessagingException
Pass a MimeMessage to this MailServer for processing

Parameters:
message - the message
Throws:
MessagingException

getUserInbox

public MailRepository getUserInbox(String userName)
Retrieve the primary mailbox for userName. For POP3 style stores this is their (sole) mailbox.

Returns:
a reference to an initialised mailbox

getId

public String getId()
Generate a new identifier/name for a mail being processed by this server.

Returns:
the new identifier

addUser

public boolean addUser(String userName,
                       String password)
Adds a new user to the mail system with userName. For POP3 style stores this may only involve adding the user to the UsersStore.

Returns:
a reference to an initialised mailbox

isLocalServer

public boolean isLocalServer(String serverName)
Checks if a server is serviced by mail context

Parameters:
serverName - - name of server.
Returns:
true if server is local, i.e. serviced by this mail context


"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."