Solved

Sendmail always timeout.

Posted on 2004-09-27
11
874 Views
Last Modified: 2013-12-17
Im writing a PHP Mailing List Script. Then i loop for the email addresses in the database then email them each using sendmail. It's working but it always timeout. (30 sec) I'm using PHP,Apache,Sendmail for Windows
0
Comment
Question by:deepsweech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 3

Expert Comment

by:cagri
ID: 12168294
What gets timeout ? You collect addresses, you open a text file or a pipe to sendmail, put those adresses (or one of them) in to To: field (Cc or Bcc), send the e-mail. At this point it normally queues the e-mail. Although the case is not that clear to me, could you please setting the e-mail body in a text file and send this one later ? If there is a problem with the body or header, you will probably notice this looking at the text file.

Do you mind sharing the piece of code sending mails ?

Hope this helps,
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12170169
A 30 second timeout on each message could be the result of Sendmail's reverse lookup on the sender IP or Sendmail timing out an ident request. Ident request can, and usually should, be disables by including:

define(`confTO_IDENT', `0')dnl

in the sendmail.mc used to build sendmail.cf. Reverse DNS issues can be solved by making sure that there's a correct PTR record for the sender's IP or by properly defining the sender's IP/hostname in the hosts file of the Sendmail server.
0
 
LVL 6

Expert Comment

by:anfi
ID: 12174271
Which sendmail version do you use ?
http://www.sendmail.org/faq/section4.html#4.16
Q4.16 -- How do I find sendmail's version number?
0
Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

 

Author Comment

by:deepsweech
ID: 12187588
Thanks to you all here is the problem:
i retrieve email addresses from the database(mySQL) then in my PHP page, I have a Loop where i email each of the email addresses i have. its like:

do {
$to = $row_GetEmail['Email'];
$from =  ...
$header = ....
mail($to, $from, .....)
} while ($row_GetEmail = mysql_fetch_assoc($rsGetEmail));

but my page expires. i tried printing a counter and i saw that it can only send 2 - 5 emails. i even received an email so i know there's no error in the mail() function. I tried researching for solution and I read 1 site saying I must turn on the email queueing of the sendmail config in php.ini. but it's not available for sendmail for windows/apache/php.

Thanks.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12192668
Where is the Sendmail that you are using running,  the windows version of Sendmail on the local machine or some other host?

What happens if you do, on this system, a telnet on port 25 to the Sendmail server you use? Does that show the same 30 second delay?
0
 
LVL 4

Accepted Solution

by:
frankcheong earned 50 total points
ID: 12224924
I have similar exp when sending the mail on local host using sendmail directly, I got no delay.

While when sending using smtp on remote SMTP gateway, it would delay for at least 10 second each email (a rough guess as I don't have timed).

It is actually becoz the local sendmail only put your request on queue and thus can return to your program immediately while when sending using SMTP gateway, it will need to complete the job before closing your connection.
0
 
LVL 7

Expert Comment

by:HalldorG
ID: 12251497
This could be because of the sendmail is failing look up the destination email addresses.
That is to say check that name resolving is working on the server.

If that is not the case and it is resolving fine check the maillog
/var/log/maillog or /var/log/messages while you are sending

Suggest

tail -f /var/log/maillog /var/log/messages

Tweeking the queuing start at load in sendmail.cf  might help as if you see that sendmail is rejecting connections
in the log file
0
 
LVL 4

Expert Comment

by:frankcheong
ID: 12260526
I guess it is the standard behavior of modern SMTP (maybe customizable) coz I have setup a postfix as an SMTP server and the same thing applies too.

This have positive effect on delaying during spamming abuse.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
In this video we show how to create a User Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Mailb…
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question