www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - IMAP library

reply "Laeeth Isharc" <Laeeth.nospam nospam-laeeth.com> writes:
Started working on a simple one.  It's not exactly rocket 
science, but a bit fiddly. Need to have some way of manipulating 
email in D though.

Is async important (so you can pipeline commands) and also 
multiple threads ?  Or is a simple enough version useful as a 
start?  If async (ie pipelining and registering callbacks to 
watch state) is important, is it okay to use vibed?  Or better 
not have the dependency.

The other aspect is mime.  Have ported headers for GMime but 
still nee to write the high level wrappers.
Apr 10 2015
next sibling parent reply "Jens Bauer" <doctor who.no> writes:
On Friday, 10 April 2015 at 19:59:49 UTC, Laeeth Isharc wrote:
 Started working on a simple one.
Sounds very good to me. :)
 It's not exactly rocket science, but a bit fiddly.
Simple is good.
 Need to have some way of manipulating email in D though.
I agree. This would especially be cool, if you can do it from a small device like a microcontroller!
 Is async important (so you can pipeline commands) and also 
 multiple threads ?
To me, multiple threads are not important, because on simple microcontrollers, threads are usually not available. If one needs threads, some kind of operating system with a context-switcher is required.
Or is a simple enough version useful as a start?
I'd say "Simple is good". ;)
 If async (ie pipelining and registering callbacks to watch 
 state) is important, is it okay to use vibed?  Or better not 
 have the dependency.
Could the extra bells and whistles be optional, eg. basic functionality in a base class (eh), and then a subclass provide some more dazzling implementation ?
 The other aspect is mime.  Have ported headers for GMime but 
 still nee to write the high level wrappers.
Hmm. Personally I hate MIME, but I guess they're necessary. :P Your work sounds very promising, I look forward to hearing more about your progress. -And please know that my opinions are just opinions; I may be right (if I'm lucky), but I don't want to restrict you in any way. Other developers in here probably have some very good input on this as well.
Apr 10 2015
parent reply "Laeeth Isharc" <nospamlaeeth nospam.laeeth.com> writes:
 Need to have some way of manipulating email in D though.
I agree. This would especially be cool, if you can do it from a small device like a microcontroller!
Yes - nice to know it can do that also. For me I need to have a way of managing large amounts of email (I have about 2mm messages) including for natural language processing etc. Dovecot/sieve + pipe facility is ok, but not perfect for everything. I guess it should work fine for regular ARM etc - perhaps not an Arduino!
 Could the extra bells and whistles be optional, eg. basic 
 functionality in a base class (eh), and then a subclass provide 
 some more dazzling implementation ?
Yes - don't think I will have time to do the async aspect in near future, in any case.
 The other aspect is mime.  Have ported headers for GMime but 
 still nee to write the high level wrappers.
Hmm. Personally I hate MIME, but I guess they're necessary. :P
Yes x2.
 Your work sounds very promising, I look forward to hearing more 
 about your progress.
Understand. Have a few other things on the boil, and also constrained in how much time I can spend for various reasons. So don't plan or expect on it being finished soon, although I hope it might be.
 -And please know that my opinions are just opinions; I may be 
 right (if I'm lucky), but I don't want to restrict you in any 
 way. Other developers in here probably have some very good 
 input on this as well.
Understand, and thanks for the engagement. Laeeth.
Apr 11 2015
parent reply "Jens Bauer" <doctor who.no> writes:
On Saturday, 11 April 2015 at 22:45:39 UTC, Laeeth Isharc wrote:
 Yes - nice to know it can do that also.  For me I need to have 
 a way of managing large amounts of email (I have about 2mm 
 messages) including for natural language processing etc.  
 Dovecot/sieve + pipe facility is ok, but not perfect for 
 everything.  I guess it should work fine for regular ARM etc - 
 perhaps not an Arduino!
I won't say it's impossible, but it would be cumbersome processing email on an AVR. But there are Arduino using ARM Cortex-M microcontrollers too. I can mention a couple of microcontrollers that have ethernet support (eg. they need a PHY of your choice and for instance a HanRun ethernet connector) - Examples are STM32F4xx from ST-Microelectronics and LPC1758/LPC1768/LPC1769/LPC177x/LPC178x/LPC43xx from NXP. There are others from other vendors as well, but those above are quite popular and very easy to find as stand-alone chips or small evaluation boards. I find it particularly interesting to be able to send an email to a device, which can then process and do some simple things (eg. turn stuff on/off, send back the room temparature, etc.) - also a mail-robot would be quite interesting as a stand-alone "thing".
 Have a few other things on the boil, and also constrained in 
 how much time I can spend for various reasons.
I have the exact same problems. ;)
 So don't plan or expect on it being finished soon, although I 
 hope it might be.
