限制部分Postfix用户只能内部收发的例子(完整版)
来源:互联网 发布:sap数据导出 编辑:程序博客网 时间:2024/05/19 17:56
1)在main.cf里定义如下的smtpd_restriction_classes:2)将main.cf里的smtpd_recipient_restrctions定义为:3)编辑/etc/postfix/local_in_senders:4)编辑/etc/postifx/local_out_senders:5)编辑/etc/postfix/local_domains:6)为3,4,5建立对应的hash文件:这样就定义了extmail.org域名里两个用户foo和bar,只允许和internal.foo.com和internel.bar.com 两个内部域的用户来往邮件,对于外部的邮件则没有收或发的能力。如果外部邮件企图给这2个用户发送,则遇到如下错误:如果这2个内部用户要给外部用户发email,将遇到如下错误:
# restrictions
smtpd_restriction_classes = local_out_only local_in_only
local_out_only = check_recipient_access hash:/etc/postfix/local_domains, reject
local_in_only = check_sender_access hash:/etc/postfix/local_domains, reject
smtpd_recipient_restrictions =
check_sender_access hash:/etc/postfix/local_out_senders
check_recipient_access hash:/etc/postfix/local_in_senders
permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname,
foo@extmail.org local_in_only
bar@extmail.org local_in_only
foo@extmail.org local_out_only
bar@extmail.org local_out_only
internal.foo.com OK
internal.bar.com OK
# postmap hash:/etc/postfix/local_in_senders
# postmap hash:/etc/postfix/local_out_senders
# postmap hash:/etc/postfix/local_domains
554 5.7.1 <foo@extmail.org>: Recipient address rejected: Access denied
554 5.7.1 <bar@extmail.org>: Sender address rejected: Access denied
目前这样的配置就可以比较完整的实现内部用户的功能需求了。其实这种配置的方法和之前的帖子道理一样,关键得分清楚什么阶段,调用什么restrictions即可。
转自:http://www.extmail.org/forum/viewthread.php?tid=6447
service postfix restart
- 限制部分Postfix用户只能内部收发的例子(完整版)
- 限制部分Postfix用户只能内部收发的例子(完整版)
- 在Exchange Server 2007中限制部分用户只能收发内部邮件
- 如何限制某些用户只能收发内部邮件,不能够对外收发邮件?
- postfix限制特定用户收发邮件的高级访问控制方法
- postfix中限制认证用户使用的sender address
- Exchange2007如何设置部分用户只允许在收发内部邮件,而不能收发外网邮件?
- mutt + fetchmail + postfix 收发imap的邮件
- VSFTP限制某用户只能访问自己的目录
- 限制用户只能登录一次的最佳方案
- EX2003/2007/2010 限制用户收发邮件
- postfix限制本域用户可以群发到all邮箱
- postfix邮件系统完整版
- postfix邮件系统完整版
- 【oracle】限制用户只能建立一个会话
- 限制同一时间只能一个用户登录
- JS限制用户只能输入数字
- mysql限制用户只能访问指定数据库
- JS中如何引用EL表达式
- ABAP 学习
- android EditText插入字符串到光标所在位置
- android系统硬件抽象层(HAL)原理及实现之原理
- 链接busybox的未链接的命令到/bin/路径
- 限制部分Postfix用户只能内部收发的例子(完整版)
- MyEclipse10中的html/JSP编辑器配置代码自动提示
- GC Root
- PRML(Pattern Recognition And Machine Learning)学习【1】
- JSDT jQuery 自动完成功能设置
- Ubuntu下阅读CHM格式的文档
- rtmp example
- Win2003 远程控制管理工具tsmmc 移植到XP连接多个服务器远程桌面的方法
- sms service