twistedvoid
2006-03-28 05:53:05 UTC
After spending hours cleaning up the mess the 'install program' made, I finally got the latest release of Indy 10 installed only to find that things that worked with indy 9, simple things mind you, are causing me major headaches with indy 10.
Example... antifreeze doesn't. period. I've seen my app on a dialup connection totally lock up for over a minute while indy tries to decide what to do. Yes, it's active, Yes, the app has priority, yes, chaged the timeout, onlywhenidle setting.. ect. ONE MINUTE freezes while working on just one e-mail. I know damn well it isn't my code causing the freezups and I don't have the time to rip out 1000 lines of code that would work fine if antifreeze worked and rearrange it into threads.
Next. Stupid things... like the smtp component not disconnecting properly. Here's my code:
procedure Tform1.dosmtpconnect(sender:tobject);
begin
application.processmessages;
try
try
log('SMTP','Sending: '+mailmessage.subject+' To: '+mailmessage.Recipients.EMailAddresses,form1);
SMTPclient.Connect;
SMTPclient.Send(MailMessage);
inc(msgssent);
except on E:Exception do
begin
log('SMTP','ERROR: ' + E.Message,form1);
smtperror:=true;
if sendingmail then
try
SMTPclient.Disconnect;
except;
// this code used to be in the smtpclient.ondisconnect event
// I had to move it here because Indy bombs every time
// I try to smtpclient.disconnect
sendingmail:=false;
smtpclient.Free;
if configform.sslcheckbox.Checked then
smtpsslsocket.free;
end;
end;
end;
finally
smtperror:=false;
if sendingmail then
try
SMTPclient.Disconnect
except
// this code used to be in the smtpclient.ondisconnect event
// I had to move it here because Indy bombs every time
// I try to smtpclient.disconnect
sendingmail:=false;
smtpclient.Free;
if configform.sslcheckbox.Checked then
smtpsslsocket.free;
end;
end;
end;
Seems simple enough. But, I had to put the smtpondisconnect routines into the try/except blocks because Indy, in some wisdom beyond mine, is disconnecting the smtp somewhere in the middle of disconnecting, raises an exception and never gets to the ondisconnect routine. Even if I tell it,
if smtpclient.connected then smtpclient.disconnect
it comes back true true on .connected and gives me an exception with the smtpclient.disconnect. 'connection gracefully closed.' There isn't a damn thing graceful about something that simple that worked in indy 9 and doesn't work in indy 10.
next thing, intuitive shit that should work doesn't...
The only reason I even went through the agony of installing indy 10 and rewriting my code was so I could put 'inline' 'text/plain' message parts in the message. Stupid me for thinking Indy 10 could do it when Indy 9 couldn't.
Here's what I'm trying to do.
messagepart:=tidtext.Create(mailmessage.messageparts);
messagepart.Body.Text:=mystrings.Strings.Text;
messagepart.ContentType:='text/plain';
messagepart.Headers.Add('Content-Disposition: inline');
You would think that the headers.add would add a header line in that messagepart. I thot so. It doesn't. You would think that those writing the Indy code would give me a messagepart.contentdisposition string in tidtext like they do with tidattachment. Even though the RFC's allow this type attachment. They don't.
Yes, I tried using tidattachment. Damned if I can figure a way to assign a string list as the body of a tidattachment, there's no tidattachment.body to assign it to. Forget tidattachmentfile. I want a string list, a small notice attached to every outgoing e-mail message, not a mime encoded attachment and I don't want to have to savetofile my string list then reload it into the attachment and then delete the file when I'm done.
And while I'm ranting: The tidlogfile with the smtp component has ceased to be of use. I was using it to debug the connection between my client and the servers. The POP intercept seems to work just fine. Here's what I get with the SMTP intercept:
Stat Connected.
Stat Disconnected.
Stat Connected.
Stat Disconnected.
Stat Connected.
Stat Disconnected.
Stat Connected.
Stat Disconnected.
Stat Connected.
Stat Disconnected.
Stat Disconnected.
Damned useful. And I know e-mail was being sent and recieved in the midst of those connects and disconnects. Worked in Indy 9. Crap in Indy 10.
The only reason I started using Indy and became a traitor to ICS was because I needed SSL and I didn't have years to wait for the ICS crew to get around to writing SSL for the pop and smtp components and then, wait another year for them to release it to the public. Now I'm regretting my decision. I should have just told my customers to stay the hell away from g-mail and use a less paranoid POP/SMTP server so that I could use a less screwed up POP/SMTP component set.
Example... antifreeze doesn't. period. I've seen my app on a dialup connection totally lock up for over a minute while indy tries to decide what to do. Yes, it's active, Yes, the app has priority, yes, chaged the timeout, onlywhenidle setting.. ect. ONE MINUTE freezes while working on just one e-mail. I know damn well it isn't my code causing the freezups and I don't have the time to rip out 1000 lines of code that would work fine if antifreeze worked and rearrange it into threads.
Next. Stupid things... like the smtp component not disconnecting properly. Here's my code:
procedure Tform1.dosmtpconnect(sender:tobject);
begin
application.processmessages;
try
try
log('SMTP','Sending: '+mailmessage.subject+' To: '+mailmessage.Recipients.EMailAddresses,form1);
SMTPclient.Connect;
SMTPclient.Send(MailMessage);
inc(msgssent);
except on E:Exception do
begin
log('SMTP','ERROR: ' + E.Message,form1);
smtperror:=true;
if sendingmail then
try
SMTPclient.Disconnect;
except;
// this code used to be in the smtpclient.ondisconnect event
// I had to move it here because Indy bombs every time
// I try to smtpclient.disconnect
sendingmail:=false;
smtpclient.Free;
if configform.sslcheckbox.Checked then
smtpsslsocket.free;
end;
end;
end;
finally
smtperror:=false;
if sendingmail then
try
SMTPclient.Disconnect
except
// this code used to be in the smtpclient.ondisconnect event
// I had to move it here because Indy bombs every time
// I try to smtpclient.disconnect
sendingmail:=false;
smtpclient.Free;
if configform.sslcheckbox.Checked then
smtpsslsocket.free;
end;
end;
end;
Seems simple enough. But, I had to put the smtpondisconnect routines into the try/except blocks because Indy, in some wisdom beyond mine, is disconnecting the smtp somewhere in the middle of disconnecting, raises an exception and never gets to the ondisconnect routine. Even if I tell it,
if smtpclient.connected then smtpclient.disconnect
it comes back true true on .connected and gives me an exception with the smtpclient.disconnect. 'connection gracefully closed.' There isn't a damn thing graceful about something that simple that worked in indy 9 and doesn't work in indy 10.
next thing, intuitive shit that should work doesn't...
The only reason I even went through the agony of installing indy 10 and rewriting my code was so I could put 'inline' 'text/plain' message parts in the message. Stupid me for thinking Indy 10 could do it when Indy 9 couldn't.
Here's what I'm trying to do.
messagepart:=tidtext.Create(mailmessage.messageparts);
messagepart.Body.Text:=mystrings.Strings.Text;
messagepart.ContentType:='text/plain';
messagepart.Headers.Add('Content-Disposition: inline');
You would think that the headers.add would add a header line in that messagepart. I thot so. It doesn't. You would think that those writing the Indy code would give me a messagepart.contentdisposition string in tidtext like they do with tidattachment. Even though the RFC's allow this type attachment. They don't.
Yes, I tried using tidattachment. Damned if I can figure a way to assign a string list as the body of a tidattachment, there's no tidattachment.body to assign it to. Forget tidattachmentfile. I want a string list, a small notice attached to every outgoing e-mail message, not a mime encoded attachment and I don't want to have to savetofile my string list then reload it into the attachment and then delete the file when I'm done.
And while I'm ranting: The tidlogfile with the smtp component has ceased to be of use. I was using it to debug the connection between my client and the servers. The POP intercept seems to work just fine. Here's what I get with the SMTP intercept:
Stat Connected.
Stat Disconnected.
Stat Connected.
Stat Disconnected.
Stat Connected.
Stat Disconnected.
Stat Connected.
Stat Disconnected.
Stat Connected.
Stat Disconnected.
Stat Disconnected.
Damned useful. And I know e-mail was being sent and recieved in the midst of those connects and disconnects. Worked in Indy 9. Crap in Indy 10.
The only reason I started using Indy and became a traitor to ICS was because I needed SSL and I didn't have years to wait for the ICS crew to get around to writing SSL for the pop and smtp components and then, wait another year for them to release it to the public. Now I'm regretting my decision. I should have just told my customers to stay the hell away from g-mail and use a less paranoid POP/SMTP server so that I could use a less screwed up POP/SMTP component set.