| org.sakaiproject.james.SakaiMailet
SakaiMailet | public class SakaiMailet extends GenericMailet (Code) | |
SakaiMailet watches incoming mail (via James) and sends mail to the appropriate mail archive channel in Sakai.
|
Method Summary | |
protected Reference | createAttachment(List attachments, String type, String fileName, byte[] body, String id) Create an attachment, adding it to the list of attachments. | public void | destroy() Called when leaving. | protected boolean | fromValidUser(String fromAddr, MailArchiveChannel channel) Check if the fromAddr email address is recognized as belonging to a user who has permission to add to the channel.
Parameters: fromAddr - The email address to check. Parameters: channel - The mail archive channel. | public void | init() Called when created. | protected void | parseEnvelope(Message innerMsg, String id, StringBuffer bodyBuf, List attachments, Integer embedCount) Saves header info about embedded email messages. | protected Integer | parseParts(Part p, String id, StringBuffer bodyBuf, StringBuffer bodyContentType, List attachments, Integer embedCount) Breaks email messages into parts which can be saved as files (saves as attachments) or viewed as plain text (added to body of message).
Parameters: p - The message-part embedded in a message.. Parameters: id - The string containing the message's id. Parameters: bodyBuf - The string-buffer in which the message body is being built. Parameters: bodyContentType - The value of the Content-Type header for the mesage body. Parameters: attachments - The ReferenceVector in which references to attachments are collected. Parameters: embedCount - An Integer that counts embedded messages (outer message is zero). | protected byte[] | readBody(int approxSize, InputStream stream) | public void | service(Mail mail) Process incoming mail. |
POSTMASTER | final public static String POSTMASTER(Code) | | The user name of the postmaster user - the one who posts incoming mail.
|
createAttachment | protected Reference createAttachment(List attachments, String type, String fileName, byte[] body, String id)(Code) | | Create an attachment, adding it to the list of attachments.
|
destroy | public void destroy()(Code) | | Called when leaving.
|
fromValidUser | protected boolean fromValidUser(String fromAddr, MailArchiveChannel channel)(Code) | | Check if the fromAddr email address is recognized as belonging to a user who has permission to add to the channel.
Parameters: fromAddr - The email address to check. Parameters: channel - The mail archive channel. True if the email address is from a user who is authorized to add mail, false if not. |
init | public void init() throws MessagingException(Code) | | Called when created.
|
parseEnvelope | protected void parseEnvelope(Message innerMsg, String id, StringBuffer bodyBuf, List attachments, Integer embedCount) throws MessagingException, IOException(Code) | | Saves header info about embedded email messages.
Parameters: innerMsg - The message-part believed to be an embedded message.. Parameters: id - The string containing the outer message's id. Parameters: bodyBuf - The string-buffer in which the message body is being built. Parameters: attachments - The ReferenceVector in which references to attachments are collected. Parameters: embedCount - An Integer that counts embedded messages (Outer message is zero). |
parseParts | protected Integer parseParts(Part p, String id, StringBuffer bodyBuf, StringBuffer bodyContentType, List attachments, Integer embedCount) throws MessagingException, IOException(Code) | | Breaks email messages into parts which can be saved as files (saves as attachments) or viewed as plain text (added to body of message).
Parameters: p - The message-part embedded in a message.. Parameters: id - The string containing the message's id. Parameters: bodyBuf - The string-buffer in which the message body is being built. Parameters: bodyContentType - The value of the Content-Type header for the mesage body. Parameters: attachments - The ReferenceVector in which references to attachments are collected. Parameters: embedCount - An Integer that counts embedded messages (outer message is zero). Value of embedCount (updated if this call processed any embedded messages). |
readBody | protected byte[] readBody(int approxSize, InputStream stream)(Code) | | Read in a stream from the mime body into a byte array
|
service | public void service(Mail mail) throws MessagingException(Code) | | Process incoming mail.
Parameters: mail - ... |
|
|