Thanks for the comments.
>> So I gather than the email must be RFC882 compliant, which means that its
>> implementing class must also be RFC882 compliant. Further, the implementing
>> class must also be RFC5228 compliant. So the email object must effectively
>> be both RFC882 **AND** RFC5882 compliant.
>>
>> First, what is the relationship with RFC882? This is the spec for "DOMAIN
>> NAMES - CONCEPTS AND FACILITIESโ, so Iโm having trouble understanding why it
>> is relevant here.
>
> Likely none.
> RFC-822 STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES seems
> related to too. And given the "one number mistake rule" is likely what
> the javadoc author intended to reference.
๐๐๐
The โone number mistake ruleโ indeed! Just not by the Javadoc author, but by
me. ๐
The Javadoc does indeed say RFC822. ๐ฌ
Even still, how the different concepts are made to come together here is still
a bit confusing to me, so:
> We would need to rework it to make its usage easier.
That would be really helpful.
> And this should be likely done before documenting it (why invest in
> documentation that will outdate itself?)
+1
> Given our previous exchanges I **propose** a first step:
>
> - As part of JSieve provide a `MailAdapter` class, that "just
> represent" a mail. It would be a Plain Old Java Object (POJO) along with
> it's builder. (it adapts a mail within JSieve context)
+1
> - The SieveFactory takes a SieveScript inputstream, and a Mail adapter,
> and returns a list of Action that results from the sieve script
> execution against the supplied email.
+1
Perhaps provide a โdefaultโ MailAdapter? In that case, then the factory could
even just take an email and a SieveScript InputStream and apply the default
MailAdapter. The method with the MailAdapter signature would only be needed for
custom MailAdapters.
> ```
> void runSieveScript(JamesMail jamesMail, InputStream sieveScript) {
> MailAdapter mailAdapter = MailAdapter.builder()
> .subject(jamesMail.getSubject)
> .to(jamesMail.headers().to())
> ...
> .build();
> List<Action> actions = sieveFactory.evaluate(sieveScript, mailAdapter);
> // Do stuff with the actions
> }
> ```
...
> That way library users don't need to extend anything
+1
> interacts with a simple POJO they need to populate
+1
> and can implement the actions they want to support.
+1
> This makes the entire API easier to discover. And it looks achievable with
> limited investment.
๐๐ป๐๐ป๐๐ป
> I also believe documenting that will be easier.
Indeed!
> I just want to conclude that, by challenging what exists, you are far
> from loosing your time. You might very well have been initiating the
> most important contribution to the JSieve library in the past few years.
Ok, good to know. Thanks!
Cheers,
=David
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]