Fix: Indy Mail Attachment Filenames lost in D2009

October 2nd, 2008

Hi,

probably you already discovered a bug in Indy & D2009 that when sending E-Mails with attachments you will loose the attachment filenames.

This is related to a small bug in the Indy Version shipped with the initial release of Delphi 2009. It has already been fixed in the Indy SVN.

See the QualityCentral report for it: http://qc.codegear.com/wc/qcmain.aspx?d=66867

Bug Report Background:
Without the line break fix (see below) the attachment filename is printed in the same line as “Content-Disposition” and so some mail clients ignore the filename. Without it the file will have random names regarding to the used client.

If you do not want to update the whole Indy version shipped with D2009 you can fix the bug on your own:

1) Copy the VCL source file for IdMessageClient.pas from your D2009 directory:
C:\Program Files\CodeGear\RAD Studio\6.0\source\Indy\Indy10\Protocols\IdMessageClient.pas
to your project’s directory
2) Edit the IdMesageClient.pas and change the lines given below:

procedure TIdMessageClient.SendBody(AMsg: TIdMessage):
begin
...
  if LFileName <> '' then begin
    IOHandler.WriteLn(';'); // inserted for QC 66867, between original line 1214/1215
    IOHandler.Write('        name="' + LFileName + '"'); {do not localize}
  end;
  IOHandler.WriteLn;
  IOHandler.WriteLn('Content-Transfer-Encoding: ' + LAttachment.ContentTransfer); {do not localize}
  // next line fixed for QC 66867, changed IOHandler.Write<strong>Ln</strong> to IOHandler.Write
  IOHandler.Write('Content-Disposition: ' + LAttachment.ContentDisposition); {do not localize}
  if LFileName <> '' then begin
    IOHandler.WriteLn(';'); // inserted QC 66867, line 1220/1221
    IOHandler.Write('        filename="' + LFileName + '"'); {do not localize}
  end;
...
end;

3) Save and do a full-rebuild on your project
4) Verify that IdMessageClient.dcu has been created in your project’s directory

You can also replace the existing files in the Delphi 2009 source
directory at:

C:\Program Files\CodeGear\RAD Studio\6.0\source\Indy\Indy10\Protocols\IdMessageClient.pas

If you are doing the latter, be sure to replace the DCUs at:

1) C:\Program Files\CodeGear\RAD Studio\6.0\lib\Indy10\IdMessageClient.dcu
2) C:\Program Files\CodeGear\RAD Studio\6.0\lib\debug\Indy10\IdMessageClient.dcu

You may create the needed DCUs with the earlier mentioned steps, one
time without and a second time with enabled “Build Debug DCU” option.

Arvid Delphi, Indy ,

SpTBXLib for D2009 released

September 27th, 2008

Hi,

I just saw that Robert Lee has posted a new Delphi 2009 compatible version of his GUI Library SpTBXLib a few hours ago. The new version compiles fine (currently with a small fix, see the newsgroups) using Delphi 2006 and Delphi 2009. Using the latter of course without the need to use TntUnicode anymore!

See his Download Page and for more information the SpTBXLib Release History.

Thanks, Robert!

Arvid Delphi

OpenSSL v0.9.8i for Indy

September 24th, 2008

Hi,

a new version of the OpenSSL libraries has been published on September, 15th 2008. I have created precompiled DLLs for use with Indy which are now available.

You can download the libraries from Fulgan’s Mirror.

Arvid Delphi, Indy ,

Fix for ShellLink & Minimized Forms under < D2007

September 15th, 2008

Hello,

you probably know of the tutorials Nathanial Woolls of InstallationExcellence has published some time ago regarding the Vista Issues under Delphi Versions below D2007 (available here and here).

As I’ve just checked Andreas Hausladen’s QC report #58939 which deals with the fact that Applications created by Delphi 2007 have no Taskbar Button when started minimized using the ShellLink, I’ve discovered that the same applies for anything below D2007 using the above mentioned Vista tweaks of InstallationExcellence:

You’ll receive a minimized TApplication Window on the desktop with no Taskbar Button assigned to it.

After stepping through the VCL sources of D2006 I saw that the problematic part is in TApplication.Run where CmdShow = SW_SHOWMINNOACTIVE is checked and a few lines below “Minimize;” is called.

Together with Nathanial’s fix this won’t do. To circumvent it you will have to make a small addition to his fix in order to have a correct behaviour together with minimized ShellLinks:

ShowWindow(Application.Handle, SW_HIDE);
SetWindowLong(Application.Handle, GWL_EXSTYLE,
GetWindowLong(Application.Handle, GWL_EXSTYLE) and not
WS_EX_APPWINDOW or WS_EX_TOOLWINDOW);
ShowWindow(Application.Handle, SW_SHOW);

// add the following lines:
if (CmdShow = SW_SHOWMINNOACTIVE) then
Application.ShowMainForm := False;

Assuming you are using Nathanial’s fix correctly in the MainForm’s OnCreate the given lines ensure that the MainForm is already hidden before Application.Run has been called.

Arvid Delphi ,

Where to get the current Indy version?

September 12th, 2008

Hi,

UPDATE – Please see this newer post about SVN access – UPDATE

as many users are asking again and again I’ll show you where to find the current Indy versions. Generally you have two choices:

Download using SVN or get your copy from Fulgan’s mirror.

The official download documentation is here. But I don’t know how long the page will stay at this location as we are going to change some things on the Indy website in future.

SVN
You can access the Indy SVN through your Browser or with any subversion client. Two of them I can recommend are SmartSVN or TortoiseSVN.

Use the following properties to access our SVN server:

Repository URL: svn://svn.atozed.com/indy/indy10

User: indy
Password: indy

That account will give you read-only access.

Note: The “trunk” folder has the current version. “branches” and “tags” are for advanced usage only.

UPDATE – Please see this newer post about SVN access – UPDATE

Mirror: Fulgan.com (Switzerland)
This mirror can be accessed on via anonymous FTP or HTTP. It is updated daily at 03:00 CET (GMT + 1).

Edit (Oct, 2nd 2008): Fulgan’s Mirror provides the current Trunk and SVN (both as .zip files). As always what you get is work in progress, so if you’re running into troubles try to update the downloaded version. Changelog is available in SVN or the Mirror’s root directory.

Arvid Delphi, Indy , ,