Frank

Member since: Thursday, 30 April 2015
Last login: 4 years ago
Profile viewed: 934 views

Your Rank: 86
Points: 8

Frank replied to the topic 'forums.embarcadero.com is down AGAIN!' in the forum. 4 years ago

It's up again

Read More...

Frank thanked Remy Lebeau in topic INDY Question 4 years ago
Frank replied to the topic 'INDY Question' in the forum. 4 years ago

I've checked the sources from INDY (the ones bundled with Tokyo), and basically you've already done what I wanted.

XE7---
else if IsHeaderMediaType(AMsg.ContentType, 'multipart') then {do not localize}
begin
// RLebeau 08/17/09 - According to RFC 2045 Section 6.4:
// "If an entity is of type "multipart" the Content-Transfer-Encoding is not
// permitted to have any value other than "7bit", "8bit" or "binary"."
//
// However, came across one message where the "Content-Type" was set to
// "multipart/related" and the "Content-Transfer-Encoding" was set to
// "quoted-printable". Outlook and Thunderbird were apparently able to parse
// the message correctly, but Indy was not. So let's check for that scenario
// and ignore illegal "Content-Transfer-Encoding" values if present...
if PosInStrArray(LContentTransferEncoding, , False) = -1 then begin {do not localize}
LContentTransferEncoding := '';
LUnknownContentTransferEncoding := True;
end;
end;
---
Tokyo---
else if IsHeaderMediaType(AMsg.ContentType, 'multipart') then {do not localize}
begin
// RLebeau 08/17/09 - According to RFC 2045 Section 6.4:
// "If an entity is of type "multipart" the Content-Transfer-Encoding is not
// permitted to have any value other than "7bit", "8bit" or "binary"."
//
// However, came across one message where the "Content-Type" was set to
// "multipart/related" and the "Content-Transfer-Encoding" was set to
// "quoted-printable". Outlook and Thunderbird were apparently able to parse
// the message correctly, but Indy was not. So let's check for that scenario
// and ignore illegal "Content-Transfer-Encoding" values if present...
if PosInStrArray(LContentTransferEncoding, , False) = -1 then begin {do not localize}
LContentTransferEncoding := '';
//LUnknownContentTransferEncoding := True;
end;
end;
---

I was a little more cautious by only forcing LContentTransferEncoding to be Empty when it was a 'quoted-printable'. The change simply puts everything invalid to Empty.

This should work.

This only leaves one different question: how can I debug the INDY code in Tokyo? When I drag and drop IdMessageClient into my project I get the message that it cannot find IdMessage. Ok, so I add the various Source directories to the Library Path and get to hear that the sources are compiled with a different version of the compiler.

Read More...

Frank replied to the topic 'INDY Question' in the forum. 4 years ago

When I add C:\Program Files (x86)\Embarcadero\Studio\19.0\source\Indy10\Protocols\IdMessageClient.pas to the project file and build it, I get the message that it can't find IdMessage.pas. How can I successfully compile Indy sources into my .exe to test if this works as supposed?

As far as an unaltered email is concerned I will have to 4relay that to my superiors as these emails contains lots of privacy and financially sensitive information, as our main clientele are insurance companies. GDPR would prohibit me from giving them away. Which is why I redacted everything privacy/financial out of the example.

So I think we should continue out of the public's eye...

Read More...

Frank replied to the topic 'INDY Question' in the forum. 4 years ago

Hey Remy,

I felt the need to do that because the emails our service had to process had these specific properties, making the ReceiveBody() procedure to set LUnknownContentTransferEncoding to True.This resulted in the procedure going into the else branch (thinking it to be single-part mime or plain text) and our program ended with empty emails...

My solution made sure that the LUnknownContenTransferencoding remained False and so it went it's regular way through the code and I end up with the content and the attachments I expected to find based on tte header.
A (heavily redacted) example of one such email is:

Return-Path: <xxx>
X-Original-To: xxx
Delivered-To: xxx
Received: (from xxx)
by xxx;
Wed, 7 Mar 2018 19:24:25 +0100
Message-Id: <xxx>
To: xxx
Subject: xxx
X-PHP-Originating-Script: 33:Zend_Mail_Transport_Sendmail.php3
From: xxx
Cc:
Reply-To: xxx
Date: Wed, 07 Mar 2018 19:24:25 +0100
Content-Type: multipart/mixed;
boundary="=_f51b104640c32aac66784a86a16cb2ed"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
MIME-Version: 1.0

This is a message in Mime Format. If you see this, your mail reader does not support this format.

--=_f51b104640c32aac66784a86a16cb2ed
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

HTML encoded message

--=_f51b104640c32aac66784a86a16cb2ed
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="xxx.pdf"

Base64 Encoded PDF

--=_f51b104640c32aac66784a86a16cb2ed--

A differentt emailer suffering the same consequences is:

X-Mailer: SMTP Build 236
...

These are messages sent to one of our customers so obviously I cannot hand out complete working examples as they contain financial and privacy sensitive data.

We can continue this in private so I could be more complete

Read More...

Frank created a new topic ' INDY Question' in the forum. 4 years ago

