ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [mdk-re] Снова замена адреса отправителя вPostfix : ПОМОГИТЕ!
@ 2002-03-14  8:41 John
  2002-03-14 11:28 ` [mdk-re] " Artem K. Jouravsky
  2002-03-14 11:52 ` Michael Shigorin
  0 siblings, 2 replies; 7+ messages in thread
From: John @ 2002-03-14  8:41 UTC (permalink / raw)
  To: Mandrake

Здраствуйте!

Пишу в третий раз. Первый раз меня отправили по факам, второй раз Игорь 
Хомяков указал конкретный документ (похоже едиственный из всей 
документации, которая идет вместе с постфиксом, кроме него вообще ничего 
похожего я не нашел, если кто-то знает, ткните) - /usr/doc/postfix ... 
/FILTER_README.

Еще раз постановка задачи: *как переименовать адрес отправителя письма, 
если адрес получателя не заканчивается на localhost, в противном случае 
оставить как есть*.

Я читаю вышеупомянутый файл

/1 - Create a dedicated local user account called "filter".  The
    user will never log in, and can be given a "*" password and
    non-existent shell and home directory. This user handles all
    potentially dangerous mail content - that is why it should be
    a separate account./

сделал

/2 - Create a directory /var/spool/filter that is accessible only
    to the "filter" user. This is where the content filtering will
    store its temporary files./

сделал

/3 - Define a content filtering entry in the Postfix master file:

    /etc/postfix/master.cf:
      filter    unix  -       n       n       -       -       pipe
        flags=Rq user=filter argv=/somewhere/filter -f ${sender} -- 
${recipient}/

сделал, только написал argv=/etc/postfix/filter, дал вообще всем права 
на его исполнение

/The /some/where/filter program can be a simple shell script like this:

    #!/bin/sh

    # Localize these
    INSPECT_DIR=/var/spool/filter
    SENDMAIL=/usr/sbin/sendmail

    # Exit codes from <sysexits.h>
    EX_TEMPFAIL=75
    EX_UNAVAILABLE=69

    # Clean up when done or when aborting.
    trap "rm -f in.$$" 0 1 2 3 15

    # Start processing.
    cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit 
$EX_TEMPFAIL; }

    cat >in.$$ || { echo Cannot save mail to file; exit $EX_TEMPFAIL; }

    # filter <in.$$ || { echo Message content rejected; exit 
$EX_UNAVAILABLE; }

    $SENDMAIL "$@" <in.$$

    exit $?/

Тоже сделал. Кстати, а куда echo должно выводится? На 12 консоль?  Этот 
файл все равно не не выполняется, т.к. я в него в самое начало даже 
вписывал echo hello > /tmp/xxx, и этот файл создан не был. Наверное, 
что-то не так в //etc/postfix/master.cf/. ЧТО?

И это только полбеды. Далее написано:

/The idea is to first capture the message to file and then run the
content through run a third-party content filter program.  If the
mail cannot be captured to file, mail delivery is deferred by
terminating with exit status 75 (EX_TEMPFAIL).  If the content
filter program finds a problem, the mail is bounced by terminating
the shell script with exit status 69 (EX_UNAVAILABLE).  If the
content is OK, it is given as input to Postfix sendmail, and the
exit status of the filter command is whatever exit status Postfix
sendmail produces./

А я не содержание, а адрес получателя хочу проверить, а адрес 
отправителя изменить (грубо говоря, динамически комментровать и 
раскомментировать в в main.cf строку sender_canonical_map = 
hash:/etc/postfix/canonical без перезапуска постфикса). Я так понял, что 
адреса я получу как параметры /-f ${sender} -- ${recipient}/. Так как 
мне их изменить? Не сам же параметр sender модифицировать (или меня 
подводит мой опыт программирования на С/С++, а здесь такое можно)?

Извиняюсь, если кого запарил своим длинным письмом, но я правда не 
понимаю, что мне сделать. Скажите мне прямо, что я слишком много хочу и 
этого нельзя, или покажите, как это сделать.

С уважением, Прокопьев Евгений





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-03-14 15:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-14  8:41 [mdk-re] Снова замена адреса отправителя вPostfix : ПОМОГИТЕ! John
2002-03-14 11:28 ` [mdk-re] " Artem K. Jouravsky
2002-03-14 11:52 ` Michael Shigorin
2002-03-14 12:09   ` Mikhail Zabaluev
2002-03-14 13:07   ` [mdk-re] Re: Снова замена адреса отправителя вPostfix: ПОМОГИТЕ! John
2002-03-14 13:42     ` Michael Shigorin
2002-03-14 15:25       ` [mdk-re] Re: Снова замена адреса отп: равителя вPostfixПОМОГИТЕ! John

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/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 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

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


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