Re: [twsocket] Should next ICS version support anything before Delphi XE ?
I'm currently on D7 (which is very stable). IMHO ICS should at least D7. Michael -Original Message- From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On Behalf Of François Piette Sent: Wednesday, March 28, 2012 8:59 PM To: ICS support mailing Subject: [twsocket] Should next ICS version support anything before Delphi XE ? Hi ! I'm planning the next ICS version... Being unable to use any features added to Delphi in the last 10 years is very restricted. Maybe we need to cease support for old Delphi versions ? Of course ICS V5 and V7 will remains available however, the only changes will be bug fixes. What do you think ? Please keep your answer as short as possible, I just want to have an idea about how many of you are still using an old Delphi version. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Decoding MIME messages
Francois, I'm trying to write a very basic automation, which should try to detect some patterns within mails, and if a mail content matches, it should save that mail for further processing and delete it from the pop3 server. Each unprocessed ('unknown' content) should stay on the server, until there's a handler for that unknown pattern. In other words, it should be a system where rules/patterns are added as soon as they're needed. What I've done so far is using a TPop3Cli component to read mails (in the first step without deleting from server) and a TMimeDecodeW component to get the contents. What's to do next is to separate readable (textual) parts of the mail and ignore all inlines or attachments. I don't need full code, but a step by step guideline on how to accomplish it. Currently I'm trying to use TMimeDecodeEx, which seems toi do what I need. Michael -Original Message- From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On Behalf Of Francois PIETTE Sent: Wednesday, November 18, 2009 6:48 AM To: ICS support mailing Subject: Re: [twsocket] Decoding MIME messages > What I basically need is to extract a text part from each mail, regardless > how many contents it may have. The "text part" is not well defined. You may have an HTML message which is not trivial to convert to a text file. Rendered on screen by a HTML rendere, it may looks like plain text but actually it isn't. You may also have an RTF formatted message. Or a plain text part and a HTML part with eauivalent content. You have to handle all the situation by detecting what format it is. You are helped by the various headers. Are you writing an email client, that is a program whose goal is to display messages on screen ? Then you need ICS-POP3 component to retieve the messages, ICS MIME component to extract the parts and as many renderer component as you want to support messages types. Are you writing some sort of automation which uses email as transport and use the data within email for data processing and not to display it on screen as an email ? That's a different thing. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be Legal Notice: HEM Vertriebs GmbH Haller Strasse 30 D-74523 Schwaebisch Hall Fon: +49-791-4079-0 Fax: +49-791-4079-80 http://www.hem.de email: i...@hem.de Rechtsform : HEM Vertriebs GmbH Handelsregister : Stuttgart HRB 570346 Steuernummer: 84060/00397 UST-ID DE256870483 Sitz der Gesellschaft : Schwäbisch Hall Geschaeftsfuehrer: Gunter Schaaf, Rene Schaaf -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Can't compile ICS V6
Arno, I tried to use TMimeDecodeW, but it won't change its behaviour regarding the encoded subject. So I guess I've to decode it separately from the mail, as soon as I detect 'iso-8859-1' in the subject line. I have another question and I hope someone can help me. I couldn't find useful information yet. I have to retrieve mails via POP3 (currently working!) and decode its textual part, which is then parsed and written to a file. I can see that some multipart messages have a text/plain part, but some others just have several multipart/alternative parts. So I firstly have to find which part to decode and secondly to find how to write just that part to a memory stream and/or file. A (simple) sample which addresses multipart messages would be fine ;) Thanks, Michael -Original Message- From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On Behalf Of Arno Garrels Sent: Tuesday, November 17, 2009 11:16 AM To: ICS support mailing Subject: Re: [twsocket] Can't compile ICS V6 Kochendoerfer, Michael wrote: > Arno, > > please ignore my last mail - V7 installed without problems. Thanks > for the hint!! > > One of the reasons for my update was a problem with the TMimeDecode > component, but I guess V7 doesn't behave different here. I have a > POP3 mail which has a subject like this: > > =?iso-8859-1?Q?FW:_Newsletter_-_Gr=FCn_ist_f=FCr_Sie!?= > > And I need to get a plain text subject from that. I thought that in > OnMessageEnd the .Subject is changed to plain text, but it is not. So > I need to find a reliable way to detect and convert such subjects > into plain text. And I'm quite sure that V7 has an option for it. I > just can't find it ;) Have a look at the new TMimeDecodeW, it decodes those inline encoded strings to WideString/UnicodeString. Display with non-Unicode compilers will only work reliable if the charset matches system's default ansi charset. "iso-8859-1" will display fine with windows-1252 except for the EURO sign. Or use the TNT-Unicode components mentioned in OverbyteIcsMimeDemo. -- Arno Garrels > > Michael > > -Original Message- > From: twsocket-boun...@elists.org > [mailto:twsocket-boun...@elists.org] On Behalf Of Arno Garrels > Sent: Tuesday, November 17, 2009 10:41 AM > To: ICS support mailing > Subject: Re: [twsocket] Can't compile ICS V6 > > Kochendoerfer, Michael wrote: >> Hi, >> >> I recently downloaded ICS V6 package from overbyte.be and now I'm >> trying to install it according to the readme file. However, I can't >> compile it because the compiler gives an error about an unknown >> _IntToStr (note the underscore) in OverbyteIcsHttpSrv. >> >> I'm on D7. What did I miss? > > This is fixed in latest snapshot downloadable at: > http://wiki.overbyte.be/wiki/index.php/FAQ#How_to_get_ICS > > or simply exchange "_IntToStr" by "IntToStr". > > Why don't you use ICS-V7? > > -- > Arno Garrels > >> >> TIA, >> Michael >> >> >> Legal Notice: >> >> HEM Vertriebs GmbH >> Haller Strasse 30 >> D-74523 Schwaebisch Hall >> Fon: +49-791-4079-0 >> Fax: +49-791-4079-80 >> >> http://www.hem.de email: i...@hem.de >> >> Rechtsform : HEM Vertriebs GmbH >> Handelsregister : Stuttgart HRB 570346 >> Steuernummer: 84060/00397 UST-ID DE256870483 >> Sitz der Gesellschaft : Schwäbisch Hall >> Geschaeftsfuehrer: Gunter Schaaf, Rene Schaaf >> >> >> >> >> >>> -- >>> To unsubscribe or change your settings for TWSocket mailing list >>> please goto >>> http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our >>> website at http://www.overbyte.be > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > > > Legal Notice: > > HEM Vertriebs GmbH > Haller Strasse 30 > D-74523 Schwaebisch Hall > Fon: +49-791-4079-0 > Fax: +49-791-4079-80 > > http://www.hem.de email: i...@hem.de > > Rechtsform : HEM Vertriebs GmbH > Handelsregister : Stuttgart HRB 570346 > Steuernummer: 84060/00397 UST-ID DE256870483 > Sitz der Gesellschaft : Schwäbisch Hall > Geschaeftsfuehrer: Gunter Schaaf, Rene Schaaf -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be Legal Notice: HEM Vertriebs GmbH Haller Strasse 30 D-74523 Schwaebisch Hall Fon: +49-791-4079-0 Fax: +49-791-4079-80 http://www.hem.de email: i...@hem.de Rechtsform : HEM Vertriebs GmbH Handelsregister : Stuttgart HRB 570346 Steuernummer: 84060/00397 UST-ID DE256870483 Sitz der Gesellschaft : Schwäbisch Hall Geschaeftsfuehrer: Gunter Schaaf, Rene Schaaf -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Can't compile ICS V6
Arno, please ignore my last mail - V7 installed without problems. Thanks for the hint!! One of the reasons for my update was a problem with the TMimeDecode component, but I guess V7 doesn't behave different here. I have a POP3 mail which has a subject like this: =?iso-8859-1?Q?FW:_Newsletter_-_Gr=FCn_ist_f=FCr_Sie!?= And I need to get a plain text subject from that. I thought that in OnMessageEnd the .Subject is changed to plain text, but it is not. So I need to find a reliable way to detect and convert such subjects into plain text. And I'm quite sure that V7 has an option for it. I just can't find it ;) Michael -Original Message- From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On Behalf Of Arno Garrels Sent: Tuesday, November 17, 2009 10:41 AM To: ICS support mailing Subject: Re: [twsocket] Can't compile ICS V6 Kochendoerfer, Michael wrote: > Hi, > > I recently downloaded ICS V6 package from overbyte.be and now I'm > trying to install it according to the readme file. However, I can't > compile it because the compiler gives an error about an unknown > _IntToStr (note the underscore) in OverbyteIcsHttpSrv. > > I'm on D7. What did I miss? This is fixed in latest snapshot downloadable at: http://wiki.overbyte.be/wiki/index.php/FAQ#How_to_get_ICS or simply exchange "_IntToStr" by "IntToStr". Why don't you use ICS-V7? -- Arno Garrels > > TIA, > Michael > > > Legal Notice: > > HEM Vertriebs GmbH > Haller Strasse 30 > D-74523 Schwaebisch Hall > Fon: +49-791-4079-0 > Fax: +49-791-4079-80 > > http://www.hem.de email: i...@hem.de > > Rechtsform : HEM Vertriebs GmbH > Handelsregister : Stuttgart HRB 570346 > Steuernummer: 84060/00397 UST-ID DE256870483 > Sitz der Gesellschaft : Schwäbisch Hall > Geschaeftsfuehrer: Gunter Schaaf, Rene Schaaf > > > > > >> -- >> To unsubscribe or change your settings for TWSocket mailing list >> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket >> Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be Legal Notice: HEM Vertriebs GmbH Haller Strasse 30 D-74523 Schwaebisch Hall Fon: +49-791-4079-0 Fax: +49-791-4079-80 http://www.hem.de email: i...@hem.de Rechtsform : HEM Vertriebs GmbH Handelsregister : Stuttgart HRB 570346 Steuernummer: 84060/00397 UST-ID DE256870483 Sitz der Gesellschaft : Schwäbisch Hall Geschaeftsfuehrer: Gunter Schaaf, Rene Schaaf -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Can't compile ICS V6
Arno, can I use V7 as a replacement (better, of course!) for my previous version, which (I think) was V5? Michael -Original Message- From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On Behalf Of Arno Garrels Sent: Tuesday, November 17, 2009 10:41 AM To: ICS support mailing Subject: Re: [twsocket] Can't compile ICS V6 Kochendoerfer, Michael wrote: > Hi, > > I recently downloaded ICS V6 package from overbyte.be and now I'm > trying to install it according to the readme file. However, I can't > compile it because the compiler gives an error about an unknown > _IntToStr (note the underscore) in OverbyteIcsHttpSrv. > > I'm on D7. What did I miss? This is fixed in latest snapshot downloadable at: http://wiki.overbyte.be/wiki/index.php/FAQ#How_to_get_ICS or simply exchange "_IntToStr" by "IntToStr". Why don't you use ICS-V7? -- Arno Garrels > > TIA, > Michael > > > Legal Notice: > > HEM Vertriebs GmbH > Haller Strasse 30 > D-74523 Schwaebisch Hall > Fon: +49-791-4079-0 > Fax: +49-791-4079-80 > > http://www.hem.de email: i...@hem.de > > Rechtsform : HEM Vertriebs GmbH > Handelsregister : Stuttgart HRB 570346 > Steuernummer: 84060/00397 UST-ID DE256870483 > Sitz der Gesellschaft : Schwäbisch Hall > Geschaeftsfuehrer: Gunter Schaaf, Rene Schaaf > > > > > >> -- >> To unsubscribe or change your settings for TWSocket mailing list >> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket >> Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be Legal Notice: HEM Vertriebs GmbH Haller Strasse 30 D-74523 Schwaebisch Hall Fon: +49-791-4079-0 Fax: +49-791-4079-80 http://www.hem.de email: i...@hem.de Rechtsform : HEM Vertriebs GmbH Handelsregister : Stuttgart HRB 570346 Steuernummer: 84060/00397 UST-ID DE256870483 Sitz der Gesellschaft : Schwäbisch Hall Geschaeftsfuehrer: Gunter Schaaf, Rene Schaaf -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] Can't compile ICS V6
Hi, I recently downloaded ICS V6 package from overbyte.be and now I'm trying to install it according to the readme file. However, I can't compile it because the compiler gives an error about an unknown _IntToStr (note the underscore) in OverbyteIcsHttpSrv. I'm on D7. What did I miss? TIA, Michael Legal Notice: HEM Vertriebs GmbH Haller Strasse 30 D-74523 Schwaebisch Hall Fon: +49-791-4079-0 Fax: +49-791-4079-80 http://www.hem.de email: i...@hem.de Rechtsform : HEM Vertriebs GmbH Handelsregister : Stuttgart HRB 570346 Steuernummer: 84060/00397 UST-ID DE256870483 Sitz der Gesellschaft : Schwäbisch Hall Geschaeftsfuehrer: Gunter Schaaf, Rene Schaaf -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Simple POP3 application
I'd like to stay with ICS, as Indy gave me too many problems in the past... However - I found an old sample ('a mini pop3cli' - thanks to Wilfried :)), but this won't work. It enters state STAT, but when entering RETR, it gives an POP3 error 500 (RqType is 7), and I don't know where it comes from... In general, this little program is exactly doing what I'd like to do, and it's expandable. Michael -Original Message- From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On Behalf Of Fastream Technologies Sent: Monday, November 16, 2009 2:49 PM To: ICS support mailing Subject: Re: [twsocket] Simple POP3 application I presume Francois will get angry when he reads your suggestion of a competitor on ICS list. SZ On Mon, Nov 16, 2009 at 3:42 PM, Alex Greenspan wrote: > You can use the indy POP3 component. I've used it in Delphi 7 and it's > fairly simple. > > -Alex Greenspan > > On Mon, Nov 16, 2009 at 8:24 AM, Kochendoerfer, Michael wrote: > > > Hi, > > > > I'm curious if there's a very simple way to retrieve mails from a POP3 > > account for writing them out to files. The MailRcv1 demo is too much for > > this (to handle and to understand), so I'm just looking for a very simple > > example on how to do it. > > > > Should be not much more than open/list > > (?)/retrieve-to-stream-or-file/close. > > > > We're on D7 and ICS V6 (?). > > > > TIA, > > Michael > > > > > > Legal Notice: > > > > HEM Vertriebs GmbH > > Haller Strasse 30 > > D-74523 Schwaebisch Hall > > Fon: +49-791-4079-0 > > Fax: +49-791-4079-80 > > > > http://www.hem.de email: i...@hem.de > > > > Rechtsform : HEM Vertriebs GmbH > > Handelsregister : Stuttgart HRB 570346 > > Steuernummer: 84060/00397 UST-ID DE256870483 > > Sitz der Gesellschaft : Schwäbisch Hall > > Geschaeftsfuehrer: Gunter Schaaf, Rene Schaaf > > > > > > -- > > To unsubscribe or change your settings for TWSocket mailing list > > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > > Visit our website at http://www.overbyte.be > > > > > > -- > Alex Greenspan > Digital Matrix Corporation > 92 Madison Ave. > Hemsptead, NY 11550 > USA > > tel. +1.516.481.7990 > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be Legal Notice: HEM Vertriebs GmbH Haller Strasse 30 D-74523 Schwaebisch Hall Fon: +49-791-4079-0 Fax: +49-791-4079-80 http://www.hem.de email: i...@hem.de Rechtsform : HEM Vertriebs GmbH Handelsregister : Stuttgart HRB 570346 Steuernummer: 84060/00397 UST-ID DE256870483 Sitz der Gesellschaft : Schwäbisch Hall Geschaeftsfuehrer: Gunter Schaaf, Rene Schaaf -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] Simple POP3 application
Hi, I'm curious if there's a very simple way to retrieve mails from a POP3 account for writing them out to files. The MailRcv1 demo is too much for this (to handle and to understand), so I'm just looking for a very simple example on how to do it. Should be not much more than open/list (?)/retrieve-to-stream-or-file/close. We're on D7 and ICS V6 (?). TIA, Michael Legal Notice: HEM Vertriebs GmbH Haller Strasse 30 D-74523 Schwaebisch Hall Fon: +49-791-4079-0 Fax: +49-791-4079-80 http://www.hem.de email: i...@hem.de Rechtsform : HEM Vertriebs GmbH Handelsregister : Stuttgart HRB 570346 Steuernummer: 84060/00397 UST-ID DE256870483 Sitz der Gesellschaft : Schwäbisch Hall Geschaeftsfuehrer: Gunter Schaaf, Rene Schaaf -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] OnSessionClosed
Markus, why not implementing some kind of NOOP over the protocol? Means that your client's sending some special small data packets over the line which the server simply drops, only if transfer is idle and possibly timer based? Michael > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Behalf Of [EMAIL PROTECTED] > Sent: Wednesday, February 14, 2007 3:38 PM > To: twsocket@elists.org > Subject: [twsocket] OnSessionClosed > > > Hello, > > strange problem here: > > - two PCs connected via normal LAN > - one runs my server app (simple TWSocket since the server > only has to handle one connection) > - the other one runs my client app (twsocket as well) > - the connection is a TCP connection > > Normal communication is fine. I've assigned OnSessionClosed > on both server and client side. > If I plug out the cable the server side detects the > OnSessionClosed, but not the client side! > > This also happens with the included demo programs Client5 and > TCPSvr. The server will recognize > the lost connection but not the client. Since I'd like to > reestablish that connection if there > hasn't been a request of my client program to close the > connection (I've implemented something > for that in my protocol) I need to know on the client side > when the connection is lost! > > What's wrong here? > > Greetings > > Markus > > > ebm-papst St. Georgen GmbH & Co. KG > Kommanditgesellschaft Sitz St. Georgen > Amtsgericht Freiburg HRA 601094 > Persoenlich haftende Gesellschafterin: > Papst-Motoren GmbH, Sitz St. Georgen > Amtsgericht Freiburg HRB 600163 > Geschaeftsfuehrer: Dr. Gerhard Lahm, Thomas Wagner > > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Problem with ftp and (legacy) ICS
Francois, I was not aware that the current V5 would work with Delphi versions less than 7. Got it, worked ;) Thanks a lot. Michael > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Behalf Of Francois PIETTE > Sent: Tuesday, January 30, 2007 6:22 PM > To: ICS support mailing > Subject: Re: [twsocket] Problem with ftp and (legacy) ICS > > > > I tried to do it with an older version of ICS which supports D5. > > Current ICS-V5 support Delphi 5. Use that version, not an old > one ! Download > now from http://www.overbyte.be. > > ICS-V6, still in beta, will not support D5 anymore. > > -- > Contribute to the SSL Effort. Visit > http://www.overbyte.be/eng/ssl.html > -- > [EMAIL PROTECTED] > http://www.overbyte.be > > > > - Original Message - > From: "Kochendoerfer, Michael" <[EMAIL PROTECTED]> > To: > Sent: Tuesday, January 30, 2007 4:10 PM > Subject: [twsocket] Problem with ftp and (legacy) ICS > > > > Hi, > > > > since I've to write a small ftp transfer program to > transfer just single > > files in D5, I tried to do it with an older version of ICS > which supports > > D5. Uploading files to a ftp server is fine but not > downloading. Status > > tells me that the file transfer is complete (226 Transfer > complete), but > > the file is nowhere on the local harddisk. > > > > This is my very simple procedure: > > > > try > >with ftpCli do begin > > HostName := '172.18.10.40'; > > UserName := 'anonymous'; > > Password := 'gimmedafile'; > > LocalFileName := 'd:\410.jpg'; > > HostDirName := '/'; > > HostFileName := '410.jpg'; > > > > Receive; > > Quit; > >end; > > except > >on E: Exception do meLog.Lines.Add('*** ' + E.ClassName + ': ' + > > E.Message); > > end; > > > > What am I doing wrong? Have I to save the file for myself > after it has > > been transferred? Or is the above syntax wrong for dirs and files? > > However, uploading works the same way except for the > Receive() - upload > > calls Transfer() instead. > > > > TIA > > Michael > > > > -- > > To unsubscribe or change your settings for TWSocket mailing list > > please goto http://www.elists.org/mailman/listinfo/twsocket > > Visit our website at http://www.overbyte.be > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] Problem with ftp and (legacy) ICS
Hi, since I've to write a small ftp transfer program to transfer just single files in D5, I tried to do it with an older version of ICS which supports D5. Uploading files to a ftp server is fine but not downloading. Status tells me that the file transfer is complete (226 Transfer complete), but the file is nowhere on the local harddisk. This is my very simple procedure: try with ftpCli do begin HostName := '172.18.10.40'; UserName := 'anonymous'; Password := 'gimmedafile'; LocalFileName := 'd:\410.jpg'; HostDirName := '/'; HostFileName := '410.jpg'; Receive; Quit; end; except on E: Exception do meLog.Lines.Add('*** ' + E.ClassName + ': ' + E.Message); end; What am I doing wrong? Have I to save the file for myself after it has been transferred? Or is the above syntax wrong for dirs and files? However, uploading works the same way except for the Receive() - upload calls Transfer() instead. TIA Michael -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] FTP high-level component
Thanks very much Francois... I didn't remember this one ;) Michael > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Behalf Of Francois Piette > Sent: Wednesday, January 24, 2007 3:51 PM > To: ICS support mailing > Subject: Re: [twsocket] FTP high-level component > > > > Also not a problem if it costs some money (however, I > contributed to the > > SSL project but Francois didn't still list me due to a lack of time > > You don't need to be on the advertized list. You have your > usercode/password > for ICS-SSL. TMagFTP component is just in the file list below > the ICS-SSL > files. You can download it since you've got your login ! > > Contribute to the SSL Effort. Visit > http://www.overbyte.be/eng/ssl.html > -- > [EMAIL PROTECTED] > Author of ICS (Internet Component Suite, freeware) > Author of MidWare (Multi-tier framework, freeware) > http://www.overbyte.be > > > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] FTP high-level component
Angus, I hope I'm not OT, but... your web site says: "Compatible with Delphi 5/6/7/2005/2006, tested with Windows 98, NT4, Windows 2000, XP and 2003. Files larger than 2 gigs needs Delphi 6 or later." Is this still true? I guess it would help a few other users here to know that there are such components available (for not being totally OT :)) Michael > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Behalf Of Angus Robertson - Magenta Systems Ltd > Sent: Wednesday, January 24, 2007 2:21 PM > To: twsocket@elists.org > Subject: Re: [twsocket] FTP high-level component > > > > Also not a problem if it costs some money (however, I contributed > > to the SSL project but Francois didn't still list me due to a lack > > of time) - if you like, you can tell me in a pm what you'd like to > > get for the components for recompiling (= with sources included). > > Pricing and order form is on my web site. But I'm sure > Francois can fix > up a logon easily. > > > Possibly a problem could be that it should be included in a D5 > > project which has to use legacy ICS sources. No chance at this time > > to advance to a higher Delphi version. Could this be problematic? > > I don't support 'legacy' ICS source, only the latest V5 and V6 betas > which have many improvements needed for proper FTP support. If you > really need to support long obsoleted ICS code, you'll need > to edit the > TMagFtp source to remove functions needing newer versions. > Likewise I've > stopped backward testing with eight year old compilers, you > can only go > back so far, but it probably still works. > > Angus > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] FTP high-level component
Angus, not a problem if one has to login (and such) previously. It's just important that the main transfer process is encapsulated into a few lines of code rather than a complex handling scheme. Also not a problem if it costs some money (however, I contributed to the SSL project but Francois didn't still list me due to a lack of time) - if you like, you can tell me in a pm what you'd like to get for the components for recompiling (= with sources included). Possibly a problem could be that it should be included in a D5 project which has to use legacy ICS sources. No chance at this time to advance to a higher Delphi version. Could this be problematic? Michael > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Behalf Of Angus Robertson - Magenta Systems Ltd > Sent: Wednesday, January 24, 2007 12:23 PM > To: twsocket@elists.org > Subject: Re: [twsocket] FTP high-level component > > > > I'm playing around with the TFtpXXX components, and for not to > > invent the wheel again, I'm looking for some kind of high-level > > component based on ICS. > > TMagFTP which is at: > > http://www.magsys.co.uk/delphi/magxfer.asp > > Note this is not free source code, a lot of effort went into it's > development and testing. DCUs are free, but you either have > to license > the source or support ICS-SSL development financially from > where you can > also download the source. > > > Like this (samples): > > CopyFileToFTP(LocalFile, FTPServer); > > It's never that simple, FTP servers need logons that can > fail, they have > multiple directories, etc, but one of our functions is almost that > simple: > > function FtpDownOneFile (const FdirSrc, Fnamesrc, Fnametar: string ; > Replopt: TFileCopyRepl) : TTaskResult ; > > Angus > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] FTP high-level component
Hi there, I'm playing around with the TFtpXXX components, and for not to invent the wheel again, I'm looking for some kind of high-level component based on ICS. What I need to do is to replace some file copy operations within an application by FTP sending/receiving operations. What I'm dreaming of is a sending/copying component which accepts file name(s) and a target ftp server instead of a file path. The same applies for the opposite way, retrieving files from a ftp server. Like this (samples): CopyFileToFTP(LocalFile, FTPServer); CopyFileFromFTP(FTPServer, LocalFile); TIA for all hints. Michael -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Still problems while sending SMTP
Regarding my last mail ('SMTP component not ready' exception), I learnt that the problem doesn't occur if I put the whole 'case RqType of: .. end;' into a try..except and simply ignore the exception. But I'm not sure if this is the correct way to handle it. I fear to miss some real exceptions which I'm also suppressing this way, and I don't like much quiet exceptions for complex operations. How do you all handle such a situation? Michael > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Behalf Of Kochendoerfer, Michael > Sent: Wednesday, January 17, 2007 3:29 PM > To: ICS support mailing > Subject: Re: [twsocket] Still problems while sending SMTP > > > Arno, > > now I implemented it all the way you suggested. I have a > message handler procedure, which decides whether a record > results in a mail or in a print job. It then calls either > smtpCli.Connect() or DoPrint() (own form method) accordingly. > > When it is a mail job and it has been processed, the > OnSessionClosed posts the handler message again. When it's a > print job, the very last line of DoPrint() posts the handler message. > > I'm starting the whole processing by an initial PostMessage() > to this handler procedure and write useful info into a log > memo and a file. And as you wrote earlier, there's another > RequestDone (smtpQuit) after a OnSessionClosed call. But even > if I don't have any direct calls to the message pump, my own > handler message is processed before the smtpQuit state occurs > in OnRequestDone, so the smtpCli.Connect() may take place > _before_ OnRequestDone has finished processing the previous > mail. This sometimes results in a SMTP component not ready exception. > > How can I prevent this situation from occuring? AFAIR, I > shouldn't have a loop somewhere testing for the component > state, so I need another mechanism to prevent it. > > All other things are fine now, thanks a lot ;) > > Michael > > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] > > Behalf Of Arno Garrels > > Sent: Wednesday, January 17, 2007 10:55 AM > > To: ICS support mailing > > Subject: Re: [twsocket] Still problems while sending SMTP > > > > > > Kochendoerfer, Michael wrote: > > > Arno, > > > > > > I think you addressed the problem correctly ;) All subsequent > > > Connect() calls (except the first one) are located within the > > > OnRequestDone event procedure, in case of > RqType=smtpQuit. I now see > > > this must be wrong. > > > > > > For a safe reconnect, should the message below be posted from > > > OnRequestDone or from OnSessionClose? I guess it's the > > latter because > > > it would be triggered after RqType=smtpQuit, right? Does calling > > > Abort() also call OnSessionClose? > > > > SessionClose is the right place to post the message and yes > Abort also > > triggers OnSessionClose. OnSessionClose fires when the connection is > > closed no matter who closed it, and that may occur at *ANY TIME*. > > Note that if a request is still pending OnRequestDone will be > > triggered afterwards as well. Calling Abort while the component is > > still waiting for a response or while it's sending data will cause > > OnRequestDone being triggered with an error code > 0, this was > > AFAIR (10053) Software caused connection abort. > > > > --- > > Arno Garrels [TeamICS] > > http://www.overbyte.be/eng/overbyte/teamics.html > > > > > > > Michael > > > > > >> -Original Message- > > >> From: [EMAIL PROTECTED] > > >> [mailto:[EMAIL PROTECTED] > > >> Behalf Of Arno Garrels > > >> Sent: Wednesday, January 17, 2007 9:24 AM > > >> To: ICS support mailing > > >> Subject: Re: [twsocket] Still problems while sending SMTP > > >> > > >> > > >> In order to reconnect safely you need to get out of your loop > > >> after the session has been closed AND after OnRequestDone > > >> has been triggered RqType smtpQuit as well. You must assign event > > >> OnSessionClose to always get notified about connection close, > > >> this can happen before as well as after OnRequestDone triggered > > >> RqType smtpQuit, I'm not sure if you do something like that. > > >> > > >> In order to get out of your loop just post a custom message, > > >> something
Re: [twsocket] Still problems while sending SMTP
Arno, now I implemented it all the way you suggested. I have a message handler procedure, which decides whether a record results in a mail or in a print job. It then calls either smtpCli.Connect() or DoPrint() (own form method) accordingly. When it is a mail job and it has been processed, the OnSessionClosed posts the handler message again. When it's a print job, the very last line of DoPrint() posts the handler message. I'm starting the whole processing by an initial PostMessage() to this handler procedure and write useful info into a log memo and a file. And as you wrote earlier, there's another RequestDone (smtpQuit) after a OnSessionClosed call. But even if I don't have any direct calls to the message pump, my own handler message is processed before the smtpQuit state occurs in OnRequestDone, so the smtpCli.Connect() may take place _before_ OnRequestDone has finished processing the previous mail. This sometimes results in a SMTP component not ready exception. How can I prevent this situation from occuring? AFAIR, I shouldn't have a loop somewhere testing for the component state, so I need another mechanism to prevent it. All other things are fine now, thanks a lot ;) Michael > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Behalf Of Arno Garrels > Sent: Wednesday, January 17, 2007 10:55 AM > To: ICS support mailing > Subject: Re: [twsocket] Still problems while sending SMTP > > > Kochendoerfer, Michael wrote: > > Arno, > > > > I think you addressed the problem correctly ;) All subsequent > > Connect() calls (except the first one) are located within the > > OnRequestDone event procedure, in case of RqType=smtpQuit. I now see > > this must be wrong. > > > > For a safe reconnect, should the message below be posted from > > OnRequestDone or from OnSessionClose? I guess it's the > latter because > > it would be triggered after RqType=smtpQuit, right? Does calling > > Abort() also call OnSessionClose? > > SessionClose is the right place to post the message and yes Abort also > triggers OnSessionClose. OnSessionClose fires when the connection is > closed no matter who closed it, and that may occur at *ANY TIME*. > Note that if a request is still pending OnRequestDone will be > triggered afterwards as well. Calling Abort while the component is > still waiting for a response or while it's sending data will cause > OnRequestDone being triggered with an error code > 0, this was > AFAIR (10053) Software caused connection abort. > > --- > Arno Garrels [TeamICS] > http://www.overbyte.be/eng/overbyte/teamics.html > > > > Michael > > > >> -Original Message- > >> From: [EMAIL PROTECTED] > >> [mailto:[EMAIL PROTECTED] > >> Behalf Of Arno Garrels > >> Sent: Wednesday, January 17, 2007 9:24 AM > >> To: ICS support mailing > >> Subject: Re: [twsocket] Still problems while sending SMTP > >> > >> > >> In order to reconnect safely you need to get out of your loop > >> after the session has been closed AND after OnRequestDone > >> has been triggered RqType smtpQuit as well. You must assign event > >> OnSessionClose to always get notified about connection close, > >> this can happen before as well as after OnRequestDone triggered > >> RqType smtpQuit, I'm not sure if you do something like that. > >> > >> In order to get out of your loop just post a custom message, > >> something like: > >> > >> PostMessage(Form1.Handle, WM_MAILSENT, Integer(Something), > >> Integer(Something)); > >> > >> The message handler is declared like: > >> > >> const > >> WM_MAILSENT = WM_USER + 1; > >> .. > >> protected > >> procedure WmMailSent(var Msg: TMessage); message WM_MAILSENT; > >> .. > >> > >> procedure TForm1.WmMailSent(var Msg: TMessage); > >> begin > >> Display(IntToStr(Msg.WParam) + ' ' + IntToStr(Msg.LParam); > >> .. > >> In the message handler you can connect safely again. > >> SmtpCli.Connect; > >> end; > >> > >> > >> --- > >> Arno Garrels [TeamICS] > >> http://www.overbyte.be/eng/overbyte/teamics.html > >> > >> > >> > >> Michael Kochendoerfer wrote: > >>> Arno and all, > >>> > >>> I realized and appreciated your hint to perform it all > event-driven > >>> and I tried to accomplish it the way you suggested. > However, I have > >>> some
Re: [twsocket] Still problems while sending SMTP
blocked. Instead let your derived component do > the work in > >> the background. In order to get notified when the job has finished > >> add a custom event that fires when the work is done, or may be add > >> another custom event that notifies the application when a single > >> message has been sent/failed. In other words, control the > >> application completely thru events while executing the mailing. So > >> in the ButtonClick handler there the call to start the mailing > >> should be the very last line. > >> > >> --- > >> Arno Garrels [TeamICS] > >> http://www.overbyte.be/eng/overbyte/teamics.html > >> > >> > >> Kochendoerfer, Michael wrote: > >> > >> > >>> You all are giving excellent information in this mailing list, > >>> thanks a lot! > >>> > >>> I guess my problem is - as you describe - that the component is > >>> still active, even if smtpQuit has been reached within > >>> OnRequestDone. I don't currently check if it's still > connected, but > >>> I will change it. Errors will be checked and force to abort the > >>> entire mail and write some log entries. > >>> > >>> As Arno said earlier, I'd like to have async components because of > >>> their benefits. But in fact, for me it is a sync call, at > least for > >>> each single mail. IOW, I've to wait until each particular mail has > >>> been finished before I'm advancing to the next one. So > I'm starting > >>> with Connect(), let the OnRequestDone do the background stuff and > >>> set a flag if either aborted or quit. Now I know I've to wait also > >>> for not Connected. But what's the correct method to wait for > >>> completion? Currently, I have a loop after calling Connect() > >>> looking like this: > >>> > >>> while not FlagDone do begin > >>> //Application.ProcessMessages; // Don't know whether or > not to use > >>> the message pump here Sleep(50); > >>> end; > >>> > >>> Any thoughts? > >>> > >>> TIA, > >>> Michael > >>> > >>> > >>> > >>> > >>>> -Original Message- > >>>> From: [EMAIL PROTECTED] > >>>> [mailto:[EMAIL PROTECTED] > >>>> Behalf Of DZ-Jay > >>>> Sent: Tuesday, January 16, 2007 10:57 AM > >>>> To: ICS support mailing > >>>> Subject: Re: [twsocket] Still problems while sending SMTP > >>>> > >>>> > >>>> > >>>> On Jan 16, 2007, at 02:49, Arno Garrels wrote: > >>>> > >>>> > >>>> > >>>>> When the response to the Quit command is received the connection > >>>>> (may) still be alive. So watch both, whether Quit response has > >>>>> been received as well as the SessionClose event. Call > connect only > >>>>> after the session has been closed. > >>>>> Don't start a loop directly from an event handler but post a > >>>>> custom message to some Window, in it's message handler start the > >>>>> next loop. > >>>>> > >>>>> > >>>> You could, in fact, re-use the connection if the next message > >>>> is to be > >>>> sent through the same server. All you have to do is, after the > >>>> DATA command is completed and the server acknowledges receipt, > >>>> check SmtpCli.Connected, if you are still connected then > reset your > >>>> state-machine to start the cycle fromthe MAIL FROM command. Some > >>>> servers required a "reset" (RSET) command be sent to reset state, > >>>> and it doesn't hurt to send it anyway. The important thing is to > >>>> check the > >>>> connection, because something may have happened -- and > indeed, some > >>>> servers have anti-spamming filters that will kick you out after > >>>> receiving DATA that they determine is spam, and some won't > >>>> allow you to > >>>> re-send after one message. So the algorithm would be something > >>>> like: > >>>> > >>>> 1. Connect > >>>> 2. HELO > >>>> 3. MAIL FROM > >>>> 4. RCP
Re: [twsocket] Still problems while sending SMTP
You all are giving excellent information in this mailing list, thanks a lot! I guess my problem is - as you describe - that the component is still active, even if smtpQuit has been reached within OnRequestDone. I don't currently check if it's still connected, but I will change it. Errors will be checked and force to abort the entire mail and write some log entries. As Arno said earlier, I'd like to have async components because of their benefits. But in fact, for me it is a sync call, at least for each single mail. IOW, I've to wait until each particular mail has been finished before I'm advancing to the next one. So I'm starting with Connect(), let the OnRequestDone do the background stuff and set a flag if either aborted or quit. Now I know I've to wait also for not Connected. But what's the correct method to wait for completion? Currently, I have a loop after calling Connect() looking like this: while not FlagDone do begin //Application.ProcessMessages; // Don't know whether or not to use the message pump here Sleep(50); end; Any thoughts? TIA, Michael > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Behalf Of DZ-Jay > Sent: Tuesday, January 16, 2007 10:57 AM > To: ICS support mailing > Subject: Re: [twsocket] Still problems while sending SMTP > > > > On Jan 16, 2007, at 02:49, Arno Garrels wrote: > > > When the response to the Quit command is received the connection > > (may) still be alive. So watch both, whether Quit response has been > > received as well as the SessionClose event. Call connect only > > after the session has been closed. > > Don't start a loop directly from an event handler but post a custom > > message to some Window, in it's message handler start the next loop. > > You could, in fact, re-use the connection if the next message > is to be > sent through the same server. All you have to do is, after the DATA > command is completed and the server acknowledges receipt, check > SmtpCli.Connected, if you are still connected then reset your > state-machine to start the cycle fromthe MAIL FROM command. Some > servers required a "reset" (RSET) command be sent to reset state, and > it doesn't hurt to send it anyway. The important thing is to > check the > connection, because something may have happened -- and indeed, some > servers have anti-spamming filters that will kick you out after > receiving DATA that they determine is spam, and some won't > allow you to > re-send after one message. So the algorithm would be something like: > > 1. Connect > 2. HELO > 3. MAIL FROM > 4. RCPT TO > 5. DATA > 6. If connected: > 6.a (yes) RSET then back to 3 > 7. QUIT > 8. back to 1 > > Of course, you should check for errors after each step (in > OnRequestDone, before changing states). Keep in mind that > some errors > are recoverable (transient: 400+), some errors are not > (non-transient: > 500+), and some are somewhere in between (like RCPT warnings, etc). > Recoverable errors allow you to try again, or require a RSET > and start > from step 3, while non-transient errors require closing the > connection > and starting from scratch. If you are sending general messages to > strange servers "in the wild" it gets pretty complicated, specially > when you factor in all the non-RFC-compliant servers; but if your > application is of limited purpose, sending using the same server all > the time, the errors and issues that may occur are predictable and > substantially less. > > Building this logic in a simple state-machine using > OnRequestDone makes > it fairly easy to make your application powerful and efficient -- the > reason we always push for the use of async methods. > > dZ. > > -- > DZ-Jay [TeamICS] > http://www.overbyte.be/eng/overbyte/teamics.html > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] TFtpClient and directory listing
Hi all, what is the correct implementation of retrieving a directory when using ftp...Async functions? My program structure is similar to the sample files (case RqType of... ftpOpenAsync: FtpClient.User; ... end;), so it wouldn't be hard for me to understand. What I've found is the option to use DirAsync, but according to the sources, it will retrieve the dir list to a file. However, does anyone have a small sample of code to retrieve a directory, and - for example - place the contents into a listbox? TIA, Michael -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be