[SOLVED] Postgrey not starting

12 posts / 0 new
Last post
#1 Fri, 11/13/2015 - 23:20
zer0

[SOLVED] Postgrey not starting

Hello, due to increase in spam I thought I should play with postgrey, so I went to Virtualmin>Email messages>email greylisting and installed postgrey. It installed Postgrey 1.34 but the service did not start. When I try to start the service I get the following messages


[administrator@mail ~]$ sudo systemctl status postgrey.service -l
postgrey.service - Postfix Greylisting Service
   Loaded: loaded (/usr/lib/systemd/system/postgrey.service; enabled)
   Active: failed (Result: start-limit) since Fri 2015-11-13 22:47:23 CST; 19min ago
     Docs: man:postgrey(8)
Main PID: 16031 (code=exited, status=255)
   CGroup: /system.slice/postgrey.service

Nov 13 22:47:22 mail.domain.TLD systemd[1]: postgrey.service: main process exited, code=exited, status=255/n/a
Nov 13 22:47:22 mail.domain.TLD systemd[1]: Unit postgrey.service entered failed state.
Nov 13 22:47:23 mail.domain.TLD systemd[1]: postgrey.service holdoff time over, scheduling restart.
Nov 13 22:47:23 mail.domain.TLD systemd[1]: Stopping Postfix Greylisting Service...
Nov 13 22:47:23 mail.domain.TLD systemd[1]: Starting Postfix Greylisting Service...
Nov 13 22:47:23 mail.domain.TLD systemd[1]: postgrey.service start request repeated too quickly, refusing to start.
Nov 13 22:47:23 mail.domain.TLD systemd[1]: Failed to start Postfix Greylisting Service.
Nov 13 22:47:23 mail.domain.TLD systemd[1]: Unit postgrey.service entered failed state.

Any help will be greatly appreciated.

Thank you

Sun, 11/15/2015 - 17:13
andreychek

Howdy,

Do you see additional errors in the email log regarding that problem? That would be located in either /var/log/maillog, or /var/log/mail.log, depending on your distribution.

Also, if you don't see any errors in the email log, do you see any in either /var/log/messages, or /var/log/syslog?

-Eric

