メール遅延発生
昨日からサーバのロードアベレージが上がっていて色々調べたところメールの再送が大量に発送していた。
原因はメールサーバにあるようだ。
SpamAssassinのディレクトリでbayes_toks.expire****というファイルがたくさん出来ている。
# ls -la 合計 23320 drwxr-xr-x 3 spamd spamd 4096 7月 29 08:03 . drwxr-xr-x 3 root root 4096 7月 25 13:13 .. drwxr-xr-x 2 spamd spamd 4096 7月 29 05:50 .razor -rw------- 1 spamd spamd 643072 7月 29 08:03 auto-whitelist -rw------- 1 spamd spamd 167936 7月 29 02:41 bayes_seen -rw------- 1 spamd spamd 5214208 7月 29 02:53 bayes_toks -rw------- 1 spamd spamd 585728 7月 28 23:40 bayes_toks.expire10877 -rw------- 1 spamd spamd 1560576 7月 29 00:20 bayes_toks.expire10971 -rw------- 1 spamd spamd 2682880 7月 29 00:38 bayes_toks.expire10972 -rw------- 1 spamd spamd 2682880 7月 29 00:57 bayes_toks.expire12065 -rw------- 1 spamd spamd 2682880 7月 29 02:18 bayes_toks.expire12066 -rw------- 1 spamd spamd 2682880 7月 29 02:58 bayes_toks.expire13173 -rw------- 1 spamd spamd 2654208 7月 28 13:59 bayes_toks.expire15934 -rw------- 1 spamd spamd 2686976 7月 28 15:56 bayes_toks.expire23158 -rw------- 1 spamd spamd 2682880 7月 28 17:15 bayes_toks.expire26195 -rw------- 1 spamd spamd 2674688 7月 28 18:02 bayes_toks.expire27824 -rw------- 1 spamd spamd 2682880 7月 28 18:23 bayes_toks.expire28634
bayes_toksファイルのデフォルトの要領を超えたために発生している現象のようだ。
SpamAssassinの設定を変更。
/etc/mail/spamassassin/local.cf
# bayes_expiry_max_db_size (default: 150000) # What should be the maximum size of the Bayes tokens database? When # expiry occurs, the Bayes system will keep either 75% of the maximum # value, or 100,000 tokens, whichever has a larger value. 150,000 # tokens is roughly equivalent to a 8Mb database file. bayes_expiry_max_db_size 1000000 # bayes_auto_expire (default: 1) # If enabled, the Bayes system will try to automatically expire old # tokens from the database. Auto-expiry occurs when the number of # tokens in the database surpasses the bayes_expiry_max_db_size # value. bayes_auto_expire 0
あとはSpamAssassinを再起動してOK。
# /sbin/service spamd restart Stopping spamd: [ OK ] Starting spamd: [ OK ]