Jump to Navigation

Postgrey "timeout while reading input attribute name"

Postgrey is a great little utility to help eliminate spam from your mails server, and our setup has been running just fine for over three, or more, years now. But the other day I noticed that some of our email accounts were not getting any external mail anymore. These accounts were some of the little used email accounts on the various domains we use.

Postfix Stopped Devlivering Mail

My first idea was that the MX records must be mixed up or maybe we forgot to pay the domain name renewal fee? But a quick dns query showed this wasn't the case. The log files showed that mail was reaching the server, but that postgrey was choking on certain mail accounts. The log was filled with error messages like the ones below:

Jul  7 17:55:15 slain postfix/smtpd[7585]: warning: timeout on 127.0.0.1:60000 while reading input attribute name
Jul  7 17:55:15 slain postfix/smtpd[7585]: warning: problem talking to server 127.0.0.1:60000: Connection timed out
Jul  7 17:55:15 slain postfix/smtpd[7585]: NOQUEUE: reject: RCPT from xxxxx.com[209.85.219.221]: 450 Server configuration problem; from=<xxxxxx@gmail.com> to=<xxx@xxxxx.co.za> proto=ESMTP helo=<xxxxxx.google.com>

So it was obvious that postgrey had a problem, but finding out exactly what, was a bit more difficult. There is very little documnetation out there about postgrey. Mainly, I suppose, because it just works, and its dead easy to configure. I tried uninstalling and then reinstalling postgrey, but to no avail. Eventually, I found a vague reference to the Berkley database.

Berkley Database Strikes Again!

Now I am sure I am not alone when I say, that the Berkley database, has been resoponsible for more hard-to-find and solve problems than I care to mention. Beside hardly any documentatoin for users, the userland tools provided are extremely limited, and usually not installed by default. If you google berkley DB, most results are about writing application using Berkely DB. Most tips on how to recover a corrupt Berkely databse require you to write a programme. Since I wasn't about to fire up my IDE I tried the "db_recover"  command line tool.

Postgrey Timeout Fixed

This is one of the few Linux commands where the man page is almost useless. This, combined with the lack of documentation on the fact, that postgrey uses, the berkely DB at all, and the location of where the database files might be hiding, meant that it took me anohter 20 minutes to sort thr problem out.

I found the Berkley DB files for Postgrey in the "/var/spool/postfix/postgrey" directory. This is the location on a Cenots/Redhat box. I tried running "db_recover -v" from within the directory, but after 15 minutes of nothing, other than 100% CPU utilisation, I killed the process, and simply moved the directory contents to another folder as backup and restarted Postgrey.

 This seems to have sorted the problem out.Thinking about it the problem can probably be traced to Eskom a few days ago bringing down our power 5 times within a few minutes. We did have a UPS though so who knows.

Open Source: 


by Dr. Radut.