Chinaunix

标题: 原创:在RHEL 4 上配置全功能的Postfix 服务器 [打印本页]

作者: anthonyfeng    时间: 2005-12-20 14:08
标题: 原创:在RHEL 4 上配置全功能的Postfix 服务器
在RHEL 4 上配置全功能的Postfix 服务器

文档版本:0.2
文档日志:
2005-12-17 至 12-20 初稿完成,首次公开

作者:Tony Feng
邮件:tonyfeng@yahoo.com

简介
本文讲述在安装了Redhat Enterprice AS 4 U2的PC上,配置一台Postfix邮件服务器的过程。实现虚拟域、虚拟用户、POP3、POP3S、SMTP、SMTPS、IMAP、IMAPS、防毒、防SPAM、网页邮件功能。



涉及的软件
1.        Redhat Enterprice AS 4 U2
2.        Mysql
系统自带
用于存储虚拟域、虚拟用户等信息。
3.        Apache
系统自带
运行网页邮件SquirrelMail和PostfixAdmin时使用。
4.        PHP
系统自带
运行网页邮件SquirrelMail和PostfixAdmin时使用。
5.        Cyrus-sasl
系统自带
实现带验证的SMTP时使用。
6.        Courier authentication library
http://www.courier-mta.org/ 下载
实现带验证的SMTP时使用。
7.        Postfix
http://postfix.org 下载
一个MTA,虽然RHEL 4 自带Postfix,但因为其不支持SSL及Mysql,所以我们需要自行编译。
8.        PostfixAdmin
http://postfixadmin.com/ 下载
虚拟域、虚拟用户等信息是放在Mysql内的,安装PostfixAdmin后,就可以用浏览器管理这些信息。
9.        SquirrelMail
系统自带
一个基于IMAP的Webmail客户端。
10.        Dovecot
系统自带
提供POP3,POP3S,IMAP,IMAPS功能。
11.        F-prot
http://www.f-prot.com 下载,Linux workstation 版个人使用是免费的
提供杀毒功能,据闻速度和病毒库比开源的Clamav好。
12.        SpamAssassin
系统自带
提供过滤垃圾邮件功能。
13.        MailScanner
http://www.sng.ecs.soton.ac.uk/mailscanner/ 下载
Postfix 是使用MailScanner 调用f-prot 与SpamAssassin,或者其它调用方法效率更好,但MailScanner配置比较直观,且最近拿了一个大奖 http://www.linuxawards.co.uk/content/view/26/42/



配置过程
1.        基本软件安装
安装RHEL 4 U2,使用默认安装,语系为简体中文。关闭SE Linux,配置网卡,使其能访问Internet。进入X window,开始->系统设置->添加/删除应用程序,安装上文中提及“系统自带”的软件,包括:
万维网服务器:mysql & php 相关的
邮件服务器:SquirrelMail perl-cyrus
SQL 数据库:全部。
下载其它需要的软件。

2.        配置PostfixAdmin、Mysql、Apache
[root@localhost tmp]# tar xzf postfixadmin-2.1.0.tgz
[root@localhost tmp]# mv postfixadmin-2.1.0 /var/www/html/pa
[root@localhost tmp]# service mysqld start
[root@localhost tmp]# mysql -uroot < /var/www/html/pa/DATABASE_MYSQL.TXT
[root@localhost tmp]# cp /var/www/html/pa/config.inc.php.sample  /var/www/html/pa/config.inc.php
[root@localhost tmp]# service httpd start

打开浏览器访问 http://localhost/pa,然后按提示增加两个虚拟域名d1.com 和 d2.com,增加两个虚拟用户a@d1.comb@d2.com

设置Mysql和Apache自动启动
[root@localhost tmp]# chkconfig --level 35 mysqld on
[root@localhost tmp]# chkconfig --level 35 httpd on

3.        编译、配置Postfix
先删除sendmail
[root@localhost tmp]# rpm –e sendmail –nodeps
[root@localhost tmp]# groupadd postfix
[root@localhost tmp]# groupadd postdrop
[root@localhost tmp]#useradd postfix -g postfix -c "Postfix user" -d /dev/null -s /sbin/nologin
[root@localhost tmp]# tar xzf postfix-2.2.7.tar.gz
[root@localhost tmp]# cd postfix-2.2.7
[root@localhost postfix-2.2.7]# make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_TLS -DUSE_SASL_AUTH -I/usr/include/sasl' 'AUXLIBS=-L/usr/lib/mysql -lmysqlclient -lz -lm -L/usr/lib -lssl -lcrypto -lsasl2'
[root@localhost postfix-2.2.7]# make
[root@localhost postfix-2.2.7]# make install
注:“make install”命令后的所有问题都直接敲回车键即可。

编辑/etc/postfix/main.cf 为以下内容
#=====================BASE=========================
myhostname = mail.d1.com
mydomain = d1.com
myorigin = $mydomain
mydestination = $myhostname localhost localhost.$mydomain
mynetworks = 192.168.1.0/24 127.0.0.0/8
inet_interfaces = all
#=====================Vritual Mailbox settings=========================
virtual_mailbox_base = /var/spool/mail
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_uid_maps = static:501
virtual_gid_maps = static:502
virtual_transport = virtual
maildrop_destination_recipient_limit = 1
maildrop_destination_concurrency_limit = 1
#====================QUOTA========================
message_size_limit = 14336000
virtual_mailbox_limit = 20971520
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.
virtual_overquota_bounce = yes
#====================SASL========================
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unauth_pipelining,reject_unauth_destination,permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_sasl_application_name = smtpd
smtpd_banner=$myhostname ESMTP "Version not Available"

readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
html_directory = no
setgid_group = postdrop
command_directory = /usr/sbin
manpage_directory = /usr/local/man
daemon_directory = /usr/libexec/postfix
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
queue_directory = /var/spool/postfix
mail_owner = postfix

编辑/etc/postfix/ mysql_virtual_alias_maps.cf 为以下内容
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = alias
select_field = goto
where_field = address

编辑/etc/postfix/ mysql_virtual_domains_maps.cf 为以下内容
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = domain
select_field = description
where_field = domain

编辑/etc/postfix/ mysql_virtual_mailbox_limit_maps.cf 为以下内容
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox
select_field = quota
where_field = username

编辑/etc/postfix/ mysql_virtual_mailbox_maps.cf 为以下内容
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox
select_field = maildir
where_field = username



4.        配置SMTP 认证
编辑 /usr/lib/sasl2/smtpd.conf 为以下内容
pwcheck_method: authdaemond
log_level: 3
mech_list: plain login
authdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket

安装Courier authentication library
[root@localhost tmp]# tar jxf courier-authlib-0.58.tar.bz2
[root@localhost tmp]# cd courier-authlib-0.58
[root@localhost courier-authlib-0.58]# ./configure --prefix=/usr/local/courier-authlib --without-authpam --without-authldap --without-authpwd --without-authshadow --without-authvchkpw --without-authpgsql  --with-authmysql --with-mysql-libs=/usr/lib/mysql --with-mysql-includes=/usr/include/mysql --with-redhat  --with-authmysqlrc=/usr/local/courier-authlib/etc/authmysqlrc  --with-authdaemonrc=/usr/local/courier-authlib/etc/authdaemonrc CFLAGS="-march=i686 -O2 -fexpensive-optimizations" CXXFLAGS="-march=i686 -O2 -fexpensive-optimizations"
[root@localhost courier-authlib-0.58]# make
[root@localhost courier-authlib-0.58]# make install
[root@localhost courier-authlib-0.58]# chmod 755 /usr/local/courier-authlib/var/spool/authdaemon
[root@localhost courier-authlib-0.58]# cp /usr/local/courier-authlib/etc/authdaemonrc.dist /usr/local/courier-authlib/etc/authdaemonrc

修改/usr/local/courier-authlib/etc/authdaemonrc 文件
authmodulelist="authmysql"
authmodulelistorig="authmysql"
daemons=10

