Solved

Sendmail always timeout.

Posted on 2004-09-27
11
853 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
Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.

 
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

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!

Join & Write a Comment

This short article will present "How to import ICS Calendar onto Office 365 Calendar". I was searching for free (or not free) tools to convert ICS to CSV without success. The only tools I found & working well were online tools...this was too hard to…
Microsoft has released various new features which are capable of handling various tasks. One of these tasks is ‘Migration from pop3 to Exchange Server’. Pop3 data stores various data along mailboxes like contacts, tasks, etc. So, it becomes the need…
In this video we show how to create an email address policy 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 Mail Flow…
To show how to create a transport rule 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 Mail Flow >> Rules tab.:  To cr…

708 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

13 Experts available now in Live!

Get 1:1 Help Now