LINUX.ORG.RU
ФорумAdmin

Проблема при транспорте сообщений с Postfix+Spamassassin на MS Exchange

 , , , ,


0

1

Добрый день.

Помогите пожалуйста разобраться, не могу понять в чем причина.

1. Сервер Ubuntu 14.04 с Postfix (перенаправляет почту на MS Exchange 2007)+Spamassassin 2. Сервер Windows 2008 R2 с MS Exchange 2007

Без spamassassin письма прекрасно ходят, входящие и исходящие. Как только подключаю spamassassin строчкой

-o content_filter=spamassassin
в файле
/etc/postfix/master.cf
, то письма больше не отправляются и не принимаются. Добавляю как положено, после строки
smtp      inet  n       -       -       -       -       smtpd
.

cat /var/postfix/master.cf

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#  -o content_filter=spamfilter
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
submission inet n       -       -       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp -o max_use=1
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
        -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}
spamfilter unix -       n       n       -       -       pipe
  flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter -f ${sender} -- ${recipient}

cat /etc/default/spamassassin

# Duncan Findlay

# WARNING: please read README.spamd before using.
# There may be security risks.

# Change to one to enable spamd
ENABLED=1

# Options
# See man spamd for possible options. The -d option is automatically added.

# SpamAssassin uses a preforking model, so be careful! You need to
# make sure --max-children is not set to anything higher than 5,
# unless you know what you're doing.

OPTIONS="--create-prefs --max-children 5 --username spamd -H ${SAHOME} -s ${SAHOME}spamd.log --helper-home-dir"

# Pid file
# Where should spamd write its PID to file? If you use the -u or
# --username option above, this needs to be writable by that user.
# Otherwise, the init script will not be able to shut spamd down.
PIDFILE="/var/run/spamd.pid"

# Set nice level of spamd
#NICE="--nicelevel 15"

# Cronjob
# Set to anything but 0 to enable the cron job to automatically update
# spamassassin's rules on a nightly basis
CRON=1

SAHOME="/var/log/spamassassin/"

cat /etc/spamassassin/local.cf

# This is the right place to customize your installation of SpamAssassin.
#
# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be
# tweaked.
#
# Only a small subset of options are listed below
#
###########################################################################

required_hits 3

#   Add *****SPAM***** to the Subject header of spam e-mails
#
rewrite_header Subject [*****SPAM*****]


#   Save spam messages as a message/rfc822 MIME attachment instead of
#   modifying the original message (0: off, 2: use text/plain instead)
#
report_safe 0


#   Set which networks or hosts are considered 'trusted' by your mail
#   server (i.e. not spammers)
#
# trusted_networks 212.17.35.


#   Set file-locking method (flock is not safe over NFS, but is faster)
#
# lock_method flock


#   Set the threshold at which a message is considered spam (default: 5.0)
#
# required_score 5.0


#   Use Bayesian classifier (default: 1)
#
use_bayes 1


#   Bayesian classifier auto-learning (default: 1)
#
bayes_auto_learn 1
bayes_path  /var/log/spamassassin/bayes
bayes_file_mode  0666
bayes_learn_to_journal 1

skip_rbl_checks  0
use_razor2       0
use_dcc          0
use_pyzor        0

#   Set headers which may provide inappropriate cues to the Bayesian
#   classifier
#
# bayes_ignore_header X-Bogosity
# bayes_ignore_header X-Spam-Flag
# bayes_ignore_header X-Spam-Status


#   Some shortcircuiting, if the plugin is enabled
#
ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
#
#   default: strongly-whitelisted mails are *really* whitelisted now, if the
#   shortcircuiting plugin is active, causing early exit to save CPU load.
#   Uncomment to turn this on
#
# shortcircuit USER_IN_WHITELIST       on
# shortcircuit USER_IN_DEF_WHITELIST   on
# shortcircuit USER_IN_ALL_SPAM_TO     on
# shortcircuit SUBJECT_IN_WHITELIST    on

#   the opposite; blacklisted mails can also save CPU
#
# shortcircuit USER_IN_BLACKLIST       on
# shortcircuit USER_IN_BLACKLIST_TO    on
# shortcircuit SUBJECT_IN_BLACKLIST    on

#   if you have taken the time to correctly specify your "trusted_networks",
#   this is another good way to save CPU
#
# shortcircuit ALL_TRUSTED             on

#   and a well-trained bayes DB can save running rules, too
#
# shortcircuit BAYES_99                spam
# shortcircuit BAYES_00                ham

endif # Mail::SpamAssassin::Plugin::Shortcircuit


Последнее исправление: Dr_Behaviour (всего исправлений: 6)

Помощь

Помочь бы парню... эх...

anonymous
()

У postfix, не поверишь, есть логи

-o content_filter=spamassassin

И где у тебя в master.cf определён spamassassin?

router ★★★★★
()
Ответ на: комментарий от Dr_Behaviour

Правда? И какую же работу ты ожидаешь от postfix'а?