编辑/usr/local/courier-authlib/etc/authmysqlrc 为以下内容,其中501,502 为postfix 用户的UID和GID。
MYSQL_SERVER         localhost
MYSQL_USERNAME       postfix
MYSQL_PASSWORD       postfix
MYSQL_SOCKET         /var/lib/mysql/mysql.sock
MYSQL_DATABASE       postfix
MYSQL_USER_TABLE     mailbox
MYSQL_CRYPT_PWFIELD   password
MYSQL_UID_FIELD       '501'
MYSQL_GID_FIELD       '502'
MYSQL_LOGIN_FIELD     username
MYSQL_HOME_FIELD     concat('/var/spool/mail/',maildir)
MYSQL_MAILDIR_FIELD   concat('/var/spool/mail/',maildir)
MYSQL_NAME_FIELD     name

# cp courier-authlib.sysvinit /etc/init.d/courier-authlib
# chmod 755 /etc/init.d/courier-authlib
# chkconfig --add courier-authlib
# chkconfig --level 35 courier-authlib on
手动启动服务:
# service courier-authlib start

此时你已经拥有一台带验证的SMTP 服务器,用Outlook 、Foxmail测试一下吧,用户名采用usename@domainName.com 形式。
作者: anthonyfeng    时间: 2005-12-20 14:09
5.        增加SSL功能,配置SMTPS服务
在/etc/postfix/main.cf 增加以下内容
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/ssl/smtpd.pem
smtpd_tls_cert_file = /etc/ssl/smtpd.pem
smtpd_tls_CAfile = /etc/ssl/smtpd.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

生成证书
# mkdir /etc/ssl
# cd /etc/ssl
# openssl req -new -x509 -nodes -out smtpd.pem -keyout smtpd.pem -days 3650

重新启动postfix
# postfix reload

这时SMTPS功能应该能正常工作了。有能力测试的网友们请验证一下这功能,因为使用SMTPS + Outlook 时有一错误提示。



6.        配置Dovecot,增加IMAP,IMAPS,POP3,POP3S功能
由于Dovecot 是系统自带的,配置两个文件,再生成证书就可以了。

编辑 /etc/dovecot.conf 为以下内容
base_dir = /var/run/dovecot/
protocols = imap imaps pop3 pop3s
imap_listen = [::]
pop3_listen = [::]
ssl_disable = no
ssl_cert_file = /etc/ssl/certs/imapd.pem
ssl_key_file = /etc/ssl/private/imapd.pem
ssl_parameters_file = /var/run/dovecot/ssl-parameters.dat
login_dir = /var/run/dovecot-login
login = imap
login = pop3
mbox_locks = fcntl
auth = default
auth_mechanisms = plain
auth_userdb = passwd
auth_user = root
default_mail_env = maildir:/var/spool/mail/%u/
auth_userdb = mysql /etc/dovecot-mysql.conf
auth_passdb = mysql /etc/dovecot-mysql.conf
first_valid_uid = 501

编辑 /etc/dovecot-mysql.conf 为以下内容
db_host = localhost
db_port = 3306
db_unix_socket = /var/lib/mysql/mysql.sock
db = postfix
db_user = postfix
db_passwd = postfix
db_client_flags = 0
default_pass_scheme = PLAIN-MD5
password_query = SELECT password FROM mailbox WHERE username = '%u'
user_query = SELECT maildir, 501 AS uid, 502 AS gid FROM mailbox WHERE username = '%u'

生成证书
# mkdir /etc/ssl/certs
# mkdir /etc/ssl private
# cd /usr/share/doc/dovecot-0.99.11/
# sh mkcert.sh

启动Dovecot 服务
# service dovecot start
# chkconfig --level 35 dovecot on

顺利的话,此时SMTP、SMTPS、POP3、POP3S已经配置完成。



7.        配置SquirrelMail网页邮件
很简单,用浏览器访问 http://localhost/webmail



8.        配置杀毒、过滤SPAM功能
如果你打算将杀毒、过滤SPAM功能安排在各个客户端,以下是不必要操作的。

安装f-prot
http://files.f-prot.com/files/linux-x86/fp-linux-ws.rpm 下载
# rpm -ivh fp-linux-ws.rpm

启动SpamAssassin
# service spamassassin start
# chkconfig --level 35 spamassassin on

安装、配置MailScanner
# tar xzf MailScanner-4.48.4-2.rpm.tar.gz
# cd MailScanner-4.48.4-2
# ./install.sh

修改 /etc/MailScanner/MailScanner.conf
Run As User = postfix
Run As Group = postfix
Incoming Queue Dir = /var/spool/postfix/hold
Outgoing Queue Dir = /var/spool/postfix/incoming
MTA = postfix
Virus Scanners = f-prot
Always Include SpamAssassin Report = yes
Use SpamAssassin = yes
Required SpamAssassin Score = 4
SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin
SpamAssassin Install Prefix = /usr/bin
SpamAssassin Local Rules Dir = /etc/MailScanner

让Postfix 调用MailScanner,在/etc/postfix/main.cf 加入以下一行
header_checks = regexp:/etc/postfix/header_checks

编辑/etc/postfix/header_checks 为以下内容
/^Received:/ HOLD

修正权限
# chown postfix.postfix /var/spool/MailScanner/incoming
# chown postfix.postfix /var/spool/MailScanner/quarantine

启用
# postfix stop
# service MailScanner start
# chkconfig --level 35 MailScanner on

注:MailScanner 会自动启动Postfix。

测试SpamAssassin
发一封邮件带如下内容,接收后,标题应该带有标记:
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X

测试f-prot
升级病毒库:
# /usr/local/f-prot/tools/check-updates.pl
访问http://www.webmail.us/testvirus,申请寄一封带virus 的邮件寄到自己的邮箱


9.        如果上面的操作顺利,整个配置完成



其它补充
在应用在生产环境前,请重新检查各个软件的配置文件,进行完整的测试,有发现请联系笔者,谢谢!


主要参考文档
http://bbs.chinaunix.net/viewthread.php?tid=640481
http://anti-spam.org.cn/forums/i ... topic=3357&st=0
作者: kaka_sun    时间: 2005-12-20 18:11
请问,您是用了多长时间配置完的
作者: anthonyfeng    时间: 2005-12-20 18:15
很遗憾,近两个星期,搞SMTP 时认证花了太多时间。

[ 本帖最后由 anthonyfeng 于 2005-12-20 18:17 编辑 ]
作者: xmy    时间: 2005-12-20 21:21
很不错啊
作者: anthonyfeng    时间: 2005-12-20 22:44
谢谢!不知几时可以加精。
作者: 王仙客    时间: 2005-12-20 23:17
呵呵,楼主,不知道可否转载呢?的确不错啊。
作者: fandy    时间: 2005-12-21 10:30
请问anthonyfeng大大,如果不增加SSL功能的情况下,那/etc/dovecot.conf又是什么样的配置啦!希望大大能指导一下小弟,真的好高兴可以见到您的那样精彩的文章!
作者: anthonyfeng    时间: 2005-12-21 11:12
王仙客:当然可以转载,保持完整就可以了,谢谢!
作者: anthonyfeng    时间: 2005-12-21 11:14
如果不需要SSL ,修改
protocols = imap pop3

以下应该要删除
ssl_disable = no
ssl_cert_file = /etc/ssl/certs/imapd.pem
ssl_key_file = /etc/ssl/private/imapd.pem
ssl_parameters_file = /var/run/dovecot/ssl-parameters.dat
作者: yijiande    时间: 2005-12-25 18:48
谢谢!已经解决!
各位:
我是一个新手,在安装时,进行Make 时,出现如下错误,不知道是什么原因?请大家帮忙解决。谢谢!

