[Gambas-devel] About gb.net.pop3

Sebastian Kulesz sebikul at ...176...
Fri Aug 31 03:55:05 CEST 2012


On Thu, Aug 30, 2012 at 5:12 PM, Sebastian Kulesz <sebikul at ...176...> wrote:
> On Thu, Aug 30, 2012 at 5:04 PM, Benoît Minisini
> <gambas at ...1...> wrote:
>> Le 30/08/2012 21:56, Sebastian Kulesz a écrit :
>>> On Wed, Aug 29, 2012 at 10:26 PM, Benoît Minisini
>>> <gambas at ...1...> wrote:
>>>> Hi Sebastian,
>>>>
>>>> I am going to make many changes to the interface of your component.
>>>>
>>>> It will be faster for me to make them directly rather than explain them
>>>> by mail.
>>>>
>>>> So once I have done my commit, please look at the result and ask me your
>>>> questions so that I can justify my changes. :-)
>>>>
>>>> Regards,
>>>>
>>>> --
>>>> Benoît Minisini
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Live Security Virtual Conference
>>>> Exclusive live event will cover all the ways today's security and
>>>> threat landscape has changed and how IT managers can respond. Discussions
>>>> will include endpoint security, mobile security and the latest in malware
>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>> _______________________________________________
>>>> Gambas-devel mailing list
>>>> Gambas-devel at lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/gambas-devel
>>>
>>> Sure, no problem. I started implementing a MIME class to parse the
>>> message. The specification is not difficult to implement, it's just
>>> large. I intend to first implement parsing the headers of the message
>>> and body. The only change i made is to create a new class which
>>> implements the MIME specs and make _POPMessage a child, so there
>>> should be no conflicts when merging.
>>>
>>
>> Do you use gmime?
>>
>> The MIME class must not depend on anything specific to Pop3Client.
>>
>> And you should be able to convert a string to a MIME structure
>> (receiving mail) and to create a MIME structure, and then convert it to
>> a string (sending mail).
>>
>> That way, gb.net.smtp will be able to be rewritten entirely in Gambas. :-)
>>
>> Regards,
>>
>> --
>> Benoît Minisini
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Gambas-devel mailing list
>> Gambas-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-devel
>
> I'm using plain Gambas. gmime is too complex and the specs don't
> require anything that gambas can't do ;)
>
> The MIMEMessage class is independent, so that if we later implement
> IMAP, for example, it can be done without additional work.

I like the changes :) One question only. When you reference $iPort to
iPort (line Pop3Client:186) you are never telling the user which port
is being used (even though it should be obvious). Is this intentional?

Leaving POP3 aside, i just pushed an initial implementation of a MIME
parser. It's far from complete, and the code is *really dirty* and
unorganized, but it already has basic functionality. Right now it can
only parse a message into a structure, not backwards, but this will
come later. i'm having some trouble decoding Quoted-Printable content,
but that's because i don't know much of regex. I found this one
online, but i don't know much of the pcre component and how to
directly replace matches, so i hardcoded it into a big loop but it is
really buggy. I'd really thank some help here.

regex: =([0-9a-fA-F]{2})
Quoted-Printable specs: http://tools.ietf.org/html/rfc2045#page-19

The parsing of the headers is divided into 2 steps. Firts multi-line
headers are grouped together with a new-line separator so they are
easy to parse. Then they are organized inside a collection. If a
header is repeated it's value is replaced by a String[] instance and
each time a repetition is fount it's appended to this array. I feel it
is still fast, regardless of it's not-so-optimized implementation.

Please leave your comments!




More information about the Devel mailing list