Кстати, в приведённом manster.cf spamassassin не закомментирован, а вообще отсутствует

router ★★★★★
()
Ответ на: комментарий от router

smtp inet n - - - - smtpd -o content_filter=spamassassin

когда я делаю такую запись, постфикс не принимает и не отправляет письма

Dr_Behaviour
() автор топика
Ответ на: комментарий от router

Логи есть.

mail.err

Aug 14 09:41:05 postfix spamc[8317]: connect to spamd on ::1 failed, retrying (#2 of 3): Connection refused
Aug 14 09:41:05 postfix spamc[8317]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
Aug 14 09:41:06 postfix spamc[8317]: connect to spamd on ::1 failed, retrying (#3 of 3): Connection refused
Aug 14 09:41:06 postfix spamc[8317]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
Aug 14 09:41:06 postfix spamc[8317]: connection attempt to spamd aborted after 3 retries
Aug 14 09:48:42 postfix postfix/trivial-rewrite[24379]: error: open database /etc/postfix/transports.db: No such file or directory
Aug 14 09:53:39 postfix postfix/trivial-rewrite[23473]: error: open database /etc/postfix/transports.db: No such file or directory
Aug 14 09:58:44 postfix postfix/trivial-rewrite[23285]: error: open database /etc/postfix/transports.db: No such file or directory
Aug 14 10:03:00 postfix postfix/sendmail[18758]: fatal: User spamfilter(1003) is not allowed to submit mail
Aug 14 10:03:00 postfix spamc[18757]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
Aug 14 10:03:00 postfix spamc[18757]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
Aug 14 10:03:00 postfix postfix/sendmail[18766]: fatal: User spamfilter(1003) is not allowed to submit mail
Aug 14 10:03:00 postfix spamc[18765]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
Aug 14 10:03:00 postfix spamc[18765]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
Aug 14 10:03:00 postfix spamc[18771]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
Aug 14 10:03:00 postfix spamc[18771]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
Aug 14 10:03:00 postfix postfix/sendmail[18772]: fatal: User spamfilter(1003) is not allowed to submit mail
Aug 14 10:03:01 postfix spamc[18757]: connect to spamd on ::1 failed, retrying (#2 of 3): Connection refused
Aug 14 10:03:01 postfix spamc[18757]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
Aug 14 10:03:01 postfix spamc[18765]: connect to spamd on ::1 failed, retrying (#2 of 3): Connection refused
Aug 14 10:03:01 postfix spamc[18765]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
Aug 14 10:03:01 postfix spamc[18771]: connect to spamd on ::1 failed, retrying (#2 of 3): Connection refused
Aug 14 10:03:01 postfix spamc[18771]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
Aug 14 10:03:02 postfix spamc[18757]: connect to spamd on ::1 failed, retrying (#3 of 3): Connection refused
Aug 14 10:03:02 postfix spamc[18757]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
Aug 14 10:03:02 postfix spamc[18757]: connection attempt to spamd aborted after 3 retries
Aug 14 10:03:02 postfix spamc[18765]: connect to spamd on ::1 failed, retrying (#3 of 3): Connection refused
Aug 14 10:03:02 postfix spamc[18765]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
Aug 14 10:03:02 postfix spamc[18765]: connection attempt to spamd aborted after 3 retries
Aug 14 10:03:02 postfix spamc[18771]: connect to spamd on ::1 failed, retrying (#3 of 3): Connection refused
Aug 14 10:03:02 postfix spamc[18771]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
Aug 14 10:03:02 postfix spamc[18771]: connection attempt to spamd aborted after 3 retries
Aug 14 10:25:42 postfix postfix/trivial-rewrite[569]: error: open database /etc/postfix/transports.db: No such file or directory
Aug 14 10:29:10 postfix postfix/trivial-rewrite[22615]: error: open database /etc/postfix/transports.db: No such file or directory
Aug 14 10:30:45 postfix postfix/trivial-rewrite[32747]: error: open database /etc/postfix/transports.db: No such file or directory

Вот что говорит postfix check

postfix: warning: /etc/postfix/main.cf, line 33: overriding earlier entry: smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
postfix: warning: /etc/postfix/main.cf, line 34: overriding earlier entry: smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
/usr/sbin/postconf: warning: /etc/postfix/main.cf, line 33: overriding earlier entry: smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
/usr/sbin/postconf: warning: /etc/postfix/main.cf, line 34: overriding earlier entry: smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: network_style=host
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: destination_concurrency_limit=2
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: check_sender_access=hash:/etc/postfix/halo_access
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: show_user_unknown_reject_code=500
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: permit_mynetworks=yes
Dr_Behaviour
() автор топика
Ответ на: комментарий от router

Да, правда. Делал по инструкции с интернета.

Сейчас пробовал по инструкции с http://itstream.net/tips/240/ . Та же самая проблема, письма не доходят и не отправляются

Dr_Behaviour
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.