免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 13902 | 回复: 29
打印 上一主题 下一主题

[Mail] 安装postfix的无法创建邮件域目录 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-09-24 16:07 |只看该作者 |正序浏览
有没有能够回复我在安装了mysql+apache+php+cyrus-sasl 2.1.20+postfix 2.2.3+postfixadmin 2.1.0后测试,
其他的暂时不安装,能后在测试postfix的起动,上面所有的安装和编译都是正确无误的,但是通过postfixadmin的时候却创建了域在数据库中,但是域目录(/var/mailbox/)却无法创建域名文件夹,创建一个新的邮箱名也无法创建一个邮箱文件夹,这是什么问题呢。我在配置文件中都已确定是正确的了。如:
# vi /etc/postfix/main.cf
#=====================BASE=========================
#主机名称(用 FQDN 的方式来写)
myhostname = www.test.com
#domain 名称
mydomain = test.com
#邮件标头上面的 mail from 的那个地址
myorigin = $mydomain
#可用来收件的主机名称(这里没有使用$mydomain是因为我们将使用virtualhost)
mydestination = $myhostname localhost localhost.$mydomain
#允许不使用smtp发信认证的网段
mynetworks = 127.0.0.0/8
inet_interfaces = all
#使用的邮箱格式
#home_mailbox = Maildir/
#mailbox_transport = maildrop

#=====================Vritual Mailbox settings=========================
# 指定用户邮箱所在的根目录
virtual_mailbox_base = /var/mailbox/
#指定postfix如何去检索邮件用户,这里是采用mysql (用户邮箱的目录)
virtual_mailbox_maps = mysql:/etc/postfix/mysql/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf
virtual_alias_domains = (原创就是这样,我注销后或者是不变都没有影响到postfix提供服务)
virtual_alias_maps = mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf
#邮件账号的uid, 使用apache的运行用户
virtual_uid_maps = static:1001
virtual_gid_maps = static:1001
#virtual_uid_maps = mysql:/etc/postfix/mysql/mysql-virtual_uid_maps.cf
#virtual_gid_maps = mysql:/etc/postfix/mysql/mysql-virtual_gid_maps.cf
# use this for virtual delivery(如果没有安装maildrop,则此处为virtual)
#virtual_transport = virtual
#use this for maildrop-delivery (如果有maildrop,则此处为maildrop)
virtual_transport = maildrop
#Maildrop-Options for usage with maildrop
maildrop_destination_recipient_limit = 1
maildrop_destination_concurrency_limit = 1

#/var/mailbox/最后的"/"字符不能省略
#所有的MySQL查询配置文件统一存放在/etc/postfix/mysql中

#====================QUOTA========================
#每封信的最大大小(10M),postfix的默认值是10M, 但这指的是邮件正文和编码后附件的总和, 经过#base64编码,附件的大小会增加35%左右, 因此这里设定可接受邮件的大小为14M
message_size_limit = 14336000
#邮箱的默认大小(10M)
virtual_mailbox_limit = 20971520
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
#指定postfix如何获得用户的quota信息(每个用户的邮箱大小)
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql/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
#In order to allow mail relaying by authenticated clients
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"

Go to top.

建立/var/mailbox并设置权限
# mkdir /var/mailbox
# chown -R vmail:vmail /var/mailbox
# chmod -R ug+rwx,o-rwx /var/mailbox

建立/etc/postfix/mysql文件夹和MySQL查询配置文件
# mkdir /etc/postfix/mysql
1、vi /etc/postfix/mysql/mysql_virtual_alias_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = alias
select_field = goto
where_field = address

2、vi /etc/postfix/mysql/mysql_virtual_domains_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = domain
select_field = description
where_field = domain
#additional_conditions = and backupmx = '0' and active = '1'

3、vi /etc/postfix/mysql/mysql_virtual_mailbox_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox
select_field = maildir
where_field = username
#additional_conditions = and active = '1'

4、vi /etc/postfix/mysql/mysql_virtual_mailbox_limit_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox
select_field = quota
where_field = username
#additional_conditions = and active = '1'

Go to top.

