[ https://issues.apache.org/jira/browse/JAMES-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17878931#comment-17878931 ]
Jean Helou commented on JAMES-1403: ----------------------------------- As far as I can tell this has not been implemented but I have no idea what state is supposed to represent nor of why such an implementation would be useful. anyone could explain the point of this in more details ? > Adding overloaded MailetContext/JamesMailetContext.bounce() method with a > state parameter > ----------------------------------------------------------------------------------------- > > Key: JAMES-1403 > URL: https://issues.apache.org/jira/browse/JAMES-1403 > Project: James Server > Issue Type: Improvement > Components: James Core > Affects Versions: 3.0-beta3 > Environment: All > Reporter: Idea Harness > Priority: Major > > I think it would be very useful to add an overloaded bounce() method to > org.apache.mailet.MailetContext and > org.apache.james.mailetcontainer.impl.JamesMailetContext > accepting a String state parameter (similar to a sendMail() method that > already has it) with the following implementation : > public void bounce(Mail mail, String message, MailAddress bouncer, String > state) throws MessagingException { > if (mail.getSender() == null) { > if (log.isInfoEnabled()) > log.info("Mail to be bounced contains a null (<>) reverse > path. No bounce will be sent."); > return; > } else { > // Bounce message goes to the reverse path, not to the Reply-To > // address > if (log.isInfoEnabled()) > log.info("Processing a bounce request for a message with a > reverse path of " + mail.getSender().toString()); > } > MailImpl reply = rawBounce(mail, message); > // Change the sender... > reply.getMessage().setFrom(bouncer.toInternetAddress()); > reply.getMessage().saveChanges(); > // Send it off ... with null reverse-path > reply.setSender(null); > // Set the specified state, which is not necessarily the root state > reply.setState(state); > sendMail(reply); > LifecycleUtil.dispose(reply); > } > This would allow the callers to specify the state of the bounced (reply) > Mail, rather than going to the root state as is now. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org