免费注册 查看新帖 |

Chinaunix

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

[Mail] postfix不能禁止用户发送到指定到别名组中 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-10-16 01:54 |只看该作者 |倒序浏览
各位高手,我遇到了个问题,我到postfix架设好以后,可以给各用户发送信件,是没有问题,然后我新建了两个别名,分别是
在extmail用户管理界面创建
dev2@redhat.mail.com
dp_develop@redhat.mail.com

然后我在postfix的配置文件中main.cf加入了
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = redhat.mail.com
mydomain = mail.com
myorigin = $mydomain
inet_interfaces = all
mydestination =
unknown_local_recipient_reject_code = 550
mynetworks = 168.168.1.0/24, 127.0.0.0/8

debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
html_directory = /var/www/postfix_html
manpage_directory = /usr/local/postfix/man
sample_directory = /etc/postfix
readme_directory = no
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $mydomain
smtpd_sasl_security_options = noanonymous
smtpd_sasl_application_name = smtpd
smtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version not Available!

virtual_mailbox_base=/var/mailbox
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=
virtual_alias_maps=mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf
virtual_uid_maps=static:1001
virtual_gid_maps=static:1001
virtual_transport=maildrop
maildrop_destination_recipient_limit=1
maildrop_destination_concurrency_limit=1


message_size_limit=1433600
virtual_mailbox_limit=20791520
virtual_create_maildirsize=yes
virtual_mailbox_extended=yes
virtual_mailbox_limit_maps=mysql:/etc/postfix/mysql/virtual_mailbox_limit_override=yes
virtual_maildir_limit_message=User's maildir has overdrawn his diskspace quota,try again later.
virtual_overquota_bounce=yes


content_filter=amavisfeed:[127.0.0.1]:10024
max_use=10
debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
html_directory = /var/www/postfix_html
manpage_directory = /usr/local/postfix/man
sample_directory = /etc/postfix

这里开始是配置规则
smtpd_restriction_classes = local_only,dev2,dp_develop
local_only = check_sender_access hash:/etc/postfix/local_sender,reject
dev2 = check_recipient_access hash:/etc/postfix/maps/dev2
dp_develop = check_recipient_access hash:/etc/postfix/maps/dp_develop
rejectall = check_recipient_access hash:/etc/postfix/maps/rejectall
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/maps/allsender, check_recipient_access hash:/etc/postfix/local_recipient



[root@redhat postfix]# cat local_sender
mail.com        OK


[root@redhat postfix]# cat local_recipient
dev2@mail.com                local_only
dp_develop@mail.com        local_only

[root@redhat postfix]# cd maps
[root@redhat maps]# cat allsender
xx@mail.com        rejectall
yy@mail.com        rejectall
zz@mail.com        rejectall
mm@mail.com        rejectall

[root@redhat maps]# cat rejectall
dp_develop@mail.com        REJECT
dev2@mail.com                REJECT

[root@redhat maps]# cat dev2
dev2@mail.com        RELAY
dp_develop@mail.com        REJECT



[root@redhat maps]# cat dp_develop
dp_develop@mail.com        RELAY
dev2@mail.com                REJECT


上面是配置文件了,再贴上我到dns的配置文件
[root@redhat maps]# cd /var/named/chroot/var/named/
[root@redhat named]# cat mail.com
$TTL    86400

@               IN SOA  ns.mail.com.       root.mail.com. (

                                        42              ; serial (d. adams)

                                        3H              ; refresh

                                        15M             ; retry

                                        1W              ; expiry

                                        1D )            ; minimum

  

                IN NS           ns.mail.com

                IN MX 10        mail.mail.com

redhat          IN A            192.168.1.108

ns              IN A            192.168.1.108

mail            IN A            192.168.1.108

www             IN A            192.168.1.108

$TTL    86400

@       IN      SOA     ns.mail.com. root.mail.com.  (

                                      1997022700 ; Serial

                                      28800      ; Refresh

                                      14400      ; Retry

                                      3600000    ; Expire

                                      86400 )    ; Minimum

@        IN      NS      ns.mail.com.

@       IN      MX 10   mail.mail.com

108     IN      PTR     redhat.mail.com

108     IN      PTR     ns.mail.com

108     IN      PTR     mail.mail.com

108     IN      PTR     www.mail.com



