Update November 13, 2006:
Fixed the rpm’s. I was putting the –daemonize in with the other options. That does not work, putting it in first works.
So now I read the /etc/sysconfig/postgrey with
test -s /etc/sysconfig/postgrey && . /etc/sysconfig/postgrey
And execute
$POSTGREY_BIN –daemonize $OPTIONS
And all is right in the world.
Here are the links for the rpm and source rpm that I use on my SuSE 10.1 server.
Original October 4th post starts here.
————
I run OpenSuSE 10.1 on my server. For a few weeks yast’s online update was acting up. It would list things for update and not seem to fully get that the update was already.
Saturday I checked and got a boat load of new updates. One reboot later and yast online update is working perfectly each time.
I like packaging the software I use. It’s one way to keep my technical skills fresh and make my server more manageable. I use Postgrey with my postfix installation and have had problems wrapping the software. The software and RPM build fine, and I can run it by hand but when I try to read the /etc/sysconfig/postgrey in the init script, junk gets added to the command line.
I hacked the postfix init script and created a new script for postgrey.
I run postgrey like so:
/usr/sbin/postgrey
–unix=/var/spool/postfix/postgrey/socket
–daemonize –user=postgrey –pidfile=/var/run/postgrey.pid
In /etc/sysconfig/postgrey I have
OPTIONS=”–unix=/var/spool/postfix/postgrey/socket –daemonize –user=postgrey –pidfile=/var/run/postgrey.pid”
So in my init script I should be able to just do
. /etc/sysconfig/postgrey
And set OPTIONS that way. Once that’s done I should be able to just run
POSTGREY_BIN=/usr/sbin/postgrey
$POSTGREY_BIN $OPTIONS
The options piece seems to be adding on junk. The OPTIONS variable is set correctly but when I execute the perl script junk gets added and the postgrey script exits.
I’ve replaced $OPTIONS with explicit command line arguments for now but it’ll bug me till I figure it out.
Todd says:
Do you have a working postgrey rpm?
I am still fairly new to Linux and am looking for an easy way to get postgrey up and running on my SuSE 10 mail gateway that I have Clam and SA on.
Todd
October 26, 2006 — 10:02 pm
Jan Dembowski says:
Todd,
Here are the links for the postgrey rpm and source rpm that I am using.
You may need to modify the /etc/init.d/postgrey file for the options you need.
In the /etc/postfix/main.cf file I have
smtpd_recipient_restrictions = permit_mynetworks,
reject_unknown_sender_domain,
reject_unauth_destination,
reject_rbl_client sbl-xbl.spamhaus.org,
check_policy_service unix:/var/spool/postfix/postgrey/socket,
check_policy_service unix:private/policy
Good luck, if you have any problems please let me know.
Jan Dembowski
October 27, 2006 — 9:42 am
Ami says:
i have implimented postgrey, using your RPM on opensuse 10.2 64bit and it run perfectly !!!.
how can i change the configuration for whitelist_clients and whitelist_recipients ?
since i can’t find those conf files on my system
February 4, 2007 — 4:10 am
Jan Dembowski says:
Ami,
I’m glad it worked for you on your system 🙂
If your run
rpm -ql postgrey
You should see
/etc/postfix/postgrey_whitelist_clients
/etc/postfix/postgrey_whitelist_clients.local
/etc/postfix/postgrey_whitelist_recipients
For addtions to whitelist_clients, I suggest you add them to the /etc/postfix/postgrey_whitelist_clients.local file.
The other file /etc/postfix/postgrey_whitelist_recipients is simple to add to as well.
Hope this helps,
Jan Dembowski
February 5, 2007 — 3:15 pm
dabide says:
Jan,
the src.rpm seems to be the wrong file: It is identical with the noarch.rpm
David
March 13, 2007 — 4:10 am
Jan Dembowski says:
David,
Thanks for pointing that out. I must have copied them incorrectly.
I have just updated the file and confirmed the two files/links are correct now.
http://blog.dembowski.net/wp-content/postgrey-1.27-0.noarch.rpm
http://blog.dembowski.net/wp-content/postgrey-1.27-0.src.rpm
Thanks,
Jan Dembowski
March 13, 2007 — 6:56 am