Eu tenho o que espero ser uma configuração normal de postfix em casa. Eu busco e-mails POP3 usando o fetchmail, que passa ao postfix via / usr / sbin / sendmail. No master.cf do postfix, adicionei um serviço spamassassin
e defino -o content_filter=spamassassin
no serviço smtp.
Eu quero que o postfix use o spamassassin para filtrar os e-mails recebidos, mas, por algum motivo, ele não está fazendo isso.
Ele está filtrando mensagens de saída, embora: Aqui estão alguns exemplos de /var/log/mail.log:
Recebendo (não filtrado, por que não?):
Sep 19 01:40:05 fitpc postfix/local[31480]: 062CC2CE070F: to=<[email protected]>, 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")
Envio (filtrado, não precisa disso):
Sep 19 01:07:16 fitpc postfix/pipe[31190]: 8CB252CE070E: to=<[email protected]>, relay=spamassassin, delay=0.48, delays=0.1/0.05/0/0.33, dsn=2.0.0, status=sent (delivered via spamassassin service)
Poderia ser porque o fetchmail está usando / usr / sbin / sendmail em vez de falar com postfix pela rede? Ou o sendmail também passa pela rede?
Configuração:
$ 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}