Golfreeze.packetlove.com: Life style of Golfreeze Canon400D Family kammtan.com Jazz Freebsd Unix Linux System Admin guitar Music

All about unix linux freebsd and FAQ for Packetlove.com Web hosting , Mail hosting , VoIP + IP PBX server => Mail issue , problem , configuration => Topic started by: golfreeze on มกราคม 09, 2015, 04:08:10 PM

Title: amavisd.conf allow zip with password file and .exe inside.
Post by: golfreeze 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  
Title: Re: amavisd.conf allow zip with password file and .exe inside.
Post by: golfreeze on มีนาคม 16, 2015, 11:52:49 AM
check mailing list for amavisd
http://www.1001newsgroups.com/l-mailing.unix.amavis-user.html (http://www.1001newsgroups.com/l-mailing.unix.amavis-user.html)