We are transitioning from XE7 to Tokyo and in XE7 I made a little change to IdMessageClient. I've checked the version bundled with Tokyo and saw that the same few lines are still needed to walk around a few stupid email senders who send multipart messages with a quoted-printable ContentTransferEncoding. After transfering the changes I built the application and got 'IdMessage not found'. When I add the directories with the INDY sources I get way more interesting exceptions, like an Undeclared structure which is declared roughly 20 lines above that in the same file. I also get the message that the newly compiled dcus are with a different version than the ones that are already there.

How can I make Tokyo/INDY behave?

@Remy: Basically what I do is make sure that LUnknownContentTransferEncoding remains False in TIdMessageClient.ReceiveBody. So I added

if IsHeaderMediaType(AMsg.ContentType, 'multipart') then {do not localize}
if PosInStrArray(AMsg.ContentTransferEncoding, , False) <> -1 then begin {do not localize}
AMsg.ContentTransferEncoding := '';
end;

as the first lines in the function.

Read More...

Frank replied to the topic 'Moderators on vacation? Or did they resign?' in the forum. 5 years ago

I'm out of here! Maybe I'll return when the company will treat this forum a little more seriously. If you need me I can be found at forums.embarcadero.com...

Read More...

Frank replied to the topic 'Moderators on vacation? Or did they resign?' in the forum. 5 years ago

Apparently it didn't wake 'em up...

Read More...

Frank replied to the topic 'Rtti and Enums' in the forum. 6 years ago

Why not simply
TRttiEnumerationType.GetName(e1);
or
TRttiEnumerationType.Getvalue('e1');

Read More...

Frank replied to the topic 'TClientDataSet Bug in D10 Seattle' in the forum. 6 years ago

Not here on Win 7 64 bits.


Have you tried it out with Debug DCUs enabled. Can you find where it goes wrong?

Read More...

Frank replied to the topic 'Using a Third Party DCU with no source' in the forum. 6 years ago

You didn't tell which version of Delphi you are working with, but it doesn't really matter. Either you need other .dcus, or you'll need to get in contact with the supplier to get updated .dcus.

Read More...

Frank replied to the topic 'DelphiX Seattle iOS9 SDK and Devices with iOS 8.x' in the forum. 6 years ago

https://forums.embarcadero.com/thread.jspa?threadID=117679&tstart=0

I ran into the same problem, the link shows a way that I used to solve it. May help.

Read More...

Frank replied to the topic 'Where has everybody gone?' in the forum. 6 years ago

In addition there is also the large amount of spam and lack of moderation that pushes people away.

Read More...

Frank replied to the topic 'SPAM!' in the forum. 7 years ago

I am seriously doubting anyone is even looking at it! Seeing as the spam is still here almost a week since posting...
Read More...

Frank created a new topic ' SPAM!' in the forum. 7 years ago

So... Tell me.... Is something going to be done about the spam infiltrating the these forums? It's ridiculous that that IMDB spam is still here two days after posting (not to mention the other spam).
Read More...

Frank replied to the topic 'Advantage DB' in the forum. 7 years ago

We're not yet on XE8, but we have been struggling with ADS as well. Many of our customers still use older versions like 8 or 10, so I thought going the FireDaC way was a good way to go. Going "the official route" would mean urging/forcing our customers to update their server...

I can't say I am extremely happy with the performance under .dbf files. I simply re-engineered the TAdsDataSet pascal files to make it work under XE7. Maybe that is an option? It took me all of two days to re-engineer all the files needed.
Read More...

Frank replied to the topic 'TLinkGridToDataSource and abstract methods' in the forum. 7 years ago

In the Tags you could have seen it was on XE3, though I did test on XE 7 as well.
Read More...

Frank created a new topic ' TLinkGridToDataSource and abstract methods' in the forum. 7 years ago

When I use the LiveBindings designer to link a StringGrid to a DataSource everything goes as planned, yet when I do it in runtime I get a warning that the TLinkgridToDataSource contains abstract methods (Reactivate and RequiresControlHandler). Is this a bug? Am I doing something wrong? This is the code used.

function TMainForm.CreateGrid(AOwner: TComponent; AParent: TWinControl; ATop, ALeft, AWidth, AHeight: Integer;
  ABindSource: TBindSourceDB; AColumnDescs: TColumnDescs = nil): TStringGrid;
var
  Link: TLinkGridToDataSource;
  Col: TLinkGridToDataSourceColumn;
  C: TColumnDesc;
begin
  Result := TStringGrid.Create(AOwner);
  Result.Parent := AParent;
  Result.SetBounds(ALeft, ATop, AWidth, AHeight);
  Link := TLinkGridToDataSource.Create(AOwner);
  Link.GridControl := Result;
  Link.DataSource := ABindSource;
  if Assigned(AColumnDescs) then
    for C in AColumnDescs do
    begin
      Col := Link.Columns.Add;
      Col.MemberName := C.MemberName;
      Col.Header := C.Header;
      Col.Width := IfThen(C.Width = 0, Result.DefaultColWidth, C.Width);
    end;
  Link.Active := True;
end;

Read More...

DavidI is friends with Frank