make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_TLS -DUSE_SASL_AUTH -I/usr/include/sasl' 'AUXLIBS=-L/usr/lib/mysql -lmysqlclient -lz -lm -L/usr/lib -lssl -lcrypto -lsasl2'
make -f Makefile.in MAKELEVEL= Makefiles
(echo "# Do not edit -- this file documents how Postfix was built for your machine."; /bin/sh makedefs) >makedefs.tmp
No <db.h> include file found.
Install the appropriate db*-devel package first.
See the RELEASE_NOTES file for more information.
make: *** [Makefiles] Error 1
make: *** [makefiles] Error 2

[ 本帖最后由 yijiande 于 2005-12-25 21:18 编辑 ]
作者: anthonyfeng    时间: 2005-12-25 22:01
No <db.h> include file found.
Install the appropriate db*-devel package first.

大概是db4-devel-4.2.52-7.1  没有安装吧
作者: yijiande    时间: 2005-12-25 22:25
楼主请查一下下面的命令是不否对
rpm –e sendmail –nodeps
好像是
rpm –e sendmail ––nodeps
作者: anthonyfeng    时间: 2005-12-26 11:39
是的,是错了,原因是ms word 自动把-- 变成 -,谢谢!
作者: yijiande    时间: 2005-12-26 21:39
标题: 请教:smtp及认证问题
以下是我配置的POSTFIX日志,我刚完成第4步,但是测试时出现如下错误,请各位帮我分析一下,问题出在哪里,谢谢。
Dec 26 22:57:20 mail postfix/smtpd[3780]: connect from unknown[192.168.1.3]
Dec 26 22:57:20 mail postfix/smtpd[3780]: 8EEAF27EE3: client=unknown[192.168.1.3
]
Dec 26 22:57:20 mail postfix/cleanup[3785]: 8EEAF27EE3: message-id=<200512261457
20.8EEAF27EE3@mail.d1.com>
Dec 26 22:57:20 mail postfix/qmgr[3778]: 8EEAF27EE3: from=<a@d1.com>, size=714,
nrcpt=1 (queue active)
Dec 26 22:57:20 mail postfix/virtual[3787]: 8EEAF27EE3: to=<a@d1.com>, relay=vir
tual, delay=0, status=deferred (maildir delivery failed: create /var/spool/mail/
a@d1.com/tmp/1135609040.P3787.mail.home.net: Permission denied)
Dec 26 22:57:20 mail postfix/virtual[3787]: warning: maildir access problem for
UID/GID=501/501: create /var/spool/mail/a@d1.com/tmp/1135609040.P3787.mail.home.
net: Permission denied
Dec 26 22:57:20 mail postfix/virtual[3787]: warning: perhaps you need to create
the maildirs in advance
Dec 26 22:57:20 mail postfix/smtpd[3780]: disconnect from unknown[192.168.1.3]
作者: anthonyfeng    时间: 2005-12-26 22:33
请检查/var/spool/mail 文件夹权限,看postfix 用户是否有rwx 权限。
执行chown postfix.postfix /var/spool/mail -R 应该可以解决

或:/etc/postfix/main.cf 内的
virtual_uid_maps = static:501
virtual_gid_maps = static:502

501,502 为我的postfix 用户的uid,gid
如果解决了请打个招呼。

[ 本帖最后由 anthonyfeng 于 2005-12-26 22:40 编辑 ]
作者: yijiande    时间: 2006-01-01 21:02
谢谢!!!应该是/var/spool/mail 文件夹权限问题,问一下,我的postfix的uid,gid都是501,而502是postdrop(这个组中没有成员),不知道做什么用的。请教一下。
另外想问一下,如何在文本方式中得到现系统中已经存在的用户及其组的资料呢?
现在日志如下应该是可以了吧。


Jan  1 21:08:22 mail postfix/virtual[4380]: EE94927EE5: to=<a@d1.com>, relay=virtual, delay=86
265, status=sent (delivered to maildir)
Jan  1 21:08:22 mail postfix/qmgr[2486]: EE94927EE5: removed
Jan  1 21:08:22 mail postfix/virtual[4380]: 7100527EEB: to=<a@d1.com>, relay=virtual, delay=86
264, status=sent (delivered to maildir)
Jan  1 21:08:22 mail postfix/qmgr[2486]: 7100527EEB: removed
Jan  1 21:08:22 mail postfix/virtual[4380]: 0062E27EED: to=<a@d1.com>, relay=virtual, delay=19
999, status=sent (delivered to maildir)
Jan  1 21:08:22 mail postfix/qmgr[2486]: 0062E27EED: removed
Jan  1 21:08:22 mail postfix/virtual[4380]: 0FCAD27EEE: to=<a@d1.com>, relay=virtual, delay=19
999, status=sent (delivered to maildir)
Jan  1 21:08:22 mail postfix/qmgr[2486]: 0FCAD27EEE: removed
作者: yijiande    时间: 2006-01-01 21:19
配置Dovecot时,发现现在配置中的auth_userdb及auth_user共出现两次,有重复情况,请对一下。谢谢!!!

auth = default
auth_mechanisms = plain
auth_userdb = passwd
auth_user = root
default_mail_env = maildir:/var/spool/mail/%u/
auth_userdb = mysql /etc/dovecot-mysql.conf
auth_passdb = mysql /etc/dovecot-mysql.conf
first_valid_uid = 501
作者: yijiande    时间: 2006-01-01 21:34
楼主请再请教一下,我在启动Dovecot,会出现如下错误提示,不知道怎么回事?
真是谢谢楼主帮忙!!!新年快乐!!!
service dovecot start
Starting Dovecot Imap: Fatal: Unknown protocol                                                           [FAILED]



后来我把/etc/dovecot.conf 重新修改了下,也没有动什么,不知道怎么就不会报如上错误了。但是在客户端收信时总是通不过认证,日志如下,说我的MYSQL连接失败,我看过了,MYSQL的服务是好的,不知道怎么回事了。请帮我分析一下,谢谢!
Jan  1 22:24:13 mail dovecot: Dovecot starting up
Jan  1 22:24:14 mail dovecot-auth: MySQL: connected to localhost
Jan  1 22:24:58 mail pop3-login: Login: a@d1.com [::ffff:192.168.1.3]
Jan  1 22:24:58 mail pop3(a@d1.com): Failed to create storage with data: ldir:/var/spool/mail/a@d1.com/
Jan  1 22:24:58 mail dovecot: child 3483 (pop3) returned error 89
Jan  1 22:25:12 mail pop3-login: Disconnected [::ffff:192.168.1.3]

[ 本帖最后由 yijiande 于 2006-1-1 22:27 编辑 ]
作者: fandy    时间: 2006-01-02 10:03
请问tonyfeng大大

可不可以将以下的内容更改为:

MYSQL_UID_FIELD     '501'
MYSQL_GID_FIELD     '502'
更改为:
MYSQL_UID_FIELD     'postfix'
MYSQL_GID_FIELD     'postfix'


我提出以上问题的原因为我在建立:


[root@localhost tmp]# groupadd postfix
[root@localhost tmp]# groupadd postdrop
[root@localhost tmp]#useradd postfix -g postfix -c "Postfix user" -d /dev/null -s /sbin/nologin

的ID好像不是501和502啊!

也不知道使用什么样的命令来查询他们的ID!

请大大指导一下!
作者: anthonyfeng    时间: 2006-01-02 12:13
那种改法我亦没有试过,所以不了解。
运行下面的就知道其UID,GID

grep postfix /etc/passwd
作者: fandy    时间: 2006-01-02 13:35
还有一个问题就是在/etc/dovecot.conf文件下:

auth_userdb = passwd(这一句代表什么意思)
auth_user = root
default_mail_env = maildir:/var/spool/mail/%u/
auth_userdb = mysql /etc/dovecot-mysql.conf (这一句代表什么意思)

不知道大大可不可以再解答一下啦!多谢!
作者: anthonyfeng    时间: 2006-01-02 15:14
那两句auth_userdb重复了,auth_userdb = passwd 是不适用于本例的,可以删除,其含意是用系统用户作pop3 用户

