james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: SMTP Transport?
Date Fri, 12 Jun 2009 12:31:04 GMT
On Fri, Jun 12, 2009 at 01:49:15PM +0200, Markus Wiederkehr wrote:
> On Fri, Jun 12, 2009 at 11:39 AM, Stefano Bagnara<apache@bago.org> wrote:
> > Oleg Kalnichevski ha scritto:
> >> On Thu, Jun 11, 2009 at 04:30:58PM +0200, Markus Wiederkehr wrote:
> >>> I've written a class SmtpTransport that can be used to send a Mime4j
> >>> message to an SMTP server.
> >>>
> >>> Currently it is very simple. Meaning it is not yet capable of
> >>> authentication or TLS or other extensions.
> >>>
> >>> Would it be worth to include this code in Mime4j?
> >>>
> >>> Cheers,
> >>> Markus
> >>>
> >>> PS: Testing is a bit of a PITA with sockets and all.. Robert, could
> >>> MPT help with that? I haven't looked into it yet..
> >>
> >> Markus et al
> >>
> >> _Coincidentally_, I have been working on a LMTP agent and LMTP client with
> >> support for mandatory extensions required by LMTP [1]: PIPELINING,
> >> ENHANCEDSTATUSCODES and 8BITMIME. The implementation is based a NIO framework
> >> derived from HttpCore NIO and should be quite scalable. This is my private
> >> project, but if there is interest in such work, I am willing to contribute it
> >> to James. Alternatively you are very welcome to contribute to the effort. It
> >> ASLv2 licensed.
> >>
> >> Cheers
> >>
> >> Oleg
> >>
> >> [1] http://www.ietf.org/rfc/rfc2033.txt
> >
> > I'm interested in email client, too.
> >
> > But I'm against putting this stuff in mime4j. A new JAMES sub-project
> > (product) would be a better place.
> Why not start with a Mime4j module?
> Later it can become an independent product. That product would have to
> have a Mime4j-submodule though because I'd like to have that
> higher-level API that accepts a Mime4j message and extracts sender and
> recipient addresses from it, too.
> > I'd like to see the sources to understand if it is something I will be
> > interested in collaborating. I wrote a NIO SMTP client, too :-) (MINA).

Hi Markus

> Out of curiosity, how do filter a stream with NIO? (Canonical CRLFs,
> escape dots at the beginning of a line.)

Using a fairly simple session input buffer:


> A Mime4j message has a writeTo(OutputStream) method.. What would have
> to be done on that side? Add a writeTo(WritableByteChannel) method?

For my personal use I am perfectly fine with streaming message body to a temp
file using NIO (NIO can be very efficient at that, specially using direct
transfer methods) and then processing it with mime4j using classic (blocking

> And is it worth it? I mean I've never had performance problems with
> JavaMail's transport which is stream based..

Contrary to popular belief NIO is _significantly_ slower than class i/o in
terms of raw throughput. Actually NIO makes no sense of what so ever for SMTP
clients. Having said that, my primary objective is an LMTP agent, where NIO
does make sense. It is quite suboptimal to have an I/O thread blocked waiting
for a result of a content filtering operation. So, some kind of event driven
protocol layer would make sense, and event-driven architectures are simpler
with NIO. SMTP client is merely a byproduct for me. I simply want to be able to
unit test my code using the same transport / protocol code. Client side LMTP
is virtually identical to client side SMPT, so I should get an SMTP client
implementation basically for free.


> Markus
> > Stefano

View raw message