November 25, 2024, 09:34:05 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Attachment Size in Postfix  (Read 5705 times)

Offline rajesh.bahl

  • Linux Learner
  • ***
  • Posts: 86
Attachment Size in Postfix
« on: November 01, 2007, 07:05:13 PM »

Dear All,

Need your help in resolving a problem:-

Our mail server is running on Postfix on CentOS 4.5.
Working is okay, but we need two more functionalities:-

1. The attachment size is 1MB maximum for any mail. Can we increase the maximum size of attachments to say 3 MB ?
2. We need to ban the sending/receiving of attachments having files like exe,bat,vbs etc. etc.

Can we do the same in postfix ?



Thanking In Advance
rajesh.bahl

Offline rsw686

  • Linux Noob !
  • *
  • Posts: 4
Re: Attachment Size in Postfix
« Reply #1 on: November 30, 2007, 07:06:11 PM »
The attachment size isn't controlled with postfix. You need to set the attachment size in your imap / pop server settings, might be courier or dovecot.

To filter out attachments I found the following example

In the postfix main.cf add

Code: [Select]
mime_header_checks = regexp:/etc/postfix/mime_header_checks.regexp

In mime_header_checks_regexp
Code: [Select]
/^\s*Content-(Disposition|Type).*name\s*=\s*"?(.+\.(lnk|asd|hlp|ocx|reg|bat|c[ho]m|cmd|exe|dll|vxd|pif|scr|hta|jse?|sh[mbs]|vb[esx]|ws[fh]|wav|mov|wmf|xl))"?\s*$/
   REJECT Attachment type not allowed. File "$2" has the unacceptable extension "$3"