qmail
qmail+vpopmailで存在しないアカウントをSMTPで拒否する方法
2010年5月20日
fixcrioのプロセスが残る
2009年10月19日
先日のhotmail MTA対策を運用していて、少し問題があるので、解決方法を書きます。
■問題
qmial-smtpdをdaemontoolで起動しているのですが、fixcrioプロセスが1日に5個ぐらいのペースで残っていきます。fixcrioを使う前まではこの現象がなかったのでfixcrioが原因の可能性が極めて高いです。
root 23043 0.0 0.0 1332 144 ? S Oct16 0:00 /usr/local/bin/fixcrio qmail-smtpdvchkpw true root 26764 0.0 0.0 1336 148 ? S Oct16 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 30459 0.0 0.0 1332 144 ? S Oct16 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 31536 0.0 0.0 1332 148 ? S Oct16 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 640 0.0 0.0 1332 144 ? S Oct16 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 7865 0.0 0.0 1336 184 ? S Oct17 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 10241 0.0 0.0 1336 192 ? S Oct17 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 15369 0.0 0.0 1336 148 ? S Oct17 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 24527 0.0 0.0 1332 188 ? S Oct18 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 7827 0.0 0.0 1332 180 ? S Oct18 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 15577 0.0 0.0 1336 192 ? S Oct18 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 23128 0.0 0.0 1332 188 ? S Oct18 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 14132 0.0 0.0 1332 188 ? S 06:25 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 32109 0.0 0.0 1336 192 ? S 09:46 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true root 6455 0.0 0.0 1332 188 ? S 15:08 0:00 /usr/local/bin/fixcrio qmail-smtpd vchkpw true
■対処
面倒だけど、qmail-smtpdにパッチを当てて再度make setup.
自分の場合、patchが自動で当たらなかったので手作業でファイルを変更。
http://www.qmail.org/qmail-smtpd-newline-1.03.patch
fixcrioを起動スクリプトから外して、qmail,qmail-smtpdを再起動して完了。
qmailがhotmailのメールを受信しなくなった
2009年10月8日
この設定よりこちらの設定の方が適切です。(2009年10月22日追記)
http://matsu.tymy.net/blog/2009/10/19/fixcrio%E3%81%AE%E3%83%97%E3%83%AD%E3%82%BB%E3%82%B9%E3%81%8C%E6%AE%8B%E3%82%8B/
hotmailから自社サーバにメールを送ったら、1日後に以下のエラーメール。
This is an automatically generated Delivery Status Notification.
THIS IS A WARNING MESSAGE ONLY.
YOU DO NOT NEED TO RESEND YOUR MESSAGE.
Delivery to the following recipients has been delayed.
2日後に以下のエラーメール。
This is an automatically generated Delivery Status Notification.
Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server.
が送り元のhotmailアカウントへ届くようになった。
現象は10月1日ぐらいから。
ここの掲示板でも盛り上がってたように、問題はhotmailから送ってくるSMTPの中身が問題。
http://forum.tsukaeru.net/viewtopic.php?t=4337
解決のために、/usr/local/bin/fixcrioを追加して、一件落着。
% cd /service/smtpd % cat run #!/bin/sh PATH=/usr/local/bin:/var/qmail/bin:/home/vpopmail/bin/:$PATH exec /usr/local/bin/softlimit -m 15000000 \ tcpserver -R -H -l0 -v -x /home/vpopmail/etc/tcp.smtp.cdb -u qmaild -g nofiles 0 smtp \ /usr/local/bin/rblsmtpd -r blocked.rbl -r bl.spamcop.net \ /usr/local/bin/fixcrio \ qmail-smtpd www.example.com vchkpw true 2>&1
qmail log
2009年2月21日
2009-01-21 23:10:15.386280500 new msg 819216 2009-01-21 23:10:15.419363500 info msg 819216: bytes 5249 fromqp 27362 uid 2005 2009-01-21 23:10:15.466129500 starting delivery 127180: msg 819216 to local foo@example.com 2009-01-21 23:10:15.466132500 status: local 2/10 remote 0/20 2009-01-21 23:10:15.466133500 delivery 127179: success: did_0+1+0/qp_27362/ 2009-01-21 23:10:15.466135500 status: local 1/10 remote 0/20 2009-01-21 23:10:15.482058500 end msg 819215 2009-01-21 23:10:15.522811500 delivery 127180: success: did_0+0+1/ 2009-01-21 23:10:15.522814500 status: local 0/10 remote 0/20 2009-01-21 23:10:15.522815500 end msg 819216
qmailの挙動を追うために、qmailのログを見ていると、メッセージのID(new msg xxxxのxxxxの所)がいっぱい重複していた。
このメッセージIDはinode番号らしい。だから、重複する。(トラッキングしづらくて困るけど)
delivery idはincrementされた数字なので、しばらくの期間は重複しない。
qmail-date-localtime.patch
2008年3月15日
あちらこちらでリンク切れになっているのでコピーしておきます。
こんな風にすれば適応できます。
% wget ftp://ftp.jp.qmail.org/qmail/qmail-1.03.tar.gz % wget http://www.tymy.net/%7Ematsu/blog/wp-content/uploads/2008/03/qmail-date-localtime.patch % tar zxf qmail-1.03.tar.gz % cd qmail-1.03 % patch < ../qmail-date-localtime.patch
写真アーカイブ
2007年11月26日
外国の方向けに写真サイトを作ってみました。
Zenphotoで作りました。Zenphotoはインストールが簡単でしかもファイルをサーバのファイルシステム上に置けば、それを自動的に認識してページを作ってくれます。meta情報はファイル名と関連づけられてデータベースに保存されています。
ezmlmのprefix設定方法
2003年10月11日
—————
ezmlm設定メモ
—————
■説明
ezmlmをインストールした後,デフォルトの設定では
いろいろ不便なのでこれらの設定を行う.
ezmlmのprefixの振り方はとっても頭が悪いので,
fmlなどと同じようなprefixがふれるようにした.
—————
■デフォルトで,Reply-toがつくようにする
/usr/local/bin/ezmlm/ezmlmrc
の321行目あたりに
Reply-to: < #L#>@< #H#>
—————
■デフォルトでprefixナンバーがつくように
/usr/local/bin/ezmlm/ezmlmrc
の440行目あたりに
[< #L#> #]
—————
■きれいな通し番号を
http://www.ep.sci.hokudai.ac.jp/~epnetfan/tebiki/server-ml/prefix.html
参照
/home/vpopmail/ に置く.
# chown vpopmail.vchkpw /home/vpopmail/prefix.pl
# chmod u+x /home/vpopmail/prefix.pl
250行目あたりコメントアウト
#|< #B#>/ezmlm-send ‘< #D#>‘
これを追加
|/usr/bin/nkf -em |/home/vpopmail/prefix.pl < #L#> ‘/home/vpopmail/domains/< #H#>/< #L#>/num’ |/usr/bin/nkf -j |/usr/local/bin/ezmlm/ezmlm-send ‘/home/vpopmail/domains/< #H#>/< #L#>‘
———prefix.pl————————
#!/usr/bin/perl # # This is a pert of the Dongury Perl library. # Copyright (C) 1999 Dongury Entertainment Corporation # All rights reserved. # # Based on the program written by Kyoma TAKAHASHI. # Many thanks for his advice! # # prefix.pl ver 0.3.6 # modified by Yuki Matsukura 2003/10/11# ######################################### $UseLock = 1; # True : 1, False : 0 $FormatIndex = 4; # Index の桁数 ######################################### sub lock_file { local(*FILE) = @_; if ($UseLock) { eval("flock(FILE, 2)"); if ($@) { return 0; } } return 1; } sub unlock_file { local(*FILE) = @_; if ($UseLock) { eval("flock(FILE, 8)"); } } sub increment { my ($path) = @_; local $num; open(INDEX, "+< " . "$path") or return 0; if (!&lock_file(INDEX)) { close(INDEX); return 0; } chop ($num = ); # Stop duplicated incrementation. # $num += 1; seek(INDEX, 0, 0); print INDEX "$num\n"; &unlock_file(INDEX); close(INDEX); return $num; } sub main { my ($prefix, $index, $result); shift; $prefix = $ARGV[0]; if (-e $ARGV[1]) { $index = &increment($ARGV[1]); } if ($index) { $index = sprintf('%.' . $FormatIndex . 'd', $index); } else { $index = "" unless $index; } while ( ) { chop; if (s/^Subject:\s//) { s/((\|\s|RE):\s)+/Re: /gi; s/^\[$prefix\s?\d+\]\s*//; # disable extra prefix # s/Re:\s\[$prefix\s?(\d+)\]\s*/Re:[$1] /g; s/Re:\s\[$prefix\s?(\d+)\](\s*)/Re: $2/g; s/Re:\s*Re:\s*/Re: /g; foreach $s (split) { if ($s =~ /Re:\[\d+\]/ and $pre =~ /Re:\[\d+\]/) { $pre = $s; $s =~ s/Re://g if (($s =~ /Re:\[/) && (!$` or $` =~ /(Re:)+/)); $result .= $s; next; } $pre = $s; $result .= " $s"; } print "Subject: [$prefix $index]" . $result . "\n"; last; } print; print "\n"; } print ; exit(0); } &main;

最近のコメント