最后贴上我到日志文件maillog的,
分三种情况
单一用户发送的
可以收到
# cat /var/log/maillog
Oct 16 01:47:25 redhat clamd[4382]: SelfCheck: Database status OK.
Oct 16 01:47:45 redhat postfix/smtpd[7863]: connect from localhost.localdomain[127.0.0.1]
Oct 16 01:47:45 redhat postfix/smtpd[7863]: C1D008F6AB: client=localhost.localdomain[127.0.0.1]
Oct 16 01:47:45 redhat postfix/cleanup[7869]: C1D008F6AB: message-id=<20111015174745.C1D008F6AB@redhat.mail.com>
Oct 16 01:47:45 redhat postfix/qmgr[6290]: C1D008F6AB: from=<xx@redhat.mail.com>, size=599, nrcpt=1 (queue active)
Oct 16 01:47:45 redhat postfix/smtpd[7863]: disconnect from localhost.localdomain[127.0.0.1]
Oct 16 01:47:48 redhat postfix/smtpd[7875]: connect from localhost.localdomain[127.0.0.1]
Oct 16 01:47:48 redhat postfix/smtpd[7875]: 763758F7D2: client=localhost.localdomain[127.0.0.1]
Oct 16 01:47:48 redhat postfix/cleanup[7869]: 763758F7D2: message-id=<20111015174745.C1D008F6AB@redhat.mail.com>
Oct 16 01:47:48 redhat postfix/qmgr[6290]: 763758F7D2: from=<xx@redhat.mail.com>, size=1454, nrcpt=1 (queue active)
Oct 16 01:47:48 redhat postfix/smtpd[7875]: disconnect from localhost.localdomain[127.0.0.1]
Oct 16 01:47:48 redhat amavis[4496]: (04496-02) Passed SPAM, MYNETS LOCAL [127.0.0.1] [127.0.0.1] <xx@redhat.mail.com> -> <mm@redhat.mail.com>, quarantine: spam-aEXzlQo61iu2.gz, Message-ID: <20111015174745.C1D008F6AB@redhat.mail.com>, mail_id: aEXzlQo61iu2, Hits: 12.424, size: 599, queued_as: 763758F7D2, 2719 ms
Oct 16 01:47:48 redhat postfix/smtp[7871]: C1D008F6AB: to=<mm@redhat.mail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.8, delays=0.08/0/0.18/2.6, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=04496-02, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 763758F7D2)
Oct 16 01:47:48 redhat postfix/qmgr[6290]: C1D008F6AB: removed
Oct 16 01:47:48 redhat postfix/pipe[7876]: 763758F7D2: to=<mm@redhat.mail.com>, relay=maildrop, delay=0.41, delays=0.05/0.01/0/0.36, dsn=2.0.0, status=sent (delivered via maildrop service)
Oct 16 01:47:48 redhat postfix/qmgr[6290]: 763758F7D2: removed

发到
相应组
dev2组
Oct 16 01:49:07 redhat postfix/smtpd[7863]: connect from localhost.localdomain[127.0.0.1]
Oct 16 01:49:07 redhat postfix/smtpd[7863]: 207908F6AB: client=localhost.localdomain[127.0.0.1]
Oct 16 01:49:07 redhat postfix/cleanup[7869]: 207908F6AB: message-id=<20111015174907.207908F6AB@redhat.mail.com>
Oct 16 01:49:07 redhat postfix/qmgr[6290]: 207908F6AB: from=<xx@redhat.mail.com>, size=599, nrcpt=2 (queue active)
Oct 16 01:49:07 redhat postfix/smtpd[7863]: disconnect from localhost.localdomain[127.0.0.1]
Oct 16 01:49:09 redhat postfix/smtpd[7875]: connect from localhost.localdomain[127.0.0.1]
Oct 16 01:49:09 redhat postfix/smtpd[7875]: 119608F7D3: client=localhost.localdomain[127.0.0.1]
Oct 16 01:49:09 redhat postfix/cleanup[7869]: 119608F7D3: message-id=<20111015174907.207908F6AB@redhat.mail.com>
Oct 16 01:49:09 redhat postfix/smtpd[7875]: disconnect from localhost.localdomain[127.0.0.1]
Oct 16 01:49:09 redhat amavis[4498]: (04498-02) Passed SPAM, MYNETS LOCAL [127.0.0.1] [127.0.0.1] <xx@redhat.mail.com> -> <xx@redhat.mail.com>,<yy@redhat.mail.com>, quarantine: spam-PPAe87Ojh7dd.gz, Message-ID: <20111015174907.207908F6AB@redhat.mail.com>, mail_id: PPAe87Ojh7dd, Hits: 12.422, size: 599, queued_as: 119608F7D3, 2096 ms
Oct 16 01:49:09 redhat postfix/smtp[7871]: 207908F6AB: to=<xx@redhat.mail.com>, orig_to=<dev2@redhat.mail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.2, delays=0.1/0/0.03/2.1, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=04498-02, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 119608F7D3)
Oct 16 01:49:09 redhat postfix/smtp[7871]: 207908F6AB: to=<yy@redhat.mail.com>, orig_to=<dev2@redhat.mail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.2, delays=0.1/0/0.03/2.1, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=04498-02, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 119608F7D3)
Oct 16 01:49:09 redhat postfix/qmgr[6290]: 207908F6AB: removed
Oct 16 01:49:09 redhat postfix/qmgr[6290]: 119608F7D3: from=<xx@redhat.mail.com>, size=1382, nrcpt=2 (queue active)
Oct 16 01:49:10 redhat postfix/pipe[7876]: 119608F7D3: to=<xx@redhat.mail.com>, relay=maildrop, delay=1.3, delays=0.47/0.41/0/0.44, dsn=2.0.0, status=sent (delivered via maildrop service)
Oct 16 01:49:10 redhat postfix/pipe[7925]: 119608F7D3: to=<yy@redhat.mail.com>, relay=maildrop, delay=1.3, delays=0.47/0.45/0/0.4, dsn=2.0.0, status=sent (delivered via maildrop service)
Oct 16 01:49:10 redhat postfix/qmgr[6290]: 119608F7D3: removed