配置 /usr/local/lib/sasl2/smtpd.conf
# vi /usr/local/lib/sasl2/smtpd.conf
pwcheck_method: auxprop
auxprop_plugin: sql
mech_list: plain login
sql_engine: mysql
sql_hostnames: localhost
sql_user: postfix
sql_passwd: postfix
sql_database: postfix
sql_select: SELECT password FROM mailbox WHERE username='%u@%r' and domain='%r' and active='1'

论坛徽章:
0
30 [报告]
发表于 2008-05-14 17:22 |只看该作者
可爱的猫咪看一下我这个。
和他的错一样的。
May 14 17:09:28 erabay postfix/master[7872]: daemon started -- version 2.4.5, configuration /etc/postfix
May 14 17:10:15 erabay postfix/smtpd[7876]: connect from localhost[127.0.0.1]
May 14 17:10:15 erabay postfix/smtpd[7876]: 178FE945F2: client=localhost[127.0.0.1]
May 14 17:10:15 erabay postfix/cleanup[7879]: 178FE945F2: message-id=<20080514091015.178FE945F2@mail.erabay.com>
May 14 17:10:15 erabay postfix/qmgr[7875]: 178FE945F2: from=<weifeng270@gmail.com>, size=514, nrcpt=1 (queue active)
May 14 17:10:15 erabay postfix/smtpd[7876]: disconnect from localhost[127.0.0.1]
May 14 17:10:15 erabay postfix/qmgr[7875]: warning: connect to transport vmail: No such file or directory
May 14 17:10:15 erabay postfix/error[7880]: 178FE945F2: to=<dddddddddddddd@erabay.cn>, relay=none, delay=0.11, delays=0.05/0.04/0/0.02, dsn=4.3.0, status=deferred (mail transport unavailable)
May 14 17:14:37 erabay postfix/smtpd[7915]: connect from localhost[127.0.0.1]
May 14 17:14:37 erabay postfix/smtpd[7915]: 8E7B9945FC: client=localhost[127.0.0.1]
May 14 17:14:37 erabay postfix/cleanup[7918]: 8E7B9945FC: message-id=<20080514091437.8E7B9945FC@mail.erabay.com>
May 14 17:14:37 erabay postfix/qmgr[7875]: 8E7B9945FC: from=<weifeng270@gmail.com>, size=496, nrcpt=1 (queue active)
May 14 17:14:37 erabay postfix/qmgr[7875]: warning: connect to transport vmail: No such file or directory
May 14 17:14:37 erabay postfix/smtpd[7915]: disconnect from localhost[127.0.0.1]
May 14 17:14:37 erabay postfix/error[7919]: 8E7B9945FC: to=<sss@www.kkk.com>, relay=none, delay=0.11, delays=0.05/0.02/0/0.04, dsn=4.3.0, status=deferred (mail transport unavailable)
May 14 17:19:28 erabay postfix/qmgr[7875]: 178FE945F2: from=<weifeng270@gmail.com>, size=514, nrcpt=1 (queue active)
May 14 17:19:28 erabay postfix/qmgr[7875]: warning: connect to transport vmail: No such file or directory
May 14 17:19:28 erabay postfix/error[7942]: 178FE945F2: to=<dddddddddddddd@erabay.cn>, relay=none, delay=554, delays=554/0.04/0/0.03, dsn=4.3.0, status=deferred (mail transport unavailable)

论坛徽章:
0
29 [报告]
发表于 2007-09-25 16:25 |只看该作者
配置文件号称使用了apache的运行用户
#邮件账号的uid, 使用apache的运行用户
virtual_uid_maps = static:1001
virtual_gid_maps = static:1001
而设置权限用了vmail
建立/var/mailbox并设置权限
# mkdir /var/mailbox
# chown -R vmail:vmail /var/mailbox
# chmod -R ug+rwx,o-rwx /var/mailbox
请确认vmail的uid是1001吗?

论坛徽章:
0
28 [报告]
发表于 2007-09-05 09:42 |只看该作者
原帖由 佛光普照 于 2005-9-27 17:29 发表
我现在修改了authdaemond的认证方式之后可以正常的发送邮件了。但是却无法认证通过,是这样,在SMTP需要身份认证时不选也可以发送邮件!
我正在查找下一步的原因,欢迎遇到过的朋友一起分享你的成功经验!

