You are on page 1of 7

�֣���‫�װ‬ʼ�������postfix+vm-pop3d+openwebmail

��ӭ���‫��������ת‬£���Ҫ��������İ�Ȩ��Ϣ��

��� �llzqq
���www.chinaunix.net
jϵ��llzqq@126.com

���µİ�‫��װ‬freebsd 5.2.1ϵ �����

1������ ports

# cvsup -gl 2 -h cvsup.freebsdchina.org /usr/share/examples/cvsup/ports-supfile

2. ��‫ װ‬openssl+apache ������

# cd /usr/ports/security/openssl
# make install
# make clean
# cd /usr/ports/www/apache2
# make install
# make clean
# vi /etc/rc.conf

apache2_enable="yes"

3. ��‫ װ‬openwebmail

# cd /usr/ports/mail/openwebmail/
# make with_quota=yes install
# make clean

4. ��‫ װ‬postfix ���‫�������ڰ�װ‬yes�‫���������ش‬

# cd /usr/ports/mail/postfix/
# make install
# make clean

# vi /etc/rc.conf

Ϊ������postfix���룺

sendmail_enable="yes"
sendmail_flags="-bd"
sendmail_pidfile="/var/spool/postfix/pid/master.pid"
sendmail_outbound_enable="no"
sendmail_submit_enable="no"
5. ��‫ װ‬vm-pop3d

# cd /usr/ports/mail/vm-pop3d
# make install
# make clean

6. ���� postfix

# vi /usr/local/etc/postfix/main.cf

��ӣ�

myhostname = nero.3322.org
mydomain = nero.3322.org
virtual_alias_maps=hash:/usr/local/etc/postfix/virtual
alias_maps=hash:/usr/local/etc/postfix/aliases
default_privs=nobody
allow_mail_to_commands = alias,forward,include
allow_mail_to_files = alias,forward,include

�����Ҽ���һ�� nero.3322.org ������� ����һ���û�llzqq


# vi /usr/local/etc/postfix/virtual

��ӣ�

nero.3322.org anything //֮����[tab]

llzqq@nero.3322.org llzqq.nero.3322.org //֮����[tab]

ִ���������� ��� virtual.db��

# cd /usr/local/etc/postfix/
# postmap virtual

# vi /usr/local/etc/postfix/aliases

��ӣ�

llzqq.nero.3322.org:/var/spool/virtual/nero.3322.org/llzqq

ִ���������� ��� aliases.db:

# cd /usr/local/etc/postfix
# postalias aliases

7. ���� vm-pop3d ʹ�俪���Զ�ִ��

# cd /usr/local/etc/rc.d
# mv vm-pop3d.sh.sample vm-pop3d.sh
���� openwebmail ֧�� nero.3322.org � ���������ļ���

# vi /usr/local/www/cgi-bin/openwebmail/etc/sites.conf/nero.3322.org

=========================== nero.3322.org =======================


auth_module auth_vdomain.pl
auth_withdomain yes
mailspooldir /var/spool/virtual/nero.3322.org
use_syshomedir no
use_homedirspools no
enable_autoreply no
enable_setforward no
enable_vdomain yes
vdomain_admlist llzqq //������������������
vdomain_maxuser 500
vdomain_vmpop3_pwdpath /usr/local/etc/virtual
vdomain_vmpop3_pwdname passwd
vdomain_vmpop3_mailpath /var/spool/virtual
vdomain_postfix_aliases /usr/local/etc/postfix/aliases
vdomain_postfix_virtual /usr/local/etc/postfix/virtual
vdomain_postfix_postalias /usr/local/sbin/postalias
vdomain_postfix_postmap /usr/local/sbin/postmap
# quota����
quota_module quota_du.pl
quota_limit 52400 //�����������С
quota_threshold 85
delmail_ifquotahit no
delfile_ifquotahit no
=========================== nero.3322.org =======================

# mkdir -p /var/spool/virtual/nero.3322.org
# chown nobody /var/spool/virtual/nero.3322.org
# chgrp mail /var/spool/virtual/nero.3322.org

# mkdir -p /usr/local/etc/virtual/nero.3322.org
# touch /usr/local/etc/virtual/nero.3322.org/passwd
# chmod 644 /usr/local/etc/virtual/nero.3322.org/passwd

# htpasswd /usr/local/etc/virtual/nero.3322.org/passwd llzqq


# chmod 755 /usr/local/www/cgi-bin/openwebmail/etc/users

# sync
# reboot

8. ��� ��������½��openwebmail

http://nero.3322.org/cgi-bin/openwebmail/openwebmail.pl

__________________________________

Ŀǰ����ʱ��Ƚ϶ ���Ҽ���Զ��ά����

�‫ص‬Ĺ���˭�������Ϣ�Ľ���һ�£�лл��
ά����Χ����ļ���OS����� �
1.bsd
2.linux
3.sun os

mail:llzqq@126.com

����ҳ�� 1¥
��Ƹ��δ���� | linux��ѹ����� | cu�°濪�ţ���Ϸ��� | ����ʼ�-����������,���������� |
sun�����������

llzqq
�����ʦ

�� uid��51939
‫��ע‬ʱ�䣺 2003-4-15 08:42
����¼��2006-1-6 17:20
�������� 5551
�������ӣ� 9
�������� 12
��֣�1056

