Retrieving emails

  1. 7 months ago

    I have see lots of conversations abouit sending emails but not about downloading emails from an email server.
    anybody any idea's...?

  2. Wayne G

    10 Jan 2019 Pre-Release Testers, Xojo Pro New Zealand axisdirect.nz

    http://docs.xojo.com/POP3SecureSocket

  3. Beatrix W

    10 Jan 2019 Pre-Release Testers Europe (Germany)

    There is CURL from the MBS plugin and the Chilkat plugin. Both have full IMAP functionality.

    The hairy part is parsing the emails. The Chilkat plugin parses only very simple emails. The CURL plugin parses simple emails. If you need more contact me directly or wait for an announcement for a new email parser.

  4. Joost R

    10 Jan 2019 Pre-Release Testers, Xojo Pro The Netherlands

    @Beatrix W - your are supposed to be our email specialist. .. which one would you use for a new project ?

  5. Sascha S

    10 Jan 2019 Pre-Release Testers, Xojo Pro Germany, Lower Saxonary

    @Joost R @Beatrix W - your are supposed to be our email specialist. .. which one would you use for a new project ?

    If i should guess, i'd guess a yet to be announced email parser ;)

  6. Beatrix W

    11 Jan 2019 Pre-Release Testers Europe (Germany)

    @Joost Rongen: do you mean between CURL or Chilkat for accessing IMAP accounts? CURL seems to have a simpler interface. The Chilkat plugin is cross language and isn't really OO.

    As for parsing emails both CURL and Chilkat are equally not very good. It really depends on what you need. If you only have simple text or html mails then both are fine. If you got any type of complex structure in your mail or screwed up data then forget both CURL and Chilkat.

  7. First off Thank you all for your replies but seems i have asked a question that is not simple to answer. I will keep going with the pop3securesocket and let you know if i succeed. Sorry if I wasted your time.

    Ian

  8. Tim S

    11 Jan 2019 Canterbury, UK

    @Ian C I have see lots of conversations abouit sending emails but not about downloading emails from an email server.
    anybody any ideas...?

    I wrote my own from scratch, including the download, recursive parsing of complex bodies, attachment handling, and a Bayesian spam filter. It depends what you want to do, really.

  9. HI Tim,

    I want to send and receive emails from a program that is not as complex as the ones we usually use.

    I will keep going and see what I can come up with.

    You have succeeded in doing what I want to do.

    Ian

  10. Sascha S

    11 Jan 2019 Pre-Release Testers, Xojo Pro Germany, Lower Saxonary

    @Tim S I wrote my own from scratch, including the download, recursive parsing of complex bodies, attachment handling, and a Bayesian spam filter.

    Something you could put up on GitHub or alike? :)

  11. Hi Sascha,
    Not sure if it is something people would be interested in.

    But will look into sharing it on GitHub but have never used it before.
    Am only in the research phase but will start coding soon as have sorted the plan for the program.

    Must tell am a 68 year old dissabled pensioner who cannot afford the plugins meantioned early in this conversation.

    Thank for all the help.

    Ian

  12. Sascha S

    11 Jan 2019 Pre-Release Testers, Xojo Pro Germany, Lower Saxonary

    @Ian C But will look into sharing it on GitHub but have never used it before.

    That would be really kind. Thank you :)

  13. Beatrix W

    11 Jan 2019 Pre-Release Testers Europe (Germany)
    Edited 7 months ago

    Then have lots of fun parsing emails.

    Some pointers:

    Preprocessing: I always make sure that the line endings are of one type. So I use a ReplaceLineEndings on the mail text first.

    Mails have a header. The end of the header is where the first 2 line endings are.

    Headers have something called "comment folding whitespace" which are line continuations. Haven't seen comments in the header myself so I only do "folding whitespace" to bake lines together. Lines that start with whitespace belong to the last line.

    A header value is "name of header: headervalue" so that this is easy to parse.

    Subjects with foreign characters need to be parsed. Example: =?UTF-8?Q?Letzte_Chance:_Flatrate_zum_absoluten_Hammerpreis_-_n?=
    =?UTF-8?Q?ur_24_EUR/Jahr_-_f=C3=BCr_J=C3=B6rg!?=

    The most important other fields are content type and content disposition. Those have a complex format. 2 examples:

    Content-Type: text/plain; charset=utf-8
    Content-Type: multipart/alternative; boundary="--==_mimepart_431915af055771c0a3e7d57f39068231"; charset=UTF-8

    I think nobody uses the first anymore. This is a simple mail.

    The second one of the content types is the most used one. You have a recursive tree structure and you need to hack the rest of the text into pieces with the boundary. With the pieces you again check if you have a header, do the content type again. And so on recursively until you don't have any multipart pieces. Then you can put everything back together. Multipart-alternative means you take either one parts or the other. Multipart-related means that you need all parts.

  14. Christian S

    12 Jan 2019 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    @Ian C Must tell am a 68 year old dissabled pensioner who cannot afford the plugins meantioned early in this conversation.

    No problem.
    Please sign up for a trial here .
    If you than email me a scan of your certificate of disability, we'd upgrade you to a full license.

  15. Tim S

    12 Jan 2019 Canterbury, UK

    @Beatrix W Then have lots of fun parsing emails.

    Some pointers:

    Preprocessing: I always make sure that the line endings are of one type. So I use a ReplaceLineEndings on the mail text first.

    Mails have a header. The end of the header is where the first 2 line endings are.

    Each "part" of a mail will have its own headers. A "part" may be an image, or the HTML body of a message, for example.

    Headers have something called "comment folding whitespace" which are line continuations. Haven't seen comments in the header myself so I only do "folding whitespace" to bake lines together. Lines that start with whitespace belong to the last line.

    A header value is "name of header: headervalue" so that this is easy to parse.

    Subjects with foreign characters need to be parsed. Example: =?UTF-8?Q?Letzte_Chance:_Flatrate_zum_absoluten_Hammerpreis_-_n?=
    =?UTF-8?Q?ur_24_EUR/Jahr_-_f=C3=BCr_J=C3=B6rg!?=

    These are called "encoded words". See this Wikipedia article:

    https://en.wikipedia.org/wiki/MIME

    which describes, amongst other things, encoded words and why they are needed. The article is a good summary and has lots of pointers for further reading. See also RFC 2822. I must have read all these RFCs dozens of times.

    The most important other fields are content type and content disposition. Those have a complex format. 2 examples:

    Content-Type: text/plain; charset=utf-8
    Content-Type: multipart/alternative; boundary="--==_mimepart_431915af055771c0a3e7d57f39068231"; charset=UTF-8

    I think nobody uses the first anymore. This is a simple mail.

    Mails from lists (e.g. the SQLite Users Mailing List) tend to use the first. Here is a snippet from a mail on that list:

    Reply-To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
    Content-Type: text/plain; charset="utf-8"
    Content-Transfer-Encoding: base64
    Errors-To: sqlite-users-bounces@mailinglists.sqlite.org
    Sender: "sqlite-users" <sqlite-users-bounces@mailinglists.sqlite.org>

    SGkgZXZlcnlvbmUhCgpJIHdhbnRlZCB0byBsZXQgdGhlIGNvbW11bml0eSBrbm93IHRoYXQgdGhl
    IHVwY29taW5nIFBlcmNvbmEgTGl2ZSBPcGVuClNvdXJjZSBEYXRhYmFzZSBDb25mZXJlbmNlIHdp
    bGwgaGF2ZSBhIHNwZWNpZmljIHRyYWNrIGZvciDigJxPdGhlciBPcGVuClNvdXJjZSBEYXRhYmFz
    ZXPigJ0sIGluIHdoaWNoIGFueXRoaW5nIFNRTGl0ZS1yZWxhdGVkIHdpbGwgZml0IDopCgpJZiBh
    bnlvbmUgaXMgaW50ZXJlc3RlZCBpbiBwcmVzZW50aW5nLCB5b3UgY2FuIHVzZSB0aGlzIGxpbms6

    [snip lots more lines]

    You'll see that the body is plain text but has been base-64 encoded.

    It took me a couple of years to understand all the ins and outs of this and to code everything up.

  16. Beatrix W

    12 Jan 2019 Pre-Release Testers Europe (Germany)

    @Tim S : yes, I know all this. I wanted to get Ian started a tiny bit without overwhelming him. Especially the RFCs are awful to read.

  17. Tim S

    12 Jan 2019 Canterbury, UK

    @Beatrix W @Tim S : yes, I know all this. I wanted to get Ian started a tiny bit without overwhelming him.

    I'm still not sure what he wants to do. I thought that by getting an idea of the scope of the matter, he could decide what, for example, to limit himself too. Although it would still be necessary to reject mails that were "out of scope".

    Especially the RFCs are awful to read.

    Ha ha yes, you're not wrong :-)

  18. Sascha S

    12 Jan 2019 Pre-Release Testers, Xojo Pro Germany, Lower Saxonary

    @ChristianSchmitz If you than email me a scan of your certificate of disability, we'd upgrade you to a full license.

    This ise VERY VERY kind @ChristianSchmitz *like*

  19. Seeems I have done a bad job of explaining what I want to do so I will try again.

    Send emails with attachments if pos.

    Retreave emails with attachments if pos.

    The program will be open source.

    as for the offer from Cristian Schmiz I am not sure what you refer to as a certificate as all have is letter from the Department of works and pension refering to my award for personal independence payments which is for paying for my carer.

    Ian.

  20. meant add that i do have goverment issue dissability badge for my car.

  21. Newer ›

or Sign Up to reply!