歡迎您光臨本站 註冊首頁

postfix不能禁止用戶發送到指定到別名組中

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

postfix不能禁止用戶發送到指定到別名組中

各位高手,我遇到了個問題,我到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::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



# cat local_sender
mail.com        OK


# cat local_recipient
dev2@mail.com                local_only
dp_develop@mail.com        local_only

# cd maps
# cat allsender
xx@mail.com        rejectall
yy@mail.com        rejectall
zz@mail.com        rejectall
mm@mail.com        rejectall

# cat rejectall
dp_develop@mail.com        REJECT
dev2@mail.com                REJECT

# cat dev2
dev2@mail.com        RELAY
dp_develop@mail.com        REJECT



# cat dp_develop
dp_develop@mail.com        RELAY
dev2@mail.com                REJECT


上面是配置文件了,再貼上我到dns的配置文件
# cd /var/named/chroot/var/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: SelfCheck: Database status OK.
Oct 16 01:47:45 redhat postfix/smtpd: connect from localhost.localdomain
Oct 16 01:47:45 redhat postfix/smtpd: C1D008F6AB: client=localhost.localdomain
Oct 16 01:47:45 redhat postfix/cleanup: C1D008F6AB: message-id=<20111015174745.C1D008F6AB@redhat.mail.com>
Oct 16 01:47:45 redhat postfix/qmgr: C1D008F6AB: from=<xx@redhat.mail.com>, size=599, nrcpt=1 (queue active)
Oct 16 01:47:45 redhat postfix/smtpd: disconnect from localhost.localdomain
Oct 16 01:47:48 redhat postfix/smtpd: connect from localhost.localdomain
Oct 16 01:47:48 redhat postfix/smtpd: 763758F7D2: client=localhost.localdomain
Oct 16 01:47:48 redhat postfix/cleanup: 763758F7D2: message-id=<20111015174745.C1D008F6AB@redhat.mail.com>
Oct 16 01:47:48 redhat postfix/qmgr: 763758F7D2: from=<xx@redhat.mail.com>, size=1454, nrcpt=1 (queue active)
Oct 16 01:47:48 redhat postfix/smtpd: disconnect from localhost.localdomain
Oct 16 01:47:48 redhat amavis: (04496-02) Passed SPAM, MYNETS LOCAL <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: C1D008F6AB: to=<mm@redhat.mail.com>, relay=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(:10025): 250 2.0.0 Ok: queued as 763758F7D2)
Oct 16 01:47:48 redhat postfix/qmgr: C1D008F6AB: removed
Oct 16 01:47:48 redhat postfix/pipe: 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: 763758F7D2: removed

發到
相應組
dev2組
Oct 16 01:49:07 redhat postfix/smtpd: connect from localhost.localdomain
Oct 16 01:49:07 redhat postfix/smtpd: 207908F6AB: client=localhost.localdomain
Oct 16 01:49:07 redhat postfix/cleanup: 207908F6AB: message-id=<20111015174907.207908F6AB@redhat.mail.com>
Oct 16 01:49:07 redhat postfix/qmgr: 207908F6AB: from=<xx@redhat.mail.com>, size=599, nrcpt=2 (queue active)
Oct 16 01:49:07 redhat postfix/smtpd: disconnect from localhost.localdomain
Oct 16 01:49:09 redhat postfix/smtpd: connect from localhost.localdomain
Oct 16 01:49:09 redhat postfix/smtpd: 119608F7D3: client=localhost.localdomain
Oct 16 01:49:09 redhat postfix/cleanup: 119608F7D3: message-id=<20111015174907.207908F6AB@redhat.mail.com>
Oct 16 01:49:09 redhat postfix/smtpd: disconnect from localhost.localdomain
Oct 16 01:49:09 redhat amavis: (04498-02) Passed SPAM, MYNETS LOCAL <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: 207908F6AB: to=<xx@redhat.mail.com>, orig_to=<dev2@redhat.mail.com>, relay=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(:10025): 250 2.0.0 Ok: queued as 119608F7D3)
Oct 16 01:49:09 redhat postfix/smtp: 207908F6AB: to=<yy@redhat.mail.com>, orig_to=<dev2@redhat.mail.com>, relay=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(:10025): 250 2.0.0 Ok: queued as 119608F7D3)
Oct 16 01:49:09 redhat postfix/qmgr: 207908F6AB: removed
Oct 16 01:49:09 redhat postfix/qmgr: 119608F7D3: from=<xx@redhat.mail.com>, size=1382, nrcpt=2 (queue active)
Oct 16 01:49:10 redhat postfix/pipe: 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: 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: 119608F7D3: removed


dp_develop2竟然也可以
Oct 16 01:50:26 redhat postfix/smtpd: connect from localhost.localdomain
Oct 16 01:50:26 redhat postfix/smtpd: 9A9B98F6AB: client=localhost.localdomain
Oct 16 01:50:26 redhat postfix/cleanup: 9A9B98F6AB: message-id=<20111015175026.9A9B98F6AB@redhat.mail.com>
Oct 16 01:50:27 redhat postfix/qmgr: 9A9B98F6AB: from=<xx@redhat.mail.com>, size=670, nrcpt=2 (queue active)
Oct 16 01:50:27 redhat postfix/smtpd: disconnect from localhost.localdomain
Oct 16 01:50:28 redhat postfix/smtpd: connect from localhost.localdomain
Oct 16 01:50:28 redhat postfix/smtpd: 9FE3A8F7D4: client=localhost.localdomain
Oct 16 01:50:28 redhat postfix/cleanup: 9FE3A8F7D4: message-id=<20111015175026.9A9B98F6AB@redhat.mail.com>
Oct 16 01:50:29 redhat postfix/smtpd: disconnect from localhost.localdomain
Oct 16 01:50:29 redhat amavis: (04499-02) Passed SPAM, MYNETS LOCAL <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: 9FE3A8F7D4: from=<xx@redhat.mail.com>, size=1453, nrcpt=2 (queue active)
Oct 16 01:50:29 redhat postfix/smtp: 9A9B98F6AB: to=<mm@redhat.mail.com>, orig_to=<dp_develop@redhat.mail.com>, relay=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(:10025): 250 2.0.0 Ok: queued as 9FE3A8F7D4)
Oct 16 01:50:29 redhat postfix/smtp: 9A9B98F6AB: to=<zz@redhat.mail.com>, orig_to=<dp_develop@redhat.mail.com>, relay=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(:10025): 250 2.0.0 Ok: queued as 9FE3A8F7D4)
Oct 16 01:50:29 redhat postfix/qmgr: 9A9B98F6AB: removed
Oct 16 01:50:29 redhat postfix/pipe: 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: 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: 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




請問,我這是哪裡出問題了?請高手指點,很是著急,求教了~~~
《解決方案》

難道CU就沒有一個人回答我嗎?

[火星人 ] postfix不能禁止用戶發送到指定到別名組中已經有691次圍觀

http://coctec.com/docs/service/show-post-13905.html