• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3919
  • Last Modified:

Postfix mail queue not being processed


I'm having big problems with my mail server. My Postfix mail queue doesn't seem to be getting processed anymore and messages seem to be placed in hold queue indefinitely.

If I run "postsuper -H ALL" the queue is released and when I restart Postfix the messages are delivered. However, the same thing starts all over again straight afterwards.

I've had to manually process the mailq for the past couple of hours and haven't been able to figure out the problem.

This problem may have started last night after I updated Debian, but I'm not sure - it could just be a coincidence. Here's the update:

Any help would be greatly appreciated as always!
Julian Matz
Julian Matz
  • 11
  • 3
  • 3
  • +1
4 Solutions
Could you look at the maillog /var/log/maillog and see whether postfix is recording any errors?
Julian MatzJoint ChairpersonAuthor Commented:
No, I'm not seeing anything. The only thing that even resembles an error message are thes:

postfix/smtpd[3768]: warning: hostname dsl.dynamic8510085156.ttnet.net.tr verification failed: Name or service not known

... but I think that's normal.

The only other things I can see Postfix logging is

- postfix/smtpd[4056]: NOQUEUE: reject: (Spamcop block, User unknown in virtual alias table, etc.)
- postfix/cleanup[4038]: A31DF2F98: hold: header Received: from ....
Is this,,  the IP of your server?
I do not believe the update you applied is the direct cause, but something else might be interfering with the operations of postfix.
Check whether there are postfix updates.

Stop and restart postfix and see what if anything is recorded in the maillog or in the /var/log/syslog or is it /var/log/messages which ever applies to your system.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Julian MatzJoint ChairpersonAuthor Commented:
No, that's not my IP.

One of the updates yesterday was a kernel update and I had to reboot the server after the update. It could also have had something to do with the reboot maybe.

This is what I get when reloading Postfix:

Feb 14 22:08:48 postfix/master[2485]: reload configuration /etc/postfix
Feb 14 22:08:48 postfix/anvil[5305]: statistics: max connection rate 1/60s for (smtp: at Feb 14 22:06:16
Feb 14 22:08:48 postfix/anvil[5305]: statistics: max connection count 1 for (smtp: at Feb 14 22:06:16
Feb 14 22:08:48 postfix/anvil[5305]: statistics: max cache size 1 at Feb 14 22:06:16

And this is a restart:

Feb 14 22:09:00 postfix/master[2485]: terminating on signal 15
Feb 14 22:09:00 postfix/master[5410]: daemon started -- version 2.3.8, configuration /etc/postfix
Julian MatzJoint ChairpersonAuthor Commented:
There aren't any Postfix updates. My version is 2.3.8, which is the latest Debian stable version.
The kernel update from the vendor should not affect the performance of an application also provided by the vendor.

You may have email messages stuck that slow down the processing of other email.
What is your queue retention period 7 days, 1 day, a few hours?
Do you send your outgoing emails through your ISP as a smarthost?

Just wondering f you installed MailScanner which does that.

It creates an entry
/^Received:/ HOLD
in /etc/postfix/header_checks
Which places all mail with a Received Header on the HOLD queue.

You could check all your access lists like so

grep hold /etc/postfix/*
grep HOLD /etc/postfix/*
grep Hold /etc/postfix/*
can you post your sanitized main.cf; do you run mailscanner?  Just wondering if you have a scanner integrated into postfix where postfix is configured to move all emails immediately to hold queue and the scanner that is suppose to pick up the mail fails to process properly, leaving it in the hold queue.
Julian MatzJoint ChairpersonAuthor Commented:
<< You may have email messages stuck that slow down the processing of other email.

I don't think so because I've been able to get the mail queue down to 0 a few times, but then every time a new message is sent or received, they are put on hold again and the queue just becomes bigger and bigger.

<< What is your queue retention period 7 days, 1 day, a few hours?
What's the parameter or where is this defined? master.cf?

<< Do you send your outgoing emails through your ISP as a smarthost?
Not sure what this means exactly, but I think a smart host is like a front-end mail server or relay server. I don't use any 3rd party relay servers. Basically, when I send mail, I make a direct connection to my SMTP server (Postfix) on port 25. Postfix does relay mail for authorized users.

Thanks for the link. I have gone through it but am still non the wiser :)

I do have MailScanner installed. It's been installed for a couple of years now, but I also have Spamassassin working on the server, so at this stage I'd be more than willing to remove MailScanner if it will fix my problem.

localhost:/etc/postfix# grep HOLD /etc/postfix/*
/etc/postfix/header_checks:/^Received:/ HOLD

localhost:/etc/postfix# postconf -n header_checks
header_checks = regexp:/etc/postfix/header_checks

Where do I go from here?

<< can you post your sanitized main.cf

I have MailScanner and Spamassassin installed. How can I check whether MailScanner is picking up the held mail?

Julian MatzJoint ChairpersonAuthor Commented:
Oh, I also have ClamAV integrated with MailScanner.
Julian MatzJoint ChairpersonAuthor Commented:
Sorry - forgot to attach main.cf !!
# see /usr/share/postfix/main.cf.dist for a commented, fuller
# version of this file.
# Do not change these directory settings - they are critical to Postfix
# operation.
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
program_directory = /usr/lib/postfix
home_mailbox = Maildir/
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
setgid_group = postdrop
biff = no
smtpd_helo_required = yes
# appending .domain is the MUA's job.
append_dot_mydomain = no
myhostname = ***********
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
relayhost =
mynetworks =
mailbox_command = procmail -a "$EXTENSION"
recipient_delimiter = +
mydestination = $myhostname
relay_domains = $mydestination
smtpd_client_restrictions =
        check_client_access hash:/etc/postfix/access
smtpd_sender_restrictions =
        hash:/etc/postfix/access, reject_unknown_sender_domain
#smtpd_recipient_restrictions = hash:/etc/postfix/access, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_policy_service unix:private/policy, reject_rbl_client bl.spamcop.net
smtpd_recipient_restrictions = hash:/etc/postfix/access, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client bl.spamcop.net
default_privs = mail
mailbox_size_limit = 0
message_size_limit = 51200000
#mailbox_size_limit = 102400000
smtpd_error_sleep_time = 0
header_checks = regexp:/etc/postfix/header_checks
virtual_maps = hash:/etc/postfix/confixx_virtualUsers, hash:/etc/postfix/confixx_localDomains
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
virtual_alias_maps = hash:/etc/postfix/confixx_virtualUsers, hash:/etc/postfix/confixx_localDomains
inet_protocols = ipv4
#smtpd_sasl_path = /etc/postfix/sasl
debug_peer_list =

Open in new window

just to verify if that is the problem or not, comment out the header_check in main.cf and reload postfix.  the email should stop going immediately to hold.

btw, is mailscanner running? this would explain the lack of log entries as everything is operating fine; just that mailscanner isn't picking up the email and putting it into the incoming queue post-scan.
Julian MatzJoint ChairpersonAuthor Commented:
I'm getting the feeling that MailScanner is not running. I checked /var/run/MailScanner/ and there is not PID file.

localhost:/etc# /etc/init.d/mailscanner restart

Stopping mail spam/virus scanner: MailScanner.
Starting mail spam/virus scanner: MailScanner.

localhost:/etc# ls -la /var/run/MailScanner/

total 8
drwxr-xr-x  2 postfix postfix 4096 Feb 14 00:22 .
drwxr-xr-x 14 root    root    4096 Feb 14 21:14 ..

Can't find MailScanner using ps -aux either...
Julian MatzJoint ChairpersonAuthor Commented:
<< btw, is mailscanner running?
I don't think it is actually :)
Julian MatzJoint ChairpersonAuthor Commented:
I changed the following line in the mailscanner init script to show me the stderr:
--exec $DAEMON >/dev/null 2>&1

This is waht I'm getting now:

localhost:/etc# /etc/init.d/mailscanner start

Starting mail spam/virus scanner: Variable "$FIELD_NAME" is not imported at /usr/share/MailScanner/MailScanner/Message.pm line 6064.
Variable "$FIELD_NAME" is not imported at /usr/share/MailScanner/MailScanner/Message.pm line 6067.
Global symbol "$FIELD_NAME" requires explicit package name at /usr/share/MailScanner/MailScanner/Message.pm line 6064.
Global symbol "$FIELD_NAME" requires explicit package name at /usr/share/MailScanner/MailScanner/Message.pm line 6067.
Compilation failed in require at /usr/sbin/MailScanner line 79.
BEGIN failed--compilation aborted at /usr/sbin/MailScanner line 79.
Found this googling that error:

I have experienced this problem and found that it is caused by upgrading
libmailtools-perl from version 1.77-1 to 2.02-1.  The problem is fixed
when downgrading the libmailtools-perl back to version 1.77-1.  This is
reproducible as seen from the terminal capture below.

Apparently there is some incompatibility between Mailscanner 4.58.9-2
and libmailtools-perl version 2.02-1.

from:  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=465095
Julian MatzJoint ChairpersonAuthor Commented:
I saw that but I only subscribe to Debian's stable package list and the current version in stable is 1.74.

I do think my perl installations are messed up though. I noticed a few weeks ago that I cannot update my cpan modules. It keeps producing errors.

Do you know how to get Postfix back working without MailScanner? I think I'm gonna remove it until I get the perl problem sorted.
Julian MatzJoint ChairpersonAuthor Commented:
Ok, got it. Just had to remove header_checks from main.cf :)

After flushing out the remaining messages that were being held, it now seems to working again.

I still have to figure out the perl problem but at least the pressure is off now.

Thanks for all your help. It was much appreciated!

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 11
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now