功能模块 | 内容 | 备注 |
操作系统(OS) | CentOS 4.6 | CentOS和RHEL是一样的,而且升级免费 |
邮件传输代理(MTA) | Postfix 2.5.1 | 使用最新版本2.5.1 |
数据库/目录服务 | MySQL 4.1 | 可选openLDAP或NetScape LDAP,本文以MySQL为蓝本 |
邮件投递代理(MDA) | maildrop 2.0.x | 支持过滤和强大功能 |
Web帐户管理后台 | ExtMan 0.2.4 | 支持无限域名、无限用户 |
POP3 服务器 | Courier-IMAP | 只使用pop3部分,对于大部分企业而言完全足够 |
WebMail 系统 | ExtMail 1.0.4 | 支持多语言、全部模板化,功能基本齐全 |
防病毒软件(Anti-Virus) | ClamAV 0.92-2 | 最热门的开源杀毒软件 |
SMTP阶段反垃圾邮件工具 | Spam Locker 0.10 | 基于SMTP行为识别的Antispam软件,大量可选插件 |
内容过滤器 | Amavisd-new 2.5.4 | Content-Filter软件,支持与clamav/sa的挂接 |
内容级别的反垃圾邮件工具 | SpamAssassin | 著名的SA,可以支持大量规则,但速度慢 |
SMTP认证库 | Cyrus SASL 2.1x | 标准的SASL实现库,可以支持Courier authlib |
其他数据认证库 | Courier Authlib 0.60 | authlib是maildrop, courier-imap等服务的关键部件 |
日志分析及显示 | mailgraph_ext | 在ExtMan中已经包含了 |
Web 服务器 | Apache 2.0.x | CentOS 自带 |
setsebool httpd_disable_trans=1 setsebool mysqld_disable_trans=1
/usr/sbin/setsebool httpd_disable_trans=1 /usr/sbin/setsebool mysqld_disable_trans=1 /etc/init.d/mysqld restart /etc/init.d/httpd restart
su - root cd /root wget http://www.extmail.org/source/ExtMail-Solution-Linux-0.2.tar.gz
wget http://www.extmail.org/source/md5sum.es_linux-0.2 cat md5sum.es_linux-0.2 md5sum ExtMail-Solution-Linux-0.2.tar.gz
# cat md5sum.es_linux-0.2 168eced41c0cac0ed9f981e791f3783b ExtMail-Solution-Linux-0.2.tar.gz # md5sum ExtMail-Solution-Linux-0.2.tar.gz 168eced41c0cac0ed9f981e791f3783b ExtMail-Solution-Linux-0.2.tar.gz
conf/ docs/ RPMS/ src/ README
postconf -n > /etc/postfix/main2.cf mv /etc/postfix/main.cf /etc/postfix/main.cf.old mv /etc/postfix/main2.cf /etc/postfix/main.cf
# hostname mynetworks = 127.0.0.1 myhostname = mail.extmail.org mydestination = $mynetworks $myhostname # banner mail_name = Postfix - by extmail.org smtpd_banner = $myhostname ESMTP $mail_name # response immediately smtpd_error_sleep_time = 0s unknown_local_recipient_reject_code = 450 # extmail config here virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf virtual_transport = maildrop:
user = extmail password = extmail hosts = localhost dbname = extmail table = alias select_field = goto where_field = address
user = extmail password = extmail hosts = localhost dbname = extmail table = domain select_field = description where_field = domain #additional_conditions = and backupmx ='0' and active ='1'
user = extmail password = extmail hosts = localhost dbname = extmail table = mailbox select_field = maildir where_field = username #additional_conditions = and active = '1'
rpm -ivh RPMS/libtool-libs-1.5.6-4.EL4.2.i386.rpm rpm -ivh RPMS/courier-authlib-0.60.2-1ext.i386.rpm rpm -ivh RPMS/courier-authlib-devel-0.60.2-1ext.i386.rpm rpm -ivh RPMS/courier-authlib-mysql-0.60.2-1ext.i386.rpm
MYSQL_SERVER localhost MYSQL_USERNAME extmail MYSQL_PASSWORD extmail MYSQL_SOCKET /var/lib/mysql/mysql.sock MYSQL_PORT 3306 MYSQL_OPT 0 MYSQL_DATABASE extmail MYSQL_USER_TABLE mailbox MYSQL_CRYPT_PWFIELD password MYSQL_UID_FIELD uidnumber MYSQL_GID_FIELD gidnumber MYSQL_LOGIN_FIELD username MYSQL_HOME_FIELD homedir MYSQL_NAME_FIELD name MYSQL_MAILDIR_FIELD maildir MYSQL_QUOTA_FIELD quota MYSQL_SELECT_CLAUSE SELECT username,password,"",uidnumber,gidnumber,\ CONCAT('/home/domains/',homedir), \ CONCAT('/home/domains/',maildir), \ quota, \ name \ FROM mailbox \ WHERE username = '$(local_part)@$(domain)'
rpm -ivh RPMS/maildrop-2.0.4-1ext.i386.rpm rpm -ivh RPMS/maildrop-man-2.0.4-1ext.i386.rpm
maildrop unix - n n - - pipe flags=DRhu user=vuser argv=maildrop -w 90 -d ${user}@${nexthop} ${recipient} ${user} ${extension} {nexthop}
NameVirtualHost *:80 Include conf/vhost_*.conf
# VirtualHost for ExtMail Solution <VirtualHost *:80> ServerName mail.extmail.org DocumentRoot /var/www/extsuite/extmail/html/ ScriptAlias /extmail/cgi/ /var/www/extsuite/extmail/cgi/ Alias /extmail/ /var/www/extsuite/extmail/html/ ScriptAlias /extman/cgi/ /var/www/extsuite/extman/cgi/ Alias /extman/ /var/www/extsuite/extman/html/ # Suexec config SuexecUserGroup vuser vgroup </VirtualHost>重新启动apache:
mkdir /var/www/extsuite tar -zxvf src/extmail-1[1][1].0.4.tar.gz -C src cp -r src/extmail-1.0.4 /var/www/extsuite/extmail cd /var/www/extsuite/extmail cp webmail.cf.default webmail.cf cd $OLDPWD
rpm -ivh RPMS/perl-Unix-Syslog-1.0-1ext.i386.rpm
SYS_USER_LANG = zh_CN SYS_USER_CHARSET = gb2312 SYS_MFILTER_ON = 1 SYS_NETDISK_ON = 1 SYS_SHOW_SIGNUP = 1 SYS_MYSQL_USER = extmail SYS_MYSQL_PASS = extmail SYS_MYSQL_DB = extmail SYS_G_ABOOK_TYPE = file SYS_G_ABOOK_FILE_CHARSET = gb2312
tar -zxvf src/extman-0[1][1].2.4.tar.gz -C src cp -r src/extman-0.2.4 /var/www/extsuite/extman/
SYS_CAPTCHA_ON = 1 # SYS_CAPTCHA_ON参数控制首页是否采用校验码登陆 SYS_CHARSET = gb2312 SYS_LANG = zh_CN
rpm -ivh RPMS/perl-GD-2.35-2ext.i386.rpm
/usr/bin/mysql_install_db service mysqld start
Starting MySQL: [ OK ]
mysql -u root -p < /var/www/extsuite/extman/docs/extmail.sql mysql -u root -p < /var/www/extsuite/extman/docs/init.sql
mkdir /tmp/extman chown -R vuser:vgroup /tmp/extman
cd /var/www/extsuite/extman/tools ./maildirmake.pl /home/domains/extmail.org/postmaster/Maildir chown -R vuser:vgroup /home/domains/extmail.org cd $OLDPWD
Authentication succeeded. Authenticated: [email protected] (uid 1000, gid 1000) Home Directory: /home/domains/extmail.org/postmaster Maildir: /home/domains/extmail.org/postmaster/Maildir/ Quota: 104857600S Encrypted Password: $1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0 Cleartext Password: extmail Options: (none)
- Perl 5.6+ (建议5.8以上) - rrdtool 及rrdtool的perl包,地址: http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/ - File::Tail (还需要Time::HiRes模块)
rpm -ivh RPMS/rrdtool-1.2.12-2ext.i386.rpm RPMS/perl-rrdtool-1.2.12-2ext.i386.rpm rpm -ivh RPMS/perl-Time-HiRes-1.72-2ext.i386.rpm rpm -ivh RPMS/perl-File-Tail-0.99.3-2ext.i386.rpm
/usr/local/mailgraph_ext/mailgraph-init start /usr/local/mailgraph_ext/qmonitor-init start
echo "/usr/local/mailgraph_ext/mailgraph-init start" >> /etc/rc.d/rc.local echo "/usr/local/mailgraph_ext/qmonitor-init start" >> /etc/rc.d/rc.local
# smtpd related config smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_hostname, # SMTP AUTH config here broken_sasl_auth_clients = yes smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_security_options = noanonymous
pwcheck_method: authdaemond log_level: 3 mech_list: PLAIN LOGIN authdaemond_path:/var/spool/authdaemon/socket
perl -e 'use MIME::Base64; print encode_base64("postmaster\@extmail.org")' cG9zdG1hc3RlckBleHRtYWlsLm9yZw== perl -e 'use MIME::Base64; print encode_base64("extmail")' ZXh0bWFpbA==
telnet localhost 25 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 mail.extmail.org ESMTP Postfix - by extmail.org ehlo demo.domain.tld 250-mail.extmail.org 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-AUTH LOGIN PLAIN 250-AUTH=LOGIN PLAIN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN auth login 334 VXNlcm5hbWU6 cG9zdG1hc3RlckBleHRtYWlsLm9yZw== 334 UGFzc3dvcmQ6 ZXh0bWFpbA== 235 2.0.0 Authentication successful quit 221 2.0.0 Bye
telnet localhost 110 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. +OK Hello there. user [email protected] +OK Password required. pass extmail +OK logged in. list +OK POP3 clients that break here, they violate STD53. . quit +OK Bye-bye. Connection closed by foreign host.
rpm -ivh RPMS/perl-Digest-SHA1-2.07-5.i386.rpm rpm -ivh RPMS/perl-Digest-HMAC-1.01-2ext.i386.rpm rpm -ivh RPMS/perl-Net-IP-1.24-2ext.i386.rpm rpm --nodeps -ivh RPMS/perl-Net-DNS-0.57-1hzq.i386.rpm rpm -ivh RPMS/perl-Time-HiRes-1.72-2ext.i386.rpm rpm -ivh RPMS/perl-HTML-Tagset-3.03-30.noarch.rpm rpm -ivh RPMS/perl-HTML-Parser-3.35-6.i386.rpm rpm -ivh RPMS/perl-libwww-perl-5.79-5.noarch.rpm rpm -ivh RPMS/spamassassin-3.1.9-1.el4.i386.rpm rpm -ivh RPMS/perl-IO-stringy-2.110-2ext.i386.rpm rpm -ivh RPMS/perl-IO-Multiplex-1.08-2ext.i386.rpm rpm -ivh RPMS/perl-Net-SSLeay-1.30-1.ext.i386.rpm rpm -ivh RPMS/perl-IO-Socket-SSL-0.97-2ext.i386.rpm rpm -ivh RPMS/perl-Net-Server-0.93-2ext.i386.rpm rpm -ivh RPMS/perl-TimeDate-1.16-2ext.i386.rpm rpm -ivh RPMS/perl-MailTools-1.67-2ext.i386.rpm rpm -ivh --force RPMS/perl-MIME-Base64-3.05-2ext.i386.rpm rpm -ivh RPMS/perl-Convert-BinHex-1.119-2ext.i386.rpm rpm -ivh RPMS/perl-MIME-tools-5.418-2ext.i386.rpm rpm -ivh RPMS/perl-BerkeleyDB-0.26-2ext.i386.rpm rpm -ivh RPMS/perl-Convert-TNEF-0.17-2ext.i386.rpm rpm -ivh RPMS/perl-Convert-UUlib-1.051-2ext.i386.rpm rpm -ivh RPMS/perl-Compress-Zlib-1.41-2ext.i386.rpm rpm -ivh RPMS/perl-Archive-Zip-1.23-1ext.i386.rpm rpm -ivh RPMS/perl-IO-Zlib-1.04-2ext.i386.rpm rpm -ivh RPMS/perl-Archive-Tar-1.38-1ext.i386.rpm rpm -ivh RPMS/arc-5.21o-2ext.i386.rpm rpm -ivh RPMS/zoo-2.10-10ext.i386.rpm rpm -ivh RPMS/unarj-2.65-50ext.i386.rpm export LANG=C rpm -ivh RPMS/amavisd-new-2.5.4-1ext.i386.rpm mkdir -p /var/amavis/tmp /var/amavis/db chown amavis.amavis /var/amavis/tmp /var/amavis/db chmod 777 �CR /var/amavis chown amavis.amavis /var/spool/vscan/db/ chkconfig --add amavisd
$max_servers = 10; $sa_spam_subject_tag = '[SPAM] '; $mydomain = 'mail.extmail.org'; $myhostname = 'mail.extmail.org'; @local_domains_maps = qw(.); $sa_tag2_level_deflt = 5.0; $sa_kill_level_deflt = 5.0;
$sa_spam_modifies_subj = 0; # don't modify subject $remove_existing_x_scanned_headers= 1; # remove existing headers $remove_existing_spam_headers = 1;
report_safe 1 use_bayes 0 auto_learn 0 bayes_auto_expire 1 skip_rbl_checks 1 use_razor2 0 use_dcc 0 use_pyzor 0 dns_available no
rpm -ivh RPMS/ clamav-db-0.92-2.ext.i386.rpm rpm -ivh RPMS/ clamav-0.92-2.ext.i386.rpm rpm -ivh RPMS/ clamd-0.92-2.ext.i386.rpm
# Path to a local socket file the daemon will listen on. # Default: disabled LocalSocket /var/run/clamav/clamd.sock #TCPSocket 3310
gpasswd -a clamav amavis usermod -G amavis clamav chown amavis.amavis /var/spool/vscan chmod 750 /var/spool/vscan chown amavis.amavis /var/spool/vscan/tmp chmod 750 /var/spool/vscan/tmp
service clamd start freshclam --daemon
['ClamAV-clamd', \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.sock"], qr/\bOK$/, qr/\bFOUND$/, qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],在154行左右,修改投递/拦截的方法:
$final_virus_destiny = D_DISCARD; $final_banned_destiny = D_BOUNCE; $final_spam_destiny = D_PASS; $final_bad_header_destiny = D_PASS;
virusalert: root spam.police: root postfix: [email protected]
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 smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o strict_rfc821_envelopes=yes -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 -o receive_override_options=
# Content-Filter content_filter = smtp:[127.0.0.1]:10024 receive_override_options = no_address_mappings
telnet localhost 25 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 mail.extmail.org ESMTP Postfix - by extmail.org mail from:<[email protected]> 250 2.1.0 Ok rcpt to:<[email protected]> 250 2.1.5 Ok data 354 End data with . X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* . 250 2.0.0 Ok: queued as BC24E85260 quit 221 2.0.0 Bye Connection closed by foreign host.
支持Linux / BSD或Solaris,HP-UX等操作系统 Perl 5.6+,建议Perl 5.8.0以上 Net::DNS POSIX Fcntl Digest::MD5 Digest::SHA1 Digest::HMAC Net::IP
rpm -ivh RPMS/perl-Digest-SHA1-2.07-5.i386.rpm rpm -ivh RPMS/ perl-Digest-HMAC-1.01-2ext.i386.rpm rpm -ivh RPMS/ perl-Net-IP-1.24-2ext.i386.rpm rpm -ivh --nodeps RPMS/perl-Net-DNS-0.57-1hzq.i386.rpm
Starting spam locker daemon: slockd starting child 2908 starting child 2909 08-01 12:34:40 [2908]: Loading APF::Plugin::localctrl 08-01 12:34:40 [2909]: Loading APF::Plugin::localctrl 08-01 12:34:40 [2908]: Loading APF::Plugin::anvil 08-01 12:34:40 [2908]: Loading APF::Plugin::fqdn 08-01 12:34:40 [2909]: Loading APF::Plugin::anvil 08-01 12:34:40 [2908]: Loading APF::Plugin::dnsbl 08-01 12:34:40 [2909]: Loading APF::Plugin::fqdn 08-01 12:34:40 [2909]: Loading APF::Plugin::dnsbl 08-01 12:34:40 [2908]: Loading APF::Plugin::hostname 08-01 12:34:40 [2909]: Loading APF::Plugin::hostname
perl policy_sig -h localhost -p 10030 --helo FOOBAR \ --ip 192.168.0.1 --from [email protected] --to [email protected]
# uncomment the following line if you need to daemonize setsid 1 ## logging log_file /var/log/slockd.log
echo "/usr/local/slockd/slockd-init start" >> /etc/rc.d/rc.local
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_hostname, check_policy_service inet:127.0.0.1:10030
telnet localhost 25 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 mail.extmail.org ESMTP Postfix - by extmail.org helo demo.extmail.org 250 mail.extmail.org mail from:<[email protected]> 250 2.1.0 Ok rcpt to:<[email protected]> 250 2.1.5 Ok data 354 End data with . Subject: Hello World Hello World! . 250 2.0.0 Ok: queued as 3E47685269 quit 221 2.0.0 Bye Connection closed by foreign host.
wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz tar xfz mod_fastcgi-2.4.2.tar.gz cd mod_fastcgi-2.4.2 cp Makefile.AP2 Makefile make top_dir=/etc/httpd install
LoadModule fastcgi_module modules/mod_fastcgi.so <Ifmodule mod_fastcgi.c> FastCgiExternalServer /usr/bin/dispatch.fcgi -host 127.0.0.1:8888 </Ifmodule>
Alias /extmail/cgi/ /usr/bin/dispatch.fcgi/ <Location "/extmail/cgi"> SetHandler fastcgi-script </Location>
echo "/var/www/extsuite/extmail/dispatch-init start" >> /etc/rc.d/rc.local
0人
|
了这篇文章 |
点击图片可刷新验证码请点击后输入验证码博客过2级,无需填写验证码
同时赞一个