dp_develop2竟然也可以
Oct 16 01:50:26 redhat postfix/smtpd[7863]: connect from localhost.localdomain[127.0.0.1]
Oct 16 01:50:26 redhat postfix/smtpd[7863]: 9A9B98F6AB: client=localhost.localdomain[127.0.0.1]
Oct 16 01:50:26 redhat postfix/cleanup[7869]: 9A9B98F6AB: message-id=<20111015175026.9A9B98F6AB@redhat.mail.com>
Oct 16 01:50:27 redhat postfix/qmgr[6290]: 9A9B98F6AB: from=<xx@redhat.mail.com>, size=670, nrcpt=2 (queue active)
Oct 16 01:50:27 redhat postfix/smtpd[7863]: disconnect from localhost.localdomain[127.0.0.1]
Oct 16 01:50:28 redhat postfix/smtpd[7875]: connect from localhost.localdomain[127.0.0.1]
Oct 16 01:50:28 redhat postfix/smtpd[7875]: 9FE3A8F7D4: client=localhost.localdomain[127.0.0.1]
Oct 16 01:50:28 redhat postfix/cleanup[7869]: 9FE3A8F7D4: message-id=<20111015175026.9A9B98F6AB@redhat.mail.com>
Oct 16 01:50:29 redhat postfix/smtpd[7875]: disconnect from localhost.localdomain[127.0.0.1]
Oct 16 01:50:29 redhat amavis[4499]: (04499-02) Passed SPAM, MYNETS LOCAL [127.0.0.1] [127.0.0.1] <xx@redhat.mail.com> -> <mm@redhat.mail.com>,<zz@redhat.mail.com>, quarantine: spam-AerYNz0VFU4p.gz, Message-ID: <20111015175026.9A9B98F6AB@redhat.mail.com>, mail_id: AerYNz0VFU4p, Hits: 12.421, size: 670, queued_as: 9FE3A8F7D4, 1910 ms
Oct 16 01:50:29 redhat postfix/qmgr[6290]: 9FE3A8F7D4: from=<xx@redhat.mail.com>, size=1453, nrcpt=2 (queue active)
Oct 16 01:50:29 redhat postfix/smtp[7871]: 9A9B98F6AB: to=<mm@redhat.mail.com>, orig_to=<dp_develop@redhat.mail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.7, delays=0.66/0/0.06/2, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=04499-02, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 9FE3A8F7D4)
Oct 16 01:50:29 redhat postfix/smtp[7871]: 9A9B98F6AB: to=<zz@redhat.mail.com>, orig_to=<dp_develop@redhat.mail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.7, delays=0.66/0/0.06/2, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=04499-02, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 9FE3A8F7D4)
Oct 16 01:50:29 redhat postfix/qmgr[6290]: 9A9B98F6AB: removed
Oct 16 01:50:29 redhat postfix/pipe[7925]: 9FE3A8F7D4: to=<zz@redhat.mail.com>, relay=maildrop, delay=1.1, delays=0.57/0.08/0/0.41, dsn=2.0.0, status=sent (delivered via maildrop service)
Oct 16 01:50:31 redhat postfix/pipe[7876]: 9FE3A8F7D4: to=<mm@redhat.mail.com>, relay=maildrop, delay=2.4, delays=0.57/0.02/0/1.8, dsn=2.0.0, status=sent (delivered via maildrop service)
Oct 16 01:50:31 redhat postfix/qmgr[6290]: 9FE3A8F7D4: removed



实在不懂哪里除了问题,我到extman后台的设置中
dev2@redhat.mail.com
dp_develop@redhat.mail.com------------------>属于redhat.mail.com这个

dev2组有两个用户
xx@redhat.mail.com
yy@redhat.mail.com
dp_develop@redhat.mail.com也有两个用户
zz@redhat.mail.com
mm@redhat.mail.com




请问,我这是哪里出问题了?请高手指点,很是着急,求教了~~~

论坛徽章:
0
2 [报告]
发表于 2011-10-16 10:20 |只看该作者
难道CU就没有一个人回答我吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP