Nyoman JS wrote:

Mas Asfihani,
Makasih infonya.
Btw, koq blm bisa juga ya...
Anda bisa cek query dengan perintah postmap, misalnya seperti ini :

saya punya file /tmp/mime_header_checks yang isinya RE untuk menolak file jpg :

$ cat /tmp/mime_header_checks
/^\s*Content-(Disposition|Type).*name\s*=\s*"?(.+\.(jpg|3gp))"?\s*$/ REJECT Attachment type not allowed. File "$2" has the unacceptable extension "$3"

saya punya contoh email berupa file (/tmp/1125367691.V303I128052M95048.server.trabas.com) yang mengandung attachment f6df62f.jpg:

$ grep Content-Type /tmp/1125367691.V303I128052M95048.server.trabas.com
Content-Type: application/octet-stream; name="f6df62f.jpg"

Test query dengan postmap -q :

$ cat /tmp/1125367691.V303I128052M95048.server.trabas.com | postmap -q - regexp:/tmp/mime_header_checks content-type: application/octet-stream; name="f6df62f.jpg" REJECT Attachment type not allowed. File "f6df62f.jpg" has the unacceptable extension "jpg" content-disposition: inline; filename="f6df62f.jpg" REJECT Attachment type not allowed. File "f6df62f.jpg" has the unacceptable extension "jpg"

Hasilnya sesuai dengan rule yang dibuat.

Saran saya kepada anda, coba lihat contoh email yang mengandung attachment kemudian cocokkan dengan pola RE yang anda buat.

Asfihani

Reply via email to