[jira] [Commented] (JAMES-4125) Rework Mailet api
"Benoit Tellier (Jira)" <[email protected]>
| Newsgroups | gmane.comp.jakarta.james.devel |
|---|---|
| Message-ID | <[email protected]> |
[ https://issues.apache.org/jira/browse/JAMES-4125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17940074#comment-17940074 ]
Benoit Tellier commented on JAMES-4125:
---------------------------------------
> improve the GuiceMailetLoader to no longer rely on the init() method but instead bind the proper mailet config in a child context as is done for the GuiceMailRepositoryLoader.
As always the proposal makes loads of sense for the guice code but is likely hard to achieve with the legacy Spring code.
(but if we succeed to work through the Spring limitatins of course then +1)
> apply default methods to the mailet api so implementing a mailet from scratch (not using GenericMailet1) is easier
+1
> change the Mailet interface to get rid of the getMailetConfig method entirely as it is only used to get the context and the error handlers from the engine
+1
> Rework Mailet api
> ------------------
>
> Key: JAMES-4125
> URL: https://issues.apache.org/jira/browse/JAMES-4125
> Project: James Server
> Issue Type: Improvement
> Reporter: Jean Helou
> Assignee: Jean Helou
> Priority: Major
>
> While prototyping a new DKIM mailet which would sign with a sender's domain specific key instead of using a fixed private key I realized the design of the mailet API is ... perfectible.
>
> I propose the following changes
> # improve the GuiceMailetLoader to no longer rely on the init() method but instead bind the proper mailet config in a child context as is done for the GuiceMailRepositoryLoader.
> # apply default methods to the mailet api so implementing a mailet from scratch (not using GenericMailet{^}1{^}) is easier
> # change the Mailet interface to get rid of the getMailetConfig method entirely as it is only used to get the context and the error handlers from the engine
> ** it is not the mailet responsibility to provide the context to the engine
> ** the getConfig would be replaced by 2 methods to explicitely provide error handlers instead of relying on an undocumented convention
> ^1^ GenericMailet is both a Mailet and a MailetConfig which doesn´t sound quite right, it also implements default behaviours that would be better placed as default methods on the interface
--
This message was sent by Atlassian Jira
(v8.20.10#820010)