On 22/05/2020 17:19, David Leangen wrote:
>>> 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.
>>
>> JSIEVE (core) don't depend on "mailet-api". For the sake of minimalist
>> dependencies, I am not sure this is a dependency we want to add. We will
>> have to "adapt" things all the time then.
>
> Yeah, it is indeed better to reduce compile-time dependencies as much as
> possible for sure!
>
> Then again, the Sieve spec appears to be dependent on “valid” emails, which
> are represented by javax.mail.Message.
>
> On that note… what is the canonical representation of an email in the James
> ecosystem? I am guessing that there has to be some kind of lingua franca
> representation of this core concept, no? Is it javax.mail.Message (which
> would be a reasonable assumption, and known to all components of the
> ecosystem)? Of course, it’s ok to have a projection of an email for each
> component, represented by a different class.
>
> If javax.mail.Message (I’ll just write j.m.M to save my hands a little
> writing) is used by all components, and any specialized representation is
> expected to have a from(j.m.M) and toMessage() method (for example), then it
> would be trivial to communicate an email between the different components
> without creating any dependency other than javax.mail.
So...
Yet another biiiig topic.
First we need to use a common language, and define *entities*:
- A Mime message represents what you call above a mail. (it is the
content of the letter)
- A mail is a mime message getting carried other from a sender to a
recipient. So it is a mime message along with SMTP envelop (the full letter)
Yes, historically, javax.mail.Message is used to represent a Mime object
in James.
This is a pretty bad thing because javax.mail is pretty hard to use.
Mime4J is an effort to remove that dependency in James. There is still a
lot of work to do to reach that goal (most notably in the mailet-container).
> If jSieve could accept a javax.mail.Message, then the default adapter would
> work.
That wouldn't be wise.
JSieve is a separated library in order to encourage usage outside of James.
We can't expect users versions to be aligned.
For users not relying on javax.mail.Message, they would still have to
carry over transformation of the mail entity.
Also, the entity Sieve expects is a mail, not a mime message. That would
be the wrong entity.
>
> Cheers,
> =David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]