On 8/10/07, Stefano Bagnara <[EMAIL PROTECTED]> wrote: > Robert Burrell Donkin ha scritto: > > On 8/10/07, Stefano Bagnara <[EMAIL PROTECTED]> wrote: > >> Robert Burrell Donkin (JIRA) ha scritto: > >>> [ > >>> https://issues.apache.org/jira/browse/JSIEVE-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518975 > >>> ] > >>> > >>> Robert Burrell Donkin commented on JSIEVE-6: > >>> -------------------------------------------- > >>> > >>> There is also the design issue of where the address list parsing should > >>> be done. > >>> > >>> Adding a getAddresses(headerName) method to MailAdapter may allow the > >>> adapter to perform the parsing. The adapter may be able to optimise this > >>> or may be able to perform more intelligently parsing. However, this is at > >>> the cost of a wider API. Implementing in Address would have the advantage > >>> that it would only need to be done correctly in one place. > >> I'm slightly on the MailAdapter.getAddresses side. > >> > >> If I understand it correctly this way we don't have to add the parsing > >> to the jSieve core and we could use mime4j on the james adapter side to > >> support this feature. (maybe this also means that it would be better to > >> move the james adapter to the james server source tree ?) > > > > this does seem best > > > > MimeMessage contains address parsing code for the common headers. IMHO > > it would be acceptable for implementations to offer a service limited > > to common address headers anyway. the implementations in jsieve have > > access to a MimeMessage representation. the JAMES version could offer > > a more comprehensive service using Mime4J. > > > > but what to do when the address cannot be parsed? i favour logging and > > returning an empty list. > > I guess this problem belongs to the matcher/mailet using jsieve, right? > > In this case I think the best way is to simply throw an exception and > then document the use of standard exception > onMatchException/onMailetException handling in james server: > http://wiki.apache.org/james/HandlingExceptions > > I think the exception handling is one of the most interesting features > and yet less used features we have in the mailet processing engine.
from RFC3028: > Implementations MUST restrict the address test to headers that > contain addresses, but MUST include at least From, To, Cc, Bcc, > Sender, Resent-From, Resent-To, and SHOULD include any other header > that utilizes an "address-list" structured header body. so, i now agree that throwing an exception is the right behaviour - robert --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
