[mel-base-devel] Some remarks

Frédéric Jolliton mel-base at frederic.jolliton.com
Thu Dec 7 21:17:48 UTC 2006


Hi,

Just some little remarks about mel-base. Except perhaps for point 1,
it's nothing serious for my own needs.

I've discovered mel-base some days ago, and while I searched the ML
(it was fast :)) and googled for more info, I really hope I'm not
asking obvious things.

1) Is there a way to open an IMAP folder with element-type
(unsigned-byte 8) ?

make-imap-connection is calling make-connection with 'character, but
it looks wrong to me. Technically, a mail is a sequence of
(unsigned-byte 8) with no meaning at the low level, and not a sequence
of (CL) characters. While some protocols forbid 8 bits characters,
most (all?) of them have 0-127 to represent ASCII set, but 128-255 are
unspecified and used for various encoding.

I understand that returning array of (unsigned-byte 8) may not be
convenient to users, but at least it is close to the "real" contents
of mails.

For example, a mail encoded with utf-8 cannot be processed by mel-base
because the contents is translated to another default representation
(iso-8859-1?), probably depending of the CL implementation (or locale
settings.) Also sometimes, I receive broken mails with 8bits bytes in
header. Not failing in such cases may be interesting for robustness.

  CL-USER> (mel:content-type (first (mel:parts (first (mel:messages *inbox*)))))
  :TEXT
  :PLAIN
  (:CHARSET "utf-8")

Here, mel-base know it is the utf-8 charset, but it's too late since
it is already a string internally.

If that was me, I would handle everything in (unsigned-byte 8) and
even split/search for fields in header using this element-type, and so
on for all the internal stuff. And perhaps returns string to the user
when encoding is known or when the sequence is composed only of
(unsigned-byte 7).

Also, not all CL implementation may support ASCII subset. But ok, such
implementations are probably not widespread :)

What do you think about that?

2) What is the way to handle connection timeout in mel-base?

When the connection times out, I get:

  end of file on #<SB-SYS:FD-STREAM for "a constant string" {D25A101}>
     [Condition of type END-OF-FILE]

We have to know what exceptions the implementation raises when the
connection is broken, which may not be convenient.

Ultimately, it could be nice to have a restart to reconnect
automatically. But on other side, it is perhaps bad because we lost
the state of the connection which be necessary to mel-base.

3) As said in a private mail, a SSL support could be nice too :)

I've no idea how hard it would be to use cl-ssl with cl-mel-base.


Thanks again for this project!

-- 
Frédéric Jolliton



More information about the mel-base-devel mailing list