Page 1 of 1

check_mailq nullmailer problem/bug?

Posted: Wed Sep 10, 2014 7:11 am
by dudley
Hey guys,

i got a problem with the nullmailer-part in check_mailq. It always reports 0 mails in queue even if there are some..

These are lines 520-525 from latest check_mailq (example output from mailq and the regex) :
while (<MAILQ>) {
#2006-06-22 16:00:00 282 bytes

if (/^[1-9][0-9]*-[01][0-9]-[0-3][0-9]\s[0-2][0-9]\:[0-2][0-9]\:[0-2][0-9]\s{2}[0-9]+\sbytes$/) {
$msg_q++ ;
First problem i see is that the regex for minutes and seconds is wrong - both only match from 00-29!? Unfortunate if your queued mail has a timestamp of 16:43:52...

Second problem that example string from mailq is a bit different on (all of) my machines. I hope someone could reproduce that. This is how mailq output looks here:
2014-09-04 21:42:36 19997323 bytes from <root@domain..>
2 small differences:
  • - there is only one space between time and size
    --> i replaced \s{2} with only \s
  • - the line doesn't end after "bytes"
    -> i replaced "$" at the end with a "*"
Can someone confirm this or tell me that i'm completely off the track ;)...

Re: check_mailq nullmailer problem/bug?

Posted: Thu Sep 11, 2014 4:43 pm
by sreinhardt
Thanks for pointing it out, I'll take a look!