auth_userdb = mysql /etc/dovecot-mysql.conf 含意是使用MySQL作用户名校验,操作MySQL所需的信息在/etc/dovecot-mysql.conf
作者: yijiande    时间: 2006-01-02 15:31
已经解决是,我的配置文件写错了,更正就好了。谢谢!!!

楼主,我在运行SquirrelMail网页邮件登入后,出现如下错误提示,说IMAP问题,不明白,请教一下,谢谢。
ERROR:  
ERROR : Connection dropped by imap-server.
Query: CAPABILITY


我的日志是:
Jan  2 15:20:18 mail authdaemond: modules="authmysql", daemons=10
Jan  2 15:20:18 mail authdaemond: Installing libauthmysql
Jan  2 15:20:19 mail authdaemond: Installation complete: authmysql
Jan  2 15:19:07 mail postfix/sendmail[2448]: fatal: flush queue mode requires no
recipient
Jan  2 15:19:08 mail postfix/postfix-script: starting the Postfix mail system
Jan  2 15:19:08 mail postfix/master[2475]: daemon started -- version 2.2.7, conf
iguration /etc/postfix
Jan  2 15:25:58 mail dovecot: Dovecot starting up
Jan  2 15:25:59 mail dovecot-auth: MySQL: connected to localhost
Jan  2 15:26:51 mail imap-login: Disconnected [::ffff:127.0.0.1]
Jan  2 15:27:00 mail imap-login: Login: a@d1.com [::ffff:127.0.0.1]
Jan  2 15:27:00 mail imap(a@d1.com): Failed to create storage with data: ldir:/v
ar/spool/mail/a@d1.com/
Jan  2 15:27:00 mail dovecot: child 3174 (imap) returned error 89
Jan  2 15:27:42 mail imap-login: Login: a@d1.com [::ffff:127.0.0.1]
Jan  2 15:27:42 mail imap(a@d1.com): Failed to create storage with data: ldir:/v
ar/spool/mail/a@d1.com/
Jan  2 15:27:42 mail dovecot: child 3176 (imap) returned error 89

[ 本帖最后由 yijiande 于 2006-1-2 16:04 编辑 ]
作者: anthonyfeng    时间: 2006-01-02 16:24
根据这一句
Jan  2 15:27:00 mail imap(a@d1.com): Failed to create storage with data: ldir:/v
ar/spool/mail/a@d1.com/

有可能是/etc/dovecot-mysql.conf 501,502 之类的设置没有搞好,或/var/spool/mail 权限不正确,运行
# chown postfix.postfix /var/spool/mail -R

建议先测试pop3 是否正常。

[ 本帖最后由 anthonyfeng 于 2006-1-2 19:53 编辑 ]
作者: yijiande    时间: 2006-01-02 16:52
请教一下,楼主,我基本上完成。但是有一个问题。我在d1.com上建立了两个帐号,分别是a和b,我用这个两个对发邮件,用FOXMAIL,但是发现在发信的时候SMTP上的认证要去掉才行,如打上认证的话,就会失败,不知道,怎么回事?
作者: anthonyfeng    时间: 2006-01-02 19:02
发给yahoo.com 之类的mail box 有错误吗?
很可能是authlib 设置不正确,你运行下面的看一下:

# cd /usr/local/courier-authlib/sbin
# ./authtest a@d1.com
Authentication succeeded.

     Authenticated: a@d1.com  (uid 501, gid 502)
    Home Directory: /var/spool/mail/a@d1.com/
           Maildir: /var/spool/mail/a@d1.com/
             Quota: (none)
Encrypted Password: $1$117dec81$gkX1cdZlkJZy3surMCFAS0
Cleartext Password: (none)
           Options: (none)
作者: anthonyfeng    时间: 2006-01-02 19:14
因为是抄回来的,postdrop 组有什么用我亦不太了解,可能编译、安装postfix 时需要吧。
在x window 内运行system-config-users 可以了解所有系统用户。

原帖由 yijiande 于 2006-1-1 21:02 发表
谢谢!!!应该是/var/spool/mail 文件夹权限问题,问一下,我的postfix的uid,gid都是501,而502是postdrop(这个组中没有成员),不知道做什么用的。请教一下。
另外想问一下,如何在文本方式中得到现系统中已经存 ...

作者: anthonyfeng    时间: 2006-01-02 19:21
另说一下本例中有一个功能是缺失的,就是用户不能自行修改密码。参考下面的文章有相关的教程:

http://anti-spam.org.cn/forums/i ... topic=3357&st=0
作者: fandy    时间: 2006-01-02 20:04
为什么使用以下的命令时会出现以下的情况:

[root@ldap ~]# telnet localhost 25
Trying 127.0.0.1...
Connected to ldap.easy.com (127.0.0.1).
Escape character is '^]'.
ehlo localhost

然后就没有反应啦!


/var/spool/mail 权限我已经做好啦!

日志为:

[root@ldap ~]# tail /var/log/maillog
Jan  2 20:23:29 ldap postfix/master[3482]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Jan  2 20:24:29 ldap postfix/smtpd[3489]: fatal: open database /etc/aliases.db: No such file or directory
Jan  2 20:24:30 ldap postfix/master[3482]: warning: process /usr/libexec/postfix/smtpd pid 3489 exit status 1
Jan  2 20:24:30 ldap postfix/master[3482]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Jan  2 20:25:30 ldap postfix/smtpd[3553]: fatal: open database /etc/aliases.db: No such file or directory
Jan  2 20:25:31 ldap postfix/master[3482]: warning: process /usr/libexec/postfix/smtpd pid 3553 exit status 1
Jan  2 20:25:31 ldap postfix/master[3482]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Jan  2 20:26:31 ldap postfix/smtpd[3554]: fatal: open database /etc/aliases.db: No such file or directory
Jan  2 20:26:32 ldap postfix/master[3482]: warning: process /usr/libexec/postfix/smtpd pid 3554 exit status 1
Jan  2 20:26:32 ldap postfix/master[3482]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling

再运行以下的命令时以下:

# postmap -q a@easy.com mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf

[root@ldap ~]# postmap -q a@easy.com mysql:/etc/postfix/mysql_virtual_mailbox_ma
ps.cf
a@easy.com/

问题已解决:

运行以下的命令:

# cd /etc
# postalias aliases

就可以正常的运行啦!

[ 本帖最后由 fandy 于 2006-1-2 20:35 编辑 ]
作者: yijiande    时间: 2006-01-02 20:32
另个请教一下,如何设置F-PROT自动过几个小时更新呢?
那个 http://localhost/pa这个进行管理的WEB是不用密码就可以进去修改的,这个怎么修改呢?
作者: yijiande    时间: 2006-01-02 20:37
另外请问一下,如果有两个虚拟域名d1.com 和 d2.com的话,这个要怎么修改呢?
myhostname = mail.d1.com
mydomain = d1.com
myorigin = $mydomain
mydestination = $myhostname localhost localhost.$mydomain
mynetworks = 192.168.1.0/24 127.0.0.0/8
inet_interfaces = all
作者: fandy    时间: 2006-01-02 21:05
根据“在RHEL 4 上配置全功能的Postfix 服务器”这一篇文章操作过程时,我遇到了认证不能通过的问题!

在localhost时可以正常的收发电子邮件!
在客户端时(Outlook)时可以正常的收电子邮件,但是不能发送,真是被批打败啦!,请大家帮助一下小弟!

日志以下:

