?
Solved

Sendmail not deliverying messeges unless I flush the queue

Posted on 2005-03-03
17
Medium Priority
?
1,218 Views
Last Modified: 2013-12-17
Hi I am using PHP to sendmail gaind via a form and for some reason the queued messages just sit in the mail queue and don't get sent unless I use the flush option in which they are sent fine.  Is this behaviour a sendmail.cf option or a commandline string?
0
Comment
Question by:jason987
[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
  • 7
  • 6
  • 4
17 Comments
 
LVL 34

Expert Comment

by:PsiCop
ID: 13453372
Is the PHP script invoking sendmail from a command-line? Is a sendmail daemon running on that machine?
0
 
LVL 5

Author Comment

by:jason987
ID: 13453508
Yes sendmail is running

4:27 sendmail: accepting connections
0:03 sendmail: Queue runner@01:00:00 for /var/spool/client

yes the php.ini has the comand line

/usr/sbin/sendmail -t -i  

another strange behaviour is that when it is submitting it hangs for a very long time when waiting for the mail to go.
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 13453595
RE: Long wait times on submission --> If sendmail if configured to do RBL lookups, then its access db may not have exceptions for localhost, meaning every time mail is sent by PHP, the server looks itself up in the RBLs. If this situation exists, then the fix is to put specific entries in the access db to bypass the RBLs.

Are you sure that the configuration of sendmail invoked by PHP is putting the E-Mails into /var/spool/client ?
0
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 
LVL 5

Author Comment

by:jason987
ID: 13453637
well that was just a line from the process list...

/var/spool/clientmqueue

...was the full line

RBL lookups, so you mean like DNS or the actuall addresses...but the larger problem is the queue not immedialty delivering and queing for a long time (maybe indefinate0
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 13454039
DNS RBLs work by turning the connecting host's IP address into a Domain Name and making a lookup request against that Domain Name. Kinda pointless for a host to keep looking itself up.

Are you sure the configuration of sendmail invoked by the PHP script is putting the E-Mail in /var/spool/clientmqueue?

Also, the queue runner will only check that queue periodically. I think 20 minutes is the default. You'll have to look at the sendmail invocation.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 13455295
Does 'mailq' indicate that there's a reason for them being in the queue?

Is the MTA process being started with "-bd -q<some-interval>"?
0
 
LVL 5

Author Comment

by:jason987
ID: 13455529
There is a message:

host map: lookup (host.host.com): deferred  (the host resovles to the sendmail box in question)

Looks like the queue is 1 hour, but it holds them for much longer...

{vars
        DAEMON=no
        QUEUE=1h
}

daemon /usr/sbin/sendmail -bd \
                                $([ -n "$QUEUE" ] && echo -q$QUEUE)
0
 
LVL 40

Accepted Solution

by:
jlevie earned 375 total points
ID: 13455586
Edit /etc/hosts on the mail server and add a definition for the hostname(s) of this server. The result should look something like:

127.0.0.1          localhost.localdomain localhost
123.4.5.6          this-host.domai.tld this-host

Then restart sendmail and run the queue (sendmail -q -v). Wait a while and see if messages are getting stuch in the queue and use the mailq command to find out why.
0
 
LVL 5

Author Comment

by:jason987
ID: 13455731
what is the 123.4.5.6

never seen anything like that before..that is a public ip  range i believe
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 13455880
You need to substitute the server's actual address for "123.4.5.6"... we don't know what the server's actual IP address is, so jlevie was just putting some numbers in as placeholders.
0
 
LVL 5

Author Comment

by:jason987
ID: 13455894
ohh lol,

checking in hosts now
0
 
LVL 40

Expert Comment

by:jlevie
ID: 13455964
Right... I don't know what the machines IP is, but I needed something in the example.
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 13459310
Mebbe "XX.YY.ZZ.AA" would be better as an example? Dunno.
0
 
LVL 5

Author Comment

by:jason987
ID: 13461998
ok I did all  of that and no help.

the odd thing is on my freebsd box messages get delivered immediately and the only reason they stay in the queue is if there is some issue with them even though the Q = 30m.

But on the linux it seems to not run the qv at all (not to mention it takes 30-45 seconds to submit a mail)
0
 
LVL 5

Author Comment

by:jason987
ID: 13462071
another thing is that I noticed it is running sendmail.sendmail that is linked like this

/sbin/sendmail ->  /etc/alternatives/mta -> /usr/sbin/sendmail.sendmail

This look familiar to anyone?  Maybe that is the root of my issues.
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 13462188
Hmmm...mebbe you're not really running sendmail? What do you see when you telnet to port 25 of the machine?
0
 
LVL 40

Expert Comment

by:jlevie
ID: 13462403
What Linux are you running?

What does hostname return?

What does 'ifconfig -a' show?

What does 'cat /etc/hosts' return?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
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.
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…
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…
Suggested Courses

771 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