--- src\java\org\apache\james\transport\mailets\CommandListservProcessor_orig.java Thu Apr 07 17:08:23 2005 +++ src\java\org\apache\james\transport\mailets\CommandListservProcessor.java Thu Apr 07 16:47:05 2005 @@ -27,10 +27,11 @@ import org.apache.mailet.GenericMailet; import org.apache.mailet.Mail; import org.apache.mailet.MailAddress; import org.apache.mailet.MailetException; +import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; import javax.mail.internet.ParseException; import java.io.IOException; @@ -154,11 +155,13 @@ */ protected XMLResources xmlResources; protected boolean specificPostersOnly; protected Collection allowedPosters; - + protected boolean addFooter; + protected String changeToAddress; + /** * Initialize the mailet */ public void init() throws MessagingException { try { @@ -170,10 +173,12 @@ subjectPrefix = getString("subjectprefix", null); listName = getString("listName", null); autoBracket = getBoolean("autobracket", true); listOwner = new MailAddress(getString("listOwner", null)); specificPostersOnly = getBoolean("specifiedpostersonly", false); + addFooter = getBoolean("addfooter", true); + changeToAddress = getString("changetoaddress", null); //initialize resources initializeResources(); //init user repos initUsersRepository(); initAllowedPosters(configuration); @@ -206,17 +211,25 @@ if (!checkBeenThere(listservAddr, mail)) { return; } //addfooter - addFooter(mail); - + if (addFooter){ + addFooter(mail); + } + //prepare the new message MimeMessage message = prepareListMessage(mail, listservAddr); + + //Set the subject if set setSubject(message); + + if (changeToAddress!=null){ + message.setRecipients(Message.RecipientType.TO, changeToAddress); + } //Send the message to the list members //We set the list owner as the sender for now so bounces go to him/her getMailetContext().sendMail(listOwner, members, message); } catch (IOException ioe) {