Greylist antispam tech
Really quick and dirty perl script to implement Greylist antispam tech to the Exim - please think before use it.
How to use:
- 1. Create database and tables:
mysql> show tables;
+--------------------+
| Tables_in_greylist |
+--------------------+
| relaytofrom |
| spam_records |
+--------------------+
2 rows in set (0.00 sec)
mysql> describe spam_records;
+---------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+---------------+------+-----+---------+-------+
| relay_ip | varchar(16) | YES | MUL | NULL | |
| mail_from | varchar(255) | YES | MUL | NULL | |
| rcpt_to | varchar(255) | YES | MUL | NULL | |
| blocked_count | bigint(20) | | | 0 | |
| passed_count | bigint(20) | | | 0 | |
| last_update | timestamp(14) | YES | | NULL | |
+---------------+---------------+------+-----+---------+-------+
6 rows in set (0.03 sec)
mysql> describe relaytofrom;
+----------------+-----------------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+-----------------------+------+-----+---------------------+----------------+
| id | bigint(20) | | PRI | NULL | auto_increment |
| relay_ip | varchar(16) | YES | MUL | NULL | |
| mail_from | varchar(255) | YES | MUL | NULL | |
| rcpt_to | varchar(255) | YES | MUL | NULL | |
| block_expires | datetime | | | 0000-00-00 00:00:00 | |
| record_expires | datetime | | | 0000-00-00 00:00:00 | |
| blocked_count | bigint(20) | | | 0 | |
| passed_count | bigint(20) | | | 0 | |
| aborted_count | bigint(20) | | | 0 | |
| origin_type | enum('MANUAL','AUTO') | | | MANUAL | |
| create_time | datetime | | | 0000-00-00 00:00:00 | |
| last_update | timestamp(14) | YES | | NULL | |
+----------------+-----------------------+------+-----+---------------------+----------------+
12 rows in set (0.01 sec)
2. Download clear_greylist.pl and exim.pl, when set your config options for MySQL connection.
3. Configure exim to use script exim.pl, add to configure following line:
perl_startup = do '/path/to/script/exim.pl
To use this you need exim with bultin perl (if no - just recompile exim).
When add next line to your exim configure (in the acl_check_rcpt section):
require domains = +your_domains
condition = ${perl{greylist}}
Where your_domains list of domains for which you want to use greylisting.
4. Second script clear_greylist.pl install to your crontab:
0 * * * * /opt/isp/bin/clear_greylist.pl
it removes expired records and stores it in table spam_records for analyz.
5. See how much SPAM you stop and have fun!
Roman Festchook
|
 |
 |
| |
09.04.2007
Мы переехали в новый офис, смотрите раздел О нас.
12.06.2004
Добавлен раздел Проекты - в котором представленны проекты свободного ПО в которых мы принимаем участие.
25.01.2004
Представляем Вашему вниманию наш сайт, на котором Вы всегда сможете узнать наши новости, предлагаемые Лабораторией Linux продукты, услуги, решения и их цены.
ПолесьеNet установка спутникового телевидения в Житомире и области
|
 |
 |
|