iT邦幫忙

0

postfix(網域認證)限制特定帳號無法收發信

postfix是使用網域認證的方式,而現在想設定某一個網域帳號無法收發信,
可是不是使用停用網域帳號的方法,只是單純的想說某網域帳號無法收發信
卻可以正常登入網域,這麼有方法可以設定解決嗎?

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

10
wonton
iT邦高手 6 級 ‧ 2009-09-04 10:20:52
最佳解答

我想到的方法是分開來限制, 首先寄信部份, 建立一個 reject_user list,

<pre class="c" name="code">編輯 vi /etc/postfix/reject_user
填入 user1@domain.com reject 後存檔
建立 map db 檔 postmap hash:/etc/postfix/reject_user

然後編輯 vi /etc/postfix/main.cf

<pre class="c" name="code">在原本的 smtpd_recipient_restrictions 或 smtpd_sender_restrictions 敘述中
加入 check_sender_access hash:/etc/postfix/reject_user 條件

要記得比 permit 條件還前面, 存檔重啟 postfix 即可限制發信。

至於收信, 可以透過 alias 來實現, 看是要 alias 到另一個帳號, 還是 alias 到 /dev/null 直接丟掉.

power1 iT邦新手 2 級 ‧ 2009-09-04 11:25:27 檢舉

不好意思再請教幾個問題
1.請問一下postmap 這個指令有什麼用處
2.直接在smtpd_recipient_restrictions 或 smtpd_sender_restrictions 敘述中直接加入check_sender_access hash:/etc/postfix/reject_user 還是
hash:/etc/postfix/reject_user,感覺第一個加入有點怪怪的

我檢查了smtpd_recipient_restrictions 或 smtpd_sender_restrictions分別為
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination

smtpd_sender_restrictions = hash:/etc/postfix/access

是直接在後面加入check_sender_access hash:/etc/postfix/reject_user嗎
smtpd_recipient_restrictions =
check_sender_access hash:/etc/postfix/reject_user,permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination

power1 iT邦新手 2 級 ‧ 2009-09-04 11:28:38 檢舉

不好意思滑鼠按太快,導至內容敍述有點怪,請看第一個段落就好

power1 iT邦新手 2 級 ‧ 2009-09-05 11:52:24 檢舉

感謝,問題已經解決了
不過有個問題想再請問一下
check_sender_access hash:/etc/postfix/reject_user 中的check_sender_access
是自訂的還是postfix原本就有這個設定

我要發表回答

立即登入回答