Block Mail ไวรัสที่แนบไฟล์ .bat .exe .com .vbs บน Postfix

Delivery Status Notification (Failure)
อยู่ดีๆมีเมล์ไม่พึ่งประสงค์เข้ามาประมาณ 900 ฉบับจากปกติที่เข้ามาไม่กี่ร้อยเองวันนี้เหมือนโดนไวรัสเล่นงานซ่ะแล้วเพราะว่าโดนแนบไฟล์ ecard.exe มาด้วย เลยค้นหาวิธีแก้ไม่รู้จะใช้ได้ไหมยังไงลองเพิ่มไปก่อนแล้วกัน วิธีนี้เป็นการสั่งให้ postfix ตรวจสอบ mime header ของเมล์ที่ส่งเข้ามาโดยให้ทำการป้องกันไฟล์ที่มีนามสกุล .com, .exe, .vbs และ .bat ครับ ขั้นตอนง่ายๆทำตามเค้าเลยแล้วกัน
Define mine header checks
Open main.cf file:
# vi /etc/postfix/main.cf
Append / set mime_header_checks directive as follows:
mime_header_checks = regexp:/etc/postfix/mime_header_checks
Save and close the file.
Block attachments
Now open /etc/postfix/mime_header_checks file:
# vi /etc/postfix/mime_header_checks
Append following line:
/name=[^>]*.(bat|com|exe|dll|vbs)/ REJECT
Save and close the file.
Restart postfix
First create postfix lookup table for mime_header_checks file:
# /etc/init.d/postfix restart
เพียงเท่านี้ก็สิ้นสุดของการป้องกันแล้วครับ(ไม่รู้จะเอามันอยู่ไหมนะ อิอิ ลองดูก่อนแล้วกัน)
ที่มา : http://www.cyberciti.biz



Posted in
Tags: