What's the postfix equivalent to sendmail -bp?

link|improve this question

feedback

4 Answers

up vote 8 down vote accepted

Or, less typing:

mailq
link|improve this answer
feedback
postqueue -p
link|improve this answer
feedback
qshape active

will show you the number of emails being sent to each domain and how long they have been in the active queue

qshape deferred 

will show you the same but for the deferred queue

link|improve this answer
feedback

Here's what I use, culled from the postfix mailing list. I removed the author's name, in case he doesn't want it here (you can see it at the source). It only displays totals.

#!/usr/bin/env perl

# postfix queue/s size
# author: 
# source: http://tech.groups.yahoo.com/group/postfix-users/message/255133

use strict;
use warnings;
use Symbol;
sub count {
        my ($dir) = @_;
        my $dh = gensym();
        my $c = 0;
        opendir($dh, $dir) or die "$0: opendir: $dir: $!\n";
        while (my $f = readdir($dh)) {
                if ($f =~ m{^[A-F0-9]{5,}$}) {
                        ++$c;
                } elsif ($f =~ m{^[A-F0-9]$}) {
                        $c += count("$dir/$f");
                }
        }
        closedir($dh) or die "closedir: $dir: $!\n";
        return $c;
}
my $qdir = `postconf -h queue_directory`;
chomp($dir);
chdir($qdir) or die "$0: chdir: $qdir: $!\n";
printf "Incoming: %d\n", count("incoming");
printf "Active: %d\n", count("active");
printf "Deferred: %d\n", count("deferred");
printf "Bounced: %d\n", count("bounce");
printf "Hold: %d\n", count("hold");
printf "Corrupt: %d\n", count("corrupt");
link|improve this answer
Done. Thanks for the tip. – threecheeseopera Nov 29 '11 at 16:05
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.