ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
From: "Вадим Илларионов" <master@nstel.ru>
To: sysadmins@lists.altlinux.org
Subject: Re: [Sysadmins] Фильтрация по заголовку письма и пункту назначения
Date: Tue, 20 May 2008 21:03:09 +0400
Message-ID: <g0v08e$3mv$1@ger.gmane.org> (raw)
In-Reply-To: <m3bq31qu1s.fsf@bungarus.tdr.pibhe.com>

Maxim Tyurin wrote:

> Тебе надо сделать свой smtpd_restriction_classes в котором будет
> нужный тебе header_checks. 
> Потом на smtpd_recipient_restrictions вешаешь таблицу в которой будет
> нужный_адрес  твой_smtpd_restriction_class

Сделал так:

check_recipient_access = hash:/usr/local/etc/postfix/dotproject_domain
check_sender_access,permit_mynetworks,reject_unauth_destination
smtpd_recipient_restrictions =
    check_recipient_access,permit_mynetworks,reject_unauth_destination
smtpd_restriction_classes = dotproject
dotproject =
    header_checks pcre:/usr/local/etc/postfix/dotproject_subject,reject

В логах ругань:

postfix/smtpd[84302]: >>> START Recipient address RESTRICTIONS <<<
postfix/smtpd[84302]: generic_checks: name=header_checks
postfix/smtpd[84302]: warning: unknown smtpd restriction: "header_checks"

Содержимое /usr/local/etc/postfix/dotproject_subject:
/^Subject:.\[dotProject\]*/     dotproject

Содержимое /usr/local/etc/postfix/dotproject_domain:
mydomain.ru dotproject

Где я накосячил?

Вся эта кухня пока что крутится на фрибзде. А сделать надо срочно.
Пока обошёлся так (но это не дело):
поднял внутри сети ещё один постфикс и сделал его релеем:

# egrep 'domain|relay' /etc/postfix/main.cf | egrep -v '^#|dest'
mydomain = mydomain.ru
myhostname = server.lab.$mydomain
relayhost = mail.$mydomain
relay_recipient_maps = $transport_maps

В транспорте настроил отправку ТОЛЬКО в домен mydomain.ru:
# grep -v ^# /etc/postfix/transport
mydomain.ru smtp:mail.mydomain.ru
* error:mail for domains other than mydomain.ru is not deliverable

и ТОЛЬКО мессаг, у которых в теме - заданный критерий:
# grep -v ^# /etc/postfix/header_checks
/^Subject:.\[dotProject\]*/ OK
/^Subject:*/ REJECT Bad subject

Здесь, судя по ману, можно обойтись всего одной строкой вида:
!/^Subject:.\[dotProject\]*/ REJECT Bad subject
Но - не прёт. Почему - хз. Не спец в регэкспах, увы.
_________________________________
С уважением,
Вадим Илларионов
системный администратор
ООО "Новые Системы Телеком"
UIN: 7899517
JID: master at usib dot irkps dot ru
Телефоны:
- рабочий    +7 495 6414045+5885
- мобильный  +7 916 3889337



  reply	other threads:[~2008-05-20 17:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-19 12:18 Вадим Илларионов
2008-05-19 12:37 ` Sergei Boudnik
2008-05-19 13:29   ` Вадим Илларионов
2008-05-19 15:02     ` [Sysadmins] Прокси сервер для Socks Shcherbina N Timur
2008-05-19 15:44       ` Вадим Илларионов
2008-05-20  8:05     ` [Sysadmins] Фильтрация по заголовку письма и пункту назначения Maxim Tyurin
2008-05-20 17:03       ` Вадим Илларионов [this message]
2008-05-20 17:45         ` Sergey
2008-05-20 18:50           ` Вадим Илларионов
2008-05-20 19:01             ` Sergey
2008-05-20 23:21     ` Andrew Kornilov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='g0v08e$3mv$1@ger.gmane.org' \
    --to=master@nstel.ru \
    --cc=sysadmins@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux sysadmins discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
		sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
	public-inbox-index sysadmins

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sysadmins


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git