in reply to how to speed the mail process?

It's probably a safe bet to say that the slowness is the sending of the mail, not the database access. Whack a

use Time::HiRes;

...at the top of the program and then instrument the time it takes to send the message:

my $begin = time; send_customer_mail($coutnet); my $delta = time - $begin; warn "Well that took $delta seconds\n";

I wager you're seeing significant times being eaten right there.

Be that as it may, two messages per second is stunningly slow. Are you trying to connect to the remote MX directly from your script? I would inject the messages to a local MTA and let it deal with the delivery.

I use Postfix at $work, and my untuned configuration will let me queue several hundred messages per second, if not more. And there are other MTAs like qpsmtpd (written in Perl, natch), which are faster still.

Another consideration to keep in mind is that just because you sent a message, doesn't mean the recipient received it... you need to check your outbound SMTP queue and check that it's been delivered (and not rejected) to the remote destination (but even then it may get dropped on the floor, filed as spam, or bounced back to you for any number of legitimate reasons).

• another intruder with the mooring in the heart of the Perl