View mode: basic / threaded / horizontal-split · Log in · Help
March 08, 2007
Pop3 connection with D
Hello i'm student of College of Engineering Informatics in Fribourg Switzerland.

For a semester project i want to create a E-mail client with D.

Anyone can help me to know how to create a pop3 and smtp connection with D?
I have searched a lot but i found only a dead reference:
http://www.digitalmars.com/d/archives/digitalmars/D/22349.html

Tanks a lot, bye, Roger
March 08, 2007
Re: Pop3 connection with D
Roger wrote:
> Hello i'm student of College of Engineering Informatics in Fribourg Switzerland.
> 
> For a semester project i want to create a E-mail client with D.
> 
> Anyone can help me to know how to create a pop3 and smtp connection with D?
> I have searched a lot but i found only a dead reference:
> http://www.digitalmars.com/d/archives/digitalmars/D/22349.html
> 
> Tanks a lot, bye, Roger

As with a lot of D you might (but not nessisaraly) have to roll your 
own. SMTP isn't that bad (I've used it by hand in telnet). I expect pop 
would be about the same. IIRC there /is/ a lib out there for SMTP.

If you feel "nerdy" enough you can just read the RFC's <G>

pop3
http://tools.ietf.org/html/rfc1939

SMTP
http://tools.ietf.org/html/rfc2821
March 08, 2007
Re: Pop3 connection with D
Roger wrote:

> Hello i'm student of College of Engineering Informatics in Fribourg
> Switzerland.
> 
> For a semester project i want to create a E-mail client with D.
> 
> Anyone can help me to know how to create a pop3 and smtp connection with
> D? I have searched a lot but i found only a dead reference:
> http://www.digitalmars.com/d/archives/digitalmars/D/22349.html
> 
> Tanks a lot, bye, Roger

There is a Pop3 client in Tango's patches directory which is likely to be
included in a later release. We hope to get smtp too, but it's further
away.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource, #d.tango & #D: larsivi
Dancing the Tango
March 08, 2007
Re: Pop3 connection with D
BCS wrote:
> Roger wrote:
>> Hello i'm student of College of Engineering Informatics in Fribourg 
>> Switzerland.
>>
>> For a semester project i want to create a E-mail client with D.
>>
>> Anyone can help me to know how to create a pop3 and smtp connection 
>> with D?
>> I have searched a lot but i found only a dead reference:
>> http://www.digitalmars.com/d/archives/digitalmars/D/22349.html
>>
>> Tanks a lot, bye, Roger
> 
> As with a lot of D you might (but not nessisaraly) have to roll your 
> own. SMTP isn't that bad (I've used it by hand in telnet). I expect pop 
> would be about the same. IIRC there /is/ a lib out there for SMTP.
> 
> If you feel "nerdy" enough you can just read the RFC's <G>
> 
> pop3
> http://tools.ietf.org/html/rfc1939
> 
> SMTP
> http://tools.ietf.org/html/rfc2821

Possibly implementing protocols could be an area in which DSLs might 
help, e.g. in the guise of automata and of course regex. I once designed 
a little DSL for implementing FTP and it was of great help.

Andrei
March 08, 2007
Re: Pop3 connection with D
Andrei Alexandrescu (See Website For Email) wrote:
> Possibly implementing protocols could be an area in which DSLs might 
> help, e.g. in the guise of automata and of course regex. I once designed 
> a little DSL for implementing FTP and it was of great help.


Compile-time DSLs?
March 08, 2007
Re: Pop3 connection with D
kris wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> Possibly implementing protocols could be an area in which DSLs might 
>> help, e.g. in the guise of automata and of course regex. I once 
>> designed a little DSL for implementing FTP and it was of great help.
> 
> 
> Compile-time DSLs?

Obviously.

Andrei
March 09, 2007
Re: Pop3 connection with D
Andrei Alexandrescu (See Website For Email) wrote:
> kris wrote:
> 
>> Andrei Alexandrescu (See Website For Email) wrote:
>>
>>> Possibly implementing protocols could be an area in which DSLs might 
>>> help, e.g. in the guise of automata and of course regex. I once 
>>> designed a little DSL for implementing FTP and it was of great help.
>>
>>
>>
>> Compile-time DSLs?
> 
> 
> Obviously.

That sounds reasonably sophisticated.

