Sendmail not deliverying messeges unless I flush the queue

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?
LVL 5
jason987Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PsiCopCommented:
Is the PHP script invoking sendmail from a command-line? Is a sendmail daemon running on that machine?
0
jason987Author Commented:
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
PsiCopCommented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

jason987Author Commented:
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
PsiCopCommented:
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
jlevieCommented:
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
jason987Author Commented:
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
jlevieCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jason987Author Commented:
what is the 123.4.5.6

never seen anything like that before..that is a public ip  range i believe
0
PsiCopCommented:
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
jason987Author Commented:
ohh lol,

checking in hosts now
0
jlevieCommented:
Right... I don't know what the machines IP is, but I needed something in the example.
0
PsiCopCommented:
Mebbe "XX.YY.ZZ.AA" would be better as an example? Dunno.
0
jason987Author Commented:
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
jason987Author Commented:
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
PsiCopCommented:
Hmmm...mebbe you're not really running sendmail? What do you see when you telnet to port 25 of the machine?
0
jlevieCommented:
What Linux are you running?

What does hostname return?

What does 'ifconfig -a' show?

What does 'cat /etc/hosts' return?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.