文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>postfix 只允许指定的用户给特定的..

postfix 只允许指定的用户给特定的..

时间:2010-10-12  来源:trt2008

公司需求:只有公司高层才可以向全体员工发送邮件,除此之外,均无权向全体员工发送邮件。

 

公司高层邮箱:

[email protected]

[email protected]  

[email protected]

[email protected]   

[email protected] 

 

全体员工邮箱:[email protected]

 

 

解决方法如下:

 

1,修改配置文件(注:红色的代表新增加的)

[root@mail postfix]# vi main.cf

 

#youshengtao 2010-10-12

smtpd_restriction_classes = local_only, local_only1

local_only = check_recipient_access hash:/etc/postfix/plugin/plugin.list,reject

local_only1 = check_sender_access hash:/etc/postfix/plugin/plugin.users,reject

 

smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqd

n_recipient, reject_unlisted_recipient, check_sender_access hash:/etc/postfix/plugin/plugin.users, check_sender_access hash:/etc/postfix/plugin/local_senders, check_recipient_access hash:/etc/postfix/plugin/local_recipients, permit_mynetworks, permit_sasl_authenticated, rejec

t_unauth_destination, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_policy_service inet:127.0.0.1:10031

 

 

 

2,建立相关的目录,也可以不建目录,直接放在postifx目录下面,不过,为了以后维护方便,我还是建了一个目录。

[root@mail ~]# mkdir -p /etc/postfix/plugin

[root@mail ~]# cd /etc/postfix/plugin/

 

[root@mail plugin]# vi local_recipients

[email protected] local_only1

 

[root@mail plugin]# vi local_senders

[email protected] local_only

[email protected]    local_only

[email protected]  local_only

[email protected]     local_only

[email protected]  local_only

 

[root@mail plugin]# vi plugin.list

[email protected] OK

 

[root@mail npc]# vi plugin.users

[email protected] OK

[email protected]    OK

[email protected]  OK

[email protected]     OK

[email protected] OK

 

 

3,利用postmap生成postfix查数据库。

postmap hash:/etc/postfix/plugin/plugin.list

postmap hash:/etc/postfix/plugin/plugin.users

postmap hash:/etc/postfix/plugin/local_senders

postmap hash:/etc/postfix/plugin/local_recipients

 

 

4,重载postfix后,邮件服务器正常工作,实现了我们需要的功能。

[root@mail npc]# service postfix reload

重新载入postfix:[确定]

 

 

 

备注:不要忘记第3步,否则服务器会不能收发任何邮件,日志中会有如下提示:

Oct 12 13:55:15 mail postfix/smtpd[875]: fatal: open database /etc/postfix/plugin/recipient_list.db: No such file or directory

Oct 12 13:55:16 mail postfix/master[2266]: warning: process /usr/libexec/postfix/smtpd pid 875 exit status 1

Oct 12 13:55:16 mail postfix/master[2266]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling

相关阅读 更多 +
排行榜 更多 +
火柴人战争血腥打击

火柴人战争血腥打击

飞行射击 下载
沉浸式射击比赛

沉浸式射击比赛

飞行射击 下载
银河世界

银河世界

飞行射击 下载