我也遇到了这个问题了,不知道 LZ 是如何解决的呢?

论坛徽章:
1
技术图书徽章
日期:2014-04-16 11:36:47
27 [报告]
发表于 2007-07-16 17:57 |只看该作者
終于找到精華暸.收藏慢慢看.謝謝

论坛徽章:
0
26 [报告]
发表于 2005-10-17 15:06 |只看该作者

安装postfix的无法创建邮件域目录

问题一:对postfix的管理有许多的优秀工具,包括邮件日志分析工具,访问工具;邮件发送和接收工具等。
具体的有:James S. Seymour用perl写了一个叫pflogsumm.pl的脚本,可以到这里下载:http://jimsun.linxnet.com/postfix_contrib.html
其对日志的分析结果:
Grand Totals
------------
messages

      6   received
      4   delivered
      0   forwarded
      4   deferred  (68  deferrals)
      8   bounced
      4   rejected (50%)
      0   reject warnings
      0   held
      0   discarded (0%)

  12442   bytes received
   8637   bytes delivered
      1   senders
      1   sending hosts/domains
      1   recipients
      1   recipient hosts/domains


Per-Day Traffic Summary
    date          received  delivered   deferred    bounced     rejected
    --------------------------------------------------------------------
    Oct 16 2005         0          0         38
    Oct 17 2005         6          4         30          8          4

Per-Hour Traffic Daily Average
    time          received  delivered   deferred    bounced     rejected
    --------------------------------------------------------------------
    0000-0100           0          0          1          0          0
    0100-0200           0          0          1          0          0
    0200-0300           0          0          1          0          0
    0300-0400           0          0          1          0          0
    0400-0500           1          0          6          0          0
    0500-0600           0          0          2          0          0
    0600-0700           0          0          3          0          0
    0700-0800           0          0          3          0          0
    0800-0900           2          2          2          4          2
    0900-1000           0          0          1          0          0
    1000-1100           0          0          1          0          0
    1100-1200           0          0          1          0          0
    1200-1300           0          0          1          0          0
    1300-1400           0          0          1          0          0
    1400-1500           0          0          0          0          0
[root@PostFix lhg]# cat result.txt   

Grand Totals
------------
messages

      6   received
      4   delivered
      0   forwarded
      4   deferred  (68  deferrals)
      8   bounced
      4   rejected (50%)
      0   reject warnings
      0   held
      0   discarded (0%)

  12442   bytes received
   8637   bytes delivered
      1   senders
      1   sending hosts/domains
      1   recipients
      1   recipient hosts/domains


Per-Day Traffic Summary
    date          received  delivered   deferred    bounced     rejected
    --------------------------------------------------------------------
    Oct 16 2005         0          0         38
    Oct 17 2005         6          4         30          8          4

Per-Hour Traffic Daily Average
    time          received  delivered   deferred    bounced     rejected
    --------------------------------------------------------------------
    0000-0100           0          0          1          0          0
    0100-0200           0          0          1          0          0
    0200-0300           0          0          1          0          0
    0300-0400           0          0          1          0          0
    0400-0500           1          0          6          0          0
    0500-0600           0          0          2          0          0
    0600-0700           0          0          3          0          0
    0700-0800           0          0          3          0          0
    0800-0900           2          2          2          4          2
    0900-1000           0          0          1          0          0
    1000-1100           0          0          1          0          0
    1100-1200           0          0          1          0          0
    1200-1300           0          0          1          0          0
    1300-1400           0          0          1          0          0
    1400-1500           0          0          0          0          0
    1500-1600           0          0          1          0          0
    1600-1700           0          0          2          0          0
    1700-1800           0          0          1          0          0
    1800-1900           0          0          1          0          0
    1900-2000           0          0          1          0          0
    2000-2100           0          0          1          0          0
    2100-2200           0          0          1          0          0
    2200-2300           0          0          0          0          0
    2300-2400           0          0          1          0          0

Host/Domain Summary: Message Delivery
sent cnt  bytes   defers   avg dly max dly host/domain
-------- -------  -------  ------- ------- -----------
      4     8637       68    16.9 h   28.9 h  www.freeshare.com.cn

