PDA

View Full Version : mailq


phppete
08-20-2007, 04:18 AM
How can I delete all the messages in mailq? mail is no longer working from within PHP or the command line, so I am thinking something is blocked or needs flushing?

Arthur
08-20-2007, 04:33 AM
How can I delete all the messages in mailq? mail is no longer working from within PHP or the command line, so I am thinking something is blocked or needs flushing? I'm assuming this is not on a FutureQuest account?

In general, to remove queued messages, you need to stop the delivery process and delete the appropriate files from the spool. How to do that depends on the MTA you're using, but the queue is normally located in /var/ (/var/spool, /var/qmail).

I'd recommend examining the mail log first, which is often located in /var/log/maillog.

-Arthur

phppete
08-20-2007, 04:52 AM
Hi Arthur,

Thanks for the reply, it is not on FQ BTW, its on my Mac, the mail log of the last message shows:


Aug 20 09:42:25 peter-hawkes-computer postfix/pickup[510]: 7836B10A734: uid=70 from=<www>
Aug 20 09:42:25 peter-hawkes-computer postfix/cleanup[663]: 7836B10A734: message-id=<20070820084225.7836B10A734@peter-hawkes-computer.local>
Aug 20 09:42:25 peter-hawkes-computer postfix/cleanup[663]: 7836B10A734: to=<unknown>, relay=none, delay=0, status=bounced (No recipients specified)
Aug 20 09:42:25 peter-hawkes-computer postfix/cleanup[666]: 80C1110A736: message-id=<20070820084225.80C1110A736@peter-hawkes-computer.local>
Aug 20 09:42:25 peter-hawkes-computer postfix/qmgr[304]: 80C1110A736: from=<>, size=2120, nrcpt=1 (queue active)
Aug 20 09:42:25 peter-hawkes-computer postfix/local[667]: 80C1110A736: to=<root@peter-hawkes-computer.local>, orig_to=<www@peter-hawkes-computer.local>, rela
y=local, delay=0, status=sent (delivered to file: /dev/null)
Aug 20 09:42:25 peter-hawkes-computer postfix/qmgr[304]: 80C1110A736: removed


I'm not used to reading mail logs but from the above it looks like there was no recipient, but there was, I used a simple test:

mail('info@********.co.uk', 'My Subject', "my message");

Everything was working as expected a few days ago. My normal mail which I collect with Thunderbird is working without any problems.

I need emails sent from my mac while testing sites locally, such as web site orders, registration emails etc.

OK, the plot thickens, I then used the mail command like so ...


mail -s "Subject" info@********.co.uk < cronlog.txt


The mail log shows:

Aug 20 09:47:53 peter-hawkes-computer postfix/smtp[695]: E856610A754: to=<info@*********.co.uk>, relay=mx.futurequest.net[69.5.6.172], delay=3, status=defer
red (host mx.futurequest.net[69.5.6.172] said: 451 http://www.spamhaus.org/query/bl?ip=85.xxx.181.xxx (in reply to RCPT TO command))

Apologies for being dumb but can you explain what the above means, does that mean it was sent or not and is the spamhaus just Spam Assasin checking the mail?

FWIW I do realise this isn't a FQ problem whatsoever :smile:

Arthur
08-20-2007, 05:12 AM
To start with the last question; a status 451 means the message was deferred by (in this case) our servers, because your IP address is listed in the CBL. It was not accepted and your MTA (Postfix) will try delivery again later.
You should visit that spamhaus URL and request delisting of your IP address.

If sending from the command-line works, but sending from PHP doesn't, that indicates your Postfix installation works correctly and you should check your PHP's settings (php.ini).

The part from the log you quoted shows delivery of a bounce message to /dev/null. Bounce messages normally don't have a sender. I believe you need to look at the message before this message.

-Arthur

phppete
08-20-2007, 06:05 AM
To start with the last question; a status 451 means the message was deferred by (in this case) our servers, because your IP address is listed in the CBL. It was not accepted and your MTA (Postfix) will try delivery again later.
You should visit that spamhaus URL and request delisting of your IP address.

If sending from the command-line works, but sending from PHP doesn't, that indicates your Postfix installation works correctly and you should check your PHP's settings (php.ini).

The part from the log you quoted shows delivery of a bounce message to /dev/null. Bounce messages normally don't have a sender. I believe you need to look at the message before this message.

-Arthur

Thanks for the info Arthur. It would appear that the problem resulted from my IP being blacklisted. I am on a dynamic IP so sometimes I get 84.1.*** other times its 85.*** the majority of them are blacklisted which I wasn't aware of.

I might change to another DSL provider and get a static IP address, otherwise I have to keep disconnecting and reconnecting until I find one that isn't blacklisted.

The other problem was that I messed something up in my php.ini file a few days ago assuming it was that, I uncommented the sendmail path when that was obviously not the thing to do, commenting it out has now fixed my problem, so all is back to normal.

I might send a bill for 3 - 4 hours of wasted time to my ISP for giving me blacklisted IPs that sent me on a wild goose chase :confuz:

Thank you for the help, without it I would still be without mail not knowing why probably running around breaking everything in sight turning a problem into a nightmare!