Retrieving emails

  1. ‹ Older
  2. 7 days ago

    Sascha S

    Jan 10 Pre-Release Testers, Xojo Pro Germany

    @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 ;)

  3. Beatrix W

    Jan 11 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.

  4. 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

  5. Tim S

    Jan 11 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.

  6. 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

  7. Sascha S

    Jan 11 Pre-Release Testers, Xojo Pro Germany

    @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? :)

  8. 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

  9. Sascha S

    Jan 11 Pre-Release Testers, Xojo Pro Germany

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

    That would be really kind. Thank you :)

  10. 6 days ago

    Beatrix W

    Jan 11 Pre-Release Testers Europe (Germany)
    Edited 6 days 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.

  11. Christian S

    Jan 12 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.

  12. Tim S

    Jan 12 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.

  13. Beatrix W

    Jan 12 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.

  14. Tim S

    Jan 12 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 :-)

  15. Sascha S

    Jan 12 Pre-Release Testers, Xojo Pro Germany

    @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*

  16. 5 days ago

    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.

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

  18. Christian S

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

    Just anything to proof the status.
    We like to avoid getting 100s of requests...

    But first get trial and test the plugins...

  19. Edited 5 days ago

    Hi Christian,

    Have downloaded the plugins and will check them out.

    Would scan my badge and send to you on the understand it is private.

    Thank You

  20. Tim S

    Jan 13 Canterbury, UK

    @Ian C 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.

    Retrieve emails with attachments if pos.

    Xojo has a number of classes that may simplify life for you: EmailAttachment, EmailMessage, InternetHeaders, POP3SecureSocket, SMTPSecureSocket. I didn't use any of these probably because I was converting an already existing application to Xojo.

  21. 4 days ago

    Just to let you know have succeded in send an email from my program now to download one...........

    Ian

or Sign Up to reply!