Host/Domain Summary: Messages Received
msg cnt   bytes   host/domain
-------- -------  -----------
      6    12442   www.freeshare.com.cn

Senders by message count
------------------------
      6   root@www.freeshare.com.cn

Recipients by message count
---------------------------
      4   root@www.freeshare.com.cn

Senders by message size
-----------------------
  12442   root@www.freeshare.com.cn

Recipients by message size
--------------------------
   8637   root@www.freeshare.com.cn

message deferral detail
-----------------------
  smtp (total: 6
        68   127.0.0.1[127.0.0.1]: Connection refused

message bounce detail (by relay)
--------------------------------
  maildrop (total:
         8   user unknown. Command output: Invalid user specified.

message reject detail
---------------------
  VRFY
    to=<test@feifei.com>; proto=ESMTP helo=<localhost>; (total: 2)
           2   PostFix
    to=<testuser@feifei.com>; proto=ESMTP helo=<localhost>; (total: 1)
           1   PostFix
    to=<testuser>; proto=ESMTP helo=<localhost>; (total: 1)
           1   PostFix

message reject warning detail: none

message hold detail: none

message discard detail: none

smtp delivery failures
----------------------
  connection refused (total: 6
        68   127.0.0.1

Warnings
--------
  local (total: 2)
         2   dict_nis_init: NIS domain name not set - NIS lookups disabled
  smtpd (total: 1)
         1   dict_nis_init: NIS domain name not set - NIS lookups disabled

Fatal Errors
------------
  postmap (total: 1)
         1   usage: postmap [-Nfinoprsvw] [-c config_dir] [-d key] [-q key] ...

Panics: none

Master daemon messages
----------------------
      1   daemon started -- version 2.2.3, configuration /etc/postfix
      1   reload configuration /etc/postfix
      1   terminating on signal 15

还有一些日志分析工具如awstats、大家一起来跟帐,看一看哪个工具最好用等。

论坛徽章:
0
25 [报告]
发表于 2005-10-14 14:31 |只看该作者

安装postfix的无法创建邮件域目录

时至今日大概安装成功了,安装了四次了。理顺了各软件之间的关系,有哪位遇了相关的问题可以在这里跟贴。结合大家的力量一起解决。

论坛徽章:
0
24 [报告]
发表于 2005-09-30 17:09 |只看该作者

安装postfix的无法创建邮件域目录

我安装了一个clamav-0.87版本的,OK,可以解决此类问题了!呵呵谢谢!
我的安装还在继续进行!

论坛徽章:
0
23 [报告]
发表于 2005-09-30 11:09 |只看该作者

安装postfix的无法创建邮件域目录

装个新版本应该能解决

论坛徽章:
0
22 [报告]
发表于 2005-09-30 11:04 |只看该作者

安装postfix的无法创建邮件域目录

经过一些时间的努务终于有所小成啊,但是现在好像还有一些比较困难的问题存在。我的clamav运行后出现了错误提示:
#clamd status
前台提示为:
LibClamAV Warning: ********************************************************
LibClamAV Warning: ***  This version of the ClamAV engine is outdated.  ***
LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/faq.html ***
LibClamAV Warning: ********************************************************
LibClamAV Warning: ********************************************************
LibClamAV Warning: ***  This version of the ClamAV engine is outdated.  ***
LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/faq.html ***
LibClamAV Warning: ********************************************************
提示是过期,但是目日志中提示的是:
+++ Started at Fri Sep 30 11:06:58 2005
clamd daemon 0.84 (OS: linux-gnu, ARCH: i386, CPU: i686)
Log file size limited to 1048576 bytes.
Verbose logging activated.
Running as user amavis (UID 12347, GID 54323)
Reading databases from /usr/local/share/clamav
Protecting against 40394 viruses.
ERROR: bind() error: Address already in use

关键是:ERROR: bind() error: Address already in use
我有看到过这样的错误提示,说是因为clamd的BUG,需要打补订才行。
我现在又找不到原来看过的网站,真是一下忘了记来的错啊,有没有哪位大哥看
到过此错误,解决方法是不是下载补订呢?
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP