Link to home
Start Free TrialLog in
Avatar of jason987
jason987

asked on

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?
Avatar of PsiCop
PsiCop
Flag of United States of America image

Is the PHP script invoking sendmail from a command-line? Is a sendmail daemon running on that machine?
Avatar of jason987
jason987

ASKER

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.
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 ?
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
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.
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>"?
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)
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
what is the 123.4.5.6

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

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

What does hostname return?

What does 'ifconfig -a' show?

What does 'cat /etc/hosts' return?