org.apache.james.services
Interface MailServer

All Superinterfaces:
org.apache.avalon.phoenix.Service
All Known Implementing Classes:
James

public interface MailServer
extends org.apache.avalon.phoenix.Service

The interface for Phoenix blocks to the James MailServer

Author:
Federico Barbieri , Charles Benett This is $Revision: 1.3 $ Committed on $Date: 2001/09/06 13:19:32 $ by: $Author: donaldp $

Field Summary
static java.lang.String ALL
          Reserved user name meaning all users for multi-user mailboxes
static java.lang.String MDA
          Reserved user name for the mail delivery agent for multi-user mailboxes
static java.lang.String ROLE
           
 
Method Summary
 boolean addUser(java.lang.String userName, java.lang.String password)
          Adds a new user to the mail system with userName.
 java.lang.String getId()
           
 MailRepository getUserInbox(java.lang.String userName)
          Retrieve the primary mailbox for userName.
 boolean isLocalServer(java.lang.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, 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 msg)
          Pass a MimeMessage to this MailServer for processing
 

Field Detail

ROLE

public static final java.lang.String ROLE

MDA

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

ALL

public static final java.lang.String ALL
Reserved user name meaning all users for multi-user mailboxes
Method Detail

sendMail

public void sendMail(MailAddress sender,
                     java.util.Collection recipients,
                     javax.mail.internet.MimeMessage msg)
              throws javax.mail.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:
javax.mail.MessagingException - - if the message fails to parse

sendMail

public void sendMail(MailAddress sender,
                     java.util.Collection recipients,
                     java.io.InputStream msg)
              throws javax.mail.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:
javax.mail.MessagingException - - if the message fails to parse

sendMail

public void sendMail(Mail mail)
              throws javax.mail.MessagingException
Pass a Mail 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:
javax.mail.MessagingException - - if the message fails to parse

getUserInbox

public MailRepository getUserInbox(java.lang.String userName)
Retrieve the primary mailbox for userName. For POP3 style stores this is their (sole) mailbox. For IMAP style stores this is the INBOX mailbox.
Parameters:
sender - - the name of the user

getId

public java.lang.String getId()

addUser

public boolean addUser(java.lang.String userName,
                       java.lang.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. For IMAP style stores this involves creating malboxes with appropriate ACLs. Additional considerations apply if there has been a previous user with the same name in an IMAP system. mailbox.
Parameters:
sender - - the name of the user

isLocalServer

public boolean isLocalServer(java.lang.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 © 2001 Apache Jakarta Project. All Rights Reserved.