Just out of interest, how does one easily debug something like that?
March 09, 2007
Re: Pop3 connection with D
kris wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> kris wrote:
>>
>>> Andrei Alexandrescu (See Website For Email) wrote:
>>>
>>>> Possibly implementing protocols could be an area in which DSLs might 
>>>> help, e.g. in the guise of automata and of course regex. I once 
>>>> designed a little DSL for implementing FTP and it was of great help.
>>>
>>>
>>>
>>> Compile-time DSLs?
>>
>>
>> Obviously.
> 
> That sounds reasonably sophisticated.
> 
> Just out of interest, how does one easily debug something like that?

Very easy. The FTP protocol is described as a collection of states with 
prescribed transitions in between them. A DFA (in C++) implemented them 
in a compact manner; whenever the DFA would bail out (by throwing), it 
would tell what state it was in, what was the expected input, and what 
the actual input was. I remember that library was a rewrite of a library 
written in a "old school" style from first principles (e.g. int and if 
and switch), meaning that following what the code does and where you are 
was horrendous. We were very pleased with the rewrite.


Andrei
March 09, 2007
Re: Pop3 connection with D
Andrei Alexandrescu (See Website For Email) wrote:
> kris wrote:
> 
>> Andrei Alexandrescu (See Website For Email) wrote:
>>
>>> kris wrote:
>>>
>>>> Andrei Alexandrescu (See Website For Email) wrote:
>>>>
>>>>> Possibly implementing protocols could be an area in which DSLs 
>>>>> might help, e.g. in the guise of automata and of course regex. I 
>>>>> once designed a little DSL for implementing FTP and it was of great 
>>>>> help.
>>>>
>>>>
>>>>
>>>>
>>>> Compile-time DSLs?
>>>
>>>
>>>
>>> Obviously.
>>
>>
>> That sounds reasonably sophisticated.
>>
>> Just out of interest, how does one easily debug something like that?
> 
> 
> Very easy. The FTP protocol is described as a collection of states with 
> prescribed transitions in between them. A DFA (in C++) implemented them 
> in a compact manner; whenever the DFA would bail out (by throwing), it 
> would tell what state it was in, what was the expected input, and what 
> the actual input was. I remember that library was a rewrite of a library 
> written in a "old school" style from first principles (e.g. int and if 
> and switch), meaning that following what the code does and where you are 
> was horrendous. We were very pleased with the rewrite.
> 
> 
> Andrei

sounds good.

Yet, you appear to be describing a "black-box" of sorts, with diagnostic 
exceptions? My guess is that interactive "step through" debugging, with 
something like MSVC6 for example, would not be particularly feasible?
March 09, 2007
Re: Pop3 connection with D
kris wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> kris wrote:
>>
>>> Andrei Alexandrescu (See Website For Email) wrote:
>>>
>>>> kris wrote:
>>>>
>>>>> Andrei Alexandrescu (See Website For Email) wrote:
>>>>>
>>>>>> Possibly implementing protocols could be an area in which DSLs 
>>>>>> might help, e.g. in the guise of automata and of course regex. I 
>>>>>> once designed a little DSL for implementing FTP and it was of 
>>>>>> great help.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Compile-time DSLs?
>>>>
>>>>
>>>>
>>>> Obviously.
>>>
>>>
>>> That sounds reasonably sophisticated.
>>>
>>> Just out of interest, how does one easily debug something like that?
>>
>>
>> Very easy. The FTP protocol is described as a collection of states 
>> with prescribed transitions in between them. A DFA (in C++) 
>> implemented them in a compact manner; whenever the DFA would bail out 
>> (by throwing), it would tell what state it was in, what was the 
>> expected input, and what the actual input was. I remember that library 
>> was a rewrite of a library written in a "old school" style from first 
>> principles (e.g. int and if and switch), meaning that following what 
>> the code does and where you are was horrendous. We were very pleased 
>> with the rewrite.
>>
>>
>> Andrei
> 
> sounds good.
> 
> Yet, you appear to be describing a "black-box" of sorts, with diagnostic 
> exceptions? My guess is that interactive "step through" debugging, with 
> something like MSVC6 for example, would not be particularly feasible?

Stepping through was of course possible and useful. The main difference 
was that stepping through manually-written code was replaced by stepping 
through the more compact templated code. The instantiation types are 
different and therefore different actual binary code maps to the same 
source line.

Andrei
« First   ‹ Prev
1 2
Top | Discussion index | About this forum | D home