Входящая корреспонденция Postfix/spamassassin, не фильтруемая, но выход,

Я имею то, что я надеюсь, довольно нормальная домашняя постфиксная установка. Я выбираю почту POP3 с помощью fetchmail, который переходит для добавления постфикса через/usr/sbin/sendmail. В master.cf постфикса я добавил a spamassassin сервис и набор -o content_filter=spamassassin на smtp сервисе.

Я хочу, чтобы постфикс использовал spamassassin для фильтрации входящей корреспонденции, но по некоторым причинам это не делает этого.

Это фильтрует исходящую почту, хотя: Вот некоторые образцы из /var/log/mail.log:

Получение (не фильтрованный, почему нет?):

Sep 19 01:40:05 fitpc postfix/local[31480]: 062CC2CE070F: to=<mailandy@example.com>, orig_to=<mailandy>, relay=local, delay=0.43, delays=0.24/0.05/0/0.14, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")

При отправке (фильтрованный, действительно не нуждайтесь в этом):

Sep 19 01:07:16 fitpc postfix/pipe[31190]: 8CB252CE070E: to=<andybalaam@example.com>, relay=spamassassin, delay=0.48, delays=0.1/0.05/0/0.33, dsn=2.0.0, status=sent (delivered via spamassassin service)

Это могло быть, потому что fetchmail использует/usr/sbin/sendmail вместо того, чтобы говорить для добавления постфикса по сети? Или sendmail пробегается через сеть также?

Конфигурация:

$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
message_size_limit = 0
mydestination = fitpc, localhost.localdomain, localhost, ubuntu-desktop, server-vm, example.com
myhostname = fitpc
mynetworks = 127.0.0.0/8 10.0.1.0/24 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = example.com
notify_classes = resource,software,bounce,2bounce,delay,policy,protocol
readme_directory = no
recipient_delimiter = +
relayhost = relay.plus.net
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_relay_restrictions = permit_sasl_authenticated,defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

$ postconf -M
2025       inet  n       -       -       -       -       smtpd -o content_filter=spamassassin
pickup     unix  n       -       -       60      1       pickup
cleanup    unix  n       -       -       -       0       cleanup
qmgr       unix  n       -       n       300     1       qmgr
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
relay      unix  -       -       -       -       -       smtp -o smtp_fallback_relay=
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
maildrop   unix  -       n       n       -       -       pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp       unix  -       n       n       -       -       pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
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}
spamassassin unix -      n       n       -       -       pipe -v user=debian-spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
1
задан 19 September 2014 в 04:54
1 ответ

Конечно, как только я написал у меня возникла идея, и она заработала.

Проблема вовсе не в конфигурации postfix или spamassassin, а в конфигурации fetchmail.

У меня это было в моем .fetchmailrc:

poll example.com with proto POP3
    user 'x' there with password 'y' is 'z' here
    mda "/usr/sbin/sendmail  -i  -f %F -- %T"

но потому что здесь используется / usr / sbin / sendmail , он не помещает почту в очередь postfix, а доставляет ее напрямую (как оказалось), поэтому он обходит спам-фильтры. Мне нужно было:

poll example.com with proto POP3
    user 'x' there with password 'y' is 'z' here
    smtphost localhost/2025

(Поскольку мой постфикс слушает порт 2025. Если он слушает порт 25, нам вообще не понадобится строка smpthost.)

2
ответ дан 3 December 2019 в 21:12

Теги

Похожие вопросы