{"id":146,"date":"2014-06-30T15:08:23","date_gmt":"2014-06-30T06:08:23","guid":{"rendered":"http:\/\/fsck.jp\/?p=146"},"modified":"2018-05-09T17:16:25","modified_gmt":"2018-05-09T08:16:25","slug":"milter-greylist-%e3%81%a7-geoip-%e3%82%92%e4%bd%bf%e3%81%88%e3%82%8b%e3%82%88%e3%81%86%e3%81%ab%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/fsck.jp\/?p=146","title":{"rendered":"milter-greylist \u3067 GeoIP \u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b"},"content":{"rendered":"<p>\u203b\u4ee5\u4e0b\u306f\u53e4\u3044\u8a18\u4e8b\u3067\u3059\u3002Ubuntu 16.04 \u4ee5\u964d\u3067\u306f libGeoIP \u304c\u30ea\u30f3\u30af\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>Ubuntu 14.04 \u6a19\u6e96\u30d1\u30c3\u30b1\u30fc\u30b8\u306e milter-greylist \u306f libGeoIP \u3092\u30ea\u30f3\u30af\u3059\u308b\u3088\u3046\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u3001GeoIP (IP\u30a2\u30c9\u30ec\u30b9\u30d9\u30fc\u30b9\u306e\u56fd\u5225\u5224\u5b9a) \u3092\u30dd\u30ea\u30b7\u30fc\u306b\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u306a\u3044\u3002\u305d\u3053\u3067 Ubuntu \u30bd\u30fc\u30b9\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5fae\u4fee\u6b63\u3057\u3066\u30ea\u30d3\u30eb\u30c9\u3059\u308b\u3053\u3068\u3067 GeoIP \u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u3002\u307e\u305f\u3001\u3064\u3044\u3067\u306bPostfix\u3078\u306e\u5bfe\u5fdc\u3092\u5165\u308c\u3066\u304a\u304f\u3002<\/p>\n<h3>\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<pre>\r\nmyserver1:~$ sudo apt-get install build-essential quilt debhelper autotools-dev bison flex\r\nmyserver1:~$ sudo apt-get install libgeoip-dev libspf2-dev libmilter-dev<\/pre>\n<h3>\u30bd\u30fc\u30b9\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/h3>\n<pre>\r\nmyserver1:~$ apt-get source milter-greylist<\/pre>\n<h3>\u30d1\u30c3\u30b1\u30fc\u30b8\u60c5\u5831\u30d5\u30a1\u30a4\u30eb\u306e\u7de8\u96c6<\/h3>\n<p>GeoIP \u3092\u30ea\u30f3\u30af\u3059\u308b\u3088\u3046\u306b\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u60c5\u5831\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b\u3002<\/p>\n<p>rules \u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u3001configure \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u4e2d\u306b  &#8211;with-libGeoIP \\ \u3092\u8ffd\u52a0\u3059\u308b\u3002configure \u5b9f\u884c\u6642\u306b libGeoIP \u3092\u63a2\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n<pre>\r\nmyserver1:~$ cd milter-greylist-4.3.9\r\nmyserver1:milter-greylist-4.3.9$ vi debian\/rules<\/pre>\n<pre>\r\noverride_dh_auto_configure:\r\n    dh_auto_configure -- \\\r\n    --with-user=greylist \\\r\n    --sysconfdir=\/etc\/milter-greylist \\\r\n    --with-conffile=\/etc\/milter-greylist\/greylist.conf \\\r\n    --with-dumpfile=\/var\/lib\/milter-greylist\/greylist.db \\\r\n    --with-libspf2=\/usr \\\r\n    --with-libmilter=\/usr \\\r\n    --with-libGeoIP \\  \u2190\u3053\u3053\u3092\u8ffd\u52a0\r\n    --enable-postfix \\  \u2190\u3053\u3053\u3092\u8ffd\u52a0\r\n    --enable-dnsrbl \\\r\n    --disable-rpath \\\r\n    LDFLAGS=\" -Wl,-z,defs -L\/usr\/lib\/libmilter \" \\\r\n    CFLAGS=\" -fno-strict-aliasing \"\r\n<\/pre>\n<p>\u307e\u305f\u3001control\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u3066\u3001Build-Depends \u884c\u306b libgeoip-dev \u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre>\r\nmyserver1:milter-greylist-4.3.9$ vi debian\/control<\/pre>\n<pre>\r\nBuild-Depends: quilt, debhelper (>= 8), autotools-dev, libmilter-dev, bison, flex, libspf2-dev, libgeoip-dev<\/pre>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u30d0\u30fc\u30b8\u30e7\u30f3\u756a\u53f7\u3092\u5909\u66f4\u3059\u308b\u305f\u3081\u306b\u3001changelog\u3082\u7de8\u96c6\u3059\u308b\u3002\u5185\u5bb9\u306f\u9069\u5f53\u3002<\/p>\n<pre>\r\nmyserver1:milter-greylist-4.3.9$ vi debian\/changelog<\/pre>\n<pre>\r\nmilter-greylist (4.3.9-101) unstable; urgency=low\r\n\r\n  * Build with --with-libGeoIP\r\n  * Build with --enable-postfix\r\n\r\n -- My Name &lt;myname@example.com&gt;  Mon, 30 Jun 2014 10:00:00 +0900<\/pre>\n<p>\u30d0\u30fc\u30b8\u30e7\u30f3\u756a\u53f7\u3092\u5143\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3088\u308a\u5927\u304d\u304f\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u3001apt-get upgrade \u3057\u305f\u6642\u306b\u516c\u5f0f\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u7f6e\u304d\u63db\u3048\u3089\u308c\u3066\u3057\u307e\u3046\u3002\u3053\u3053\u3067\u306f 4.3.9-1 \u304b\u3089 4.3.9-101 \u306b\u3057\u3066\u304a\u3044\u305f\u3002<\/p>\n<h3>\u30d3\u30eb\u30c9<\/h3>\n<p>\u7de8\u96c6\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u5b9f\u969b\u306b\u30d3\u30eb\u30c9\u3059\u308b\u3002<\/p>\n<pre>\r\nmyserver1:milter-greylist-4.3.9$ dpkg-buildpackage -us -uc<\/pre>\n<h3>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>.deb \u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u51fa\u6765\u4e0a\u304c\u3063\u305f\u3089\u3001\u516c\u5f0f\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u5165\u308c\u63db\u3048\u308b\u3002<\/p>\n<pre>\r\nmyserver1:milter-greylist-4.3.9$ sudo apt-get purge milter-greylist\r\nmyserver1:milter-greylist-4.3.9$ sudo dpkg -i ..\/milter-greylist_4.3.9-101_amd64.deb<\/pre>\n<h3>\u8a2d\u5b9a<\/h3>\n<p>milter-greylist \u3092\u5165\u308c\u63db\u3048\u305f\u3089\u3001\/etc\/milter-greylist\/greylist.conf \u306b geoip \u306e\u8a18\u8ff0\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u3002\u4f8b\u3048\u3070\u81ea\u5b85\u306e\u30b5\u30fc\u30d0\u3067\u306f\u3001CN \u304b\u3089\u30e1\u30fc\u30eb\u3092\u53d7\u3051\u53d6\u308b\u4e88\u5b9a\u304c\u7121\u3044\u306e\u3067\u3053\u308c\u3092\u30d6\u30e9\u30c3\u30af\u30ea\u30b9\u30c8\u306b\u5165\u308c\u3066\u307f\u308b\u3002<\/p>\n<pre>\r\nmyserver1:~$ sudo vi \/etc\/milter-greylist\/greylist.conf<\/pre>\n<p>greylist.conf \u306e\u4e2d\u8eab:<\/p>\n<pre>\r\ngeoipdb \"\/usr\/share\/GeoIP\/GeoIP.dat\"\r\n...\r\nracl blacklist geoip \"CN\"<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u203b\u4ee5\u4e0b\u306f\u53e4\u3044\u8a18\u4e8b\u3067\u3059\u3002Ubuntu 16.04 \u4ee5\u964d\u3067\u306f libGeoIP \u304c\u30ea\u30f3\u30af\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002 Ubuntu 14.04 \u6a19\u6e96\u30d1\u30c3\u30b1\u30fc\u30b8\u306e milter-greylist \u306f libGeoIP \u3092\u30ea [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13,9,8],"tags":[],"_links":{"self":[{"href":"https:\/\/fsck.jp\/index.php?rest_route=\/wp\/v2\/posts\/146"}],"collection":[{"href":"https:\/\/fsck.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fsck.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fsck.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fsck.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=146"}],"version-history":[{"count":0,"href":"https:\/\/fsck.jp\/index.php?rest_route=\/wp\/v2\/posts\/146\/revisions"}],"wp:attachment":[{"href":"https:\/\/fsck.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fsck.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fsck.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}