Hi:

I"m using content filtering by using the following (this is the example) syntax in master.cf:

smtp      inet  ...other stuff here, do not change...   smtpd
        -o content_filter=myfilter:myfilter
myfilter     unix  -       n       n       -       10      pipe
   flags......

All is working as expected.

According to the directive documentation, the content_filter directive I am using above can take a transport(5) table (hash:, pcre:, etc.) to use different transports for different domains

Does anyone know if I can use a MySQL lookup for this? with a syntax like:

smtp      inet  ...other stuff here, do not change...   smtpd
        -o content_filter=mysql:/etc/postfix/mysql_filter_maps.cf
with mysql_filter_maps.cf using a syntax like:


user = postfix_sql_user
password = postfix_sql_password
hosts = localhost
dbname = postfix_sql_database_name
query = SELECT filter_result FROM filter_table WHERE domain='%s'

The reason I'd do this is to be able to add a domain or change content filtering for a domain on the fly without having to reload postfix

Also - what happens if I don't want content filtering for a domain, and I just don't have that domain in the lookup table? (i.e. the query returns a NULL result or no rows found result?

The desired outcome is that no content filtering is performed,

Any help or advice is much appreciated! Thank you!

Reply via email to