4� ��ӱ�- ��

����̬‫��״‬...����...

[�� ����] [ �‫[ ]���ڶ‬blog]

������: 2004-7-19 08:52 [����] [ ��] [���‫]�ٻظ‬

--------------------------------------------------------------------------------

�2��֣����‫�����ڶ‬,���ʼ���clamav+amavisd-new+spam

��ӭ���‫��������ת‬£���Ҫ��������İ�Ȩ��Ϣ��

��� �llzqq
���www.chinaunix.net
jϵ��llzqq@126.com

1��0 ��‫װ‬clamav:

# cd /usr/ports/security/clamav
# make install
# make clean

# vi /usr/local/etc/clamav.conf
===============================clamav.conf============================
# comment or remove the line below.
# example
logfile /var/log/clamav/clamd.log
logfilemaxsize 1m
logtime
logverbose
pidfile /var/run/clamav/clamd.pid
datadirectory /usr/local/share/clamav
localsocket /tmp/clamd
streammaxlength 10m
maxthreads 10
maxdirectoryrecursion 15
user clamav
scanmail
scanarchive
scanrar
archivemaxfilesize 10m
archivemaxrecursion 5
archivemaxfiles 1000
clamukoscanonopen
clamukoscanonclose
clamukoscanonexec
clamukoincludepath /var/spool/virtual
clamukomaxfilesize 6m
clamukoscanarchive
===============================clamav.conf============================

1.1 ���²�����

# /usr/local/etc/rc.d/clamav-freshclam.sh start

2.0 ��‫װ‬amavisd-new

# cd /usr/ports/security/amavisd-new
# make install
# make clean

# cd /usr/local/etc
# mv amavisd.conf-dist amavisd.conf
# vi amavisd.conf
============================== amavisd.conf ===============================
$myhome = '/var/amavis'; # (default is '/var/amavis')
$mydomain = 'nero.3322.org'; # (no useful default)
$daemon_user = 'vscan'; # (no default; customary: vscan or amavis)
$daemon_group = 'vscan'; # (no default; customary: vscan or amavis)

$log_level = 0;

$sa_spam_subject_tag = '***spam***'

$virus_admin = "root\@$mydomain";
$spam_admin = "llzqq\@$mydomain";
$mailfrom_notify_admin = "llzqq\@$mydomain";
$mailfrom_notify_recip = "llzqq\@$mydomain";
$mailfrom_notify_spamadmin = "llzqq\@$mydomain";
$inet_socket_bind = '127.0.0.1';
$forward_method = 'smtp:127.0.0.1:10025';
$notify_method = $forward_method;
$inet_socket_port = 10024;
$max_servers = 2;

['clam antivirus-clamd',
\&ask_daemon, ["contscan {}\n", '/tmp/clamd'],
qr/\bok$/, qr/\bfound$/,
qr/^.*?: (?!infected archive)(.*) found$/ ],
============================== amavisd.conf ===============================

2.1 Ҫ��clamav��amavisd-new��Ҫ����һ��/etc/rc.conf

# vi /etc/rc.conf

spamd_enable="yes"
amavisd_enable="yes
clamav_clamd_enable="yes"

3.0 �����‫ڰ�װ‬amavisd-newʱspamassassin��һ��‫����������������װ‬

3.1 ��b��� ���

# cd /usr/local/etc/mail/spamassassin
# env lang=c vi local.cf
=============================== local.cf ===============================
# spamassassin config file for version x.xx
# generated by http://www.yrex.com/spam/spamconfig.php (version 1.01)

# how many hits before a message is considered spam.


required_hits 4.0

# whether to change the subject of suspected spam


rewrite_subject 1

# text to prepend to subject if rewrite_subject is used


subject_tag *****spam*****

# encapsulate spam in an attachment


report_safe 1

# use terse version of the spam report


use_terse_report 0

# enable the bayes system


use_bayes 1

# enable bayes auto-learning


auto_learn 1

# enable or disable network checks


skip_rbl_checks 1
use_razor2 0
use_dcc 0
use_pyzor 0
# mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
# - chinese english
ok_languages zh en

# mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales en zh
score subj_full_of_8bits 2
score no_real_name 4.0
=============================== local.cf ===============================

3.2 �����µ�,���ʼ���ַ�б��ļ�

# cd /usr/local/share/spamassassin
# fetch http://anti-spam.org.cn/rules/sa/55_diy_score.cf

4.0 ��Posfix�������ã�����������ļ�����������һЩ����

# vi /usr/local/etc/postfix/master.cf

---------------------- master.cf ---------------------


smtp-amavis unix - - n - 2 smtp
-o smtp_data_done_timeout=1200
-o disable_dns_lookups=yes

127.0.0.1:10025 inet n - n - - smtpd


-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o mynetworks=127.0.0.0/8
---------------------- master.cf ---------------------

# vi /usr/local/etc/postfix/main.cf

content_filter = smtp-amavis:[127.0.0.1]:10024

���ˣ�����һ�����Freebsd�Ĺ������������ʼ������� �b��4�ˣ�������Ĺ��� ��� �½openwebmail�


����û�����ӡ�ɾ��Ȳ��������û����� ��OPENWebmail� ��Լ������롣

You might also like