[root@ldap ~]# tail /var/log/maillog
Jan 2 21:15:51 ldap postfix/master[3949]: terminating on signal 15
Jan 2 21:15:54 ldap postfix/postfix-script: starting the Postfix mail system
Jan 2 21:15:54 ldap postfix/master[4018]: daemon started -- version 2.2.7, configuration /etc/postfix
Jan 2 21:16:14 ldap postfix/smtpd[4022]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Jan 2 21:16:32 ldap postfix/smtpd[4022]: connect from unknown[192.168.1.2]
Jan 2 21:16:35 ldap postfix/smtpd[4022]: warning: SASL authentication failure: could not verify password
Jan 2 21:16:35 ldap postfix/smtpd[4022]: warning: unknown[192.168.1.2]: SASL LOGIN authentication failed
Jan 2 21:16:35 ldap authdaemond: failed to connect to mysql server (server=localhost., userid=postfix.): Unknown MySQL server host 'localhost.' (1)
Jan 2 21:16:35 ldap postfix/smtpd[4022]: lost connection after AUTH from unknown[192.168.1.2]
Jan 2 21:16:35 ldap postfix/smtpd[4022]: disconnect from unknown[192.168.1.2]

[ 本帖最后由 fandy 于 2006-1-2 21:46 编辑 ]
作者: anthonyfeng    时间: 2006-01-02 22:57
f-prot 应该已经自动update 了,可以检查
/etc/cron.hourly 内的 update_virus_scanners 脚本
及运行
# cat /var/log/maillog|grep update

Jan  3 01:01:02 localhost update.virus.scanners: Delaying cron job up to 600 seconds
Jan  3 01:07:55 localhost update.virus.scanners: Found f-prot installed
Jan  3 01:07:55 localhost update.virus.scanners: Running autoupdate for f-prot
Jan  3 01:08:00 localhost F-Prot autoupdate[3736]: F-Prot did not need updating.
Jan  3 01:08:00 localhost update.virus.scanners: Found generic installed
Jan  3 01:08:00 localhost update.virus.scanners: Running autoupdate for generic

至于http://localhost/pa 的问题,可请教www.toping.net 的Jackey,本人的想法是可以配置apache 达至访问前要输入密码的功能,这样可能是最简单的,详细怎做忘记了,请自行查找相关文档。

原帖由 yijiande 于 2006-1-2 20:32 发表
另个请教一下,如何设置F-PROT自动过几个小时更新呢?
那个 http://localhost/pa这个进行管理的WEB是不用密码就可以进去修改的,这个怎么修改呢?

作者: anthonyfeng    时间: 2006-01-02 23:00
按本例操作,就已经完全支持d1.com 和 d2.com 虚拟域名,你的不支持吗?

原帖由 yijiande 于 2006-1-2 20:37 发表
另外请问一下,如果有两个虚拟域名d1.com 和 d2.com的话,这个要怎么修改呢?
myhostname = mail.d1.com
mydomain = d1.com
myorigin = $mydomain
mydestination = $myhostname localhost localhost.$mydomai ...

作者: anthonyfeng    时间: 2006-01-02 23:11
你运行下面的看一下是什么结果,如果不是类似的,就是authlib 配置有错误。

# cd /usr/local/courier-authlib/sbin
# ./authtest a@d1.com
Authentication succeeded.

     Authenticated: a@d1.com  (uid 501, gid 502)
    Home Directory: /var/spool/mail/a@d1.com/
           Maildir: /var/spool/mail/a@d1.com/
             Quota: (none)
Encrypted Password: $1$117dec81$gkX1cdZlkJZy3surMCFAS0
Cleartext Password: (none)
           Options: (none)


原帖由 fandy 于 2006-1-2 21:05 发表
根据“在RHEL 4 上配置全功能的Postfix 服务器”这一篇文章操作过程时,我遇到了认证不能通过的问题!

在localhost时可以正常的收发电子邮件!
在客户端时(Outlook)时可以正常的收电子邮件,但是不能发送, ...

作者: fandy    时间: 2006-01-03 09:01
请问运行这个是有什么作用啦!

还有如果我在main.cnf不加以下的信息,客户端就可以正常的收发啊!

broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unauth_pipelining,reject_unauth_destination,permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_sasl_application_name = smtpd
smtpd_banner=$myhostname ESMTP "Version not Available"

[ 本帖最后由 fandy 于 2006-1-3 09:11 编辑 ]
作者: yijiande    时间: 2006-01-03 10:17
谢谢,楼主的解答!!!问题已经解决,但是还有一个问题,请教一下,我通过FOXMAIL发信时,SMTP上无论是否选上需要认证,都可以发信,不知道怎么回事呢?能否做到一定要进行认证才能发信呢?

[ 本帖最后由 yijiande 于 2006-1-3 11:16 编辑 ]
作者: anthonyfeng    时间: 2006-01-03 11:13
两位检查一下与authlib  相关的文件,我的是这样的。重启一下authlib,再运行一下上面说过的,才能继续判断:

# cat /usr/lib/sasl2/smtpd.conf
pwcheck_method: authdaemond
log_level: 3
mech_list: plain login
authdaemond_path: /usr/local/courier-authlib/var/spool/authdaemon/socket

# cat /usr/local/courier-authlib/etc/authdaemonrc |grep -v ^#|grep -v ^$
authmodulelist="authmysql"
authmodulelistorig="authmysq"
daemons=15
authdaemonvar=/usr/local/courier-authlib/var/spool/authdaemon
DEBUG_LOGIN=0
DEFAULTOPTIONS=""
LOGGEROPTS=""

# cat /usr/local/courier-authlib/etc/authmysqlrc
MYSQL_SERVER         localhost
MYSQL_USERNAME       postfix
MYSQL_PASSWORD       postfix
MYSQL_SOCKET         /var/lib/mysql/mysql.sock
MYSQL_DATABASE       postfix
MYSQL_USER_TABLE     mailbox
MYSQL_CRYPT_PWFIELD   password
MYSQL_UID_FIELD       '501'
MYSQL_GID_FIELD       '502'
MYSQL_LOGIN_FIELD     username
MYSQL_HOME_FIELD     concat('/var/spool/mail/',maildir)
MYSQL_MAILDIR_FIELD   concat('/var/spool/mail/',maildir)
MYSQL_NAME_FIELD     name

[ 本帖最后由 anthonyfeng 于 2006-1-3 11:16 编辑 ]
作者: yijiande    时间: 2006-01-03 11:25
楼主请查一下这两句中的下面那句,
authmodulelist="authmysql"
authmodulelistorig="authmysq"
是否应该是
authmodulelist="authmysql"
authmodulelistorig="authmysql"

另外就是那个通过FOXMAIL发信时,SMTP上无论是否选上需要认证,都可以发信,不知道怎么回事呢?能否做到一定要进行认证才能发信呢?
作者: anthonyfeng    时间: 2006-01-03 11:50
哦,我自己的亦错了,谢谢提醒。

发给本地域的邮件是不用验证的,否则别的smtp server 怎样发邮件给你呢,除非你的mail server 不想对外公开,只给本地域使用。


原帖由 yijiande 于 2006-1-3 11:25 发表
楼主请查一下这两句中的下面那句,
authmodulelist="authmysql"
authmodulelistorig="authmysq"
是否应该是
authmodulelist="authmysql"
authmodulelistorig="authmysql ...

作者: yijiande    时间: 2006-01-03 11:58
也是,我自己想来也是这个原因吧。如果通过其它IP发信的应该要认证了吧。谢谢!!!
按照楼主的教程,我已经完成了。不错可以使用。再次感谢!!!
作者: yijiande    时间: 2006-01-03 12:02
对了,请教一下。关于配置杀毒、过滤SPAM功能,如果以前一台POSTFIX的服务器已经架好了(可能跟楼主的配置不一样),但是它没有配置配置杀毒、过滤SPAM功能,是否可以直接按配置杀毒、过滤SPAM功能那部分操作,就可以加这个功能了吗???
作者: yijiande    时间: 2006-01-03 12:43
另外请教一下,如何在POSTFIX中实现自动转发,如我要把a@d1.com的邮件自动转发到b@d1.com中去?谢谢!!
作者: anthonyfeng    时间: 2006-01-03 13:40
完全可以,做之前备份一下。如果想更高级一点,使用Amavisd-new,可能速度会差一点,但可以把杀毒、过滤SPAM功能安排在另一台server,再简单一点,使用商业化的产品,such as symantec smtp gateway。

