Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

outgoing messages "stuck" in mail queue

Status
Not open for further replies.

oscarsmac

Programmer
May 18, 2010
2
US
Hello;

I'm having an issue with outgoing mail getting "stuck" in
the queue.

I'm not a postfix expert by any definition, and would be
grateful for any advice on this.

Here are the relevant details:

We have a php-based application running, that sends email
messages to customers as needed (order processing, confirmations,
etc.)

Each time a customer orders a product, we send an email to
the customer, and one to our in-house sales staff.

If several orders are placed in a short period of time
(for example, 3 orders in one minute), the last email
(the one going to the sales staff) gets "stuck" in the
outgoing queue.

At some point in the future, the message gets delivered;
sometimes in 15 minutes, sometimes not for over an hour.

some points of interest, in no particular order:

-- the problem only occurs when sending mail from our php
code. even a very small test script with two mail() function
calls can be used to reproduce the problem.

-- using sendmail from the command line does not reproduce the
problem. I can easily fire off 10 emails in 10 seconds or so,
and they all get delivered correctly.

-- I tried enabling verbose logging on virtually every component
of the postfix system (pickup, cleanup, qmgr, smtp & others),
and poured through the logs for hours, but I can't find any reason
for the messages to get stuck in the queue.

-- when a message is "stuck", I can see it in the directory:
/var/spool/postfix/maildrop. I can even view the message with
postcat.

-- when the messages do finally get delivered, the smtp log entry
shows "delay=nnnn", where nnnn is the number of seconds the message
sat in the queue. but again, no clue as to why it sat there for so long.

During the past few days of troubleshooting this problem, I noticed
that sending an email with sendmail from the command line would cause
any messages stuck in the queue to immediately get delivered. So,
as a work-around, I setup a cron job to run sendmail every so often,
sending a blank email (to a nonexistent address). This has solved
the problem for now, and I'm no longer getting phone calls from our
sales staff (whew.)

Any help would be greatly appreciated.

our configuration is as follows:

machine: Mac XServe
os: Mac OSX Sevrer 10.5
postfix version: mail_version = 2.1.5
php: 5.2.1 (cli)

Robert Meyer
 
ping!

just wondering if anyone has any thoughts on this.

thanks in advance.
rm.
 
If I am not mistaken, maildrop is one of the Postfix daemon processes. Specifically it is the one for local delivery. The fact that using sendmail, or the Postfix sendmail equivalent (?) causes the messages to get delivered makes it sound like there may be a problem with the daemon process.

For starters I would try this: either wait for or cause the problem to occur and then see if you can do a ps or other command to see what the state of the process is. If you do see that it is a problem with this process, look in master.cf as the first place as this is where the daemons are configured.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top