[exim] It isn't pretty - but it allows you to have a text fi…

Pàgina inicial
Delete this message
Reply to this message
Autor: Marc Perkel
Data:  
A: exim-users
Assumpte: [exim] It isn't pretty - but it allows you to have a text file in an ACL to block subjects
There's got to be a better way to do this but this seems to works so
far. The idea is that you have a test file that has a list of prohibited
subject strings in it. This file allows for blank lines and comments
starting with #.

You might be wondering why I'm going to the trouble to do this. Well,
next I'm going to write a squirrelmail modules so that every user can
edit their personal subject string blockers.

There's got to be a cleaner way to do this.

# - Master Subject Block List

deny    message = REJECTED - Subject in master block list - F=$h_From: 
T=$h_X-Recipient:
    log_message = REJECTED - Subject in master block list - F=$h_From: 
T=$h_X-Recipient:
        condition = ${if exists{/etc/exim/control/blocksubject.txt}\
        {${if 
match{$h_Subject:}{\x28${sg{${sg{${sg{${readfile{/etc/exim/control/blocksubject.txt}{|}}}{\\|+}{|}}}{#.*?\\|}{}}}{\\|\$}{}}\x29}{true}{false}}}\
    {no}}


Here's the personal version:

# - Personal Subject Block List

deny    message = REJECTED - Subject in personal block list - F=$h_From: 
T=$h_X-Recipient:
    log_message = REJECTED - Subject in personal block list - F=$h_From: 
T=$h_X-Recipient:
        condition = ${if 
exists{/etc/exim/control/domains/${domain:$h_X-Recipient:}/users/${local_part:$h_X-Recipient:}/blocksubject.txt}\
        {${if 
match{$h_Subject:}{\x28${sg{${sg{${sg{${readfile{/etc/exim/control/domains/${domain:$h_X-Recipient:}/users/${local_part:$h_X-Recipient:}/blocksubject.txt}{|}}}{\\|+}{|}}}{#.*?\\|}{}}}{\\|\$}{}}\x29}{true}{false}}}\
    {no}}