http://www.toping.net/htm_data/7/0601/869.html


原帖由 yijiande 于 2006-1-3 12:02 发表
对了,请教一下。关于配置杀毒、过滤SPAM功能,如果以前一台POSTFIX的服务器已经架好了(可能跟楼主的配置不一样),但是它没有配置配置杀毒、过滤SPAM功能,是否可以直接按配置杀毒、过滤SPAM功能那部分操作,就 ...

作者: anthonyfeng    时间: 2006-01-03 14:05
刚刚试了一下,在postfix admin 内有一个add alias ,可以解决部分问题。


原帖由 yijiande 于 2006-1-3 12:43 发表
另外请教一下,如何在POSTFIX中实现自动转发,如我要把a@d1.com的邮件自动转发到b@d1.com中去?谢谢!!

作者: snake_she    时间: 2006-01-03 14:18
标题: 按照上面的全部做好了,真的很不错,但是有几个这样的要求不知道能否实限
1.在OUTLOOKEXPRESS 里面的帐号必须设邮箱全名,帐号能否设成@前面的字符。
  2.如何将所有收到和发出的邮件都备份到一个固定的邮箱里面。
  3.如何设置邮箱的大小,
  4.如何将发往某个域的邮件交由另外一台主机投递?
  5.该服务器如何设置能为某个域(或主机)代理投递。

我之前是用Qmail可以实现以上几个功能,对POSTFIX 不熟悉,不知道该怎么设置,请各位大大指点指点,谢谢!
作者: yijiande    时间: 2006-01-03 14:26
谢谢!楼主的回答。关于那个自动转发的问题,通过别名是可以部分解决问题。但是如果两个帐号都是真实存在的,好像就没有办法解决了。必需把一个删除,变成别名后才可以。
作者: yijiande    时间: 2006-01-03 14:29
对啊,我也想知道,关于邮箱大小的问题,能否根据用户的不同分别设置邮箱大小呢?还有就是邮件的附件大小也是一样,能否分别设置呢?
作者: anthonyfeng    时间: 2006-01-03 18:08
标题: 回复 47楼 snake_she 的帖子
1.在OUTLOOKEXPRESS 里面的帐号必须设邮箱全名,帐号能否设成@前面的字符。
如果mailserver 负责只有一个域,就可以,多域我就不懂了。

  2.如何将所有收到和发出的邮件都备份到一个固定的邮箱里面。
always_bcc copy@here.com

  3.如何设置邮箱的大小,
操作mysql postfix 库内某个表就可以了,具体我没有试过。

  4.如何将发往某个域的邮件交由另外一台主机投递?
我不懂。

  5.该服务器如何设置能为某个域(或主机)代理投递。
我不懂,我想4解决了,5亦会解决。

以下的link 对4,5 应该有帮助
http://www.postfix.org/transport.5.html

原来这种功能叫smtp route,网上一抓一大把。
http://mail.kelasmalem.com/postfix-users/msg00493.html

[ 本帖最后由 anthonyfeng 于 2006-1-3 21:26 编辑 ]
作者: fandy    时间: 2006-01-03 18:49
好多谢anthonyfeng大大的帮助,现在我的MYSQL+postfix系统以可以正常的使用了,真的要好多谢您, anthonyfeng大大,多谢您的好文章,多谢您的的热情帮助!
作者: anthonyfeng    时间: 2006-01-03 20:56
不客气,一齐研究。
作者: yu10101    时间: 2006-01-15 20:47
仔细研读中,谢谢anthonyfeng

------------------------------------
善待自己,学会感恩
作者: yzls    时间: 2006-01-16 17:02
标题: 初学者请教:/etc/postfix/main.cf文件里没有virtual mailbox settings等内容
按照本文一步一步操作,当编辑/etc/postfix/main.cf文件时,仅有base部分的内容,而"virtual mailbox settings","quota""sasl"等部分内容没有。而且/etc/postfix/目录下也没有"mysql_virtual_alias_maps.cf","mysql_virtual_domains_maps.cf","mysql_virtual_mailbox_limit_maps.cf","mysql_virtual_mailbox_maps.cf"等文件。请问我哪里出了错?我的配置环境和本文中的一摸一样(但我用的是postfix-2.2.8.tar.gz)
作者: anthonyfeng    时间: 2006-01-16 17:22
没有的,要自己加上去
作者: xiangxiaobao    时间: 2006-02-27 10:44
请问一下,在做第2步时:配置PostfixAdmin、Mysql、Apache,为什么打开http://localhost/pa没有任何显示,谢谢!
作者: xiangxiaobao    时间: 2006-02-27 12:39
再请问一下,我怎么去建立邮箱帐户和邮箱啊,谢谢
作者: anthonyfeng    时间: 2006-02-27 13:34
访问 http://localhost  正常吗?如果不行,应该是apache 或文件权限有问题


原帖由 xiangxiaobao 于 2006-2-27 10:44 发表
请问一下,在做第2步时:配置PostfixAdmin、Mysql、Apache,为什么打开http://localhost/pa没有任何显示,谢谢!

[ 本帖最后由 anthonyfeng 于 2006-2-27 13:38 编辑 ]
作者: anthonyfeng    时间: 2006-02-27 13:35
利用PostfixAdmin 就可以了,或者直接操作Mysql

原帖由 xiangxiaobao 于 2006-2-27 12:39 发表
再请问一下,我怎么去建立邮箱帐户和邮箱啊,谢谢

作者: xiangxiaobao    时间: 2006-02-27 13:54
apache测试页面可以打开,就是http://localhost/pa打不开管理界面,我就想显示管理页面.
还有您说的可以用postfixadmin和直接用mysql也行,那怎么去做呢
作者: xiangxiaobao    时间: 2006-02-27 14:08
还有个问题anthonyfeng老大,那您说直接可以在mysql里去操作,我怎样在mysql数据库里为用户创建个用户名和邮箱啊,我对数据库不太熟,还请您把步骤说一下.
还有请问您,按您做的用户可以直接在webmail页面修改用户名和密码吗?
谢谢您!
作者: anthonyfeng    时间: 2006-02-27 17:32
即然对数据库不太熟,就不要直接操作mysql 了,其实也很简单,看一下表结构,学习sql 的皮毛,再加大胆尝试就可以了。还是postfixadmin 好用,应该很容易配置的。

按本文的操作,webmail页面自行修改用户名是不可能的,自行修改密码需要加装一个plugin 之类的东西。
作者: ghbspecial    时间: 2006-03-07 14:31
感谢LZ精彩的文章,请问一下您的这篇文章是否可以直接用在redhat9.0上,如果是需要改动什么吗?还有是否可以用在debina上。
作者: wang3140    时间: 2006-03-15 16:46
标题: smtp无法通过验证怎么解决
大虾,配完第4布后测试了一下,smtp在不加验证时可以正常发送邮件。但一旦加上验证,就会老是弹出对话框,提示密码不对。这个问题怎么解决阿。错误日志如下:


Mar 15 15:29:00 test postfix/smtpd[3099]: connect from sms.usish.com.cn[192.168.40.3]
Mar 15 15:29:00 test postfix/smtpd[3099]: warning: SASL authentication problem: unknown password verifier
Mar 15 15:29:00 test postfix/smtpd[3099]: warning: sms.usish.com.cn[192.168.40.3]: SASL LOGIN authentication failed
Mar 15 15:29:00 test postfix/smtpd[3099]: lost connection after AUTH from sms.usish.com.cn[192.168.40.3]
Mar 15 15:29:00 test postfix/smtpd[3099]: disconnect from sms.usish.com.cn[192.168.40.3]
作者: anthonyfeng    时间: 2006-03-16 20:46
提示很明显,密码错误。
再不你运行下面的看一下是什么结果,如果不是类似的,就是authlib 配置有错误。

