Hello,
I'm having on occasion members complain of a software error
I've done the ole google wotsit banger and the threads i find seem to indicate a mail server issue.
When I told the mail server guys they said this
I'm a little confused, do I really want to issue a telnet command to the mail server , before MIME:Lite tries to send the email?
Is it possible this error is a bogus 'mis-reported' error as they suggest?
This only happens now and again, emails normally get sent ok, so if there was a problem with the perl code , surely it would never work!
either way, how do I work out what is causing the problem and what this error message means.
I beleive it is a connection problem with the mail server, either timing out, refusing connection, or them simply having networking / conectivity problems at the time the email is trying to be sent.
But hey, it could be to do with the internet connection the webserver is connecting from.
What I feel i can be cetain about is the perl code is not at fault (well I hope not having made that statement - lol )
any advice is appreciated.
perl code is here..
highlighted is the line where it bombs.
cheers 1DMF.
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
I'm having on occasion members complain of a software error
Failed to connect to mail server: Bad file descriptor
I've done the ole google wotsit banger and the threads i find seem to indicate a mail server issue.
When I told the mail server guys they said this
I explained that the perl runs fine and all threads found indicate it is not a perl code problem, they repliedUnfortunatly we dont support Pearl code as no one here has enough experience with it to answer your question however we can confirm that our servers are all up and running fine.
Apologies that we can not resolve this issue for you.
I have spoken to one of our developers....
He has suggested that you try using the following command from the machine you are running the perl script on
telnet post6.emailfiltering.com 25
if you see the response 220 ......
then you have connected to the mail server and it is correctly responding.
Following that the SMTP conversation will start. Our service runs with no peculiar settings. It will however perform open-relay checks, etc. I am assuming this is an outbound email, so I would advise that you check that the sender email address matches the domains we scan for.
Bad file Descriptor would tend to indicate a local problem. It it is likely that this error is simply mis-reporting/ masking a valid SMTP response from our service. We really need you to tell us the SMTP response code, which we can then diagnose for you.
I'm a little confused, do I really want to issue a telnet command to the mail server , before MIME:Lite tries to send the email?
Is it possible this error is a bogus 'mis-reported' error as they suggest?
This only happens now and again, emails normally get sent ok, so if there was a problem with the perl code , surely it would never work!
either way, how do I work out what is causing the problem and what this error message means.
I beleive it is a connection problem with the mail server, either timing out, refusing connection, or them simply having networking / conectivity problems at the time the email is trying to be sent.
But hey, it could be to do with the internet connection the webserver is connecting from.
What I feel i can be cetain about is the perl code is not at fault (well I hope not having made that statement - lol )
any advice is appreciated.
perl code is here..
Code:
##############################
###### SENDMAIL ROUTINE #####
##############################
# USING MIME::Lite;
sub send_pdf {
#_[0] = To
#_[1] = From
#_[2] = Subject
#_[3] = Body Text
#_[4] = Filename
#_[5] = File
use MIME::Lite;
my @TO = split(/\;/, $_[0]);
foreach my $to (@TO){
my $msg = MIME::Lite->new( From => "$_[1]",
To => "$to",
Subject => "$_[2]",
Type => 'multipart/mixed',
Timeout => 60 );
$msg->attach(Type => 'application/pdf',
Path => "$_[5]",
Filename => "$_[4]");
$msg->attach(Type => 'TEXT/HTML',
Data => "$_[3]");
[b]$msg->send('smtp', "mail.mailserver.com");[/b]
}
}
highlighted is the line where it bombs.
cheers 1DMF.
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!