« February 2006 | 首页 | May 2006 »
April 30, 2006
《Postfix权威指南》
oreilly_postfix_the_definitive_guide
作者: Kyle D. Dent 著 O'Reilly Taiwan公司 编译
章节目录
序
前言
第一章 简介
Postfix的起源与设计理念
E-mail与Internet
Postfix的角色
Postfix的安全性
如何取得Postfix
第二章 基本概念
Unix的概念
E-mail的概念
第三章 Postfix的结构
Postfix的组件
邮件如何进入Postfix系统
Postfix的队列管理器
投递操作
实际追踪Postfix的邮件处理流程
第四章 基本的配置与管理
第一次启动Postfix
配置文件
重要的考虑事项
管理
master.cf
收信限制
改写地址格式
改变根目录(chroot)
在线说明书
第五章 队列管理
qmgr的运行原理
队列管理工具
第六章 E-mail与DNS
DNS概论
决定邮件路由
Postfix与DNS
常见问题
第七章 本地投递与 POP/IMAP
Postfix的投递代理程序
邮箱格式
本地邮件的投递操作
POP与IMAP
本地邮件传输协议(LMTP)
第八章 虚拟网域
共享网域搭配系统账户
独立网域搭配系统账户
独立网域搭配虚拟账户
虚拟网域搭配特殊格式的邮箱
投递到外部程序
第九章 邮件转发
备用交换器
传输表
入站邮件网关
出站邮件网关
UUCP、传真以及其他投递机制
第十章 邮件列表
简易的邮件列表
邮件列表管理系统
第十一章 反垃圾邮件
垃圾邮件的本质
垃圾邮件的问题
开放转发(Open Relay)
辨别垃圾邮件
反垃圾邮件的措施
Postfix的挡信机制
客户端判别规则
SMTP语法规范参数
内容检查
自定义过滤条件组合
反垃圾邮件实例
第十二章 SASL身份验证
SASL概论
Postfix与SASL
Postfix的SASL配置
测试SASL验证配置
SMTP客户端验证
第十三章 传输层安全协议(TLS)
Postfix与TLS
TLS证书
第十四章 内容过滤
基于命令的过滤
基于守护进程的过滤
其他考虑事项
第十五章 外部数据库
MySQL
LDAP
附录一 配置参数
附录二 Postfix支持工具
附录三 Postfix的编译与安装
附录四 问题集
索引
下载地址 可惜不是中文的,大家先看英文吧,中文书店有买
由 frank 发表于 1:29 PM
April 29, 2006
Courier-IMAP编译出错解决
编译Courier-IMAP的时候,出现以下报错信息:
imaplogin.c:35:32: courierauth.h: 没有那个文件或目录
imaplogin.c:36:37: courierauthdebug.h: 没有那个文件或目录
imaplogin.c:159: warning: `struct authinfo' declared inside parameter list
imaplogin.c:159: warning: its scope is only this definition or declaration, which is probably not what you want
imaplogin.c: In function `login_callback':
imaplogin.c:169: dereferencing pointer to incomplete type
imaplogin.c:170: warning: implicit declaration of function `auth_getoption'
imaplogin.c:170: dereferencing pointer to incomplete type
imaplogin.c:171: warning: assignment makes pointer from integer without a cast
imaplogin.c:175: dereferencing pointer to incomplete type
imaplogin.c:180: dereferencing pointer to incomplete type
imaplogin.c:184: dereferencing pointer to incomplete type
imaplogin.c:199: dereferencing pointer to incomplete type
imaplogin.c:200: dereferencing pointer to incomplete type
imaplogin.c:223: warning: implicit declaration of function `auth_callback_default'
imaplogin.c:227: dereferencing pointer to incomplete type
imaplogin.c:228: dereferencing pointer to incomplete type
imaplogin.c:233: dereferencing pointer to incomplete type
imaplogin.c:233: dereferencing pointer to incomplete type
imaplogin.c:243: dereferencing pointer to incomplete type
imaplogin.c:247: dereferencing pointer to incomplete type
imaplogin.c:251: dereferencing pointer to incomplete type
imaplogin.c:252: dereferencing pointer to incomplete type
imaplogin.c: In function `do_imap_command':
imaplogin.c:281: warning: implicit declaration of function `courier_authdebug_login'
imaplogin.c:375: warning: implicit declaration of function `auth_login'
imaplogin.c:376: warning: implicit declaration of function `courier_safe_printf'
imaplogin.c: In function `main':
imaplogin.c:454: warning: implicit declaration of function `courier_authdebug_login_init'
imaplogin.c: In function `login_imap':
imaplogin.c:599: warning: implicit declaration of function `DPRINTF'
make[3]: *** [imaplogin.o] Error 1
make[3]: Leaving directory `/root/soft/postfix/courier-imap-4.1.0/imap'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/soft/postfix/courier-imap-4.1.0/imap'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/soft/postfix/courier-imap-4.1.0'
make: *** [all] Error 2
google寻找了一圈,没有实质性的答案,不过仔细看了编译出错的,很快就找到解决办法,就是在预编译的时候加 CPPFLAGS='-I/usr/local/courier-authlib/include'
那完整的编译参数是
./configure --prefix=/usr/local/courier-imap --with-redhat --enable-unicode --disable-root-check --with-trashquota --without-ipv6 \
CPPFLAGS='-I/usr/local/courier-authlib/include' \
COURIERAUTHCONFIG='/usr/local/courier-authlib/bin/courierauthconfig'
April 24, 2006
squid快速编译安装
去http://www.squid-cache.org/下载最新的tar包
编译:
./configure
--exec_prefix=/usr/local/squid
--bindir=/usr/sbin
--libexecdir=/usr/lib/squid
--sysconfdir=/etc/squid
--enable-poll
--enable-snmp
--enable-removal-policies="heap,lru"
--enable-storeio="aufs,coss,diskd,null,ufs"
--enable-ssl
--with-openssl=/usr/kerberos
--enable-delay-pools
--enable-linux-netfilter
--with-pthreads --enable-auth="basic"
--with-winbind-auth-challenge
--enable-useragent-log
--enable-referer-log
--disable-dependency-tracking
--enable-cachemgr-hostname=localhost
--disable-ident-lookups
--enable-truncate
--enable-underscores
--datadir=/usr/share/squid
--enable-basic-auth-helpers="NCSA"
--enable-err-language="Simplify_Chinese"
--enable-default-err-language="Simplify_Chinese"
make
make install
安装完毕后,修改目录权限,默认是以"nobody"用户运行squid.所以我们要为/usr/local/squid/var 设置相应的权限,否则会报以下错误
FATAL: Failed to make swap directory /usr/local/squid/var/cache: (13) Permission denied
Squid Cache (Version 2.5.STABLE13): Terminated abnormally.
CPU Usage: 0.000 seconds = 0.000 user + 0.000 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 4
或者以下错误
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
最简单的处理办法就是
chown -R nobody:nobody /usr/local/squid/var
ok,生成缓存目录
/usr/local/squid/sbin/squid -z
然后启动squid,测试一下是否成功
/usr/local/squid/sbin/squid -NCd1
默认端口是3128,用ie测试一下,如果能看到中文的拒绝访问错误提示,就说明安装正确,并且已经使用.
以后就可以直接/usr/local/squid/sbin/squid & 后台运行即可,当然怎么配置,我这里不讲了
April 12, 2006
qmail中的几个error的产生的原因和解决方法
qmail中的几个error的产生的原因和解决方法
1 deferral: Unable_to_chdir_to_maildir._(#4.2.1)
这个是qmail找不到用户的收信目录所致。如果你是用vpopmail的虚拟域名来管理的,那看看你的control/locals文件,里面不能有虚拟域名,只能有实际域名(这个实际域名的意思应该是使用系统用户作为用户的域,而不是使用vpopmail的虚拟用户的域)。因此呢,如果不是用vpopmail,那么可能是系统用户的目录权限设置不正确。
如果发生这个错误,首先保证你没有对user/assign做过手动修改,添加域名都是使用vpopmail的vadddomin命令来添加的,没有修改过~vopmail/domins目录以及其下面目录的权限和属主,然后修改了locals文件之后重启应该就没有问题了。
2 deferral: Uh-oh:_.qmail_has_prog_delivery_but_has_x_bit_set._(#4.7.0)
这个是因为你的.qmail文件设置了x属性,把.qmail文件的x去掉就ok了。这个.qmail文件就在你的domins/xxx.com下面,包括比如.qmail-default之类的文件,修改一下权限,去掉x就ok了。
3 454 oops, unable to write pipe and I can't auth (#4.3.0)
这个错误是在你打了smtp auth的补丁之后,却发现不能正常auth,输入了正确的用户名密码还是提示不正确。可以通过下面的命令来测试。
[root@caph qmail-smtpd]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 xxx.com ESMTP
ehlo
250-xxx.com
250-PIPELINING
250-8BITMIME
250-SIZE 104857600
250 AUTH LOGIN PLAIN CRAM-MD5 //显示这个通常表示你已经打好了补丁,不过这个是可以通过修改qmail-smtp.c文件来定制的。
auth login
334 VXNlcm5hbWU6
awefaq23rasdf
334 UGFzc3dvcmQ6
awefwaef
454 oops, unable to write pipe and I can't auth (#4.3.0)
quit
221 xxx.com
Connection closed by foreign host.
出现了这种问题是因为smtp运行脚本没有设置正确的用户所致。将你的smtp的tcpserver命令的运行用户和组指定一下。
QMAILDUID=`id -u vpopmail`
QMAILDGID=`id -g vpopmail`
/usr/local/bin/tcpserver -v -H -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD"
-u "$QMAILDUID" -g "$QMAILDGID" 0 smtp /usr/local/bin/rblsmtpd -r relays.ordb.org
/var/qmail/bin/qmail-smtpd
/home/vpopmail/bin/vchkpw /bin/true /bin/cmd5checkpw /bin/true 2>&1
不需要修改~vpopmail/bin/vchkpw的属性。
4 451 qq write error or disk full (#4.3.0)
通常产生这个可能有2个原因:(1)你的qmail queue所在的磁盘空间不足。(2)qmail-queue的权限设置不正确或者文件有问题。
错误信息:the smtp server reply:qq crashed (#5.1.1)
修改stmp启动脚本,改大smtp的softlimit
Sorry. Although I'm listed as a best-preference MX or A for that host,it isn't in my control/locals file, so I don't treat it as local. (#5.4.6)
修改源码:ipme.c
ip_scan("0.0.0.0",&ix.ip);--92行左右加进
if (!ipalloc_append(&ipme,&ix)) { close(moreipme_fd); return 0; }
在邮件队列中快速删除从一个地方发过来但又不存在的邮件?
A:
设bad.jite.com是这个域。可以键入以下命令
echo # > ~alias/.qmail-baddomain-default
echo bad.jite.com:alias-baddomain>> /var/qmail/control/virtualdomains
echo bad.jite.com:127.0.0.1 >> /var/qmail/control/smtproutes
然后运行/var/qmail/bin/qmail-tcpok,给qmail-send 一个HUP信号
解决qmail经常收到来至<#@[]>这样的邮件!
首先说明一下<>和<#@[]>都是系统bouce信件信封(envelope)上的寄信人地址
这两种信都是系统产生的,区别在于<>往往是系统single bouce的地址,而<#@[]>则是系统double bounces或者triple bouces的地址
系统用这两种地址是为了避免邮件回路(mail loops)
来自<#@[]>一般都是系统的double bounces
要去掉这些double bounces可以有一种简单的办法
其原理是产生一个nobody的地址,发往这里的信件都会被丢弃,这样double bouces就不会烦你的postmaster了
具体步骤如下:
echo # > /var/qmail/alias/.qmail-nobody
echo nobody > /var/qmail/control/doublebounceto
April 8, 2006
近期学习计划
好久没学习了,技术荒废了不少,连blog都懒得写,直接就用mail搞定msn的space,咳!咋整?
在技术论坛逛了一下,又发现了好多新东西,其实也不新,就是自己老不学习,索性计划了一下准备研究以下技术。
Nagios
http://www.nagios.org/
同时,对Splunk也有浓厚兴趣,下面这个地址是Nagios和Splunk的联合使用介绍
http://www.nagios.org/products/enterprisesolutions/splunk/
extmail
http://extmail.org
Extmail 是一个以perl语言编写,面向大容量/ISP级应用,免费的高性能Webmail软件。它以GPL版权释出,设计初衷是希望设计一个适应当前高速发展的IT应用环境,满足用户多变的需求,能快速进行开发、改进和升级,适应能力强的webmail系统。
Extmail还被设计成一个能够替代目前国内外一些主流webmail软件的系统,例如:SqWebMail,OpenWebmail及squirrel,Igenus等。
OPENVPN http://openvpn.net
SmoothWall http://www.smoothwall.org/
SmoothWall是欧洲成功的Open Source项目之一,它可以帮助你把一台已经淘汰的386,486机器变成一台功能强大,稳定的防火抢路由器!
嘿嘿,最近有的玩了:)
由 frank 发表于 5:43 AM