Re: [Exim] RBL settings via MySQL

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Wakko Warner
Date:  
À: Rossz Vamos-Wentworth
CC: exim users list
Sujet: Re: [Exim] RBL settings via MySQL
> I'm researching an idea to allow virtual domains to have different
> settings for rbls by storing the settings in mysql. There are two
> important considerations.
>
> 1. Can the rbl list be obtained from mysql in the acl.
> 2. Will be performance be good enough to make is usable.


For a system with ~210 users, it doesn't seem too bad. and Yes, it can be
done.

deny    !hosts = +rbl_exclude_hosts
    message = $sender_host_address listed in rbl blacklist \
        $dnslist_domain($dnslist_value)\
        ${if !eq{$dnslist_text}{}{\n$dnslist_text}}\
        ${expand:${lookup \
                 mysql{select url \
                from eximconf.rbl_list \
                where rbl='$dnslist_domain' \
                limit 1\
                 }\
                 {${if !eq{$value}{}{\nSee $value}}}\
              }}
    log_message = RBLed $dnslist_domain/$dnslist_value
    dnslists = ${lookup \
            mysql{select rbl \
                from eximconf.rbl_list \
                where enabled='yes' \
                order by priority,rbl\
            } \
            {${sg{$value}{ *\\n}{ : }}}\
            }


The table:
CREATE TABLE `rbl_list` (
`rbl` varchar(100) NOT NULL default '',
`enabled` enum('yes','no') NOT NULL default 'yes',
`url` varchar(100) NOT NULL default '',
`priority` int(11) NOT NULL default '0',
`comment` varchar(100) NOT NULL default '',
PRIMARY KEY (`rbl`)
);

Since SQL will/can insert wherever it wants, I used a priority.
You can change url to message or whatever you'd like, or maybe another table
for messages.

--
Lab tests show that use of micro$oft causes cancer in lab animals