Hi Jerry, Regarding that one I believe the best move is relying on the mailet extension system by defining a 'onSuccessProcessor' configuration option in the RemoteDelivery mailet.
This requires adapting 'RemoteDelivery' code for allowing such an extension mechanism. I dropped what I had in mind, as well as related concerns in https://issues.apache.org/jira/browse/JAMES-2912 Cheers, Benoit On 07/10/2019 08:43, Jerry Malcolm wrote: > One more request for advice while I'm thinking about it.... I have a > client that has a requirement for a db entry for each mail item going in > or out for a certain domain that logs the final result. For outbound, > the db entry will either be a bounce message or the 'success' log entry > that says something like: > > Mail xyz sent successfully to target-smtp.aaaaaaa.com. at xx.xxx.xxx.xxx > from m...@mydomain.com for [y...@yourdomain.com] > > Inbound email just needs to log the email to/from/subj and the target > folder it was stored in. > > Inbound and bounces are not an issue. I can just add mailets to the > bounce processor and to the transport processor for inbound. No concerns > there. > > The real issue is hooking the final success where the mail was > successfully transferred out to the target smtp server (possibly after > retries, etc). Back in v3b5 I had a total hack adding my custom code to > the RemoteDelivery mailet. It's worked fine for years. But I don't want > to repeat that moving forward to 3.3+. And the remoteDelivery logic has > changed in 3.3. So it doesn't appear my hack would still work anyway. > But I still need the function. I would like to add a hook or listener > externally without having to build it into a custom James build if > possible. I've been looking into HookResultLogger and > CoreCmdHandlerLogger. But I don't see a way to register an additional > logger short of changing the core code. > > So... my question is: what is the best way to add a logger at the point > where the outbound transfer has just completed? If it requires > modification to the core James code, I have no problem creating a custom > build. I just need advice as to where to do the surgery and what the > recommended solution is in the opinion of the experienced James team. > > Thanks, > > Jerry > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org > For additional commands, e-mail: server-dev-h...@james.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org