problems with MIME:Lite timeout

From: dan baker (botfood_at_yahoo.com)
Date: 08/30/04


Date: 30 Aug 2004 13:33:59 -0700

I am trying to build a simple little script using MIME:Lite to run
through about 200 email addresses and send a simple text message. I
seem to be having a problem with a timeout as it gets though 5 or ten
addresses and then quits with the message:
Failed to connect to mail server: Bad file descriptor

I have tried sending a 'hello' every time, but that doesn't seem to
change the behavior....

I am running perl from ActiveState precompiled for windows98 on a PC,
and attempting to send via SMTP thru my server. I am wondering if
there is any way to disconnect and reconnect every 5 addresses or
something like that?

here is a snippet, with some error checking removed for brevity:

foreach $Recipient ( @tempList ) {

        $First_Name = '';
        $Last_Name = '';
        $email = '';
        $MarriedName = '';

        # split the raw CSV textline
        if ( $Recipient =~ m/"(.*)","(.*)","(.*)","(.*)"/ ) {
                $First_Name = $1 ;
                $Last_Name = $2 ;
                $email = $3 ;
                $MarriedName = $4 ;
        }

        $Recipient = "$First_Name $Last_Name";
        if ( $MarriedName ) { $Recipient .= "-$MarriedName" }
        $Recipient = "\"$Recipient\"\<$email\>";

        # handshake server again
        MIME::Lite->send('smtp', $cSMTPserver ,
                         Hello=>$cSMTPserver , Timeout=>60 );

        # send mail
        # -----
        $msg='';
            $msg = MIME::Lite->new(
                From => $Sender ,
                To => $Recipient ,
                Subject => $Subject ,
                Type => $Type ,
                Data => $Body
        );

        unless ( $msg->send() ) { # send it now
            print "...send FAILED \n\n";
        }
}



Relevant Pages

  • Re: Script to list out users with enabled outlook mobile access in
    ... here is your script, all you need to do is to change the server name to your ... mail server name, and run it ... MVP - Exchange ... single LDAP query, so what I would do is query for all users (or some ...
    (microsoft.public.exchange.admin)
  • Re: incoming emails
    ... Most mail servers can pass an email to a script. ... just put the perl script in the mail server setting file ... Note Sendmail can be very tricky in where it will run processes from. ... you could put these emails in to a POP3 account and have a ...
    (comp.lang.php)
  • Re: problem with Mime::Lite
    ... I believe that that can be done by filling the reply-to variable of ... Mime::Lite this should make the mail server send any reply to the email ... script that drives the form is a perl script and it uses Mime::Lite to send ... We would like that the returned email goes to the emaill address ...
    (perl.beginners)
  • Re: mailman upgrade problem
    ... Mailman expected the mail wrapper script to be executed as group ... "nobody", but the system's mail server executed the mail script as group ... Try tweaking the mail server to run the script as group ...
    (freebsd-questions)
  • Re: 10.2 and sendmail
    ... The script is only available to restricted users and then they have no ... How do I tell sendmail the outgoing mail server address? ... are you wanting to use your ISPs mail server to do the delivery? ... Are these mails meant to be sent to local users or non-local users? ...
    (alt.os.linux.suse)