Author Topic: amavisd.conf allow zip with password file and .exe inside.  (Read 5250 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
amavisd.conf allow zip with password file and .exe inside.
« on: มกราคม 09, 2015, 04:08:10 PM »
amavisd.conf allow zip with password file and .exe inside.

วันนี้มาแชร์เทคนิคในการอนุญาตให้ user ทำการส่งไฟล์เข้ามาในระบบเมลของเรา
โดยมีเงื่อนไขดังนี้ ครับผม
##Requirement คือ
Disallow normal attach file (*.exe) , (*.dll)
DisAllow (.exe) if case zip,rar extension.
Allow .zip , .rar , .lzh
Allow .zip or .lzh with password encrypt and inside .zip include file .exe inside.

##On amavisd.conf
less /usr/local/etc/amavisd.conf

###Current
$final_banned_destiny     = D_PASS;
Change to
$final_banned_destiny     = D_BOUNCE;

##focus on this configure line
$banned_filename_re = new_RE(

### BLOCKED ANYWHERE (Current configure)
# qr'^UNDECIPHERABLE$',  # บันทัดนี้ถ้าเปิดจะทำการเชคไฟล์ที่ zip ใส่ password ด้วย undecipherable components ตาม requirement ปิดไว้ครับ
qr'^\.( exe|exe-ms|dll)$',         # banned file(1) types ทำการ block file ที่ .zip มี exe , dll  อยู่ภายใน

#### Current for Allow zip,rar,lzh,lha อนุญาตให้ส่ง zip ไฟล์รูปแบบต่างๆได้
# [ qr'^\.(zip|rar|arc|arj|zoo)$'=> 0 ],  # allow any within these archives
Change to allow .zip,.rar,.lzh
[ qr'^\.(zip|rar|lzh|lha)$'=> 0 ],  # allow any within these archives

เรียบร้อยแล้วทำการ restart service amavisd 1 ครั้งครับ และดู error maillog  ;)
#/usr/local/etc/rc.d/amavisd  restart  ;  tail -f /var/log/maillog  

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: amavisd.conf allow zip with password file and .exe inside.
« Reply #1 on: มีนาคม 16, 2015, 11:52:49 AM »