Re: [twsocket] Using lots of TSmtpCli in a single application

2009-08-17 Thread Angus Robertson - Magenta Systems Ltd
 Also  if  a MX refuse you because of some blacklist then remove 
 thoses mails  from the queue and send you a mail alert so you can 
 investigate why destination refused your mail.

It's important not to fail an email on a first refusal, due to the wide
usage of 'greylisting' where the SMTP server rejects the first email
attempt and then allows a second attempt, typically 10 to 15 minutes
later.  Sometimes the response mentions greylisting, but some SMTP
servers don't even do that.  

MAIL FROM: nursery...@englishmotorsports.com
250 OK nursery...@englishmotorsports.com Sender ok 
RCPT TO: i...@magsys.co.uk
451 Greylisted, please try again in 600 seconds 

Once an email has been sent successfully, the server adds the sender to
an internal list so future email is not delayed.  

Greylisting is very successful in stopping spam, at least for the moment,
it stops 500 to 1,000 spams a day here.  

However have a couple of Delphi applications that currently sent email
without using a queue or a 15 minute delay, which really need updating to
cope with greylisting.

Angus

--
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] Using lots of TSmtpCli in a single application

2009-08-17 Thread Dod
Hello Angus,

I  usually  do  it  according to fail code 5.x.x or 4.x.x for 4.x.x I
retry  later,  for 5.x.x I pout them appart to check manually why they
have been rejected.

regards.

 Also  if  a MX refuse you because of some blacklist then remove 
 thoses mails  from the queue and send you a mail alert so you can 
 investigate why destination refused your mail.

ARMSL It's important not to fail an email on a first refusal, due to the wide
ARMSL usage of 'greylisting' where the SMTP server rejects the first email
ARMSL attempt and then allows a second attempt, typically 10 to 15 minutes
ARMSL later.  Sometimes the response mentions greylisting, but some SMTP
ARMSL servers don't even do that.  

ARMSL MAIL FROM: nursery...@englishmotorsports.com
ARMSL 250 OK nursery...@englishmotorsports.com Sender ok 
ARMSL RCPT TO: i...@magsys.co.uk
ARMSL 451 Greylisted, please try again in 600 seconds 

ARMSL Once an email has been sent successfully, the server adds the sender to
ARMSL an internal list so future email is not delayed.  

ARMSL Greylisting is very successful in stopping spam, at least for the moment,
ARMSL it stops 500 to 1,000 spams a day here.  

ARMSL However have a couple of Delphi applications that currently sent email
ARMSL without using a queue or a 15 minute delay, which really need updating to
ARMSL cope with greylisting.

ARMSL Angus

ARMSL --
ARMSL To unsubscribe or change your settings for TWSocket mailing list
ARMSL please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
ARMSL 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] Using lots of TSmtpCli in a single application

2009-08-17 Thread DZ-Jay

On Aug 16, 2009, at 14:43, Pete Williams wrote:

Previously my app used a single TSmtpCli and this all worked fine.  
Now however I have to send mail on behalf of lots of accounts and  
the number of TsmtpCli components in use simultaneously, used in a  
multi threaded application, could be in excess of 100.



I created a mail queue system using a customized TSmtpCli component  
(among other things) and, as far as I recall, I was sending 10,000  
messages in a couple of minutes--all within a single thread.  ICS  
Components are very good for this sort of thing, and you do not need  
multiple threads to use it.


Since the components are asynchroneous, slow server connections or  
responses should not affect your performance when using multiple  
components simultaneously.  The thing that may cause a delay is DNS  
look-up, which is an expensive operation, and typically blocks.


Your description of the project does not seem unusual at all, and in  
fact, as others have said, 200 messages per hour seems rather low.   
You shouldn't have a problem using ICS for it.


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://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Using lots of TSmtpCli in a single application

2009-08-17 Thread DZ-Jay


On Aug 17, 2009, at 04:45, Dod wrote:


I  usually  do  it  according to fail code 5.x.x or 4.x.x for 4.x.x I
retry  later,  for 5.x.x I pout them appart to check manually why they
have been rejected.



This is the correct way of handling.  As per the RFC, error codes win  
the 400 range are transient errors, meaning that they are temporary,  
and the sender should retry eventually; while codes in the 500 range  
are permanent errors.  Of course, servers are not required to adhere  
to the RFC, but I haven't come across one that does not in this  
regard.  It's for their own benefit, for they stand to break the  
entire system and lose e-mail if they send the wrong response.


