How do we use "Mail Content Filter" in ISPConfig 3?

Discussion in 'Installation/Configuration' started by erigo1974, Sep 16, 2016.

  1. erigo1974

    erigo1974 New Member

    When you create a "Mime-Header Filter" with the ISPConfig web interface, a new record is created in the 'mail_content_filter' table of the MySQL ISPConfig database.

    For example:

    select pattern, data, action from mail_content_filter where type='mime_header' and active='y';
    +-------------------------------------------------------------------------------------------------------------+----------------------------------------+---------+
    | pattern | data | action |
    +-------------------------------------------------------------------------------------------------------------+----------------------------------------+---------+
    | /^Content-(Disposition|Type).*name\s*=\s*"?(.*\.(com|exe|scr|msi))(\?=)?"?\s*(;|$)/x | Executable file extensions not allowed | DISCARD |
    | /^Content-(Disposition|Type).*name\s*=\s*"?(.*\.(zip|7z|rar|cab))(\?=)?"?\s*(;|$)/x | Compressed file extensions not allowed | DISCARD |
    | /^Content-(Disposition|Type).*name\s*=\s*"?(.*\.(bat|cmd|vbs|wsh|reg))(\?=)?"?\s*(;|$)/x | Script file extensions not allowed | DISCARD |
    | /^Content-(Disposition|Type).*name\s*=\s*"?(.*\.(docm|dotm|xlm|xlsm|xltm|pptm|potm|ppsm))(\?=)?"?\s*(;|$)/x | Macro file extensions not allowed | DISCARD |
    +-------------------------------------------------------------------------------------------------------------+----------------------------------------+---------+

    So my question is how do we get Postfix to actually use these records?

    My '/etc/postfix/main.cf' currently has 'mime_header_checks = regexp:/etc/postfix/mime_header_checks'. I know that I need to change that line to 'mime_header_checks = mysql:/etc/postfix/mysql-virtual_contentfilter.cf'

    So what should be the contents of the '/etc/postfix/mysql-virtual_contentfilter.cf' file?
     
  2. erigo1974

    erigo1974 New Member

    Actually I found that updating the "Mime-Header Filter" in the ISPConfig web interface, also updates the '/etc/postfix/mime_header_checks' file. It is working as expected in one of my ISPconfig servers. The other server (which was the one I was checking) has an empty '/etc/postfix/mime_header_checks' file, and updating a "Mime-Header Filter" in the ISPConfig web interface does not change it.
    Permissions are identical on both servers. Why would the second server not be updating the '/etc/postfix/mime_header_checks' file?
     
  3. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Do you have postfix_filter_plugin.inc.php on both servers in /usr/local/ispconfig/server/plugins-enabled? Is this a mirror-setup?
     
  4. erigo1974

    erigo1974 New Member

    Yes, and yes...
     

Share This Page