Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1222
  • Last Modified:

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?
0
jason987
Asked:
jason987
  • 7
  • 6
  • 4
1 Solution
 
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
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
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
 
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

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

  • 7
  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now