{"id":153,"date":"2012-02-17T16:14:39","date_gmt":"2012-02-17T07:14:39","guid":{"rendered":"http:\/\/www.freedom.ne.jp\/hide\/hogehoge\/?p=153"},"modified":"2017-09-27T01:59:07","modified_gmt":"2017-09-26T16:59:07","slug":"freebsd-postfix-spamassassin","status":"publish","type":"post","link":"https:\/\/www.freedom.ne.jp\/hide\/hogehoge\/?p=153","title":{"rendered":"FreeBSD + Postfix + Spamassassin"},"content":{"rendered":"<p>\u4ed5\u4e8b\u3067\u307e\u305f spamassassin \u3092\u4f7f\u3063\u3066\u307e\u3059\u3002\u4eca\u56de\u306f\u5ff5\u9858\u306e FreeBSD postfix postgresql\u3000\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u3059\u3002<br \/>\n\u3084\u3071\u308a postfix \u3067\u306a\u3044\u3068\u3002<\/p>\n<p>maillog \u3067\u3001<\/p>\n<p>spamd: still running as root: user not specified with -u, not found, or set to root, falling back to nobody<\/p>\n<p>\u307f\u305f\u3044\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3057\u305f\u3002<br \/>\n\u306a\u3093\u304bspamd\u304croot\u3067\u52d5\u3044\u3066\u308b\u307f\u305f\u3044\u306a\u611f\u3058\u3089\u3057\u3044\u3067\u3059\u3002\u3067\u3059\u306e\u3067\u3001<\/p>\n<p>\/usr\/local\/etc\/rc.d\/sa-spamd\u3000\u3092<\/p>\n<p>ommand_args=&#8221;-d -d -x -r -v -q -u hogehoge -A 202.211.xx.xx -r ${pidfile}&#8221;<\/p>\n<p>\u3067 -u hogehoge \u307f\u305f\u3044\u306a\u611f\u3058\u3067\u5225\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u3057\u3066\u3042\u3052\u308b\u3068\u884c\u3051\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u3042\u3068\u3001-A 202.211.xx.xx \u306f\u3001<\/p>\n<p>spamd[40410]: spamd: unauthorized connection from noname.freedom.ne.jp [202.211.xx.xx] at port 24135 at \/usr\/local\/bin\/spamd line 1271.<\/p>\n<p>\u304cmaillog\u306b\u51fa\u305f\u6642\u306e\u5bfe\u51e6\u3067\u3059\u3002\u306a\u3093\u304b\u3053\u3046\u3057\u306a\u3044\u3068\u3001127.0.0.1\u304b\u3089\u3057\u304bspamd\u306f\u53d7\u3051\u4ed8\u3051\u3066\u304f\u308c\u306a\u3044\u307f\u305f\u3044\u3067\u3059\u3002<\/p>\n<p>pgsql\u306e\u5834\u5408\u306e\/usr\/local\/etc\/mail\/spamassassin\/sql.cf<\/p>\n<p>user_scores_dsn DBI:Pg:dbname=spamassassin;host=localhost;port=5432<br \/>\nuser_scores_sql_password xxxxxxx<br \/>\nuser_scores_sql_username zzzzzzz<br \/>\n\u00d7user_scores_sql_custom_query SELECT preference, value FROM _TABLE_ WHERE username = _USERNAME_ OR username = &#8216;$GLOBAL&#8217; OR username = CONCAT(&#8216;%&#8217;,_DOMAIN_) ORDER BY username ASC<br \/>\n\u25cbuser_scores_sql_custom_query SELECT preference, value FROM _TABLE_ WHERE username = _USERNAME_ OR username = &#8216;$GLOBAL&#8217; OR username = &#8216;%&#8217; || _DOMAIN_ ORDER BY username ASC<\/p>\n<p>\u203bpostgresql\u3067\u306fconcat\u306f\u4f7f\u3048\u306a\u3044\u3002<\/p>\n<p>pgsql\u306e\u5834\u5408\u306euserpref\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210<\/p>\n<p>userpref<\/p>\n<p>http:\/\/www.koders.com\/sql\/fid0DF2E1AD66C6EB4CE480765A739AD867D8EA4A07.aspx?s=update<\/p>\n<p>CREATE TABLE userpref (<br \/>\n  prefid bigserial NOT NULL unique primary key,<br \/>\n  username varchar(100) NOT NULL,<br \/>\n  preference varchar(30) NOT NULL,<br \/>\n  value varchar(100) NOT NULL<br \/>\n);<br \/>\nCREATE INDEX userpref_username_idx ON userpref(username);<\/p>\n<p>pgsql\u306e\u5834\u5408\u306eawlf\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210<\/p>\n<p>http:\/\/www.opensource.apple.com\/source\/SpamAssassin\/SpamAssassin-124.5\/SpamAssassin\/sql\/awl_pg.sql<\/p>\n<p>CREATE TABLE awl (<br \/>\n  username varchar(100) NOT NULL default &#8221;,<br \/>\n  email varchar(200) NOT NULL default &#8221;,<br \/>\n  ip varchar(10) NOT NULL default &#8221;,<br \/>\n  count bigint default &#8216;0&#8217;,<br \/>\n  totscore float default &#8216;0&#8217;<br \/>\n);<br \/>\nCREATE UNIQUE INDEX awl_pkey ON awl (username,email,ip);<\/p>\n<p>pgsql\u306e\u5834\u5408\u306ebayes\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210<\/p>\n<p>http:\/\/svn.apache.org\/repos\/asf\/spamassassin\/branches\/3.0\/sql\/bayes_pg.sql<br \/>\nCREATE TABLE bayes_expire (<br \/>\n  id integer NOT NULL default &#8216;0&#8217;,<br \/>\n  runtime integer NOT NULL default &#8216;0&#8217;<br \/>\n);<\/p>\n<p>CREATE INDEX bayes_expire_idx1 ON bayes_expire (id);<\/p>\n<p>CREATE TABLE bayes_global_vars (<br \/>\n  variable varchar(30) NOT NULL default &#8221;,<br \/>\n  value varchar(200) NOT NULL default &#8221;,<br \/>\n  PRIMARY KEY  (variable)<br \/>\n);<\/p>\n<p>INSERT INTO bayes_global_vars VALUES (&#8216;VERSION&#8217;,&#8217;3&#8242;);<\/p>\n<p>CREATE TABLE bayes_seen (<br \/>\n  id integer NOT NULL default &#8216;0&#8217;,<br \/>\n  msgid varchar(200) NOT NULL default &#8221;,<br \/>\n  flag character(1) NOT NULL default &#8221;,<br \/>\n  PRIMARY KEY  (id,msgid)<br \/>\n);<\/p>\n<p>CREATE TABLE bayes_token (<br \/>\n  id integer NOT NULL default &#8216;0&#8217;,<br \/>\n  token char(5) NOT NULL default &#8221;,<br \/>\n  spam_count integer NOT NULL default &#8216;0&#8217;,<br \/>\n  ham_count integer NOT NULL default &#8216;0&#8217;,<br \/>\n  atime integer NOT NULL default &#8216;0&#8217;,<br \/>\n  PRIMARY KEY  (id,token)<br \/>\n);<\/p>\n<p>CREATE TABLE bayes_vars (<br \/>\n  id serial NOT NULL,<br \/>\n  username varchar(200) NOT NULL default &#8221;,<br \/>\n  spam_count integer NOT NULL default &#8216;0&#8217;,<br \/>\n  ham_count integer NOT NULL default &#8216;0&#8217;,<br \/>\n  token_count integer NOT NULL default &#8216;0&#8217;,<br \/>\n  last_expire integer NOT NULL default &#8216;0&#8217;,<br \/>\n  last_atime_delta integer NOT NULL default &#8216;0&#8217;,<br \/>\n  last_expire_reduce integer NOT NULL default &#8216;0&#8217;,<br \/>\n  oldest_token_age integer NOT NULL default &#8216;2147483647&#8217;,<br \/>\n  newest_token_age integer NOT NULL default &#8216;0&#8217;,<br \/>\n  PRIMARY KEY  (id)<br \/>\n);<\/p>\n<p>CREATE INDEX bayes_vars_idx1 ON bayes_vars (username);<\/p>\n<p>smtp auth\u306b\u3064\u3044\u3066\u306f\u3053\u3053\u304c\u3059\u3054\u304f\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nhttp:\/\/satospo.sakura.ne.jp\/blog_archives\/tech\/centos\/postfix_smtpauth.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ed5\u4e8b\u3067\u307e\u305f spamassassin \u3092\u4f7f\u3063\u3066\u307e\u3059\u3002\u4eca\u56de\u306f\u5ff5\u9858\u306e FreeBSD postfix postgresql\u3000\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u3059\u3002 \u3084\u3071\u308a postfix \u3067\u306a\u3044\u3068\u3002 maillog \u3067\u3001 spamd: stil [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-8"],"_links":{"self":[{"href":"https:\/\/www.freedom.ne.jp\/hide\/hogehoge\/index.php?rest_route=\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freedom.ne.jp\/hide\/hogehoge\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freedom.ne.jp\/hide\/hogehoge\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freedom.ne.jp\/hide\/hogehoge\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freedom.ne.jp\/hide\/hogehoge\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=153"}],"version-history":[{"count":3,"href":"https:\/\/www.freedom.ne.jp\/hide\/hogehoge\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":157,"href":"https:\/\/www.freedom.ne.jp\/hide\/hogehoge\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions\/157"}],"wp:attachment":[{"href":"https:\/\/www.freedom.ne.jp\/hide\/hogehoge\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freedom.ne.jp\/hide\/hogehoge\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freedom.ne.jp\/hide\/hogehoge\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}