[ 
https://issues.apache.org/jira/browse/JAMES-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ioan Eugen Stan closed JAMES-367.
---------------------------------

    Resolution: Unresolved
      Assignee: Ioan Eugen Stan

No longer relevant.
                
> Added option to CommandListServ to change the to address.
> ---------------------------------------------------------
>
>                 Key: JAMES-367
>                 URL: https://issues.apache.org/jira/browse/JAMES-367
>             Project: James Server
>          Issue Type: Improvement
>          Components: Matchers/Mailets (bundled)
>         Environment: N/A
>            Reporter: Daniel Perry
>            Assignee: Ioan Eugen Stan
>            Priority: Minor
>         Attachments: patch.txt
>
>
> I have added the option: <changetoaddress>newaddress@blah</changetoaddress> 
> to the CommandListServProcessor.  When an email is sent to the list, it 
> changes the to address into this.  Is useful in hiding the list address, or 
> in any other circmstances where you need to make it appear different. Note: 
> it doesnt change the received headers, so the address is still there if 
> people look.
> Daniel.
> --- 
> 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) {

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to