The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

форумы  помощь  поиск  регистрация  майллист  вход/выход  слежка  RSS
"sendmail + regex map"
Вариант для распечатки  
Пред. тема | След. тема 
Форумы OpenNET: Виртуальная конференция (Public)
Изначальное сообщение [ Отслеживать ]

"sendmail + regex map"  +/
Сообщение от sproot (ok) on 28-Авг-09, 05:02 
Привет Народ!

Есть regex карты:
Kspamwords1_d regex -a@FOUND_D1 -f rev.gaoland.net|pool|dyn[.]user|broadband|in[.]hosting[.]ua|ppp|user|dsl|dynamic|dhcp|cable|pppoe
Kspamwords 2_d ....
Kspamwords3_d ....
....

Ksumm_d sequence spamwords1_d spamwords2_d spamwords3_d spamwords4_d ....

SLocal_check_relay
#R$* $| $*              $: $(syslog B_H: $1 $) $1 $| $2
R$* $| $*               $: $(summ_a $1 $) $| $1
R@FOUND_A1 $| $*        $@ OK
R@FOUND_A2 $| $*        $@ OK
R@FOUND_A3 $| $*        $@ OK
R@FOUND_A4 $| $*        $@ OK
R@FOUND_A5 $| $*        $@ OK
R$* $| $*               $: $(summ_d $1 $) $| $1
R@FOUND_D1 $| $*        $#error $: 553 Bad Host1: We get a lot of spam from your relay-ip ($1). If you are not a spamer, please contact the tech@xxx.ru via another relay-ip.
R@FOUND_D2 $| $*        $#error $: 553 Bad Host2: We get a lot of spam from your relay-ip ($1). If you are not a spamer, please contact the tech@xxx.ru via another relay-ip.
R@FOUND_D3 $| $*        $#error $: 553 Bad Host3: We get a lot of spam from your relay-ip ($1). If you are not a spamer, please contact the tech@xxx.ru via another relay-ip.
.....


Данное правило должно фильтровать хосты по regex выражениям. Проблема в том, что sendmail не переводит hostname в нижний регистр перед отправкой его на проверку в regex map, т.е. не работает case-insensitive, что собственно должно быть по-умолчанию(ключ -f не задан). Из "Sendmail By Bryan Costales, Eric Allman":

============
33.3.4.3 -f don't fold keys to lowercase (V8.1 and above)

Ordinarily, sendmail will normalize a key to lowercase before looking it up in the database. If the keys in the database are case-sensitive ("TEX" is considered different from "tex," for example), the -f switch should be used to prevent this normalization. Note that if the -f switch is omitted (the default), the database must have been created with all lowercase keys (also the default).
============

Однако, когда hostname в нижнем регистре фильтрация проходит на ура.

Высказать мнение | Ответить | Правка | Cообщить модератору

 Оглавление

Сообщения по теме [Сортировка по времени | RSS]


1. "sendmail + regex map"  +/
Сообщение от sproot (ok) on 28-Авг-09, 14:44 
>[оверквотинг удален]
>
>Ordinarily, sendmail will normalize a key to lowercase before looking it up
>in the database. If the keys in the database are case-sensitive
>("TEX" is considered different from "tex," for example), the -f switch
>should be used to prevent this normalization. Note that if the
>-f switch is omitted (the default), the database must have been
>created with all lowercase keys (also the default).
>============
>
>Однако, когда hostname в нижнем регистре фильтрация проходит на ура.

Вопрос снят. Пора очки покупать..

Высказать мнение | Ответить | Правка | Наверх | Cообщить модератору

2. "sendmail + regex map"  +/
Сообщение от Medlar email(??) on 28-Авг-09, 16:45 
А в чем была проблема?
Высказать мнение | Ответить | Правка | Наверх | Cообщить модератору

3. "sendmail + regex map"  +/
Сообщение от sproot (ok) on 28-Авг-09, 17:24 
>А в чем была проблема?

Не увидел -f в regex map после Kspamwords1_d regex -a@FOUND_D1 Тривиальный случай. Мне даже стыдно стало. :) Теперь все работает как надо.

Высказать мнение | Ответить | Правка | Наверх | Cообщить модератору

Архив | Удалить

Индекс форумов | Темы | Пред. тема | След. тема




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2025 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру