Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,579
» Latest member: xin88de
» Forum threads: 2,207
» Forum posts: 10,656

Full Statistics

Online Users
There are currently 210 online users.
» 1 Member(s) | 204 Guest(s)
Applebot, Bing, Facebook, Google, Yandex, xin88de

Latest Threads
TIdMessage - html content...
Forum: Indy General Discussion
Last Post: Justin Case
07-25-2024, 09:23 PM
» Replies: 5
» Views: 262
Bundle license and suppor...
Forum: IntraWeb General Discussion
Last Post: Comograma
07-23-2024, 04:40 PM
» Replies: 1
» Views: 150
Intraweb and Honeywell CT...
Forum: IntraWeb General Discussion
Last Post: jeroen.rottink
07-22-2024, 07:37 AM
» Replies: 5
» Views: 659
TIdSMTPServer - Questions...
Forum: Indy General Discussion
Last Post: Justin Case
07-20-2024, 08:41 PM
» Replies: 15
» Views: 1,267
searching for open availa...
Forum: Indy General Discussion
Last Post: rlebeau
07-19-2024, 04:22 PM
» Replies: 3
» Views: 333
TIWSweetAlert Text linefe...
Forum: IntraWeb General Discussion
Last Post: Comograma
07-18-2024, 10:50 AM
» Replies: 0
» Views: 157
Set Response 403 from TCo...
Forum: IntraWeb General Discussion
Last Post: Mario Villalba
07-17-2024, 10:11 PM
» Replies: 2
» Views: 1,431
IWServerControllerBaseExe...
Forum: IntraWeb General Discussion
Last Post: Mario Villalba
07-17-2024, 03:55 PM
» Replies: 0
» Views: 140
Instructions for setting ...
Forum: CrossTalk General Discussion
Last Post: Platyforma
07-17-2024, 06:56 AM
» Replies: 0
» Views: 112
OnChange problems
Forum: IntraWeb General Discussion
Last Post: MJS@mjs.us
07-16-2024, 08:25 PM
» Replies: 1
» Views: 241

 
  TIdMessage - html content being damaged..
Posted by: Justin Case - 07-23-2024, 10:25 AM - Forum: Indy General Discussion - Replies (5)

This is a follow-on from my SMTP server thread but not directly a SMTP server issue - this is TIdMessage playing up.

I'm using Outlook express to send test emails to test@localhost.

OE is writing html email.

When the IdSMTPServer1MsgReceive event is triggered, I'm creating a TIdMessage and loading the AMsg stream into it. The problem is that the html content is then heavily damaged. When my server then forwards this via my VPS's smtp server, it's forwarded on as-is and reaches my yahoo account malformed.

If I send through another OE account that connects straight to my VPS's server (running Mercury32) then the email arrives at my yahoo account intact.

Saving the TIdMessage to a file has confirmed this behaviour is caused by TIdMessage. When I save the AMsg Stream to the database and then pull it out, the original email from Outlook Express is intact meaning that it's TIdMessage at fault for not reading the stream correctly.

This is my code:

Code:
procedure TDataModule1.IdSMTPServer1MsgReceive(
  ASender: TIdSMTPServerContext; AMsg: TStream; var VAction: TIdDataReply);
var
BlobStream: TStream;
I: Integer;
LAction : TIdRCPToReply;
Msg: TIdMessage;
ReplyObject: TReplyObject;
Results: TStringList;
SMTP: TIdSMTP;
UserID: Integer;

Count: Integer;
begin
//10
// When a message is received by the server, this event fires.
// The message data is made available in the AMsg : TStream.
// In this example, we will save it to a temporary file, and the load it using
// IdMessage and parse some header elements.

UserID := 0;

SMTP := TIdSMTP.Create;

Msg := TIdMessage.Create;
Msg.LoadFromStream(AMsg);

//Save to file to see how it's been parsed..
Msg.SaveToFile('zedmail.eml'); //zed makes windows explorer display at the bottom - easy to find
//Check MessageParts Count via the live debugger - point and hover.. (confirmed as 2 parts)
Count := Msg.MessageParts.Count;

Results := TStringList(ASender.Data);

//Look for internal recipients first - remove them from the RCPTList
//as the external relay server will throw an error
for I := ASender.RCPTList.Count -1 downto 0 do
   begin
   ReplyObject := TReplyObject(Results.Objects[Results.IndexOf(ASender.RCPTList.Items[I].Address)]);
   LAction := ReplyObject.Reply;

   case LAction of
      rAddressOk:
         begin
         Query1.Close;
         Query1.SQL.Text := SQL('FindUserIDByAddress');
         Query1.ParamByName('email').AsString := ASender.RCPTList.Items[I].Address;
         Query1.Open;

         with Query1 do
            begin
            First;

            while not EOF do
               begin
               UserID := FieldByName('user_id').AsInteger;

               Next;
               end;
            end;

         Query1.Close;

         Table1.TableName := 'mail';
         Table1.Open;

         Table1.Append;

         Table1.FieldByName('To_Address').AsString := ASender.RCPTList.Items[I].Address;
         Table1.FieldByName('From_Name').AsString := Msg.From.Name;
         Table1.FieldByName('From_Address').AsString := Msg.From.Address;
         Table1.FieldByName('Subject').AsString := Msg.Subject;
         Table1.FieldByName('Files').AsInteger := Msg.MessageParts.AttachmentCount;
         Table1.FieldByName('Size').AsInteger := AMsg.Size;
         Table1.FieldByName('User_Id').AsInteger := UserID;
         Table1.FieldByName('Received').AsDateTime := Now;//Received;

            //Save original AMsg stream to the database - it's original and that's good.
            try
            BlobStream := Table1.CreateBlobStream(Table1.FieldByName('Raw_Email'), bmWrite);
            //FileStream := TFileStream.Create(odBlob.FileName,fmOpenRead or fmShareDenyNone);
            AMsg.Position := 0;
            BlobStream.CopyFrom(AMsg, AMsg.Size);
            //FileStream.Free;
            BlobStream.Free;
            //tVenues.Post;
            finally
            Table1.Post;
            Table1.Close;
            end;

         Results.Delete(Results.IndexOf(ASender.RCPTList.Items[I].Address));
         ReplyObject.Free;
         ASender.RCPTList.Delete(I);
         end;
      end;
   end;

//Now RCPTList only has external email addresses - connect and forward.
for I := ASender.RCPTList.Count -1 downto 0 do
   begin
   ReplyObject := TReplyObject(Results.Objects[Results.IndexOf(ASender.RCPTList.Items[I].Address)]);
   LAction := ReplyObject.Reply;

   case LAction of
      rWillForward:
         begin
         SMTP.Host := 'myserver.com';
         SMTP.Port := 25;
         SMTP.Username := 'test';
         SMTP.Password := 'password';

            try
            SMTP.Connect;
            SMTP.Send(Msg, ASender.RCPTList);
            except

            end;

         SMTP.Disconnect;

         Results.Delete(Results.IndexOf(ASender.RCPTList.Items[I].Address));
         ReplyObject.Free;
         ASender.RCPTList.Delete(I);
         end;
      end;
   end;

VAction := dOk;
ASender.Data := nil;
Msg.Free;
Results.Free;
SMTP.Free;
end;

This is the original email from AMsg:

Code:
Message-ID: <04db01dadc83$466372c0$8a4ba8c0@Asuras>
From: "TEST User" <test@myserver.com>
To: <test@localhost>
Subject: test
Date: Mon, 22 Jul 2024 23:05:33 +0100
MIME-Version: 1.0
Content-Type: multipart/alternative;
    boundary="----=_NextPart_000_04D8_01DADC8B.A8069720"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180

This is a multi-part message in MIME format.

------=_NextPart_000_04D8_01DADC8B.A8069720
Content-Type: text/plain;
    charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


This is a test message
------=_NextPart_000_04D8_01DADC8B.A8069720
Content-Type: text/html;
    charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>&nbsp;</DIV>This is a test message</BODY></HTML>

------=_NextPart_000_04D8_01DADC8B.A8069720--


This is how TIdMessage leaves it after it is loaded in from AMsg

Code:
Message-ID: <04fe01dadce7$c2a3ed10$8a4ba8c0@Asuras>
From: "TEST User" <test@safrane.info>
To: test@localhost
Subject: test
Date: Tue, 23 Jul 2024 11:04:51 +0100
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="u1e2sBDEKRSzIuUEBLNYLDbvPORi2Mn=_A"
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
In-Reply-To: <04fe01dadce7$c2a3ed10$8a4ba8c0@Asuras>

This is a multi-part message in MIME format.

--u1e2sBDEKRSzIuUEBLNYLDbvPORi2Mn=_A
Content-Type: text/plain ; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

This is a test message

--u1e2sBDEKRSzIuUEBLNYLDbvPORi2Mn=_A
Content-Type: text/html ; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

message</BODY></HTML>

--u1e2sBDEKRSzIuUEBLNYLDbvPORi2Mn=_A--

.

If i use NoDecode := True; then it does make a little difference.. but still strips out a lot of html:

Code:
Received: from 10.217.130.17
by atlas310.free.mail.ne1.yahoo.com pod-id NONE with HTTPS; Tue, 23 Jul 2024 11:27:11 +0000
Return-Path: <test@myserver.com>
X-Originating-Ip: [84.93.230.235]
Received-SPF: pass (domain of myserver.com designates 1.1.1.1 as permitted sender)
Authentication-Results: atlas310.free.mail.ne1.yahoo.com;
dkim=unknown;
spf=pass smtp.mailfrom=myserver.com;
dmarc=unknown header.from=myserver.com;
X-Apparently-To: me@yahoo.com; Tue, 23 Jul 2024 11:27:11 +0000
X-YMailISG: n5r.Pi0WLDtDafQ7rJxkRKjLMd99sHGg5EdeoauWXaRliZBK
eHryI6bqS7nGYOeZj9gR7wfNw0HdGZfM.5PgvDwaHA_xHHdC8iR5D2pe6xPz
EPQ2.meXwca6LJq5JBDMfpTeR9yI6Yl6ZwsFKksVMN3ZdfyuqHip84738q8H
eH.U145J1FEsGrJO_SOaNq.QH.UgP1Sm9vZ6lSsZG70CdMXieVqCulJW7MTQ
qyvVyOvZNpZ8E2cfixDWqE2QhjwmaFF6RFvb9DuKjEir9JcLUDPX6TJYDOYJ
jBo7tGNh5lvijycb3CouKRugUlEIaFzF143SH8Jsp1e_pJmr6olTL2Rx4Ujc
SPDJPesjYcxR1LVVzGevfAYa4NPT5QdC4CPQ9DcVbo0DK5C.R7peqvLod6sI
ND6qaqfKujvVPcaXkMrnWJOcgkTyA41Y8SSY52bDRjMOFhXUsFPZAd.kOG5E
TJcuyY_XySdh9nmR_uYUAr4e2sBa2P1oRwm9MKknBwy6AtncAlriBq69PMtB
D82TWWU5kEmZJTXskGyXrLRbR3gIfrquYD7vt4dhk32Myndzj8n8hM0fSUjg
USbVBlCy8jDlhBFRJThBxwNvHQh2LnpvsdwmyhHEBRIR9IShZrsTNx8DeA7O
LSKPrcl3XYq7awCfTcEtNzZ76.RsgyK2kW.g1KlFYqir65puVAAX_skbSX2t
4MY9PA8n1hcPSxaruKP5FZ8mAdGGU6wCmZ5py1eD3wHKiGJfBR_mqwp2R5jx
xcH7PdXWQJ7nGv87vkfq67MMo4u8apDHFkSwWm4iGkCI0MWOGb5mfMlf0Cxq
EhDEg4gjEhv1dTFvlh4BT9gIEaP01tRxo0yaWHaTi1GlzucsKPbM9X1ZOeHh
GpfMRO7PYNrzia3YAnlMBDhh60LSbDhaS.bHSfnWkH2Rmm13ZnFbZjcZ.5rC
cfR5qRNdnp5DpReOLM2CNW0JqBLh1GBMi5pAbgS0MGGn1ixGV790WWW05.vg
7tNZ8KKhoxtg9vpWthADGRDCG7YDN7cBeS8ZmWm4pcBS90X83f5szAL4Qbxb
N7JKY3.WBSzjejGqU3qGyFhIdfpHzD3TGcQLgO3vFgH_XDjR4s.Y.tCTOumR
7mrLG2YUONPokNUD7v74pVjOwZ8BONmYMojDx7QFAkTVZUutmElKLi1HYo2c
M7_erB5gZ9jUXyJ5JJZElTgSRR16SgWssk7s1jhz_2aJJKOcbKv.5EsE.TPJ
iBklMxyao4IuVhR9_wk48f3h2wmw0rR.gtLv
Received: from 84.93.230.235 (EHLO myisp.net)
by 10.217.130.17 with SMTPs
(version=TLS1_2 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256);
Tue, 23 Jul 2024 11:27:11 +0000
Received: from myserver.com ([191.96.209.122])
    by smtp with ESMTPA
    id WDffsxHJAItnuWDfgsN3gZ; Tue, 23 Jul 2024 12:27:09 +0100
X-Clacks-Overhead: "GNU Terry Pratchett"
X-CM-Score: 0.00
X-CNFS-Analysis: v=2.4 cv=XMWTShhE c=1 sm=1 tr=0 ts=669f938d
a=HyS37gJifMNTHLq8jXbfCg==:117 a=HyS37gJifMNTHLq8jXbfCg==:17
a=MKtGQD3n3ToA:10 a=4kmOji7k6h8A:10 a=r77TgQKjGQsHNAKrUKIA:9
a=hEd9wg7epzSlDZCZp3cA:9 a=wPNLvfGTeEIA:10 a=QlPsXv4Xzdw7B_FWiFMA:9
a=iRAxY5Wokv9zikXpuOqg:22
X-AUTH: myisp:username@:2500
Received: from Spooler by myserver.com (Mercury/32 v4.72) ID MO000092;
  23 Jul 2024 12:27:09 +0100
Received: from spooler by myserver.com (Mercury/32 v4.72); 23 Jul 2024 12:27:03 +0100
Received: from Asuras (146.199.16.99) by myserver.com (Mercury/32 v4.72) with ESMTP ID MG000091;
   23 Jul 2024 12:26:53 +0100
Message-ID: <050701dadcf3$293a4820$8a4ba8c0@Asuras>
From: "TEST User" <test@myserver.com>
To: test@localhost, me@yahoo.com
Subject: test
Date: Tue, 23 Jul 2024 12:26:28 +0100
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="VV4ti8b=_J3TyFtEGw0D4gvwVydkKruEhu"
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
In-Reply-To: <050701dadcf3$293a4820$8a4ba8c0@Asuras>
X-CMAE-Envelope: MS4xfDZYVv3iL1pU90UO++bjKkWQGelyv2eytQOMwX/chPAW4PZWoLKdb0OggRMZDaHl2J2bNZF2lC52dBy4ZRd7W0GluqqMg07d1dVK8ckS7DkkPhqs8Xlq
V3EylxeqPy0cAtme44C/8pZhWrvj75/3Wo1L02uhHq2b3HxaxoHfPknHT5CjGv17TaIqiiW54GjSNA==
Content-Length: 424

This is a multi-part message in MIME format.

--VV4ti8b=_J3TyFtEGw0D4gvwVydkKruEhu
Content-Type: text/plain ; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

This is a test message

--VV4ti8b=_J3TyFtEGw0D4gvwVydkKruEhu
Content-Type: text/html ; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<DIV>&nbsp;</DIV>This is a test message</BODY></HTML>

--VV4ti8b=_J3TyFtEGw0D4gvwVydkKruEhu--

Now, I do have a confession to make, as in the opening post of my other thread i mentioned that I'm using an older version of V10. Was this a known bug back then or am I doing something wrong?

Is this still an issue in the latest version?

Alternatively, is there a way to send the AMsg stream itself so that IdMessage is only used internally to get addresses etc but SMTP sends the original version? - That would work for me.

Thanks,

JC

Print this item

  Bundle license and support SSL
Posted by: mpr-gekko - 07-22-2024, 09:28 PM - Forum: IntraWeb General Discussion - Replies (1)

Hi, I'm using Delphi XE Enterprise with preinstalled IW11 and it seems that SSL is not supported. 
I try the StandAloneSSL example project and apparently the program doesn't even try to load the libeay32.dll and ssleay32.dll libraries. 
Does anyone know how it is? Do I have to buy a new license if I want to use SSL mode?
Thanks for help.

Print this item

  searching for open available ports for listening on server side TCP/UDP
Posted by: Ahmed Sayed - 07-18-2024, 11:21 AM - Forum: Indy General Discussion - Replies (3)

Hi,
I am looking for a clean way to make a service search for available ports to open it and listen on that port and then set the chosen port number in the Windows registry for clients to use to connect to it, whether it is using TCP or UDP. Is there a function out of the box for Indy to use, or do I need to do this the hard way and loop through random numbers starting from specific numbers and keep going up until I find an open port? 

Currently, What I am doing is that I get the process ID and then adding 8000 to it and use that as the port number for the service, but I want a cleaner way to do so.

Print this item

  TIWSweetAlert Text linefeed
Posted by: Comograma - 07-18-2024, 10:50 AM - Forum: IntraWeb General Discussion - No Replies

How can I pass a linefeed <br> to the Text property of a TIWSweetAlert component?

Print this item

  IWServerControllerBaseExecuteRequest Event
Posted by: Mario Villalba - 07-17-2024, 03:55 PM - Forum: IntraWeb General Discussion - No Replies

Hello.
I'm new to IW and would like to know how I could capture the body of a post request. I am using the "IWServerControllerBaseExecuteRequest" event. The body I am trying to retrieve is a JSON. I hope you can guide me, since the IW.HTTP.Request.THttpRequest object does not have a ContentStream or something similar.

Print this item

  Instructions for setting up an earlier version's license (1.0.68)
Posted by: Platyforma - 07-17-2024, 06:56 AM - Forum: CrossTalk General Discussion - No Replies

Hello,

My old Delphi 2010 project is using Crosstalk 1.0.68. There will be a need for minor adjustments once some time has passed. Delphi 2010 and Crosstalk have been reinstalled, however I am unable to recall the process for activating the license. 
Sadly, the provided URL is inoperable at this time. Help! I need to know how to activate the license again.

Many thanks in advance

Meyers,

Print this item

  OnChange problems
Posted by: anatolewilson - 07-15-2024, 09:30 AM - Forum: IntraWeb General Discussion - Replies (1)

I made a form with 100+ TIWComboBox questions on one page.

Using the OnChange event, the page is updated on every response. That is an inconvenience when we are at the end of the Form because it returns to the beginning every time it responds.

Is there any code that solves this problem? (Ps. I would not want to use Async events).

Best regards.

Print this item

  Looking for the source of Indy10 DNS Resolver Demo
Posted by: Justin Case - 07-12-2024, 11:18 AM - Forum: Indy General Discussion - No Replies

[EDIT] I've solved this now - found wireshark installed on the VM and found the problem - missing length byte at the beginning of the TXT record. For some reason I didn't think wireshark ran on XP but I found it there and fixed it now. But if anyone can still help with the problem below I'd be grateful!!

Hi

Ages ago from somewhere, I found an example for using Indy10's TIdDNSResolver component.

Using that component isn't much of a problem however I'm trying to debug why a TXT record that is served from my server, is misunderstood and coming through garbled. Having this demo on my desktop I thought I'd use it.. but I can't find the source code anywhere in order to debug what is coming in from my dns server.

The demo's main form looks like this:

[Image: screenshot-1612.jpg]

Does this ring any bells with anyone?

It's not one of the indy demos and isn't on the indy github either. I've been prowling around my hard drives but cannot locate it anywhere - all i have is the executable.

Thanks,
JC

Print this item

  Intraweb and Honeywell CT45 handhels
Posted by: FAlvarado - 07-11-2024, 07:08 PM - Forum: IntraWeb General Discussion - Replies (5)

I had a subscription to IntraWeb 14 Ultimate Edition several years ago. I developed an industrial application with success. 
Now I'm evaluating the new version 15 to develop a new project.
This project is relatively simple: uses SQL server to store info about products and let the user to print labels to a Zebra printer in several client locations....
My question is: as we are using Honeywell CT45 handheld's browser to run the web application and read a barcode for the product and then print the corresponding label, will IntraWeb interface with the barcode reader of the handheld computer?
https://sps.honeywell.com/us/en/products...#resources
I suppose IntraWeb can interface with the bowser printers.
Any one had developed an IntraWeb web application using this type of handhelds?
Kind Regards 
Francisco Alvarado

Print this item

  When to use UniqueURL
Posted by: Comograma - 07-11-2024, 11:57 AM - Forum: IntraWeb General Discussion - No Replies

Can anyone tell me when must I uses UniqueURL = True?
Regarding RestartExpiredSessions , this means that, when set to True, the session will automatically restart when the do something, right?
Thanks!!

Print this item