# cd /usr/local/courier-authlib/sbin
# ./authtest a@d1.com
Authentication succeeded.

     Authenticated: a@d1.com  (uid 501, gid 502)
    Home Directory: /var/spool/mail/a@d1.com/
           Maildir: /var/spool/mail/a@d1.com/
             Quota: (none)
Encrypted Password: $1$117dec81$gkX1cdZlkJZy3surMCFAS0
Cleartext Password: (none)
           Options: (none)
作者: wang3140    时间: 2006-03-24 14:57
我按照你的办法做过,返回的信息和你提供的是一样的,唯一的不同是uid和gid都是500,因我这边两个id号都是500。有没有别的可以诊断故障的办法
作者: wang3140    时间: 2006-03-27 17:42
终于验证通过,原来是启用smtp认证后弹出的用户名对话框中必须是a@d1.com,而不能像一般那样用a。不过最后在配置完mailscanner后有一个小问题要请教一下,公司邮件服务器上网是必须通过代理的,升级病毒库时碰到我用如下命令却碰到无法升级的错误,显示如下:

[root@testmail MailScanner-4.48.4-2]# /usr/local/f-prot/tools/check-updates.pl -proxy-server=192.168.40.80:80
Use of uninitialized value in hash element at /usr/lib/perl5/vendor_perl/5.8.5/LWP/Protocol.pm line 55.
Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/vendor_perl/5.8.5/LWP/Protocol.pm line 58.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/LWP/Protocol.pm line 38.
Use of uninitialized value in string eq at /usr/lib/perl5/vendor_perl/5.8.5/LWP/UserAgent.pm line 194.
Unable to connect retrieve update info from server.
Error:
Exiting...

请问哪个高手能帮忙解决一下
作者: anthonyfeng    时间: 2006-03-27 19:41
应该是这样吧:-proxy-server=http://proxy.name:portnumber

http://www.f-prot.com/support/un ... k-updates.pl.8.html
作者: wang3140    时间: 2006-03-28 08:25
问题解决,整体测试结束。真的是太感谢搂主,写出这么好的文章。
作者: anthonyfeng    时间: 2006-03-28 13:22
btw: 用户自行修改密码功能,您有没有实现?
作者: victor27077    时间: 2006-03-30 10:30
謝謝,正在學習
作者: wang3140    时间: 2006-04-05 12:47
用户自行修改密码的功能我已经实现了。修改了squirrelmail的页面程序,增加改密码的功能,不过必须要依赖postfixadmin中的一些功能模块
作者: 权老实    时间: 2006-07-11 22:23
原帖由 wang3140 于 2006-4-5 12:47 发表
用户自行修改密码的功能我已经实现了。修改了squirrelmail的页面程序,增加改密码的功能,不过必须要依赖postfixadmin中的一些功能模块



能讲讲吗?????
作者: booker2688    时间: 2006-07-12 21:29
忘了问一下:用户的邮件是存放再那里目录下?非常感谢楼主!
作者: booker2688    时间: 2006-07-12 22:05
我在第四步的时候用foxmail测试了,不行啊,提示找不到服务器?这是怎么回事?
作者: booker2688    时间: 2006-07-13 09:22
我用了是RHEL4 没有update 2的,可不可以使用?安装了有点问题。
作者: anthonyfeng    时间: 2006-07-13 15:01
/var/mail

原帖由 booker2688 于 2006-7-12 21:29 发表
忘了问一下:用户的邮件是存放再那里目录下?非常感谢楼主!

作者: anthonyfeng    时间: 2006-07-13 15:03
一般都是服务没有成功启动或firewall 拦了,可看看日志或nmap 扫描一下。

原帖由 booker2688 于 2006-7-12 22:05 发表
我在第四步的时候用foxmail测试了,不行啊,提示找不到服务器?这是怎么回事?

作者: zhanghj_ok    时间: 2006-07-23 00:31
原帖由 权老实 于 2006-7-11 22:23 发表



能讲讲吗?????



这个功能我想好多人都想知道,包括我!

能否单独开一张贴:

[B]使用squirrelmail修改邮件账户密码[/B]
作者: fuleru    时间: 2006-08-15 11:57
有人遇到这样的问题吗?

http://bbs.chinaunix.net/viewthr ... &extra=page%3D2
作者: www_cisco    时间: 2006-08-31 18:45
标题: 为何我配置好以后收到的邮件的标题都是?SPAM
我想这么配置后,希望我的邮件服务器能自动过滤掉垃圾邮件,不需要加上?SPAM,直接删除,可是我现在正常的邮件也加上了?SPAM,而垃圾邮件也没有自动过滤掉,请问我该怎么设置才能实现的的目的
作者: anthonyfeng    时间: 2006-09-01 10:50
SpamAssassin 3.x 配置指南(中文版)
http://anti-spam.org.cn/references/index.php?Action=Show&ID=9

学习一下如何使用SpamAssassin,小弟对其了解亦不多。
作者: booker2688    时间: 2006-09-01 12:54
对于SA确实不好做啊,我到现在还不知道怎么测试他有没有起作用,只是看到有spamd进程。
作者: anthonyfeng    时间: 2006-09-01 23:18
有日志吗
作者: www_cisco    时间: 2006-09-02 10:22
标题: 找到原因了
在这一行里Required SpamAssassin Score = 4
把4改成原来的6或者8,SA对邮件的审核就会放宽许多,这样把正常邮件当成垃圾邮件的几率就小很多,这个数值可以自己调整到比较适合自己的情况就可以了
作者: wgdzh    时间: 2006-09-03 08:45
提示: 作者被禁止或删除 内容自动屏蔽
作者: zxwwen    时间: 2006-12-02 17:14
原帖由 anthonyfeng 于 2005-12-20 14:08 发表
在RHEL 4 上配置全功能的Postfix 服务器

文档版本:0.2
文档日志:
2005-12-17 至 12-20 初稿完成,首次公开

作者:Tony Feng
邮件:tonyfeng@yahoo.com

简介
本文讲述在安装了Redha ...


樓主我參考你的說明自已測試postfix郵件系統,我現有一個問題

我可以發出去,但是收不回來
我用#mailq 查看可以看到郵件還在服務器上.

但不知是什麼原因.
作者: anthonyfeng    时间: 2006-12-02 21:03
没有遇过同类故障,所以亦不大了解,自己发给自己的如何?拿日志来看看
作者: gunguymadman    时间: 2006-12-05 11:46
spamassassin   先把值放大   然后再不断减小
作者: zxwwen    时间: 2006-12-06 15:24
#telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.ult.com ESMTP "Version not Available"
ehlo mail
250-mail.ult.com
250-PIPELINING
250-SIZE 14336000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250 8BITMIME
auth login
334 VXNlcm5hbWU6
enh3QGFiYy5jb20=
334 UGFzc3dvcmQ6
enh3MTIxOQ==
235 Authentication successful
quit
221 Bye
Connection closed by foreign host.
這說明我認證成功

telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK dovecot ready.
user jesse@ult.com
+OK
pass 1234567
+OK Logged in.
list
+OK 0 messages:
+OK POP3 clients that break here, they violate STD53 ---這一句我沒有!!
.
quit
+OK Logging out.
Connection closed by foreign host.

rpm -qa |grep cyrus-sasl
cyrus-sasl-md5-2.1.19-5.EL4
cyrus-sasl-gssapi-2.1.19-5.EL4
cyrus-sasl-sql-2.1.19-5.EL4
cyrus-sasl-ntlm-2.1.19-5.EL4
cyrus-sasl-2.1.19-5.EL4
cyrus-sasl-plain-2.1.19-5.EL4
cyrus-sasl-devel-2.1.19-5.EL4

這個是系統自帶的.

紅色這一句我沒有,是不是有問題,

我用outlook express測試時,"服務器認證"那裡打不打勾都可以發郵件不知那裡有問題?
   
--------------------------------------------------------------------------------

