We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Postfix mail queue not being processed

Medium Priority
5,428 Views
Last Modified: 2013-12-06
Hi!

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:
http://www.debian.org/News/2009/20090210

Any help would be greatly appreciated as always!
Comment
Watch Question

CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Could you look at the maillog /var/log/maillog and see whether postfix is recording any errors?
Julian MatzTechnical Support
Top Expert 2005

Author

Commented:
No, I'm not seeing anything. The only thing that even resembles an error message are thes:

postfix/smtpd[3768]: warning: 85.100.85.156: 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 ....
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Is this, 85.100.85.156,  the IP of your server?
/sbin/ifconfig
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.
Julian MatzTechnical Support
Top Expert 2005

Author

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:78.163.167.122) at Feb 14 22:06:16
Feb 14 22:08:48 postfix/anvil[5305]: statistics: max connection count 1 for (smtp:78.163.167.122) 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 MatzTechnical Support
Top Expert 2005

Author

Commented:
There aren't any Postfix updates. My version is 2.3.8, which is the latest Debian stable version.
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
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?
http://www.postfix.org/DEBUG_README.html

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
David BeveridgeLinux Systems Admin
CERTIFIED EXPERT
Commented:
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/*
Cyclops3590Sr Software Engineer
CERTIFIED EXPERT
Commented:
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 MatzTechnical Support
Top Expert 2005

Author

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
Attached...

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

Julian MatzTechnical Support
Top Expert 2005

Author

Commented:
Oh, I also have ClamAV integrated with MailScanner.
Julian MatzTechnical Support
Top Expert 2005

Author

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 = 127.0.0.0/8
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
 
#20060923
header_checks = regexp:/etc/postfix/header_checks
 
### CONFIXX POSTFIX ENTRY ###
virtual_maps = hash:/etc/postfix/confixx_virtualUsers, hash:/etc/postfix/confixx_localDomains
### /CONFIXX POSTFIX ENTRY ###
 
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 = 127.0.0.1

Open in new window

Sr Software Engineer
CERTIFIED EXPERT
Commented:
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 MatzTechnical Support
Top Expert 2005

Author

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 MatzTechnical Support
Top Expert 2005

Author

Commented:
<< btw, is mailscanner running?
I don't think it is actually :)
Julian MatzTechnical Support
Top Expert 2005

Author

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.
MailScanner.
Cyclops3590Sr Software Engineer
CERTIFIED EXPERT

Commented:
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 MatzTechnical Support
Top Expert 2005

Author

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 MatzTechnical Support
Top Expert 2005

Author

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!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.