Sun, 11/15/2015 - 17:59 (Reply to #2)
zer0

Thank you so much for replying Eric.

I also followed the guide at: https://wiki.centos.org/HowTos/postgrey and added     check_policy_service unix:postgrey/socket line, but it did not help.

In the /var/log/maillog I see

Nov 15 14:37:21 mail postgrey[15098]: Process Backgrounded
Nov 15 14:37:21 mail postgrey[15098]: 2015/11/15-14:37:21 postgrey (type Net::Server::Multiplex) starting! pid(15098)
Nov 15 14:37:21 mail postgrey[15098]: Binding to UNIX socket file "/var/spool/postfix/postgrey/socket"
Nov 15 14:37:23 mail postgrey[15104]: Process Backgrounded
Nov 15 14:37:23 mail postgrey[15104]: 2015/11/15-14:37:23 postgrey (type Net::Server::Multiplex) starting! pid(15104)
Nov 15 14:37:23 mail postgrey[15104]: Binding to UNIX socket file "/var/spool/postfix/postgrey/socket"
Nov 15 14:37:24 mail postgrey[15110]: Process Backgrounded
Nov 15 14:37:24 mail postgrey[15110]: 2015/11/15-14:37:24 postgrey (type Net::Server::Multiplex) starting! pid(15110)
Nov 15 14:37:24 mail postgrey[15110]: Binding to UNIX socket file "/var/spool/postfix/postgrey/socket"

And also

Nov 15 17:11:29 mail postfix/smtpd[23464]: warning: connect to postgrey/socket: Connection refused
Nov 15 17:11:29 mail postfix/smtpd[23464]: warning: problem talking to server postgrey/socket: Connection refused
Nov 15 17:11:30 mail postfix/smtpd[23464]: warning: connect to postgrey/socket: Connection refused
Nov 15 17:11:30 mail postfix/smtpd[23464]: warning: problem talking to server postgrey/socket: Connection refused

And in /var/log/messages

Nov 15 14:37:21 mail systemd: Starting Postfix Greylisting Service...
Nov 15 14:37:21 mail systemd: Started Postfix Greylisting Service.
Nov 15 14:37:21 mail systemd: postgrey.service: main process exited, code=exited, status=255/n/a
Nov 15 14:37:21 mail systemd: Unit postgrey.service entered failed state.
Nov 15 14:37:22 mail systemd: postgrey.service holdoff time over, scheduling restart.
Nov 15 14:37:22 mail systemd: Stopping Postfix Greylisting Service...
Nov 15 14:37:22 mail systemd: Starting Postfix Greylisting Service...
Nov 15 14:37:23 mail systemd: Started Postfix Greylisting Service.
Nov 15 14:37:23 mail systemd: postgrey.service: main process exited, code=exited, status=255/n/a
Nov 15 14:37:23 mail systemd: Unit postgrey.service entered failed state.
Nov 15 14:37:24 mail systemd: postgrey.service holdoff time over, scheduling restart.
Nov 15 14:37:24 mail systemd: Stopping Postfix Greylisting Service...
Nov 15 14:37:24 mail systemd: Starting Postfix Greylisting Service...
Nov 15 14:37:24 mail systemd: Started Postfix Greylisting Service.
Nov 15 14:37:24 mail systemd: postgrey.service: main process exited, code=exited, status=255/n/a
Nov 15 14:37:24 mail systemd: Unit postgrey.service entered failed state.
Nov 15 14:37:25 mail systemd: postgrey.service holdoff time over, scheduling restart.
Nov 15 14:37:25 mail systemd: Stopping Postfix Greylisting Service...
Nov 15 14:37:25 mail systemd: Starting Postfix Greylisting Service...
Nov 15 14:37:25 mail systemd: Started Postfix Greylisting Service.
Nov 15 14:37:25 mail systemd: postgrey.service: main process exited, code=exited, status=255/n/a
Nov 15 14:37:25 mail systemd: Unit postgrey.service entered failed state.
Nov 15 14:37:26 mail systemd: postgrey.service holdoff time over, scheduling restart.
Nov 15 14:37:26 mail systemd: Stopping Postfix Greylisting Service...
Nov 15 14:37:26 mail systemd: Starting Postfix Greylisting Service...
Nov 15 14:37:26 mail systemd: Started Postfix Greylisting Service.
Nov 15 14:37:26 mail systemd: postgrey.service: main process exited, code=exited, status=255/n/a
Nov 15 14:37:26 mail systemd: Unit postgrey.service entered failed state.
Nov 15 14:37:27 mail systemd: postgrey.service holdoff time over, scheduling restart.
Nov 15 14:37:27 mail systemd: Stopping Postfix Greylisting Service...
Nov 15 14:37:27 mail systemd: Starting Postfix Greylisting Service...
Nov 15 14:37:27 mail systemd: postgrey.service start request repeated too quickly, refusing to start.
Nov 15 14:37:27 mail systemd: Failed to start Postfix Greylisting Service.
Nov 15 14:37:27 mail systemd: Unit postgrey.service entered failed state.
Nov 15 14:37:43 mail systemd: Reloading Postfix Mail Transport Agent.

And there is no /var/log/syslog I am running CentOS7

Mon, 11/16/2015 - 18:32
zer0

Hi, so it seems like I broke the email by installing postgrey. All of the incoming emails are bouncing and not being delivered.

I sent myself a test message and this is what I see in the /var/log/maillog

Nov 16 18:15:35 mail postfix/smtpd[14007]: warning: unknown smtpd restriction: "#check_policy_service"
Nov 16 18:15:35 mail postfix/smtpd[14007]: NOQUEUE: reject: RCPT from blu004-omc3s37.hotmail.com[65.55.116.112]: 451 4.3.5 Server configuration error; from=<user@hotmail.com> to=<user@domain.tld> proto=ESMTP helo=<BLU004-OMC3S37.hotmail.com>
Nov 16 18:15:35 mail postfix/local[13634]: 349A9C068E8E: to=<root@mail.domain.tld>, orig_to=<postmaster>, relay=local, delay=0.28, delays=0.07/0/0/0.22, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)