[ 本帖最后由 zxwwen 于 2006-12-6 15:29 编辑 ]
作者: zxwwen    时间: 2006-12-08 08:51
樓主,我用公網的IP發郵件時則認證起作用,但是用內網IP(192.168.1.2)則認不認證都可以發郵件.如何讓內網IP發郵件也要認證.
作者: xuledw    时间: 2006-12-27 14:56
标题: 无法显示创建虚拟域相关
全部按照楼主的帖子做的也是as4.2的系统。但是用postfixadmin可以创建虚拟域和虚拟用户,也可以通过用户来发送邮件,但是就是有下面报错

#service dovecot restart
#service courier-authlib restart
#postfix reload
maillog
Dec 27 13:47:50 mailtest dovecot: Killed with signal 15
Dec 27 13:47:50 mailtest dovecot: Dovecot starting up
Dec 27 13:47:51 mailtest dovecot-auth: MySQL: connected to localhost
Dec 27 13:47:56 mailtest authdaemond: stopping authdaemond children
Dec 27 13:47:56 mailtest authdaemond: modules="authmysql", daemons=10
Dec 27 13:47:56 mailtest authdaemond: Installing libauthmysql
Dec 27 13:47:56 mailtest authdaemond: Installation complete: authmysql
Dec 27 13:49:42 mailtest postfix/postfix-script: refreshing the Postfix mail system
Dec 27 13:49:42 mailtest postfix/master[2517]: reload configuration /etc/postfix
message
Dec 27 13:47:50 mailtest dovecot: dovecot 关闭 succeeded
Dec 27 13:47:50 mailtest dovecot: dovecot 启动 succeeded
一旦telnet localhost 25端口正常退出后
message就会报错
Dec 27 13:51:57 mailtest postfix/smtpd[4439]: sql_select option missing
Dec 27 13:51:57 mailtest postfix/smtpd[4439]: auxpropfunc error no mechanism ava

请大家帮忙分析分析可能性!谢谢
把所有人的回帖都看了,没有这个报错。
作者: anthonyfeng    时间: 2006-12-30 15:20
有可能是你定义了mynetwork=192.168.1.0/24,是不?

原帖由 zxwwen 于 2006-12-8 08:51 发表
樓主,我用公網的IP發郵件時則認證起作用,但是用內網IP(192.168.1.2)則認不認證都可以發郵件.如何讓內網IP發郵件也要認證.

作者: anthonyfeng    时间: 2006-12-30 15:30
刚在google search  postfix sql_select option missing,不过访问不了那些网站

原帖由 xuledw 于 2006-12-27 14:56 发表
全部按照楼主的帖子做的也是as4.2的系统。但是用postfixadmin可以创建虚拟域和虚拟用户,也可以通过用户来发送邮件,但是就是有下面报错

#service dovecot restart
#service courier-authlib restart
#postf ...

作者: choufachun    时间: 2007-04-07 01:47
樓主你好,真是感謝你無私的分享,讓我從這篇文章學到了許多。
依造你的配置方式,小弟的主機已經正常的運作了。
在這有個問題還不是很明白,我的主機上兩個虛擬域的使用者都能正常的收發郵件,
可是真實使用者我卻一直試不出來該如何通過收發郵件的認證?
還有系統寄給ROOT的信件該如何轉到虛擬帳號上面了?
這兩點我一直試不成功,還請樓主指點一下。
作者: atyu30    时间: 2007-04-07 11:45
实验
作者: neena    时间: 2007-04-07 17:40
标题: 请教pop3收邮件为什么密码会不对呢?
请教pop3收邮件为什么密码会不对呢? 用postfixadmin更改密码之后还是老样子
作者: anthonyfeng    时间: 2007-04-08 21:23
要看Dovecot 的日志

原帖由 neena 于 2007-4-7 17:40 发表
请教pop3收邮件为什么密码会不对呢? 用postfixadmin更改密码之后还是老样子

作者: 三国赵云    时间: 2007-07-12 17:04
大家帮我看看。我这里能发不能收。使用outlook express 发信都正常 。但是收不回来。我使用WEB方式进去看。里面也没有收到。log 里的提示信息如下:

Jul 12 16:44:00 mailserver imap-login: Login: a@d1.com [::ffff:127.0.0.1]
Jul 12 16:44:05 mailserver last message repeated 5 times
Jul 12 16:46:48 mailserver pop3-login: Login: a@d1.com [::ffff:192.168.0.110]
Jul 12 16:46:58 mailserver last message repeated 3 times
Jul 12 16:47:11 mailserver postfix/smtpd[3317]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Jul 12 16:47:11 mailserver postfix/smtpd[3317]: warning: 192.168.0.110: hostname www verification failed: Name or service not known
Jul 12 16:47:11 mailserver postfix/smtpd[3317]: connect from unknown[192.168.0.110]
Jul 12 16:47:11 mailserver postfix/trivial-rewrite[3320]: warning: do not list domain d1.com in BOTH mydestination and virtual_mailbox_domains
Jul 12 16:47:11 mailserver postfix/smtpd[3317]: D57582BC52: client=unknown[192.168.0.110], sasl_method=LOGIN, [email=sasl_username=a@d1.com]sasl_username=a@d1.com[/email]
Jul 12 16:47:12 mailserver postfix/cleanup[3323]: D57582BC52: message-id=<[email=000601c7c461$7cb1d710$6e00a8c0@netbook]000601c7c461$7cb1d710$6e00a8c0@netbook[/email]>
Jul 12 16:47:12 mailserver postfix/qmgr[2890]: D57582BC52: from=<a@d1.com>, size=1382, nrcpt=1 (queue active)
Jul 12 16:47:12 mailserver postfix/smtpd[3317]: disconnect from unknown[192.168.0.110]
Jul 12 16:47:12 mailserver postfix/trivial-rewrite[3320]: warning: do not list domain d1.com in BOTH mydestination and virtual_mailbox_domains
Jul 12 16:47:12 mailserver postfix/local[3325]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Jul 12 16:47:12 mailserver postfix/local[3325]: D57582BC52: to=<a@d1.com>, relay=local, delay=0.36, delays=0.32/0.02/0/0.02, dsn=5.1.1, status=bounced (unknown user: "a")
Jul 12 16:47:12 mailserver postfix/cleanup[3323]: 312F42BC55: message-id=<20070712084712.312F42BC55@mail.d1.com>
Jul 12 16:47:12 mailserver postfix/qmgr[2890]: 312F42BC55: from=<>, size=2998, nrcpt=1 (queue active)
Jul 12 16:47:12 mailserver postfix/trivial-rewrite[3320]: warning: do not list domain d1.com in BOTH mydestination and virtual_mailbox_domains
Jul 12 16:47:12 mailserver postfix/bounce[3326]: D57582BC52: sender non-delivery notification: 312F42BC55
Jul 12 16:47:12 mailserver postfix/qmgr[2890]: D57582BC52: removed
Jul 12 16:47:12 mailserver postfix/local[3325]: 312F42BC55: to=<a@d1.com>, relay=local, delay=0.02, delays=0.01/0/0/0.01, dsn=5.1.1, status=bounced (unknown user: "a")
Jul 12 16:47:12 mailserver postfix/qmgr[2890]: 312F42BC55: removed


谢谢。
作者: anthonyfeng    时间: 2007-07-12 21:53
抱歉没有留意到你的留言

可是真實使用者我卻一直試不出來該如何通過收發郵件的認證?
小弟目前还做过此实验,所以不知道。

還有系統寄給ROOT的信件該如何轉到虛擬帳號上面了?
小弟目前还做过此实验,不过我想你可能要研究一下
http://www.postfix.org/VIRTUAL_README.html#virtual_alias


原帖由 choufachun 于 2007-4-7 01:47 发表
樓主你好,真是感謝你無私的分享,讓我從這篇文章學到了許多。
依造你的配置方式,小弟的主機已經正常的運作了。
在這有個問題還不是很明白,我的主機上兩個虛擬域的使用者都能正常的收發郵件,
可是真實使 ...





欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2