我是qmail的新手,参照life with qmail, 最近安装了qmail和vpopmail. 能够正常地收发邮件,看上去没有任何问题。但是如果我尝试向一个不存在的用户发邮件的时候,马上就有问题了。最近问题困扰了我将尽2个星期,还是没找到答案,所以期望各位达人给与指点,在下感激不尽。
我现在有一个需求,当用户邮件不存在的时候,我会自动创建用户帐号,并且把新到来的邮件发送到这个邮件帐号中。基本原理就是利用文件.qmail-default. 在该文件中调用我写好的脚本创建帐号,然后再转发这个邮件到这个帐号。如果我不用vpopmail,而用系统真实的帐号,我这个脚本就没有任何问题。
下面我列出我的一些信息,我尽量把它写的详细一些。
1.我的域名是test.com(内网,我自己设置的好了DNS,MX都已经设置好,可以确定没有问题)
2.文件 /var/qmail/user/assign的内容
+test.com-:test.com:89:89:/home/vpopmail/domains/test.com:-::
.
3. 文件/home/vpopmail/domains/test.com/.qmail-default 的内容(我的vpopmail安装在/home/vpopmail下)
| /home/webmail/add-qmail-account.sh "$DEFAULT" "$SENDER" && qmail-inject "$DEFAULT"
add-qmail-account.sh 是一个用来添加用户邮件帐号的脚本
从maillog 来看, 这个脚本从来都没有给调用过
4. 安装vpopmail 以后, 我用 /home/vpopmail/bin/vqmaillocal 换掉了文件 /var/qmail/bin/qmail-local with
如果我不换掉的话文件.qmail-default 会起作用,但是却收不到任何邮件
安装vpopmail以后,我尝试向一个不存在的用户发送邮件
echo "req and to do list" | mail no_such_user@test.com -s "requirements and todo list"
然后 qmail 抱怨 "message_is_looping_/mail_is_looping"
下面是详细的日志:(附件里面有详细的日志)
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.428087 new msg 957104
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.428172 info msg
957104: bytes 240 from <root@test.com> qp 9808 uid 0
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.432902 starting
delivery 1: msg 957104 to local [email=test.com-no_such_user@test.com]test.com-no_such_user@test.com[/email]
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.433078 status: local
1/10 remote 0/20
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.683124 new msg 957105
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.683208 info msg
957105: bytes 329 from <anonymous@test.com> qp 9812 uid 89
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.688239 starting
delivery 2: msg 957105 to local test.com-@test.com
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.688291 status: local
2/10 remote 0/20
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.688332 delivery 1:
success: /home/vpopmail/domains/test.com,no_such_user,test.com/
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.688367 status: local
1/10 remote 0/20
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.688401 end msg 957104
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.721400 delivery 2:
failure: /home/vpopmail/domains/test.com,,test.com/message_is_looping_/mail_is_looping/
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.721475 status: local
0/10 remote 0/20
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.726975 bounce msg
957105 qp 9815
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.727036 end msg 957105
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.727466 new msg 957106
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.727516 info msg
957106: bytes 874 from <> qp 9815 uid 853
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.731858 starting
delivery 3: msg 957106 to local [email=test.com-anonymous@test.com]test.com-anonymous@test.com[/email]
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.732013 status: local
1/10 remote 0/20
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.770251 new msg 957107
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.770335 info msg
957107: bytes 1012 from <anonymous@test.com> qp 9819 uid 89
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.775153 starting
delivery 4: msg 957107 to local test.com-@test.com
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.775206 status: local
2/10 remote 0/20
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.775247 delivery 3:
success: /home/vpopmail/domains/test.com,anonymous,test.com/
-------------------------------------------------------------------
I am a newbie in qmail. I install qmail and vpopmail.I can send
and recevice mails. it looks work fine. but if I try to send a mail to
a nonexistent mail account, the problem comes. this problem bother me
about 2 weeks. if you know the root cause, would you please tell me
what is problem. your suggestion a great favor to me. thanks very
much.
I need to create a new account if the mail account does not exist.
that is the special requirements for me, if the mail account do not
exist, I will use .qmail-default to create an email account, and then
inject the mail to the new account. it work well if I do not use
vpopmail. but I want to use virtual account.
some information about my software envionment:
1.My domain name is test.com(in internal network)
2.the content of file /var/qmail/user/assign
+test.com-:test.com:89:89:/home/vpopmail/domains/test.com:-::
.
3. then content of file /home/vpopmail/domains/test.com/.qmail-default
| /home/webmail/add-qmail-account.sh "$DEFAULT" "$SENDER" &&
qmail-inject "$DEFAULT"
add-qmail-account.sh is a script to add a mail account
I know it never be called from the maillog.
4. I replace /var/qmail/bin/qmail-local with
/home/vpopmail/bin/vqmaillocal(by following the installation docs)
if I do not replace, .qmail-default can work, but I can not recevie any mail.
after I install vpopmail, I try to send a mail to an nonexist account like this
echo "req and to do list" | mail no_such_user@test.com -s
"requirements and todo list"
then qmail complains "message_is_looping_/mail_is_looping"
the following is the detail of the maillog.
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.428087 new msg 957104
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.428172 info msg
957104: bytes 240 from <root@test.com> qp 9808 uid 0
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.432902 starting
delivery 1: msg 957104 to local [email=test.com-no_such_user@test.com]test.com-no_such_user@test.com[/email]
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.433078 status: local
1/10 remote 0/20
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.683124 new msg 957105
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.683208 info msg
957105: bytes 329 from <anonymous@test.com> qp 9812 uid 89
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.688239 starting
delivery 2: msg 957105 to local test.com-@test.com
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.688291 status: local
2/10 remote 0/20
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.688332 delivery 1:
success: /home/vpopmail/domains/test.com,no_such_user,test.com/
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.688367 status: local
1/10 remote 0/20
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.688401 end msg 957104
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.721400 delivery 2:
failure: /home/vpopmail/domains/test.com,,test.com/message_is_looping_/mail_is_looping/
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.721475 status: local
0/10 remote 0/20
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.726975 bounce msg
957105 qp 9815
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.727036 end msg 957105
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.727466 new msg 957106
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.727516 info msg
957106: bytes 874 from <> qp 9815 uid 853
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.731858 starting
delivery 3: msg 957106 to local [email=test.com-anonymous@test.com]test.com-anonymous@test.com[/email]
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.732013 status: local
1/10 remote 0/20
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.770251 new msg 957107
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.770335 info msg
957107: bytes 1012 from <anonymous@test.com> qp 9819 uid 89
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.775153 starting
delivery 4: msg 957107 to local test.com-@test.com
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.775206 status: local
2/10 remote 0/20
Jul 7 21:54:14 shaohui-laptop qmail: 1183816454.775247 delivery 3:
success: /home/vpopmail/domains/test.com,anonymous,test.com/