{"id":22,"date":"2011-08-28T21:32:25","date_gmt":"2011-08-28T12:32:25","guid":{"rendered":"http:\/\/staka.jp\/wordpress\/?p=22"},"modified":"2011-08-28T21:32:25","modified_gmt":"2011-08-28T12:32:25","slug":"%e3%83%a1%e3%83%bc%e3%83%ab%e3%81%ae%e3%83%89%e3%83%a1%e3%82%a4%e3%83%b3%e6%8c%87%e5%ae%9a%e9%80%81%e4%bf%a1","status":"publish","type":"post","link":"https:\/\/staka.jp\/wordpress\/?p=22","title":{"rendered":"\u30e1\u30fc\u30eb\u306e\u30c9\u30e1\u30a4\u30f3\u6307\u5b9a\u9001\u4fe1"},"content":{"rendered":"<p>\u30e1\u30fc\u30eb\u306e\u8aa4\u9001\u4fe1\u3092\u9632\u6b62\u3059\u308b\u306b\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306a\u624b\u6bb5\u304c\u8003\u3048\u3089\u308c\u308b\u3002<\/p>\n<ol>\n<li>\u30b5\u30fc\u30d0\u5074\u3067\u5bfe\u5fdc\u3059\u308b\u3002<br \/>\nPostfix\u306esmtpd_client_restrictions\u306a\u3069\u3002<\/li>\n<li>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u3067\u5bfe\u5fdc\u3059\u308b\u3002<br \/>\nThunderbird\u306echeck and send\u306a\u3069\u3002<br \/>\n<a href=\"https:\/\/addons.mozilla.org\/ja\/thunderbird\/addon\/check-and-send\/\">https:\/\/addons.mozilla.org\/ja\/thunderbird\/addon\/check-and-send\/<\/a><\/li>\n<li>\u30b5\u30fc\u30d0\uff0d\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u9593\u3067\u5bfe\u5fdc\u3059\u308b\u3002<br \/>\nSMTP\u306eProxy\u3092\u4f7f\u3063\u3066\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3001AntiVirus\u3063\u307d\u304f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306eOS\u30ec\u30a4\u30e4\u30fc\u3067\u901a\u4fe1\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3001DeepInspection\u7684\u306b\u30d1\u30b1\u30c3\u30c8\u306e\u8ee2\u9001\u7d4c\u8def\u3067\u901a\u4fe1\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3002\u306a\u3069\u306a\u3069\u3002<\/li>\n<\/ol>\n<p>\u306a\u3093\u3068\u306a\u304f\u30013.\u306e\u4e00\u756a\u76ee\u300cSMTP\u306eProxy\u3092\u4f7f\u3063\u3066\u5bfe\u5fdc\u3059\u308b\u300d\u304c\u53ef\u80fd\u304b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u307f\u305f\u3002\u7d50\u679c\u306f\u30da\u30fc\u30b8\u306e\u6700\u5f8c\u306b\u3002Perl\u306eCPAN\u306f\u975e\u5e38\u306b\u4fbf\u5229\u3067\u7c21\u5358\u306b\u66f8\u3051\u308b\u3002\uff08\u305f\u3060\u3057\u3001\u30c6\u30b9\u30c8\u306f\u3042\u307e\u308a\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u4fe1\u983c\u6027\u306a\u3069\u306f\u5fae\u5999\u3002\u3053\u3053\u306fproof-of-concept\u306e\u5834\u6240\u306a\u306e\u3067\u305d\u306e\u8fba\u308a\u306f\u3064\u3063\u3053\u307e\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002\uff09<br \/>\n\u306a\u304a\u3001\u4e0b\u8a18\u306e\u30b3\u30fc\u30c9\u306f\u60aa\u610f\u306e\u3042\u308b\u4eba\u304c\u3044\u308b\u72b6\u6cc1\u4e0b\u3067\u4e00\u5b9a\u306e\u4eba\u306b\u3057\u304b\u30e1\u30fc\u30eb\u3092\u9001\u3089\u305b\u306a\u3044\u305f\u3081\u306e\u5bfe\u5fdc\u3068\u3057\u3066\u306f<strong>\u4f7f\u3063\u3066\u306f\u3044\u3051\u306a\u3044<\/strong>\u3002<br \/>\n\u306a\u305c\u306a\u3089\u3001RFC\u3067\u8a31\u3055\u308c\u308b\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u30c1\u30a7\u30c3\u30af\u306f\u96e3\u3057\u304f\u3001\u4e00\u5b9a\u6587\u5b57\u5217\u304c\u542b\u307e\u308c\u308b\u5834\u5408\u306f\u8a31\u53ef\u3068\u3044\u3046\u30eb\u30fc\u30eb\u306f\u5371\u967a\u3059\u304e\u308b\u304b\u3089\u3067\u3042\u308b\u3002<br \/>\n<a title=\"Wikiedia\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3078\u306e\u30ea\u30f3\u30af\" href=\"http:\/\/ja.wikipedia.org\/wiki\/%E3%83%A1%E3%83%BC%E3%83%AB%E3%82%A2%E3%83%89%E3%83%AC%E3%82%B9\">http:\/\/ja.wikipedia.org\/wiki\/%E3%83%A1%E3%83%BC%E3%83%AB%E3%82%A2%E3%83%89%E3%83%AC%E3%82%B9<\/a><br \/>\n\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u30c1\u30a7\u30c3\u30af\u304c\u96e3\u3057\u3044\u7406\u7531\u3068\u3057\u3066\u306f\u3001\u30e1\u30fc\u30eb\u306e\u4e0d\u6b63\u4e2d\u7d99\u3092\u30c6\u30b9\u30c8\u3059\u308b\u30c6\u30b9\u30c8\u30d1\u30bf\u30fc\u30f3\u3082\u53c2\u8003\u306b\u306a\u308b\u3002\uff08%\u306b\u3088\u308b\u8ee2\u9001\u7d4c\u8def\u6307\u5b9a\u3068\u304b\u3002\uff09<br \/>\n<a title=\"\uff20IT \u30b9\u30d1\u30e0\u4e2d\u7d99\u9632\u6b62\u306e\u305f\u3081\u3001\u7b2c\u4e09\u8005\u4e2d\u7d99\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\" href=\"http:\/\/www.atmarkit.co.jp\/fsecurity\/rensai\/securitytips\/005checkmail.html\">http:\/\/www.atmarkit.co.jp\/fsecurity\/rensai\/securitytips\/005checkmail.html<br \/>\n<\/a><br \/>\n\u4ee5\u4e0b\u3001Perl\u306e\u30b3\u30fc\u30c9\u3002<\/p>\n<blockquote>\n<pre>use Carp;\nuse Net::SMTP::Server;\nuse Net::SMTP::Server::Client;\nuse Net::SMTP::Server::Relay;\nuse Data::Dumper;\nmy $SMTP_SERVER = \"smtp_server\";\nmy $SMTP_PORT = \"587\";\n#\u30e1\u30fc\u30eb\u3042\u3066\u5148\u30c1\u30a7\u30c3\u30af\u7528\nsub is_ok_to{\n  my $ref_to_ary = shift;\n  foreach my $to (@$ref_to_ary) {\n    #\u3042\u3066\u5148\u30c1\u30a7\u30c3\u30af\u3092\u3053\u3053\u306b\u66f8\u304f\u3002\n    if($to !~ \/example@example.com\/){\n      return 0;\n    }\n  }\n  return 1;\n}\n# \u4ee5\u4e0b\u672c\u4f53\u51e6\u7406\u90e8\u5206\n#CPAN\u3088\u308a\u3002\n#http:\/\/search.cpan.org\/~macgyver\/SMTP-Server-1.1\/Server.pm\n$server = new Net::SMTP::Server('localhost', 25) ||\n  croak(\"Unable to handle client connection: $!n\");\nwhile($conn = $server-&gt;accept()) {\n  my $client = new Net::SMTP::Server::Client($conn) ||\n    croak(\"Unable to handle client connection: $!n\");\n  $client-&gt;process || next;\n  #\u3053\u3053\u307e\u3067CPAN\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9(\u30b3\u30e1\u30f3\u30c8\u306f\u524a\u9664)\n  if(is_ok_to($client-&gt;{TO})){\n    &amp;send_mail($client-&gt;{FROM},$client-&gt;{TO},$client-&gt;{MSG});\n  }else{\n    print \"bad mail\u00a0 [\" . Dumper($client). \"]\";\n  }\n}\n#\u554f\u984c\u306e\u7121\u3044\u30e1\u30fc\u30eb\u3092\u9001\u308b\nsub send_mail{\n  my $from = shift;\n  my $ref_to_ary = shift;\n  my $msg = shift;\n  $smtp = Net::SMTP-&gt;new($SMTP_SERVER, Port=&gt;$SMTP_PORT );\n  $smtp-&gt;mail($from);\n  foreach my $to (@$ref_to_ary) {\n    $smtp-&gt;to($to);\n  }\n  $smtp-&gt;data($msg);\n  $smtp-&gt;quit() || croak \"send_mail() failed [\" . Dumper($from, $ref_to_ary, $msg). \"]\";\n  return;\n}<\/pre>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u30e1\u30fc\u30eb\u306e\u8aa4\u9001\u4fe1\u3092\u9632\u6b62\u3059\u308b\u306b\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306a\u624b\u6bb5\u304c\u8003\u3048\u3089\u308c\u308b\u3002 \u30b5\u30fc\u30d0\u5074\u3067\u5bfe\u5fdc\u3059\u308b\u3002 Postfix\u306esmtpd_client_restrictions\u306a\u3069\u3002 \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u3067\u5bfe\u5fdc\u3059\u308b\u3002 Thunderbird\u306echeck  &hellip; <a href=\"https:\/\/staka.jp\/wordpress\/?p=22\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u30e1\u30fc\u30eb\u306e\u30c9\u30e1\u30a4\u30f3\u6307\u5b9a\u9001\u4fe1&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,9],"tags":[44,60,67],"class_list":["post-22","post","type-post","status-publish","format-standard","hentry","category-perl","category-security","tag-mail","tag-proxy","tag-smtp"],"_links":{"self":[{"href":"https:\/\/staka.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staka.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staka.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staka.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staka.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=22"}],"version-history":[{"count":0,"href":"https:\/\/staka.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/22\/revisions"}],"wp:attachment":[{"href":"https:\/\/staka.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staka.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staka.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}