any help will be greatly appreciated

Mon, 11/16/2015 - 19:13 (Reply to #4)
zer0

Hi, I was able to fix the email issue by removing the line

check_policy_service unix:postgrey/socket,
   permit

in /etc/postfix/main.cf and then restarting postfix.

I have uninstalled postgrey, but I would still like to make it work.

Tue, 11/17/2015 - 11:09
zer0

Under virtulmin > Email Settings > Email Greylisting it says

Greylisting is not available on this system : The Postgrey user postgrey does not exist
However, Virtualmin can attempt to automatically install the Postgrey greylisting package for you.

Even though it was installed from vritualmin. maybe I just need to create a user "postgrey"

is it any different than creating an email user?

Thank you

Tue, 11/17/2015 - 12:35
andreychek

Howdy,

That user should be created when the postgrey package is installed.

However, just to make sure it was installed properly, you could always have it attempt reinstalling it.

Also, what is the output of this command:

rpm -qa |grep postgrey

Wed, 11/18/2015 - 14:57 (Reply to #7)
zer0

Thank you for reply Eric, I have tried to reinstall, uninstall then reinstall many times, but did not work.

Out put is:

[administrator@mail ~]$ rpm -qa |grep postgrey
postgrey-1.34-12.el7.noarch

If I try to reinstall it from Virtualmin, I get

Installing the Postgrey package ..
Installing package(s) with command /bin/yum -y install postgrey ..
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.les.net
* epel: www.muug.mb.ca
* extras: centos.les.net
* updates: www.muug.mb.ca
Package postgrey-1.34-12.el7.noarch already installed and latest version
Nothing to do
.. install complete.
.. installation failed!
Thu, 11/19/2015 - 08:24
zer0

Holy Crap!! I finally got it working!

I uninstalled the existing postgrey by using the Yum Extender. Then I manually downloaded the same version Postgrey-1.34-12.el7.noarch.rpm from rpm.pbone.net There are newer version available but they require later version of perl which is not available in Centos repos I believe.

once downloaded I installed it from terminal using

sudo rpm -ivh postgrey-1.34-12.el7.noarch.rpm

and then virtualmin gave me option to enable greylisting!

I hope this information helps

Wed, 01/11/2017 - 22:39
KAtwitch

I'm having the exact same problem getting Postgrey to run on Virtualmin as the original poster. I've followed the steps here all the way to the part about installing Postgrey from rpm.pbone.net. I'm not sure speficically how that was done. I'm assuming a repo was added, but I'm unfamiliar with how to do that. If anyone is willing to help me troubleshoot getting Postgrey to run, I would much appreciate it.

Sat, 04/29/2017 - 22:51
ksihota

Had the exact same issue on Centos 7 (new installation of OS and Virtualmin) I have been fighting with this all day. Tried installing manually as well as through Virtualmin. Finally after unintalling (yum erase postgrey) I went into Webmin Users and Groups and created the group postgrey and the user postgrey and then went back to Virtualmin Email Messages - email Greylisting and allowed Virtualmin to install postgrey. This time it installed properly (as far as I can tell so far) and did not display the missing user/group message. Now I just have to see if anything else is broken with this fix.

edit: I started having an SQL STATE[40001]: Serialization failure: 1213 Deadlock error when I had postgrey enabled. I haven't figure out what is causing this yet. It also appear to be blocking my log files from being updated. It might be due to the postgrey User and Group I created not having the proper settings. Can someone provide me with the proper configuration for the postgrey user and group?

edit 2: The logging issue may have been related to another problem. I commented out "$OmitLocalLogging on" in the rsyslog.conf file and logging came back. As far as I can tell postgrey appears to be working now. The service is running. I have not seen anything coming through it yet that has been rejected but it has passed several that it should have.

Sun, 06/04/2017 - 06:07
dobryadmin
dobryadmin's picture

I've got the same error when tried to start postgrey on centos 7.2, the virtualmin installation didn't create a postgrey userso the easiest way to fix this issue is to remove the postgrey package: yum remove postgrey and then let virtualmin reinstall the package via: Email messages -> Email Greylisting

Systems Administrator DOBRYADMIN.PL