Доброй день всем!
Ребята, строю почтовый релей для внутреннего корпоративного сервера Exchange с фильтрацией спама на CentOS 5.2.
Установил postfix 2.3.3. Нстроил. Проверяю хождение почты по средствам телнета. Письма постфикс принимает, обрабатывает и передает нормально на Exch 2003.
Далее прекрутил spamassassin 2.5.2. Проверяю хождение почты, и тут происходит зацикливание отправленного на poistfix письма.
Прикручивание SA к Postfix делал по этой статье:
http://www.akadia.com/services/postfix_spamassassin.html(текст скрипта для spamassassina вот:)
#!/bin/sh
# -----------------------------------------------------------------
# File: relayspam
#
# Purpose: SPAMASSASIN shell-based filter
#
# Usage: Call this script from master.cf (Postfix)
#
# -----------------------------------------------------------------
# Variables
SENDMAIL="/usr/sbin/sendmail -i"
EGREP=/bin/egrep
SUBJECT=WARNING_SPAM
# Clean up when done or when aborting.
trap "rm -f /var/tmp/out.$$" 0 1 2 3 15
# Pipe message to spamc
cat | /usr/bin/spamc -u filter > /var/tmp/out.$$
# | /usr/bin/spamc -u filter
# Are there more than $SPAMLIMIT stars in X-Spam-Level header? :
if $EGREP -q "$SUBJECT" < /var/tmp/out.$$
then
# Option 2: Divert to an alternate e-mail address:
$SENDMAIL spam@orl.unimilk.ru < /var/tmp/out.$$
# Option 3: Delete the message
#rm -f /var/tmp/out.$$
else
$SENDMAIL "$@" < /var/tmp/out.$$
fi
# Postfix returns the exit status of the Postfix sendmail command.
exit $?
Пробую сделать вот так, дабы понять, почему не передается письмо от SA на postfix:
# /usr/sbin/sendmail -i spam@spamstore.test.ru < /root/install.log
Вот, что вижу в логах:
Aug 10 20:26:54 cent-dns sendmail[6534]: m7AGQsKg006534: from=root, size=34521, class=0, nrcpts=1, msgid=<200808101626.m7AGQsKg006534@server01.test.ru>, relay=root@localhost
Aug 10 20:26:54 cent-dns postfix/smtpd[6535]: connect from localhost.localdomain[127.0.0.1]
Aug 10 20:26:54 cent-dns postfix/smtpd[6535]: 5716B18F9DC: client=localhost.localdomain[127.0.0.1]
Aug 10 20:26:54 cent-dns postfix/cleanup[6538]: 5716B18F9DC: message-id=<200808101626.m7AGQsKg006534@server01.test.ru>
Aug 10 20:26:54 cent-dns sendmail[6534]: m7AGQsKg006534: to=spam@spamstore.test.ru, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=64521, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 5716B18F9DC)
Aug 10 20:26:54 cent-dns postfix/qmgr[6533]: 5716B18F9DC: from=<root@server01.test.ru>, size=35867, nrcpt=1 (queue active)
Aug 10 20:26:54 cent-dns postfix/smtpd[6535]: disconnect from localhost.localdomain[127.0.0.1]
Aug 10 20:26:55 cent-dns sendmail[6544]: m7AGQtra006544: Authentication-Warning: server01.test.ru: filter set sender to root@server01.test.ru using -f
Aug 10 20:26:55 cent-dns sendmail[6544]: m7AGQtra006544: from=root@server01.test.ru, size=35284, class=0, nrcpts=1, msgid=<200808101626.m7AGQsKg006534@server01.test.ru>, relay=filter@localhost
Aug 10 20:26:55 cent-dns postfix/smtpd[6535]: connect from localhost.localdomain[127.0.0.1]
Aug 10 20:26:55 cent-dns postfix/smtpd[6535]: A4F9F18FA8D: client=localhost.localdomain[127.0.0.1]
Aug 10 20:26:55 cent-dns postfix/cleanup[6538]: A4F9F18FA8D: message-id=<200808101626.m7AGQsKg006534@server01.test.ru>
Aug 10 20:26:55 cent-dns postfix/qmgr[6533]: A4F9F18FA8D: from=<root@server01.test.ru>, size=36537, nrcpt=1 (queue active)
Aug 10 20:26:55 cent-dns sendmail[6544]: m7AGQtra006544: to=spam@spamstore.test.ru, ctladdr=root@server01.test.ru (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=65284, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as A4F9F18FA8D)
Aug 10 20:26:55 cent-dns postfix/smtpd[6535]: disconnect from localhost.localdomain[127.0.0.1]
Aug 10 20:26:55 cent-dns postfix/pipe[6539]: 5716B18F9DC: to=<spam@spamstore.test.ru>, relay=relayspam, delay=1.5, delays=0.14/0.04/0/1.3, dsn=2.0.0, status=sent (delivered via relayspam service)
Aug 10 20:26:55 cent-dns postfix/qmgr[6533]: 5716B18F9DC: removed
Aug 10 20:26:56 cent-dns sendmail[6551]: m7AGQufO006551: Authentication-Warning: server01.test.ru: filter set sender to root@server01.test.ru using -f
Aug 10 20:26:56 cent-dns sendmail[6551]: m7AGQufO006551: from=root@server01.test.ru, size=35740, class=0, nrcpts=1, msgid=<200808101626.m7AGQsKg006534@server01.test.ru>, relay=filter@localhost
Aug 10 20:26:56 cent-dns postfix/smtpd[6535]: connect from localhost.localdomain[127.0.0.1]
Aug 10 20:26:56 cent-dns postfix/smtpd[6535]: C782918F9DC: client=localhost.localdomain[127.0.0.1]
Aug 10 20:26:56 cent-dns postfix/cleanup[6538]: C782918F9DC: message-id=<200808101626.m7AGQsKg006534@server01.test.ru>
Aug 10 20:26:56 cent-dns postfix/qmgr[6533]: C782918F9DC: from=<root@server01.test.ru>, size=37000, nrcpt=1 (queue active)
Aug 10 20:26:56 cent-dns sendmail[6551]: m7AGQufO006551: to=spam@spamstore.test.ru, ctladdr=root@server01.test.ru (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=65740, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as C782918F9DC)
Aug 10 20:26:56 cent-dns postfix/smtpd[6535]: disconnect from localhost.localdomain[127.0.0.1]
Aug 10 20:26:56 cent-dns postfix/pipe[6545]: A4F9F18FA8D: to=<spam@spamstore.test.ru>, relay=relayspam, delay=1.3, delays=0.07/0.04/0/1.2, dsn=2.0.0, status=sent (delivered via relayspam service)
Aug 10 20:26:56 cent-dns postfix/qmgr[6533]: A4F9F18FA8D: removed
Aug 10 20:26:57 cent-dns sendmail[6557]: m7AGQvMm006557: Authentication-Warning: server01.test.ru: filter set sender to root@server01.test.ru using -f
Aug 10 20:26:57 cent-dns sendmail[6557]: m7AGQvMm006557: from=root@server01.test.ru, size=36196, class=0, nrcpts=1, msgid=<200808101626.m7AGQsKg006534@server01.test.ru>, relay=filter@localhost
Aug 10 20:26:57 cent-dns postfix/smtpd[6535]: connect from localhost.localdomain[127.0.0.1]
Aug 10 20:26:57 cent-dns postfix/smtpd[6535]: E1E5F18FA8D: client=localhost.localdomain[127.0.0.1]
Aug 10 20:26:57 cent-dns postfix/cleanup[6538]: E1E5F18FA8D: message-id=<200808101626.m7AGQsKg006534@server01.test.ru>
Aug 10 20:26:57 cent-dns postfix/qmgr[6533]: E1E5F18FA8D: from=<root@server01.test.ru>, size=37463, nrcpt=1 (queue active)
Aug 10 20:26:57 cent-dns sendmail[6557]: m7AGQvMm006557: to=spam@spamstore.test.ru, ctladdr=root@server01.test.ru (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=66196, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as E1E5F18FA8D)
Aug 10 20:26:58 cent-dns postfix/smtpd[6535]: disconnect from localhost.localdomain[127.0.0.1]
Aug 10 20:26:58 cent-dns postfix/pipe[6539]: C782918F9DC: to=<spam@spamstore.test.ru>, relay=relayspam, delay=1.3, delays=0.1/0/0/1.2, dsn=2.0.0, status=sent (delivered via relayspam service)
Aug 10 20:26:58 cent-dns postfix/qmgr[6533]: C782918F9DC: removed
Aug 10 20:26:59 cent-dns sendmail[6563]: m7AGQxdI006563: Authentication-Warning: server01.test.ru: filter set sender to root@server01.test.ru using -f
Aug 10 20:26:59 cent-dns sendmail[6563]: m7AGQxdI006563: from=root@server01.test.ru, size=36652, class=0, nrcpts=1, msgid=<200808101626.m7AGQsKg006534@server01.test.ru>, relay=filter@localhost
Aug 10 20:26:59 cent-dns postfix/smtpd[6535]: connect from localhost.localdomain[127.0.0.1]
Aug 10 20:26:59 cent-dns postfix/smtpd[6535]: 2BEB118F9DC: client=localhost.localdomain[127.0.0.1]
Aug 10 20:26:59 cent-dns postfix/cleanup[6538]: 2BEB118F9DC: message-id=<200808101626.m7AGQsKg006534@server01.test.ru>
Aug 10 20:26:59 cent-dns postfix/qmgr[6533]: 2BEB118F9DC: from=<root@server01.test.ru>, size=37926, nrcpt=1 (queue active)
Aug 10 20:26:59 cent-dns sendmail[6563]: m7AGQxdI006563: to=spam@spamstore.test.ru, ctladdr=root@server01.test.ru (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=66652, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 2BEB118F9DC)
Aug 10 20:26:59 cent-dns postfix/smtpd[6535]: disconnect from localhost.localdomain[127.0.0.1]
Aug 10 20:26:59 cent-dns postfix/pipe[6545]: E1E5F18FA8D: to=<spam@spamstore.test.ru>, relay=relayspam, delay=1.4, delays=0.07/0/0/1.4, dsn=2.0.0, status=sent (delivered via relayspam service)
Aug 10 20:26:59 cent-dns postfix/qmgr[6533]: E1E5F18FA8D: removed