อ่านเจอจากเว็บไซต์ spalinux เป็นบทความที่มีประโยชน์ เพราะใช้ dovecot authen mail ก่อนจะส่งออก เป็นการป้องกัน และเช็ค ไม่ให้เราโดนรีเลสแปม
login-before-send-mail-by-configure-smtp-auth-in-postfix-on-centos-6
configure-postfix-smtp-auth-with-dovecot-on-fedora-17
Showing posts with label postfix. Show all posts
Showing posts with label postfix. Show all posts
Thursday, December 17, 2015
Thursday, June 18, 2015
การกำหนดสิทธ์ให้บางคนส่งเมลออกข้างนอกได้เท่านั้น
สิ่งที่ต้องทำมีดังนี้
1. แก้ไขไฟล์ #vim main.cf
เพิ่มบรรทัดด้านล่าง
smtpd_restriction_classes = external, local_only
external = reject_unauth_destination
local_only = check_recipient_access hash:/etc/postfix/local_domains, reject_unauth_destination
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/restricted_senders
2. สร้างไฟล์ local_domains แล้วแอดโดเมนที่ต้องการให้ส่งเมลออกได้ (ส่วนใหญ่เป็นเมลภายในบริษัท) ดังนี้
#vim local_domains
domain.com OK
abc.domain.org OK
บันทึก แล้ว postmap /etc/postfix/local_domains
3. สร้างไฟล์ #vim restricted_senders
เพิ่มข้อมูลดังนี้
บรรทัดที่ 1: ใส่เมลที่ต้องการให้ส่งเมลออกได้
บรรทัดที่ 2: ใส่โดเมนที่ไม่ต้องการให้ส่งเมลออกไป
#vim restricted_senders
abc@domain.com OK
domain.com local_only
* สำหรับการเพิ่มเมลคนอื่น ๆ ก็ใส่เพิ่มเข้ามาก่อนบรรทัด domain.com local_only
เสร็จแล้วรันคำสั่ง
#postmap /etc/postfix/restricted_sendes
4. ให้ตรวจสอบ file /etc/default/saslauthd
# Example: MECHANISMS="pam"
#MECHANISMS="ldap"
PARAMS="-r"
MECHANISMS="rimap -O 192.168.0.xx" (IP Mail server ตัวหลัก)
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
5. สุดท้ายสั่ง service postfix ,saslauthd เพื่อใช้งาน
/etc/init.d/postfix restart
/etc/init.d/saslauthd restart
บทความที่เกี่ยวข้อง
1. แก้ไขไฟล์ #vim main.cf
เพิ่มบรรทัดด้านล่าง
smtpd_restriction_classes = external, local_only
external = reject_unauth_destination
local_only = check_recipient_access hash:/etc/postfix/local_domains, reject_unauth_destination
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/restricted_senders
2. สร้างไฟล์ local_domains แล้วแอดโดเมนที่ต้องการให้ส่งเมลออกได้ (ส่วนใหญ่เป็นเมลภายในบริษัท) ดังนี้
#vim local_domains
domain.com OK
abc.domain.org OK
บันทึก แล้ว postmap /etc/postfix/local_domains
3. สร้างไฟล์ #vim restricted_senders
เพิ่มข้อมูลดังนี้
บรรทัดที่ 1: ใส่เมลที่ต้องการให้ส่งเมลออกได้
บรรทัดที่ 2: ใส่โดเมนที่ไม่ต้องการให้ส่งเมลออกไป
#vim restricted_senders
abc@domain.com OK
domain.com local_only
* สำหรับการเพิ่มเมลคนอื่น ๆ ก็ใส่เพิ่มเข้ามาก่อนบรรทัด domain.com local_only
เสร็จแล้วรันคำสั่ง
#postmap /etc/postfix/restricted_sendes
4. ให้ตรวจสอบ file /etc/default/saslauthd
# Example: MECHANISMS="pam"
#MECHANISMS="ldap"
PARAMS="-r"
MECHANISMS="rimap -O 192.168.0.xx" (IP Mail server ตัวหลัก)
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
5. สุดท้ายสั่ง service postfix ,saslauthd เพื่อใช้งาน
/etc/init.d/postfix restart
/etc/init.d/saslauthd restart
บทความที่เกี่ยวข้อง
Labels:
mail,
mail restrict,
postfix,
กำหนดสิทธิ์การส่งเมลออกข้างนอก
Subscribe to:
Posts (Atom)