Greylisting and other anti-spam techniques should result in a 4.x.x  
error.  Any mail sending application should be smart enough to re- 
queue these.  5.x.x errors must not be re-tried without  
modifications.  In my mail queue server I have a simple algorithm to  
attempt to determine the reason for the failure, and sort them so that  
they can be manually analysed and corrected if necessary.  The most  
common errors I've seen are:

1. User not found (account closed)
2. Destination server blacklisted in ORDB
3. Common typo in domain name (e.g. yaho.com, gmail.cmo, etc.)

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://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Using lots of TSmtpCli in a single application

2009-08-17 Thread Pete Williams

Thanks for all the messages! Some useful things for me to know.

My question wasn't about email volume as such, but simply about having lots of 
TSmtpCli components active at any one time, even if they are not doing anything.

The application I'm working on is 9 years old, has many thousands of man hours 
spent on it, and whilst it would be nice to have a single TSmtpCli, in order to 
avoid a massive code rewrite it's much easier for me to have lots of TSnmpCli 
components, rather than one (you can't see it, but I can of course). 

Reading the responses, it looks like this is somewhat un-orthodox but will not 
generate any stability problems at all with respect to ICS - which is what I'd 
hoped.

Thanks again, Pete

_
Windows Live Messenger: Thanks for 10 great years—enjoy free winks and 
emoticons.
http://clk.atdmt.com/UKM/go/157562755/direct/01/
--
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] Using lots of TSmtpCli in a single application

2009-08-17 Thread Pete Williams

This is a really useful thing for me to know, thanks for posting this.
 
 This is the correct way of handling.  As per the RFC, error codes win  
 the 400 range are transient errors, meaning that they are temporary,  
 and the sender should retry eventually; while codes in the 500 range  
 are permanent errors.  Of course, servers are not required to adhere  
 to the RFC, but I haven't come across one that does not in this  
 regard.  It's for their own benefit, for they stand to break the  
 entire system and lose e-mail if they send the wrong response.
 
 Greylisting and other anti-spam techniques should result in a 4.x.x  
 error.  Any mail sending application should be smart enough to re- 
 queue these.  5.x.x errors must not be re-tried without  
 modifications.  In my mail queue server I have a simple algorithm to  
 attempt to determine the reason for the failure, and sort them so that  
 they can be manually analysed and corrected if necessary.  The most  
 common errors I've seen are:
   1. User not found (account closed)
   2. Destination server blacklisted in ORDB
   3. Common typo in domain name (e.g. yaho.com, gmail.cmo, etc.)
 
   dZ.
 


_
Windows Live Messenger: Happy 10-Year Anniversary—get free winks and emoticons.
http://clk.atdmt.com/UKM/go/157562755/direct/01/
--
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] Using lots of TSmtpCli in a single application

2009-08-17 Thread Angus Robertson - Magenta Systems Ltd
 The application I'm working on is 9 years old, has many thousands 
 of man hours spent on it, and whilst it would be nice to have a 
 single TSmtpCli, in order to avoid a massive code rewrite it's much 
 easier for me to have lots of TSnmpCli components, rather than one 
 (you can't see it, but I can of course). 

The issue we were discussing was not the use of a single TSmtpCli which
is clearly unsuitable for all but the most simple mail servers, but
whether you should be using threads with multiple TSmtpCli components (or
most other ICS components for that matter).  

I have an application that captures data on 400 TWSockets simultaneously,
in a single thread.  

As was said, two or more threads are beneficial where there are multiple
processors available to the application and you can hog the entire server,
or where you really are handling thousands of simultaneous connections.  

Angus

--
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] Using lots of TSmtpCli in a single application

2009-08-17 Thread Dod
Hello Angus,

You  are  true,  I  made a mistake talking about multiple threads, I
meant  multiple  components in a single thread with a thread dedicated
to the smtp component's so it is separated from the main GUI thread so
the visual interface (if any) should be always responsive whenever the
smtp thread is working hard.

regards.

 The application I'm working on is 9 years old, has many thousands 
 of man hours spent on it, and whilst it would be nice to have a 
 single TSmtpCli, in order to avoid a massive code rewrite it's much 
 easier for me to have lots of TSnmpCli components, rather than one 
 (you can't see it, but I can of course). 

ARMSL The issue we were discussing was not the use of a single TSmtpCli which
ARMSL is clearly unsuitable for all but the most simple mail servers, but
ARMSL whether you should be using threads with multiple TSmtpCli components (or
ARMSL most other ICS components for that matter).  

ARMSL I have an application that captures data on 400 TWSockets simultaneously,
ARMSL in a single thread.  

ARMSL As was said, two or more threads are beneficial where there are multiple
ARMSL processors available to the application and you can hog the entire 
server,
ARMSL or where you really are handling thousands of simultaneous connections.  

ARMSL Angus

ARMSL --
ARMSL To unsubscribe or change your settings for TWSocket mailing list
ARMSL please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
ARMSL 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


[twsocket] Using lots of TSmtpCli in a single application

2009-08-16 Thread Pete Williams

Hi 

I've used ICS components for a while now and had great results. 

I have something new to do and wanted some advice before starting a new project.

Previously my app used a single TSmtpCli and this all worked fine. Now however 
I have to send mail on behalf of lots of accounts and the number of TsmtpCli 
components in use simultaneously, used in a multi threaded application, could 
be in excess of 100.

Assuming that the machine has enough memory and processor power, am I likely to 
run into any problems?

I don't evisage the email volumes being massive - say 20 per hour per account, 
meaning something like 200 per hour outgoing per application.

My reason for asking is simple - I'm doing something unusual. If it is likely 
to be a problem I can try concentrating all emails through a single Tsmtpcli 
but because of the code base I am working with this will be much harder to do.

Any comments welcome. Thanks in advance!





_

Upgrade to Internet Explorer 8 Optimised for MSN.  

http://extras.uk.msn.com/internet-explorer-8/?ocid=T010MSN07A0716U
--
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] Using lots of TSmtpCli in a single application

2009-08-16 Thread Dod
Hello Pete,

200  mails  per  hour  is really not much, a single thread can do much
more.

But  you  may be slowed by the other side smtp server if it is slow or
timeout.  So  doing  multi-thread  is  a  good  way to maintain a good
average speed.

You  can  create  20  threads with a common queue that each thread can
take mails from, so if a thread is slowed because of slow or timed-out
smtp  server,  then  the other threads continue to empty the queue and
send e-mails to other smtp servers.

In  case  you  send  multiple  mails so same MX domain, then make some
function  that  will  re-arrange  the  queue to move slow or timed-out
domains to the end of the queue so you'll retry them later.

Also  if  a MX refuse you because of some blacklist then remove thoses
mails  from the queue and send you a mail alert so you can investigate
why destination refused your mail.

regards.


PW Hi 

PW I've used ICS components for a while now and had great results. 

PW I have something new to do and wanted some advice before starting a new 
project.

PW Previously my app used a single TSmtpCli and this all worked fine. Now 
however I have to send mail on behalf of lots of accounts and the number of 
TsmtpCli components in use simultaneously, used
PW in a multi threaded application, could be in excess of 100.

PW Assuming that the machine has enough memory and processor power, am I 
likely to run into any problems?

PW I don't evisage the email volumes being massive - say 20 per hour per 
account, meaning something like 200 per hour outgoing per application.

PW My reason for asking is simple - I'm doing something unusual. If it is 
likely to be a problem I can try concentrating all emails through a single 
Tsmtpcli but because of the code base I am
PW working with this will be much harder to do.

PW Any comments welcome. Thanks in advance!





PW _

PW Upgrade to Internet Explorer 8 Optimised for MSN.  

PW http://extras.uk.msn.com/internet-explorer-8/?ocid=T010MSN07A0716U
PW --
PW To unsubscribe or change your settings for TWSocket mailing list
PW please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
PW 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] Using lots of TSmtpCli in a single application

2009-08-16 Thread Arno Garrels
Pete Williams wrote:
 Hi
 
 I've used ICS components for a while now and had great results.
 
 I have something new to do and wanted some advice before starting a
 new project. 
 
 Previously my app used a single TSmtpCli and this all worked fine.
 Now however I have to send mail on behalf of lots of accounts and the
 number of TsmtpCli components in use simultaneously, used in a multi
 threaded application, could be in excess of 100. 

100 connections and more in one single thread is no problem. Anyway don't
use one thread per connection, that was wasted resource! Since ICS works 
asynchronous there _basically is no need for multiple threads. However if 
you want your application scale well with multiple processors and keep
your GUI responsive create as many additional threads as CPUs/cores are
available and divide work/number of connections accordingly.  

--
Arno Garrels
--
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