org.apache.james.transport.mailets
Class AvalonListserv

java.lang.Object
  extended by org.apache.mailet.GenericMailet
      extended by org.apache.james.transport.mailets.GenericListserv
          extended by org.apache.james.transport.mailets.AvalonListserv
All Implemented Interfaces:
Mailet, MailetConfig

public class AvalonListserv
extends GenericListserv

MailingListServer capability.

Requires a configuration element in the config.xml file of the form:
<mailet match="RecipientIs=LIST-ADDRESS" class="AvalonListserv">
<repositoryName>LIST-NAME</repositoryName>
<membersonly>[true|false]</membersonly>
<attachmentsallowed>[true|false]</attachmentsallowed>
<replytolist>[true|false]</replytolist>
<autobracket>[true|false]</autobracket>
<subjectprefix [xml:space="preserve"]>SUBJECT-PREFIX</subjectprefix>
</mailet>

repositoryName - the name of a user repository configured in the UsersStore block, e.g.,
<repository name="list-name" class="org.apache.james.userrepository.ListUsersJdbcRepository" destinationURL="db://maildb/lists/list-name">
<sqlFile>file://conf/sqlResources.xml</sqlFile>
</repository>

or
<repository name="list-name" class="org.apache.james.userrepository.UsersFileRepository">
<destination URL="file://var/lists/list-name/"/>
</repository>

membersonly - if true only members can post to the list

attachmentsallowed - if false attachments are not allowed

replytolist - if true, replies go back to the list address; if false they go to the sender.

subjectprefix - a prefix that will be inserted at the front of the subject. If autobracketing is disabled (see below), the xml:space="preserve" attribute can be used to precisely control the prefix.

autobracket - if true the subject prefix will be rendered as "[PREFIX] ", if false, the prefix will be used literally.

Version:
This is $Revision: 494012 $

Field Summary
protected  boolean attachmentsAllowed
          Whether attachments can be sent to the list
protected  boolean autoBracket
          Whether the subject prefix should be bracketed with '[' and ']'
protected  boolean membersOnly
          Whether only members can post to the list
protected  boolean replyToList
          Whether the reply-to header should be set to the list address
protected  java.lang.String subjectPrefix
          A String to prepend to the subject of the message when it is sent to the list
 
Constructor Summary
AvalonListserv()
           
 
Method Summary
 java.lang.String getMailetInfo()
          Return a string describing this mailet.
 java.util.Collection getMembers()
          Returns a Collection of MailAddress objects of members to receive this email
 java.lang.String getSubjectPrefix()
          Get the prefix prepended to the subject line
 void init()
          Initialize the mailet
 boolean isAttachmentsAllowed()
          Get whether attachments can be sent to this list
 boolean isMembersOnly()
          Get whether posting to this list is restricted to list members
 boolean isPrefixAutoBracketed()
          Return whether the prefix for subjects on this list will be bracketed.
 boolean isReplyToList()
          Get whether the reply-to header for messages sent to this list will be replaced with the list address
 
Methods inherited from class org.apache.james.transport.mailets.GenericListserv
getListservAddress, service
 
Methods inherited from class org.apache.mailet.GenericMailet
destroy, getInitParameter, getInitParameter, getInitParameterNames, getMailetConfig, getMailetContext, getMailetName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

membersOnly

protected boolean membersOnly
Whether only members can post to the list


attachmentsAllowed

protected boolean attachmentsAllowed
Whether attachments can be sent to the list


replyToList

protected boolean replyToList
Whether the reply-to header should be set to the list address


subjectPrefix

protected java.lang.String subjectPrefix
A String to prepend to the subject of the message when it is sent to the list


autoBracket

protected boolean autoBracket
Whether the subject prefix should be bracketed with '[' and ']'

Constructor Detail

AvalonListserv

public AvalonListserv()
Method Detail

init

public void init()
Initialize the mailet

Overrides:
init in class GenericMailet

getMembers

public java.util.Collection getMembers()
                                throws javax.mail.internet.ParseException
Description copied from class: GenericListserv
Returns a Collection of MailAddress objects of members to receive this email

Specified by:
getMembers in class GenericListserv
Throws:
javax.mail.internet.ParseException

isMembersOnly

public boolean isMembersOnly()
Get whether posting to this list is restricted to list members

Specified by:
isMembersOnly in class GenericListserv
Returns:
whether posting to this list is restricted to list members

isAttachmentsAllowed

public boolean isAttachmentsAllowed()
Get whether attachments can be sent to this list

Specified by:
isAttachmentsAllowed in class GenericListserv
Returns:
whether attachments can be sent to this list

isReplyToList

public boolean isReplyToList()
Get whether the reply-to header for messages sent to this list will be replaced with the list address

Specified by:
isReplyToList in class GenericListserv
Returns:
whether replies to messages posted to this list will go to the entire list

getSubjectPrefix

public java.lang.String getSubjectPrefix()
Get the prefix prepended to the subject line

Specified by:
getSubjectPrefix in class GenericListserv
Returns:
whether the prefix for subjects on this list will be bracketed.

isPrefixAutoBracketed

public boolean isPrefixAutoBracketed()
Return whether the prefix for subjects on this list will be bracketed.

Overrides:
isPrefixAutoBracketed in class GenericListserv
Returns:
whether the prefix for subjects on this list will be bracketed.

getMailetInfo

public java.lang.String getMailetInfo()
Return a string describing this mailet.

Specified by:
getMailetInfo in interface Mailet
Overrides:
getMailetInfo in class GenericMailet
Returns:
a string describing this mailet


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.