It'll be ready when it's ready. When building in small steps, the job often gets easier. May you be successful with ease!
Apr 12 2015
next sibling parent "Laeeth Isharc" <nospamlaeeth nospam.laeeth.com> writes:
On Sunday, 12 April 2015 at 17:27:32 UTC, Jens Bauer wrote:

 I won't say it's impossible, but it would be cumbersome 
 processing email on an AVR.
I do miss the days of having to work within very real hardware constraints to achieve something only just about achievable. But part of the joy goes out of it when you know that the constraint is artifical.
 But there are Arduino using ARM Cortex-M microcontrollers too.
Yes - I meant this in a loose, everyday, form of speaking.
 I can mention a couple of microcontrollers that have ethernet 
 support (eg. they need a PHY of your choice and for instance a 
 HanRun ethernet connector) - Examples are STM32F4xx from 
 ST-Microelectronics and 
 LPC1758/LPC1768/LPC1769/LPC177x/LPC178x/LPC43xx from NXP.
 There are others from other vendors as well, but those above 
 are quite popular and very easy to find as stand-alone chips or 
 small evaluation boards.
Tku - I have one of these modules lying around, but have not had time to hook it up yet and don't remember which one. We may not have been delivered the world of the Jetsons, but I am still occasionally astonished that what was only imagination in childhood is now almost too ordinary to be worth remarking on today. One aspect of embedded stuff I haven't seen people comment on is that even if D is not yet there for running for regular use on the controller, you still need to talk to it from the host or control unit, and I guess D can be quite useful there. Also for processing logs, and so on.
 I find it particularly interesting to be able to send an email 
 to a device, which can then process and do some simple things 
 (eg. turn stuff on/off, send back the room temparature, etc.) - 
 also a mail-robot would be quite interesting as a stand-alone 
 "thing".
Yes - makes sense. (Reminded of an article on the supposed spam epidemic from networked 'toasters'). Email might not be the best protocol for this, but it is easy.
 It'll be ready when it's ready. When building in small steps, 
 the job often gets easier.

 May you be successful with ease!
Thank you! And v interesting what you are doing on the microcontroller side, too - and I hope that goes well. Laeeth
Apr 12 2015
prev sibling parent reply Johannes Pfau <nospam example.com> writes:
Am Sun, 12 Apr 2015 17:27:31 +0000
schrieb "Jens Bauer" <doctor who.no>:

 On Saturday, 11 April 2015 at 22:45:39 UTC, Laeeth Isharc wrote:
 Yes - nice to know it can do that also.  For me I need to have 
 a way of managing large amounts of email (I have about 2mm 
 messages) including for natural language processing etc.  
 Dovecot/sieve + pipe facility is ok, but not perfect for 
 everything.  I guess it should work fine for regular ARM etc - 
 perhaps not an Arduino!
I won't say it's impossible, but it would be cumbersome processing email on an AVR.
There are HTTP servers for AVR(8bit) devices, so it should be possible. Doesn't mean it's a good idea though ;-)
Apr 13 2015
parent reply "Jens Bauer" <doctor who.no> writes:
On Monday, 13 April 2015 at 14:31:56 UTC, Johannes Pfau wrote:
 Am Sun, 12 Apr 2015 17:27:31 +0000
 schrieb "Jens Bauer" <doctor who.no>:

 I won't say it's impossible, but it would be cumbersome 
 processing email on an AVR.
