首 页 网络编程
网页制作 图形图象 操作系统 冲浪宝典
软件教学 认证考试

网络安全 网络办公 行业资讯 评测对比
您当前位置:站长天空 -> 软件教学-> 图文处理
限制特定用户收发邮件的高级访问控制方法_qmail
作者:网友供稿 点击:0
推荐
西部数码-全国虚拟主机10强!20余项虚拟主机管理功能,全国领先!第6代双线路虚拟主机,南北访问畅通无阻!可在线rar解压,自动数据恢复设置虚拟目录等.免费赠送访问统计,企业邮局.Cn域名注册10元/年,自助建站480元起,免费试用7天,满意再付款!P4主机租用799元/月.月付免压金
站内搜索
文章页数:[1] 

一般邮件应用稍微有一电规模的企业,大多都会涉及到这样的应用需求:

某销售A只能收到来自163.com及sina.com的邮件某技术员B只能给内部用户发邮件,不允许向外网发邮件,但可以收到外网邮件某主管可以收发内、外网邮件......

如何实现呢?Postfix 1.x就已经可以通过配置实现这些功能了。

以下是邮件列表里Noel Jones 提出的解决方案:

Hello!

I have the same problem:

1. I need to permit some internal users (not all) to send mail to any
external user (Internet)
2. I need to permite any external user to send mail to some my internal
users (not all)

In fact, the problem is: just "some" of my internal users have permission to
receive mail from and send mail to the Internet.

How can I solve this?

寄件者:Noel Jones (njones@megan.vbhcs.org)
主旨:Re: RES: User Restriction.....


View this article only
新闻群组:mailing.postfix.users
日期:2002-12-04 15:18:04 PST

At 05:39 PM 12/4/02 -0200, raissa.medeiros@caixa.gov.br wrote:
>1. I need to permit some internal users (not all) to send mail to any
>external user (Internet)
>2. I need to permite any external user to send mail to some my internal
>users (not all)
>
>In fact, the problem is: just "some" of my internal users have permission
>to receive mail from and send mail to the Internet.
>
>How can I solve this?
>
>Thanks,
>Raissa

Restricting also who can receive mail from the internet changes the example
I posted a few minutes ago.

In the example below, the same list of restricted_users is used for
controlling both who can send and who can receive internet mail. If you
dont require the local_plus feature, just leave that part out.

  1. in main.cf:
  1. use restriction classes to make restricted_users file more readable.
    smtpd_restriction_classes = local_only, local_plus

local_only =
reject_unauth_destination
permit_mynetworks
reject

local_plus =
check_recipient_access hash:/etc/postfix/local_plus
check_sender_access hash:/etc/postfix/local_plus
reject_unauth_destination
permit_mynetworks
reject

  1. this is the default setting, required for this setup.
    smtpd_delay_reject = yes
  1. well do this in sender restrictions to avoid open relay problems.
    smtpd_sender_restrictions =
    check_sender_access hash:/etc/postfix/restricted_users
    check_recipient_access hash:/etc/postfix/restricted_users

and in /etc/postfix/restricted_users
# /etc/postfix/restricted_users
# this file contains a list of users only allowed to send and receive local
mail
# postmap this file after changes
# local users not listed here have no restrictions
user1@miodemi.com local_only
user2@miodemi.com local_plus

and in /etc/postfix/local_plus:
# /etc/postfix/local_plus
# this file contains allowed destinations and senders
# for users restricted to local_plus
# postmap this file after changes
miproveedor.com OK

Remember to "postmap local_plus" and "postmap restricted_users" after
making changes to them.
Remember to run "postfix reload" after changing main.cf

我自己常用的限制方法

有几个方法:

1) smtpd_restriction_classes = local_only
设置一个限制类别叫local_only,然后参考access(5)的格式做一个访问控制:

local_only = check_recipient_access hash:/etc/postfix/maps/my_rcpt

文件my_rcpt内容:

163.com RELAY21cn.com RELAYhzqbbc.com RELAY

然后,设置:

smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/maps/mysender 

mysender内容:

hzqbbc@local.hzqbbc.com   local_only 

这样凡是Mail from:的信只能RCPT TO: 到163.com, 21cn.com及 hzqbbc.com 三个地方了。其他的都发不出去。

按这个方法,还可以设置更多的类别,例如remote_only以及不限制的帐号等。但这些都只对from:限制。而且不管是否SASL后的。所以有一定缺陷。不过,已经达到目的了。

2)使用snapshot版的policy策略
根据某个hash表或配置文件,判断对应的sender和recipient是否匹配,匹配就返回OK或者DUNNO或者RELAY等(可能RELAY已经过时,这个是postfix 1.1.x的)如果不匹配就返回错误代码

按postfix所带的smtpd-policy.pl模式,修改一下就可以使用了。详细参考POLICY_README等。

3)使用APF for postfix
详细地址:http://apf.org.cn/addon/

其实和2)方法是基本一致的。同样利用postfix内置的policy功能。


文章整理:站长天空 网址:http://www.z6688.com/
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

文章页数:[1] 


放大字体显示 缩小字体显示 打印文章 推荐给朋友
热门文章
·Java Reflection (JAVA反射)-JSP教程,Java技巧及代码
·WebServices入门-.NET教程,Web Service开发
·如何在c#中使用mapx5.0(二)-.NET教程,C#语言
·用java启动记事本程序,并输入内容-JSP教程,Java技巧及代码
·正则表达式-ASP教程,正则表达式
·sql server中的外键约束-数据库专栏,SQL Server
·java中的基于套结字(socket)的通信 一. 一个双人单方向通信例子-JSP教程,Java技巧及代码
·图解利用Eclipse3+Lomboz3+Tomcat开发JSP --1.环境-JSP教程,Jsp/Servlet
·EditPlus+NAnt构建轻巧的.NET开发环境-.NET教程,Asp.Net开发
·ASP.NET2.0下利用javascript实现TreeView中的checkbox全选-.NET教程,Asp.Net开发
最新文章
·photoshop简单为美女照片瘦身及调色_photoshop教程
·fireworks巧绘精美可爱水杯图标_fireworks教程
·如何修复windows vista系统用户损坏的配置文件_windows vista
·本地门户营运的3个重点注意事项_站长心得
·必知:在线推广网站的十四种方法_站长心得
·google analytics统计分析新版本说明_google推广
·google adsense 违规行为集_google推广
·googleadsense的无效点击_google推广
·关于网络原创作品的版权问题_网络编辑
·符合xhtml标准div+css布局的网站对网站seo的影响_seo网站优化
相关主题
西部数码虚拟主机

友情链接
CNNIC 西部数码
万网 自助建站
虚拟主机 asp空间
域名注册 域名
域名申请 主页空间
论坛空间 网站空间
国际域名 虚拟空间
空间租用 DDOS防火墙
成都主机托管 四川主机托管
主机租用 服务器租用
网站目录 自助建站
虚拟主机 网址大全
软件下载
自助链接
虚拟主机资讯 特价虚拟主机
版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!
关于我们:站长天空:专业提供最新的站长资讯、在线教程、虚拟主机权威评测、虚拟主机性能对比、网站制作教程,开发教程,站长工具。包括网页制作教程、冲浪宝典、编程参考、操作系统、软件教学、行业动态等。
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。
发表评论 打印  刷新     关闭