送信者に通知をしても意味が無いのでQMAILSCAN_NOTIFYからsenderを排除してQMAILSCAN_NOTIFY="recips,admin"を指定。
各ユーザーのメールボックスに.qmail-spamという制御ファイルを置いて、spamというメールボックスを設置しているのでQMAILSCAN_SPAMSTOSUFFIXを指定。
あとQMAILSCAN_LOCALDOMAINSが自動認識だとhostnameが付くので、明示的に指定。
'mail/qmail-scanner' => 'QMAILSCAN_SPAMSTOSUFFIX="spam" \
QMAILSCAN_LOCALDOMAINS="example.jp" QMAILSCAN_NOTIFY="recips,admin" \
QMAILSCAN_ADMIN="postmaster" ',
なんかわかんないがsetenv LANG ja_JP.EUC
*1
でビルドしても--langが反映されていない気が? するためのMakefileの変更点。
--- Makefile.orig Wed Feb 4 16:38:29 2004
+++ Makefile Wed Feb 4 17:38:18 2004
@@ -19,7 +19,8 @@
BUILD_DEPENDS= ${QMAIL_QUEUE}:${PORTSDIR}/mail/qmail \
${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes \
- reformime:${PORTSDIR}/mail/maildrop
+ reformime:${PORTSDIR}/mail/maildrop \
+ nkf:${PORTSDIR}/japanese/nkf
# A normal qmail installation puts everything into /var/qmail/.
# Must match your qmail installation
@@ -68,6 +69,7 @@
--add-dscr-hdrs yes \
--fix-mime yes \
--log-details syslog --debug no \
+ --lang ja_JP.EUC \
--batch
pre-configure:
そしてsubjectの文字化けpatch。
--- qmail-scanner-queue.pl.orig Wed Feb 4 16:29:20 2004
+++ qmail-scanner-queue.pl Wed Feb 4 17:24:37 2004
@@ -1742,7 +1742,7 @@
my($addr_type)=@_;
my ($HDR,$hdr,$tmpsndrs,$tmpsubj)='';
my ($tmpmsgid)= &uniq_id() . "-" . $V_FROM;
- open(SM,"|$qmailinject -h -f ''")||&error_condition("cannot open $qmailinject for sending quarantine report - $!");
+ open(SM,"|/usr/local/bin/nkf -j|$qmailinject -h -f ''")||&error_condition("cannot open $qmailinject for sending quarantine report - $!");
print SM "From: \"$V_FROMNAME\" <$V_FROM>\n";
if ($addr_type eq "sender") {
if (!&is_unreplyable_email('sender') && ¬ify_addr('sender')) {
@@ -1841,7 +1841,7 @@
my($HDR,$hdr,$tmprecips,$tmpsubj)='';
my($tmpmsgid)= &uniq_id() . "-" . $V_FROM;
- open(SM,"|$qmailinject -h -f ''")||&error_condition("cannot open $qmailinject for sending quarantine report - $!");
+ open(SM,"|/usr/local/bin/nkf -j|$qmailinject -h -f ''")||&error_condition("cannot open $qmailinject for sending quarantine report - $!");
print SM "From: \"$V_FROMNAME\" <$V_FROM>\n";
if (!&is_unreplyable_email('recips')) {
&debug("e_r: sending quarantine report via: $qmailinject to recip address ($recip)");
忘れずに念のため
cd /usr/local/qmailscan
fetch http://www.es.qmail.org/quarantine-attachments.txt
qmail-scanner-queue.pl -g
どっちかと言うとjapanese/qmail-scannerにスレーブportsを作ったほうがいいな:
files/に上記のnkfのpatchを入れて。
Makefile
# New ports collection makefile for: ja-qmail-scanner
# Date Created: 4 Feb 2004
# Whom: Masafumi Otsune <info@otsune.com>
#
# $FreeBSD$
#
PORTNAME= qmail-scanner
PORTVERSION= 1.20
PORTREVISION= 2
CATEGORIES= japanese mail security
MAINTAINER= info@otsune.com
COMMENT= Content/Anti-virus Scanner for qmail with Japanese patch
CONFLICTS= qmail-scanner
EXTRA_PATCHES= ${.CURDIR}/files/patch-qmail-scanner-queue.template
MASTERDIR= ${.CURDIR}/../../mail/qmail-scanner
CONFIGURE_ARGS+= \
--lang ja_JP.EUC
RUN_DEPENDS+= nkf:${PORTSDIR}/japanese/nkf
.include "${MASTERDIR}/Makefile"
files/patch-qmail-scanner-queue.template
--- qmail-scanner-queue.template.orig Wed Nov 5 07:26:25 2003
+++ qmail-scanner-queue.template Wed Feb 4 18:44:29 2004
@@ -1724,7 +1724,7 @@
my($addr_type)=@_;
my ($HDR,$hdr,$tmpsndrs,$tmpsubj)='';
my ($tmpmsgid)= &uniq_id() . "-" . $V_FROM;
- open(SM,"|$qmailinject -h -f ''")||&error_condition("cannot open $qmailinject for sending quarantine report - $!");
+ open(SM,"|/usr/local/bin/nkf -j|$qmailinject -h -f ''")||&error_condition("cannot open $qmailinject for sending quarantine report - $!");
print SM "From: \"$V_FROMNAME\" <$V_FROM>\n";
if ($addr_type eq "sender") {
if (!&is_unreplyable_email('sender') && ¬ify_addr('sender')) {
@@ -1788,7 +1788,7 @@
my($HDR,$hdr,$tmprecips,$tmpsubj)='';
my($tmpmsgid)= &uniq_id() . "-" . $V_FROM;
- open(SM,"|$qmailinject -h -f ''")||&error_condition("cannot open $qmailinject for sending quarantine report - $!");
+ open(SM,"|/usr/local/bin/nkf -j|$qmailinject -h -f ''")||&error_condition("cannot open $qmailinject for sending quarantine report - $!");
print SM "From: \"$V_FROMNAME\" <$V_FROM>\n";
if (!&is_unreplyable_email('recips')) {
&debug("e_r: sending quarantine report via: $qmailinject to recip address ($recip)");
portlintするとfilesは使うなって警告が出るけど、どうするのがいいのやら。
コメントを読む(4) [ コメントする ]