Solved

Sendmail always timeout.

Posted on 2004-09-27
11
859 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
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
 

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
Don't lose your head updating email signatures!

Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users do...so should you!

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

MS outlook is a premier email client that enable you to send and receive the e-mails with various file formats of attachments such as document files, media file, and many others formats. There is some scenario occurs when a receiver of an e-mail mes…
Utilizing an array to gracefully append to a list of EmailAddresses
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In this video we show how to create a mailbox database 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 Servers >> Data…

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now