There are HTTP servers for AVR(8bit) devices, so it should be possible.
That's absolutely true, but usually they're very simple. You can interface the AVR to an external SRAM or NOR-flash and thus store the entire email (or Web-page) there. But imagine that someone sends an email with an attachment - or just writes 50K of babbling. -That might be difficult if you have an AVR with only 8K RAM. It's much easier - and perhaps cheaper - to pick a Cortex-M, which has most of the things you need already; you can get ethernet PHYs for less than $2, which interfaces with a Cortex-M.
Apr 13 2015
parent reply "Laeeth Isharc" <Laeeth.nospam nospam-laeeth.com> writes:
On Monday, 13 April 2015 at 18:03:12 UTC, Jens Bauer wrote:
 On Monday, 13 April 2015 at 14:31:56 UTC, Johannes Pfau wrote:
 Am Sun, 12 Apr 2015 17:27:31 +0000
 schrieb "Jens Bauer" <doctor who.no>:

 I won't say it's impossible, but it would be cumbersome 
 processing email on an AVR.
There are HTTP servers for AVR(8bit) devices, so it should be possible.
That's absolutely true, but usually they're very simple. You can interface the AVR to an external SRAM or NOR-flash and thus store the entire email (or Web-page) there. But imagine that someone sends an email with an attachment - or just writes 50K of babbling. -That might be difficult if you have an AVR with only 8K RAM. It's much easier - and perhaps cheaper - to pick a Cortex-M, which has most of the things you need already; you can get ethernet PHYs for less than $2, which interfaces with a Cortex-M.
I am reminded of the constraints from these days: http://www.abook.ru/dmk/FidoNet/unpublished/fhist.html My first 'open source' contribution was to a data structure in his BBS system a few years later.
Apr 13 2015
parent reply "Jens Bauer" <doctor who.no> writes:
On Tuesday, 14 April 2015 at 02:28:40 UTC, Laeeth Isharc wrote:
 My first 'open source' contribution was to a data structure in 
 his BBS system a few years later.
Those were the days. I wrote my own BBS for Atari ST in 1988 (which was never released to the public) - and I started writing a mailer as well. Today noone is using those things anymore though. However, a microcontroller would probably be good for a BBS; it can easily connect to a modem. ;)
Apr 14 2015
parent "D Denizen since a year" <nospam gmail.com> writes:
On Tuesday, 14 April 2015 at 14:01:10 UTC, Jens Bauer wrote:
 On Tuesday, 14 April 2015 at 02:28:40 UTC, Laeeth Isharc wrote:
 My first 'open source' contribution was to a data structure in 
 his BBS system a few years later.
Those were the days. I wrote my own BBS for Atari ST in 1988 (which was never released to the public) - and I started writing a mailer as well. Today noone is using those things anymore though. However, a microcontroller would probably be good for a BBS; it can easily connect to a modem. ;)
Come the next Carrington event, and we'll be running fidonet over mesh packet switching until everything is rebuilt ;)
Apr 14 2015
prev sibling parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
You might like my email.d too 
https://github.com/adamdruppe/arsd/blob/master/email.d

It is able to help construct emails and also read an mbox format 
- part of that code might help your imap library too.
Apr 13 2015
next sibling parent "Laeeth Isharc" <Laeeth.nospam nospam-laeeth.com> writes:
On Tuesday, 14 April 2015 at 02:31:23 UTC, Adam D. Ruppe wrote:
 You might like my email.d too 
 https://github.com/adamdruppe/arsd/blob/master/email.d

 It is able to help construct emails and also read an mbox 
 format - part of that code might help your imap library too.
Thanks, Adam. Was just thinking earlier today that I should reread that code. Laeeth
Apr 13 2015
prev sibling parent "Jens Bauer" <doctor who.no> writes:
On Tuesday, 14 April 2015 at 02:31:23 UTC, Adam D. Ruppe wrote:
 You might like my email.d too 
 https://github.com/adamdruppe/arsd/blob/master/email.d

 It is able to help construct emails and also read an mbox 
 format - part of that code might help your imap library too.
This looks very nice. I did not find any dot stuffing in there; maybe it would be a good idea to add this ? http://tools.ietf.org/html/rfc5321#section-4.5.2
Apr 14 2015