{"id":292,"date":"2010-04-25T19:14:08","date_gmt":"2010-04-25T03:14:08","guid":{"rendered":"http:\/\/blog.longwin.com.tw\/?p=292"},"modified":"2010-04-25T19:14:08","modified_gmt":"2010-04-25T03:14:08","slug":"fedora-13-greylist-centos","status":"publish","type":"post","link":"https:\/\/blog.fhl.net\/?p=292","title":{"rendered":"\u5982\u4f55\u4f7f\u7528Fedora 13\u7684greylist \u5957\u4ef6\u5728CentOS\u4e0a"},"content":{"rendered":"<p>1, wget http:\/\/software.virtualmin.com\/gpl\/centos\/5\/SRPMS\/fedora-usermgmt-0.9-1.el5.src.rpm&nbsp;&nbsp; and build the source rpm<\/p>\n<p>rpm -ivh \/usr\/src\/redhat\/RPMS\/noarch\/fedora-usermgmt-0.9-1.noarch.rpm \/usr\/src\/redhat\/RPMS\/noarch\/fedora-usermgmt-core-0.9-1.noarch.rpm \/usr\/src\/redhat\/RPMS\/noarch\/fedora-usermgmt-default-fedora-setup-0.9-1.noarch.rpm \/usr\/src\/redhat\/RPMS\/noarch\/fedora-usermgmt-shadow-utils-0.9-1.noarch.rpm \/usr\/src\/redhat\/RPMS\/noarch\/fedora-usermgmt-devel-0.9-1.noarch.rpm<\/p>\n<p>2, yum -y install sendmail-devel geoip-* &#8211;enablerepo dag<\/p>\n<p>\n3, wget ftp:\/\/ftp.muug.mb.ca\/mirror\/fedora\/linux\/development\/rawhide\/source\/SRPMS\/milter-greylist-4.2.4-1400.fc14.src.rpm<\/p>\n<p>\n4, rpm -ivh milter-greylist-4.2.3-1400.fc14.src.rpm &#8211;nomd5<\/p>\n<p>\nvim \/usr\/src\/redhat\/SPECS\/milter-greylist.spec<\/p>\n<p>\ndefine the following variable<\/p>\n<p>%global username&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; smmsp<br \/>\n%global vardir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %_var\/%name<br \/>\n%global dbdir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %vardir<br \/>\n%global rundir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %_var\/%name<br \/>\n%global __chkconfig&nbsp;&nbsp;&nbsp;&nbsp; \/sbin\/chkconfig<\/p>\n<p>\ndelete<br \/>\nRequires:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; init(%name)<\/p>\n<p>delete<br \/>\n&#8211;enable-dnsrbl&nbsp;&nbsp;&nbsp; \\<\/p>\n<p>\ndelete the following (we want \/var\/milter-greylist\/ path)<\/p>\n<p>\nfor i in `find -type f`; do<br \/>\n&nbsp;&nbsp;&nbsp; sed -e &#8216;s!\/var\/milter-greylist\/milter-greylist.sock!%rundir\/milter-greylist.sock!g;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s!\/var\/milter-greylist\/greylist.db!%dbdir\/greylist.db!g;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s!\/var\/milter-greylist\/milter-greylist.pid!%_var\/run\/milter-greylist.pid!g;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8216; &quot;$i&quot; &gt;&quot;$i.tmp&quot;<br \/>\n&nbsp;&nbsp;&nbsp; cmp -s &quot;$i&quot; &quot;$i.tmp&quot; || cat &quot;$i.tmp&quot; &gt;&quot;$i&quot;<br \/>\n&nbsp;&nbsp;&nbsp; rm -f &quot;$i&quot;.tmp<br \/>\ndone<\/p>\n<p>change this line<br \/>\ntouch $RPM_BUILD_ROOT%_var\/run\/milter-greylist.pid<br \/>\nto<br \/>\ntouch $RPM_BUILD_ROOT%rundir\/milter-greylist.pid<\/p>\n<p>\nchange this line<br \/>\ntouch $RPM_BUILD_ROOT%_var\/run\/milter-greylist.sock<br \/>\nto<br \/>\ntouch $RPM_BUILD_ROOT%rundir\/milter-greylist.sock<\/p>\n<p>change this line<br \/>\n%ghost %_var\/run\/milter-greylist.pid<br \/>\nto<br \/>\n%ghost %rundir\/run\/milter-greylist.pid<\/p>\n<p>%ghost %rundir\/milter-greylist.sock<\/p>\n<p>%dir \/usr\/src\/debug\/%name-4.2.3\/*<br \/>\n\/usr\/lib\/debug\/usr\/sbin\/%name.debug<br \/>\n%dir %vardir\/%name.sock<br \/>\n%vardir\/%name.pid<\/p>\n<p>\nrpmbuild -ba \/usr\/src\/redhat\/SPECS\/milter-greylist.spec<\/p>\n<p>rpm -Uvh \/usr\/src\/redhat\/RPMS\/noarch\/milter-greylist-4.2.3-1400.noarch.rpm<\/p>\n<p>edit \/etc\/mail\/greylist.conf, adding the following<\/p>\n<p>geoipdb &quot;\/usr\/share\/GeoIP\/GeoIP.dat&quot;<br \/>\nspamdsock inet &quot;127.0.0.1:783&quot;<\/p>\n<p>dacl blacklist spamd &gt; 7 msg &quot;Your message is considered spam.&quot;<br \/>\ndacl greylist&nbsp; spamd &gt; 6&nbsp; delay 6h autowhite 3h msg &quot;greylist in action (6) , please come back later. call 886-921361388 for help!&quot;<br \/>\ndacl greylist&nbsp; spamd &gt; 5&nbsp; delay 1h autowhite 40h msg &quot;greylist in action (5), please come back later. call 886-921361388 for help!&quot;<br \/>\ndacl greylist&nbsp; spamd &gt; 4&nbsp; delay 30m autowhite 110h msg &quot;greylist in action (4), please come back later. call 886-921361388 for help!&quot;<br \/>\ndacl greylist&nbsp; spamd &gt; 3&nbsp; delay 10m autowhite 180h msg &quot;greylist in action (3), please come back later. call 886-921361388 for help!&quot;<br \/>\nracl whitelist default<br \/>\nracl greylist default&nbsp; delay 5m autowhite 7d msg &quot;greylist in action (4), please come back later. call 886-921361388 for help!&quot;<\/p>\n<p>now spamassassin must be starting<br \/>\nedit \/etc\/sysconfig\/spamassassin<\/p>\n<p>\nchkconfig &#8211;level 35 spamassassin on<br \/>\nservice spamassassin start<br \/>\nservice milter-greylist restart<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1, wget http:\/\/software.virtualmin.com\/gpl\/centos\/5\/SRP &hellip; <a href=\"https:\/\/blog.fhl.net\/?p=292\" class=\"more-link\">\u95b1\u8b80\u5168\u6587 <span class=\"screen-reader-text\">\u5982\u4f55\u4f7f\u7528Fedora 13\u7684greylist \u5957\u4ef6\u5728CentOS\u4e0a<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-292","post","type-post","status-publish","format-standard","hentry","category-e"],"_links":{"self":[{"href":"https:\/\/blog.fhl.net\/index.php?rest_route=\/wp\/v2\/posts\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.fhl.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.fhl.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.fhl.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.fhl.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=292"}],"version-history":[{"count":0,"href":"https:\/\/blog.fhl.net\/index.php?rest_route=\/wp\/v2\/posts\/292\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.fhl.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.fhl.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.fhl.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}